← Back to Pull requests

[GTO] Update struct field indices after localizing operands #9108

Closed
unknown closed this pull request without merging on Sep 16, 2026 18:29 UTC
View on GitHub
unknown unknown commented on Sep 16, 2026 15:30 UTC
Author

PR #9043 ("Avoid newly exposing prototypes in GTO") introduced prepending
an i8 placeholder field at index 0 of exposed no-proto descriptors when
their first field becomes prototype-exposing. When all fields of such a
descriptor are kept, the new index of the last field equals the old
struct's fields.size().

Because updateInstructions runs before updateTypes (so expression
heap types still refer to the pre-optimization Struct definitions), and
FieldRemover is a PostWalker, child struct.get, struct.rmw, and
struct.cmpxchg instructions had their index mutated in-place to the
new index before an enclosing struct.new or struct.set ran
ChildLocalizer or getResultOfFirst. When EffectAnalyzer subsequently
inspected those child instructions, readsStruct accessed
type.getStruct().fields[index] using the old HeapType and the new
index, causing an out-of-bounds assertion failure (__n < this->size())
or reading the wrong field's mutability.

Fix this by splitting instruction updating into two passes executed in a
single nested PassRunner invocation (FieldRemover followed by
IndexUpdater), along with sequential runOnModuleCode runs.
FieldRemover removes/reorders struct.new operands and replaces
removed struct.sets while all struct instructions still have their old
field indices matching their old HeapTypes, and IndexUpdater then
updates the field indices on all remaining struct instructions.

Diff: 182 lines (+136 / -46) across 2 files Reviewer: stevenfontanella Review duration: 178m
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 · 182 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.312
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #9108"
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: 35.6% (MEDIUM) · Higher = larger blast radius
35.6%
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.1% · Safe to merge
14.1%