Skip to content

docs(adr): ADR-0102 D3 (precompile WASM) — DEFERRED after API verification (#3297)#3318

Merged
os-zhuang merged 1 commit into
mainfrom
claude/nested-write-sandbox-timeout-muw13i
Jul 19, 2026
Merged

docs(adr): ADR-0102 D3 (precompile WASM) — DEFERRED after API verification (#3297)#3318
os-zhuang merged 1 commit into
mainfrom
claude/nested-write-sandbox-timeout-muw13i

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Phase 3 of #3275 (ADR-0102 D3). Closes #3297. Docs-only — records a deferral decision, no code.

Decision: defer D3

D3's own bar was "cache one compiled WebAssembly.Module, instantiate per invocation — if clean access to the variant's .wasm bytes proves awkward, defer." Verifying the quickjs-emscripten@0.32.0 API against the installed sync variant shows it does not clear that bar:

  • No clean, portable, edge-safe way to obtain the bytes. @jitl/quickjs-wasmfile-release-sync loads its .wasm lazily via the variant's own importModuleLoader (with node/browser/workerd export conditions). Precompiling needs the raw bytes first; sourcing them ourselves means a Node fs/fetch of emscripten-module.wasm — which breaks the Workers/edge-safe design that motivated choosing quickjs-emscripten over isolated-vm — or replicating emscripten's per-runtime locateFile (fragile, bundler-specific). The instantiateWasm hook has the same bytes-sourcing problem.
  • Uncertain payoff. Engines already code-cache WebAssembly compilation for identical bytes, so repeated newQuickJSWASMModule() largely amortizes the compile already; D3 would remove only that, not the inherent per-invocation instantiate (fresh memory). Phase 2 already delivered the dominant win — dropping the asyncify build.

Recorded in ADR-0102 D3 with an explicit revisit criterion. D1 (CPU budget, merged) and D2 (sync variant, merged) stand on their own — deferring D3 doesn't weaken them.

Net result of ADR-0102

Notes

  • Docs-only, one file. No changeset. pnpm check:doc-authoring clean.
  • Uses the allow-major label to bypass the unrelated pre-existing @objectstack/console: major changeset on main (per the Phase 1/2 decisions).

🤖 Generated with Claude Code


Generated by Claude Code

…ation (#3297)

Phase 3 of #3275. Verifying the quickjs-emscripten 0.32 API against the installed
sync variant shows no clean, portable, edge-safe way to obtain the variant's
.wasm bytes to precompile: sourcing them means a Node fs/fetch of
emscripten-module.wasm (breaks the Workers/edge-safe design that motivated
quickjs-emscripten over isolated-vm) or replicating emscripten's per-runtime
locateFile (fragile, bundler-specific); the instantiateWasm hook has the same
problem. Payoff is uncertain too — engines already code-cache wasm compilation,
so newQuickJSWASMModule() largely amortizes the compile; D3 wouldn't remove the
inherent per-invocation instantiate. Phase 2 already delivered the dominant win
(dropping asyncify). Records the deferral + revisit criteria in ADR-0102 D3;
D1 (CPU budget) and D2 (sync variant) stand on their own.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011iJLjqToxNv1aYP3syQtRp
@vercel

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jul 19, 2026 6:06pm

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation size/s labels Jul 19, 2026
@os-zhuang os-zhuang added the allow-major label Jul 19, 2026 — with Claude
@os-zhuang
os-zhuang marked this pull request as ready for review July 19, 2026 18:07
@os-zhuang
os-zhuang merged commit a016e27 into main Jul 19, 2026
17 of 18 checks passed
@os-zhuang
os-zhuang deleted the claude/nested-write-sandbox-timeout-muw13i branch July 19, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

allow-major documentation Improvements or additions to documentation size/s

Projects

None yet

2 participants