feat[next]: Extend and refactor constant folding #1810
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 · 214 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 #1810"
general
weight: 0.35
SF-N
The following new transformations are introduced:
literal, symref->symref, literal, prerequisite for FOLD_FUNCALL_LITERAL, FOLD_NEUTRAL_OPliteral, funcall->funcall, literal, prerequisite for FOLD_FUNCALL_LITERAL, FOLD_NEUTRAL_OPfuncall, op->op, funcallfor s[0] + (s[0] + 1), prerequisite for FOLD_MIN_MAX_PLUSa - b->a + (-b), prerequisite for FOLD_MIN_MAX_PLUSmaximum(a, maximum(...))->maximum(maximum(...), a), prerequisite for(a + 1) + 1->a + (1 + 1)maximum(maximum(a, 1), a)->maximum(a, 1)maximum(maximum(a, 1), 1)->maximum(a, 1)maximum(plus(a, 1), a)->plus(a, 1)maximum(plus(a, 1), plus(a, -1))->plus(a, maximum(1, -1))a + 0->a,a * 1->aIn the end, unary minuses are transformed back to
minus-calls where possible byUndoCanonicalizeMinus:a + (-b)->a - b,-a + b->b - a,-a + (-b)->-a - bIn addition the pass now transforms until a fixed point is reached (like in the
CollapseTuplepass) instead of just transforming once. TheFixedPointTransformationclass from PR 1826 is used here.Previously, large nested maximum expressions like
maximum(maximum(maximum(maximum(sym, 1),...), 1), maximum(maximum(sym, 1), 1))caused timeouts in PMAP-GO as the runtime of the domain inference increased significantly due to the large domain expressions that could not be simplified.This replaces this PR.