Implement part of the Pyodide runtime bridge in Rust #8867
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
ryanking13
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.