Parents: #140, #141, #143 Profiles: #163, #164 Roadmap: #134
Implement genuine streaming WebAssembly compilation and the remaining pinned compiler-feed ABI. This must use the same parser, validator, compiler, and feature profiles as ordinary WebAssembly.Module; buffering bytes behind a resolved placeholder is not completion.
Scope
- Pin Home
7ed99c02, Bun4982b91e, the JSC streaming compiler bridge, response-extraction hook, and exact source identities. - Add realm-local
WebAssembly.compileStreamingandWebAssembly.instantiateStreamingwith standard Promise assimilation and result shapes. - Validate Response status,
application/wasmMIME type, used/locked bodies, rejection, and abrupt thenables before consuming bytes. - Stream ordered string/BufferSource body chunks through an incremental compiler state with bounded growth, overflow checks, and no user code under engine/GC locks.
- Implement
JSC__Wasm__StreamingCompiler__addBytesagainst an owned opaque compiler handle; reject stale, foreign-VM, null-pointer/nonzero-length, and post-finalization use without memory corruption. - Preserve empty, malformed, validation-error, compile-error, trap-at-instantiation, missing-import, cancellation, detached-view, sibling-realm, invalid-handle, and OOM/failure-atomic paths.
- Prove byte-for-byte and diagnostic equivalence with ordinary compilation across the declared MVP, Core 2, SIMD, threads, exception, tail-call, memory64, and Core 3/GC profiles where applicable.
- Add bounded Home/Bun Debug, ReleaseSafe, and TSan compiled consumers; refresh inventories, WebAssembly docs, concise README evidence, and parent roadmaps.
- Keep the frozen
wg-1.0corpus pin unchanged; record modern coverage against the existing WG3 and upstream-main shadow profiles. - Close only after the exact fixing
mainCI job is green.
Children
- #407 — preserve ReadableStream Fetch Body lifecycle
- #408 — add compileStreaming and instantiateStreaming
- #409 — lifetime-safe private StreamingCompiler feed
- #410 — feed Response chunks directly into StreamingCompiler
The opaque ABI cannot be a byte-dropping no-op, and the JavaScript APIs cannot be aliases that skip Response and streaming lifecycle behavior.