Repository navigation
Conversation
An IndexedPointer (`ptr->field[idx]`) had no handler in CSE's `_catch`, so the generic handler recursed into its index. In a floating-point Cluster a repeated integer index expression was then bound to a CTemp whose dtype `cse_dtype` promotes to the Cluster's float type, producing an array subscript of floating-point type that nvcc/hipcc reject. Treat IndexedPointer like Indexed: an opaque terminal that CSE does not look inside. Add a regression test that fails without this change.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3047 +/- ##
==========================================
- Coverage 84.26% 84.15% -0.12%
==========================================
Files 258 258
Lines 56982 56999 +17
Branches 4854 4856 +2
==========================================
- Hits 48018 47967 -51
- Misses 8138 8202 +64
- Partials 826 830 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Oct 13, 2026
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
IndexedPointer(ptr->field[idx]) had no handler in CSE's_catch, so the generic handler recursed into its index. When an integer index expression repeats inside a floating-point Cluster, CSE binds it to aCTemp, andcse_dtypepromotes an integer expression in a float Cluster to the Cluster's float type. The result is a floating-point array subscript:This surfaced after #3043: the CondEq snapshot shift turned a bare
IntDivindex (never captured) into anAddthat CSE does capture. Any backend that lowers metadata lookups toIndexedPointerinside a float Cluster hits it.Fix
Register
IndexedPointerwith the same_catchhandler asIndexed/Symbol/Reserved, so CSE treats it as an opaque terminal and never looks inside its index. Two executable lines; no change tocse_dtype, whose promotion rule affects unrelated arithmetic.Test
tests/test_cse.py::test_indexedpointer_index_not_captured: twoIndexedPointers sharing a repeated integer index in a float32 Cluster; asserts noCTempends up inside anIndexedPointerindex.devito/passes/clusters/cse.pyreverted the test fails (assert not True: the index was captured); with the change it passes.tests/test_cse.py,test_dse.py,test_buffering.py: 306 passed, 2 xfailed (one MPI test fails identically without this change on the host used, due to a missingmpirun).nvcc12.4: 5 errors before, 0 after; the same case runs on an RTX 3090 (CUDA 12.9).🤖 Generated with Claude Code
CI note.
pytest-osx-py312-clang-omp-basefails on this PR for a reason unrelated to the change: the runner it drew is a non-M1 Apple chip, whichget_platform()does not classify asAppleArm, sotest_nested_nthreadsis not skipped and emits x86 intrinsics headers. Fixed in #3048.pytest-gpu-omp-amdsegfaults in the examples step (test_tti_stability[staggered]); the generated code for that operator is byte-identical with and without this change, and a concurrent unrelated PR run failed the same job (runner contention, tracked in #3049).