Skip to content

Raising: canonicalize maps before permutation matching; while fallback for constant-bound loops - #2998

Open
wsmoses wants to merge 1 commit into
mainfrom
pb/while-fallback-canonical-maps
Open

Raising: canonicalize maps before permutation matching; while fallback for constant-bound loops#2998
wsmoses wants to merge 1 commit into
mainfrom
pb/while-fallback-canonical-maps

Conversation

@wsmoses

@wsmoses wsmoses commented Aug 28, 2026

Copy link
Copy Markdown
Member

Two fixes that let mfem's EA mass-assembly kernels (7³ per-thread loop nests around chained 8×8 reductions) raise (#2968):

  • memoryEquivalentPermutation failed when an eliminated unit axis left an unused dim behind in the yielded value's map — the while raise then rejected a carried accumulator whose map was memory-equivalent up to dead dims. Canonicalize both maps (drop unused dims/operands) before matching.
  • When lockstep and unrolling both fail on a constant-bound affine.for (the chained-accumulator nests defeat both), fall back to the sequential while raise even under prefer_while_raising=false.

With these, bilininteg_mass_ea, hdiv_kernels, hcurl_kernels, elasticity_kernels, mixedvecgrad_pa, and convection_ea all raise strict; the raising lit suite is unchanged.

🤖 Generated with Claude Code

https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD

…k for constant-bound loops

An eliminated unit axis leaves an unused dim behind in the yielded
value's map, which failed the memory-equivalence permutation against the
carried arg; canonicalize both maps first. And when lockstep and
unrolling both fail on a constant-bound loop (accumulators chained
through nested reductions, mfem's EA mass assembly), fall back to the
sequential while raise regardless of the preference.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD
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.

1 participant