EnzymeHLOOpt: bound the provenance walk behind DUSDUSSubsuming; fix its dangling insert #3131
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 228 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.325
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3131"
general
weight: 0.35
ftynse
computeTensorValueProvenanceImplfollows a chain of slices, updates and pads back to its sources with a Presburger relation that grows with the chain, andDUSDUSSubsumingrecomputes it from scratch for every update it visits: cubic in the chain. mfem's TMOP metric kernels write a scratch buffer a few hundred times. One such kernel (270 updates, 14k lines) spends 132 s in this pattern and 3 s in everything else (passseswithout bit 512), and the eightfem/tmop/metrics/3xx.cpptranslation units carry the whole cost of runningenzyme-hlo-opton raised kernels at compile time (#3129): 464 s of a 533 s compile, per the pass timing.The walk now stops after 128 steps and treats what is left as an opaque source. That only loses precision: both provenances the pattern compares are computed against the same sources, so an opaque prefix makes the comparison conservative, never wrong. The kernel takes 3 s; the 45-kernel translation unit's optimizer time goes from 411 s to 78 s.
The slice case also inserted into the provenance map with arguments that were references into that map (
try_emplace(value, it->second.sources, it->second.provenanceRelation)); the insertion can rehash, after which they dangle and the copy reads freed memory. Nine of the 45 kernels segfault on that, inPresburgerRelation's copy constructor. Copy first.Test: a three-update chain read back through overlapping slices, checked line for line. The reduced shapes that exercise the pattern fold before the walk gets deep, and the kernels that hit the cost and the crash are 8-14k lines each (
fem/tmop/metrics/315.cpp, kernels 43 and 44 of its pre-optimizer dump; I can attach them if useful). Lit passes.🤖 Generated with Claude Code
https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD