Skip to content

compiler: Linearize Indexeds nested in other Indexeds' indices - #3065

Draft
ggorman wants to merge 1 commit into
mainfrom
fix-linearize-nested-guard
Draft

ggorman wants to merge 1 commit into
mainfrom
fix-linearize-nested-guard

Conversation

@ggorman

@ggorman ggorman commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Uxreplace does not recurse into a replacement, so T[0, I[0, 0, 0], 0] in a guard kept I n-dimensional while its pointer was flattened, a compile error. Nested substitutions are now resolved innermost first, both when generating FIndexeds and when binding macros.

Test: test_linearize.py::test_nested_indexeds_in_guard (macro and values); reverting either site fails it.

Both this PR and #3064 append to the bottom of test_linearize.py; whichever lands second needs a trivial rebase.

🤖 Generated with Claude Code

Uxreplace does not recurse into a replacement, so an Indexed nested in the
indices of another one (e.g. in a guard `T[0, I[0, 0, 0], 0] < 1.5`) was left
in its n-dimensional form while its pointer was flattened, which does not
compile. Resolve the nested substitutions innermost first, both when
generating FIndexeds and when binding them to macros
@codecov

codecov Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.23%. Comparing base (2707ac9) to head (c8aa2c7).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3065   +/-   ##
=======================================
  Coverage   84.23%   84.23%           
=======================================
  Files         258      258           
  Lines       57070    57091   +21     
  Branches     4874     4877    +3     
=======================================
+ Hits        48072    48091   +19     
- Misses       8170     8172    +2     
  Partials      828      828           
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX 68.52% <100.00%> (+<0.01%) ⬆️
pytest-gpu-gcc- 79.00% <100.00%> (+<0.01%) ⬆️
pytest-gpu-icx- 78.93% <100.00%> (+<0.01%) ⬆️
pytest-gpu-nvc-nvidiaX 69.09% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant