← Back to Pull requests

Compiler: test the IR verifier and dominator tree updates, and fix the bugs they found #64518

Closed
unknown closed this pull request without merging on Nov 06, 2026 21:46 UTC
View on GitHub
unknown unknown commented on Oct 31, 2026 14:59 UTC
Author

Claude:

---

Most of the IR verifier's error paths, and the incremental dominator tree update and renaming code, had no tests. The first commit tests that each kind of malformed IR is rejected with its own message. It also checks that incremental dominator tree updates match a tree recomputed from scratch.

Bugs found, each fixed in its own commit:

  • Terminator operands were never checked. Since #54279 put terminators in their own branch, a ReturnNode or GotoIfNot could use a value its block is not dominated by, or a terminator's own value, and still pass.

  • The :leave checks could not run, because :leave is caught as a terminator first. Once they ran, they caught one hand-written test IR in irpasses.jl that named a goto; that IR now names its :enter instead.

  • A non-positive SSA id only printed a message, then verification went on.

  • print=false was ignored for messages with interpolation, which is most of them.

  • A 2018 allowance for statements after :enter contradicted a later check that rejects that IR anyway. The allowance is removed.

  • A use of a pending node placed before its insertion point hit an @assert instead of giving a verifier error.

  • rename_nodes! threw a BoundsError when an unreachable block was kept.

  • Deleting an edge could leave a stale dominator tree. The check for whether the edge mattered only followed the source's chain of semidominators, so it missed paths through a DFS tree parent. It now tests whether the target dominates the source.
  • The stricter checks may reject IR the compiler produces. Locally, I forced verification on (normally only in assert builds) through 15 Compiler test files, also verifying after each mid-pipeline pass. Nothing fired on compiler output. The assert CI build is the first full-suite run.

    Not added: a range check on Argument(n). About 200 hand-written test IRs are built without argument types.

    Written with Claude Code (Opus 5.5).

    Diff: 247 lines (+185 / -62) across 3 files Reviewer: IanButterworth Review duration: 9047m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.44) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.44 · 247 lines diff across 3 files
    0.44
    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.330
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #64518"
    general weight: 0.35
    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: 43.9% (MEDIUM) · Higher = larger blast radius
    43.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: 17.3% · Safe to merge
    17.3%