Skip to content

compiler: Run linearize after DataManager when listed as a pass - #3064

Open
ggorman wants to merge 1 commit into
mainfrom
fix-linearize-as-pass
Open

ggorman wants to merge 1 commit into
mainfrom
fix-linearize-as-pass

Conversation

@ggorman

@ggorman ggorman commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

opt=('linearize', ...) in a custom pass list ran before symbol definitions, emitting both macros and VLA casts, a compile error. It now becomes the homonymous option, as openmp already does.

Test: test_linearize.py::test_linearize_as_pass (three pass-list forms).

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

🤖 Generated with Claude Code

@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.22%. Comparing base (2707ac9) to head (3973620).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3064      +/-   ##
==========================================
- Coverage   84.23%   84.22%   -0.01%     
==========================================
  Files         258      258              
  Lines       57070    57080      +10     
  Branches     4874     4873       -1     
==========================================
+ Hits        48072    48076       +4     
- Misses       8170     8174       +4     
- Partials      828      830       +2     
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX 68.50% <100.00%> (-0.01%) ⬇️
pytest-gpu-gcc- 79.02% <100.00%> (+0.01%) ⬆️
pytest-gpu-icx- 78.92% <100.00%> (+<0.01%) ⬆️
pytest-gpu-nvc-nvidiaX 69.08% <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.

Comment thread devito/operator/operator.py Outdated
if isinstance(overrides, dict):
options.update(overrides)

# A listed `linearize` (e.g., `opt=('linearize', {})`) must run after the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

linearize isn't supposed to be used as a mode it's an opt (mode, {'linearize': True})

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fair enough. It was still registered as a pass (_known_passes and the custom IET mapper, with _specialize_iet special-casing it), but that path had been broken since 520ba95: silent no-op without the option, compile error with it. Reworked to drop it from the pass list, so opt=('linearize', ...) now errors out as an unknown pass; the option is untouched and always applied after DataManager.

`linearize` is an opt-option, not a pass. Listed as a pass it ran before
the symbol definitions and either did nothing or produced uncompilable
code, so it is no longer a known pass and the option is applied after
DataManager as in the other pipelines.
@ggorman
ggorman force-pushed the fix-linearize-as-pass branch from 7dba0ec to 3973620 Compare October 19, 2026 11:24
@ggorman
ggorman marked this pull request as ready for review October 19, 2026 18:41

@FabioLuporini FabioLuporini left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't see the point here

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.

3 participants