← Back to Pull requests

Embed compile caches for Cloudflare and static Pyodide modules #8339

Open
unknown opened this pull request with 261 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 10, 2026 13:13 UTC
Author

Cloudflare's builtin modules and the static Pyodide helpers should be able to load trusted V8 code caches generated alongside the executable. These bundles currently omit gen_compile_cache, so loading their modules requires compiling source or consulting the shared runtime code cache, despite their source being fixed for the build.

Enable the existing build-time cache generator for both bundles. Their module loaders already prefer embedded caches, so this avoids shared-cache lookups and runtime cache generation for these modules. The source remains embedded for V8's normal rejection fallback. This adds cache bytes to the executable; it does not eagerly compile lazy function bodies or remove runtime deserialization.

Represent Vectorize's error-message ellipsis with a JavaScript Unicode escape. The legacy builtin loader interprets raw bytes as Latin-1, whereas the generator and new module registry decode UTF-8. The literal ellipsis made their source lengths differ and caused V8 to reject the generated cache. The escape keeps the source ASCII and produces the intended ellipsis in both registries, also correcting the legacy loader's mojibake suffix. Extend the cache tests to require a cache for every JavaScript module in both bundles, compare the legacy and UTF-8 source strings, and assert that V8 accepts the cache.

The separately distributed, versioned Pyodide runtime bundle remains unchanged: its artifact identity does not include the consuming executable's V8 build and flags, so it needs separate coordination before embedding useful V8 caches.

The C++ encoding smoke suite runs its construction, encoder, decoder, and pipeline cases in one test, and the WebSocket kill-switch test accepts 32,770 sockets in one actor. Both workloads can outlast the downstream 15-second medium-test budget, as seen in the debug test timeouts. Classify them as large, matching the TypeScript encoding suite and neighboring WebSocket limit test. Every benchmark case and socket boundary check is retained.

Diff: 261 lines (+195 / -66) across 3 files Reviewer: ryanking13 Review duration: 6356m
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 261 lines diff across 3 files
0.39
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.333
Real PR Conversation Timeline
1 comments
"Review active on #8339"
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: 39.2% (MEDIUM) · Higher = larger blast radius
39.2%
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: 20.9% · Safe to merge
20.9%