← Back to Pull requests

simplify-affine-exprs: simplify against domains with symbols #3174

Closed
unknown closed this pull request without merging on Sep 09, 2026 21:59 UTC
View on GitHub
unknown unknown commented on Sep 09, 2026 13:29 UTC
Author

simplify-affine-exprs gists every access map and affine.if condition against the enclosing loop and branch domain with ISL, which is what folds (%j + %i floordiv 3) floordiv 3 to 0 when %i, %j range over [0, 3). It gave up whenever the domain carried a symbol, so any access under a loop with a symbolic bound was skipped. Every GPU kernel's grid loop has a symbolic bound, which left the pass dead on the raising path: on MFEM's nonlininteg_vecconvection_pa the shared-memory scratch accesses stay as

affine.store %v, %alloca[(%j + %i floordiv 3) floordiv 3, (%j + %i floordiv 3) mod 3, %i mod 3] : memref<4x3x3xf64>

under affine.parallel (%i, %j) = (0, 0) to (3, 3), where [0, %j, %i] is the answer.

Map operands the domain does not know (an access's own symbol operand, or a dim no enclosing affine op binds) are appended to the constraint system and the ISL set as unconstrained variables, symbols get parameter identifiers on both spaces so the gist aligns them, semi-affine expressions (a division or modulus by a symbol) are left alone, and a simplified result that reads a domain variable the map has no operand for (which a domain equality can produce) is rejected instead of being decoded as position 0.

Test simplify-affine-exprs-symbols.mlir: a symbolic grid bound above the folding loop, an access with its own symbol operand, and a condition under a symbolic bound.

🤖 Generated with Claude Code

https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD

Diff: 191 lines (+143 / -48) across 2 files Reviewer: ftynse Review duration: 509m
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 191 lines diff across 2 files
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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.315
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3174"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 35.9% (MEDIUM) · Higher = larger blast radius
35.9%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14.2% · Safe to merge
14.2%