docs(adr): ADR-0102 D3 (precompile WASM) — DEFERRED after API verification (#3297)#3318
Merged
Merged
Conversation
…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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
os-zhuang
marked this pull request as ready for review
July 19, 2026 18:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.wasmbytes proves awkward, defer." Verifying thequickjs-emscripten@0.32.0API against the installed sync variant shows it does not clear that bar:@jitl/quickjs-wasmfile-release-syncloads its.wasmlazily via the variant's ownimportModuleLoader(withnode/browser/workerdexport conditions). Precompiling needs the raw bytes first; sourcing them ourselves means a Nodefs/fetch ofemscripten-module.wasm— which breaks the Workers/edge-safe design that motivated choosing quickjs-emscripten over isolated-vm — or replicating emscripten's per-runtimelocateFile(fragile, bundler-specific). TheinstantiateWasmhook has the same bytes-sourcing problem.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
nested-write.integration.test.tssandbox hook exceeds the 250ms deadline on CI (Test Core) #3259 + nested-hooks-billed-to-parent).Notes
pnpm check:doc-authoringclean.allow-majorlabel to bypass the unrelated pre-existing@objectstack/console: majorchangeset onmain(per the Phase 1/2 decisions).🤖 Generated with Claude Code
Generated by Claude Code