Phase out Relax-specific Id aliases#19959
Conversation
There was a problem hiding this comment.
Code Review
This pull request simplifies variable identification in Relax by removing the Id class and instead identifying variables uniquely by their memory address. Consequently, VarNode now stores name_hint_ directly, and all mapping structures (such as var_remap_ and binding_table_) have been updated to use Var as keys instead of Id. Feedback on these changes highlights a potential performance bottleneck in the newly introduced RedirectVarRemapTargets helper, which performs a linear scan and introduces O(N^2) complexity; implementing a transitive lookup strategy is recommended to resolve this issue efficiently.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Use Relax variable object identity directly and make type-changing rewrites remap definitions, uses, and binding lookups coherently.
dbde9ef to
900bf3c
Compare
Remove the Relax-specific Id indirection and use Var/DataflowVar object identity directly.
Type-changing rewrites now remap definitions, uses, and binding lookups coherently while preserving reflection, serialization, and the DataflowVar subtype. Existing tests are adjusted for the API change; no new test files or test cases are added.
Validation: the compiler and C++ tests build successfully; focused C++ coverage passes 4/4; the affected existing Python matrices pass 549 tests with 2 expected xfails; source censuses, diff checks, and applicable hooks pass.