← Back to Pull requests

Implement part of the Pyodide runtime bridge in Rust #8867

Open
unknown opened this pull request with 191 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 24, 2026 09:29 UTC
Author

The motivation for this change is to start moving the Pyodide runtime
bridge, the pyodide-internal: modules that the Python Workers runtime
calls, from api/pyodide/pyodide.h to Rust. The new pyodide-api crate
implements three of them as Rust JSG resources, chosen by the new
RUST_PYODIDE_BRIDGE autogate: the disabled tracer
(DisabledInternalJaeger), the disabled startup limiter
(SimplePythonLimiter) and WorkerFatalReporter, which records a fatal
error in the current request's metrics through a small C++ shim over
its IoContext. An embedder that passes its own tracer or limiter keeps
it. The C++ classes are unchanged and remain the gate-off path. This
also sets up the crate and the gate for the package, metadata and
snapshot readers, which can follow once Rust JSG can write into an
ArrayBuffer safely.

The Rust modules take the same arguments, throw the same TypeErrors
and return the same values as the C++ ones, so the runtime can't tell
them apart. A Worker can't call them either, since they are internal
to the runtime. A new C++ test runs the Rust WorkerFatalReporter
inside a request and checks that each kind of error reaches the
request's metrics. Python tests have no @all-autogates variant, so new
smoke tests run a Python Worker, and the fatal-error test, with the
gate turned on in their config. A check fails them if their configs
misspell the gate. The existing Pyodide tests and the crate's unit
tests pass, and Python Workers never start from a startup snapshot,
so the resources need no snapshot support.

Diff: 191 lines (+143 / -48) across 2 files Reviewer: ryanking13 Review duration: 1416m
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 191 lines diff across 2 files
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
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
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.315
Real PR Conversation Timeline
1 comments
"Review active on #8867"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 46.7% 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.9% (MEDIUM) · Higher = larger blast radius
35.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: 46.7% · Lower = rushed or shallow review
46.7%
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: 19.1% · Safe to merge
19.1%