Skip to content

Remove legacy indexer - #6019

Merged
naoyam merged 8 commits into
mainfrom
remove_legacy_indexer
Apr 7, 2026
Merged

Remove legacy indexer#6019
naoyam merged 8 commits into
mainfrom
remove_legacy_indexer

Conversation

@naoyam

@naoyam naoyam commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

This PR just removes the code for the legacy indexer. There should be no functional difference.

@naoyam

naoyam commented Feb 27, 2026

Copy link
Copy Markdown
Contributor Author

!test

@naoyam

naoyam commented Apr 6, 2026

Copy link
Copy Markdown
Contributor Author

!test

@naoyam

naoyam commented Apr 6, 2026

Copy link
Copy Markdown
Contributor Author

!test --diff

Naoya Maruyama added 2 commits April 6, 2026 16:27
@naoyam

naoyam commented Apr 6, 2026

Copy link
Copy Markdown
Contributor Author

!test --diff

@naoyam

naoyam commented Apr 7, 2026

Copy link
Copy Markdown
Contributor Author

!test --diff

@naoyam
naoyam marked this pull request as ready for review April 7, 2026 05:05
@naoyam

naoyam commented Apr 7, 2026

Copy link
Copy Markdown
Contributor Author

!test --diff

@greptile-apps

greptile-apps Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR removes the legacy IndexCompute-based indexer (~3500+ lines across csrc/index_compute.h/cpp and csrc/device_lower/analysis/index_compute.h/cpp), along with associated infrastructure (IndexMagicZeroInfo, protectPredicateIndexWithMagicZero, protectNonPredicateIndexWithMagicZero, IndexFromIdGraph, LoopIndexing). All predicate and index lowering code now exclusively routes through TensorIndexer, removing the legacy fallback conditionals that checked isTensorIndexerEnabled(). A secondary std::ranges:: modernization pass is included across several files.

Confidence Score: 5/5

Safe to merge — this is a pure deletion of dead legacy code with no functional changes

All findings are P2 or lower. The legacy indexer was already fully superseded by TensorIndexer (enabled by default), the conditional fallback branches are correctly removed, and the CMakeLists entry is cleaned up. No new logic is introduced.

No files require special attention; all changes are straightforward deletions and minor modernization

Important Files Changed

Filename Overview
csrc/index_compute.h Removed IndexCompute class (~300 lines) and standalone free functions; only PredicateInfo, Index, and PredicateDomainInfo remain
csrc/index_compute.cpp Removed ~1936 lines of legacy IndexCompute implementation; remaining functions assert isTensorIndexerEnabled and delegate to TensorIndexer
csrc/device_lower/analysis/index_compute.cpp Entire file deleted (~1407 lines): all LoopIndexing/IndexFromIdGraph infrastructure and related helpers removed
csrc/device_lower/analysis/index_compute.h Header for deleted file fully removed
csrc/predicate_compute.cpp Removed conditional fallback to legacy indexer in getInlinePredicate and predicateOn; also modernized std:: to std::ranges:: throughout
csrc/device_lower/pass/magic_zero.h Removed IndexMagicZeroInfo struct, protectPredicateIndexWithMagicZero, and protectNonPredicateIndexWithMagicZero—all legacy-indexer-only APIs
csrc/device_lower/pass/magic_zero.cpp Deleted implementations of the two magic-zero protection helpers that were only used by the legacy indexer
csrc/device_lower/pass/rng.cpp Removed legacy header include, added NOLINTNEXTLINE for const reference member, modernized std::any_of to std::ranges::any_of
csrc/device_lower/analysis/sync_information.cpp Removed legacy header include; std::transform/std::sort modernized to std::ranges equivalents
csrc/id_model/indexing_utils.h Removed legacy header include; std::find_if modernized to std::ranges::find_if
CMakeLists.txt Removed device_lower/analysis/index_compute.cpp from the build source list to match file deletion

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Index / Predicate Lowering Request] --> B{isTensorIndexerEnabled?}
    B -- Before PR: true --> C[TensorIndexer path]
    B -- Before PR: false --> D[Legacy IndexCompute path]
    D --> E[IndexFromIdGraph / LoopIndexing]
    E --> F[protectPredicateIndexWithMagicZero]
    C --> G[TensorIndexer.getPredicates]
    C --> H[TensorIndexer.getIndexFor]
    B -- After PR: always true --> C
    D -. REMOVED .- D
    E -. REMOVED .- E
    F -. REMOVED .- F
    style D fill:#ffcccc,stroke:#cc0000
    style E fill:#ffcccc,stroke:#cc0000
    style F fill:#ffcccc,stroke:#cc0000
Loading

Reviews (1): Last reviewed commit: "clang-tidy" | Re-trigger Greptile

@naoyam
naoyam requested a review from jacobhinkle April 7, 2026 05:41
@naoyam naoyam changed the title [WIP] Remove legacy indexer Remove legacy indexer Apr 7, 2026

@jacobhinkle jacobhinkle left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@naoyam
naoyam merged commit e37acf9 into main Apr 7, 2026
58 of 59 checks passed
@naoyam
naoyam deleted the remove_legacy_indexer branch April 7, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants