← Back to Pull requests

Allow struct.wait expected value to be a supertype #9139

Closed
unknown closed this pull request without merging on Sep 23, 2026 21:23 UTC
View on GitHub
unknown unknown commented on Sep 22, 2026 23:29 UTC
Author

For ref fields, the expected ref that's passed in does not need to be a subtype of the struct's field's type. See the typing rules from the proposal, and https://github.com/WebAssembly/shared-everything-threads/pull/92 which explains why. From the spec:

wait_expected(i32) = i32
wait_expected(i64) = i64
wait_expected(t) = (ref null (shared eq)) -- if t <: (ref null (shared eq))

C |- struct.wait x y : [(ref null x) (ref null (shared waitqueue)) t i64] -> [i32]
 -- C.types[x] = shared? struct ft*
 -- ft*[y] = mut? t'
 -- t = wait_expected(t')

In this case t <: (ref null (shared eq)) and it's not required that t <: t'.

---

Since the expected value isn't required to be a subtype of the field type, we no longer need the fixing code in TypeRefining.cpp. This matches the behavior for the expected field of atomic cmpxchg, which doesn't touch curr->expected. The type-refining-gufa test was a mis-optimization before, because it caused the struct.wait to block (by changing the expected value to ref.null) when it did not block in the original program.

Part of #8315.

Diff: 157 lines (+117 / -40) across 1 files Reviewer: stevenfontanella Review duration: 1314m
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.33) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.33 · 157 lines diff across 1 files
0.33
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.303
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #9139"
general weight: 0.35
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: 33.3% (LOW) · Higher = larger blast radius
33.3%
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: 14.4% · Safe to merge
14.4%