AffineCFG: read a lowered division whose arms a canonicalize folded #3451
All Vouch review confidence checks passed
Residual risk 0.14 = 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 · 213 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.321
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3451"
general
weight: 0.35
ImanHosseini
Split out of #3425. Merge this before #3425: the indicator #3425 writes into a loop bound contains a
floordiv, which goes throughlower-affineand back. Checked on MFEM: with #3425 alone,bilininteg_curlcurl_pa,bilininteg_mixedcurl_paandtest_curlcurl_integfail to compile. With #3425 and this PR, all three compile.The existing support for this is
matchLoweredDiv(#3163). It readslower-affine's expansion offloordiv/ceildiv/modback for the normalizer, and keeps those selects away fromMoveSelectToAffine(isLoweredDivSelect). But it matched the dividend arms as the expansion writes them:-1 - xfor floordiv,0 - xandx - 1for ceildiv. The pipeline canonicalizes afterlower-affine, and that folds those arms intox's own arithmetic. Withx = 1 - c,-1 - xbecomesc - 2. The selects then went unrecognized,MoveSelectToAffinesplit them intoaffine.ifs around adivsi, and the loop they bound stayed anscfloop with a non-affine bound.This compares those arms to
xas linear forms (isLinearIn, overaddi/subi/multiplication by a constant), so the normalizer reads the division back whole. The earlier version of this PR added a separate pattern for the splitaffine.ifform; that pattern is gone.Test:
affinecfg_lowered_div_folded.mlirtakes the reallower-affine+canonicalizeoutput for(1 - c) floordiv 2 + 3and(1 - c) ceildiv 2 + 3. With--affine-cfg, both bounds come back as the division and the loops raise toaffine.parallel. On main, both stayscf.forunder splitaffine.ifs.🤖 Generated with Claude Code
https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD