← Back to Pull requests

[source maps] Add support for scopes proposal call stacks #9400

Closed
unknown closed this pull request without merging on Nov 20, 2026 19:28 UTC
View on GitHub
unknown unknown commented on Nov 17, 2026 23:14 UTC
Author

The scopes proposal extends source maps to add inlined call stacks and
variable bindings:

https://tc39.es/ecma426/branch/proposal-scopes/#sec-source-map-format

This PR adds support for call stacks. We can now read the "scopes" and
"ranges" additions to the spec, and write them. To support multiple call
stacks for each expression in our IR, we shift from storing a single
DebugLocation to a SmallVector of them. When we inline, we simply
push more scopes on the stack.

For convenience and for debuggability, the ;;@ src.cpp:10:5:funcname
annotations are extended to support multiple scopes. For example, if we
have

  (func $caller
    ;;@ caller.cpp:10:5:CallerFunc
    (call $callee)
  )

  (func $callee
    ;;@ callee.cpp:2:3:CalleeFunc
    (nop)
  )

then after inlining we'd have this:
  (func $caller
    ;;@ caller.cpp:10:5:CallerFunc
    ;;@ callee.cpp:2:3:CalleeFunc
    (nop)
  )

That nop is now annotated as having a call stack of both the
caller and the inlined code, as if we never inlined. The ;;@
annotations are simply the stack frames in order.

Most of the changes in this PR are simple things that fall out
of the move from a single DebugLocation to a vector of them.
Otherwise, Inlining is extended to concatenate inlined stacks,
and then there are the messy details of the source maps
format itself (which is quite complex and uses VLQ encoding).

Diff: 174 lines (+130 / -44) across 2 files Reviewer: tlively Review duration: 4093m
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.35) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 174 lines diff across 2 files
0.35
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%
56%
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.309
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #9400"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 56.8% 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.4% (MEDIUM) · Higher = larger blast radius
35.4%
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: 56.8% · Lower = rushed or shallow review
56.8%
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: 15.3% · Safe to merge
15.3%