Deforkify - #1
Draft
guybedford wants to merge 2 commits into
Draft
Conversation
Drop the wasm-streams checkout and cdylib patch in favor of guybedford/wasm-streams (MattiasBuelens/wasm-streams PR pending). The socket2 git rev was exactly the v0.6.5 release.
guybedford
force-pushed
the
deforkify
branch
from
September 11, 2026 05:07
8475439 to
87eb88f
Compare
One perpetual `#[wasm_bindgen(jspi)]` export builds a current-thread runtime and `block_on`s the whole server lifetime; every park suspends the Wasm stack on `epoll_wait`, so the hosted runtime adapter is gone. Pumpkin binds its stock `TcpListener` on 25565 inside the Durable Object's port table, and the object routes each inbound socket to it with `handleAsNodeConnection`, replacing the injected-stream entry point, wasm-streams, and the workers-rs dependency. `stop` cancels the server and the run promise settling is the checkpoint signal. `-sREENTRANT_JSPI` gives each activation its own shadow stack, so other entries into the module while the server is suspended cannot clobber its frames. Toolchain: Rust beta; emscripten main plus the JSPI hooks, reentrant JSPI and epoll listener PRs, with the paired emscripten-releases LLVM and the jspi-hooks Binaryen branch built by setup; wasm-bindgen 0.2.128 CLI via `-sWASM_BINDGEN`; exnref exception handling throughout; tokio `emscripten-epoll`, mio tokio-rs/mio#1969, libc `libc-0.2`. rustc needs a larger compile-thread stack for pumpkin-data. The wasm-bindgen and workers-rs patches and the CLI lockfile are gone; the Pumpkin patch drops the injected-stream entry point. Requires a workerd with per-Durable-Object port tables and `net.Server` inbound routing (`MINIFLARE_WORKERD_PATH`). CI moves to Linux.
guybedford
force-pushed
the
deforkify
branch
from
September 11, 2026 20:45
87eb88f to
4cb2734
Compare
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.
Simplification of the patch set to just the current in-progress upstream PRs ready to land. In particular no longer relying on the hosted runtime behavior of JSPI IO under callbacks: Pumpkin runs bottom-up on stock Tokio under JSPI, with
-sREENTRANT_JSPIgiving each activation its own shadow stack.Removed:
PR branches referenced directly
cf-final: Add JSPI lifecycle hooks (<emscripten/jspi.h>) emscripten-core/emscripten#27698 (JSPI lifecycle hooks), Add REENTRANT_JSPI: a shadow stack per JSPI activation emscripten-core/emscripten#27699 (REENTRANT_JSPI, plus two follow-up fixes for it), Add emscripten_epoll_add_listener for epoll readiness callbacks emscripten-core/emscripten#27547 (epoll listeners), on upstream mainjspi-hooks: Add jspi-hooks pass WebAssembly/binaryen#9102getrandomsupport for Emscripten briansmith/ring#2877This builds on top of and requires cloudflare/workerd#7306 (net.Server, per-Durable-Object port tables, connectHandler/handleAsNodeConnection) on top of merged cloudflare/workerd#7299, to support the ability to treat incoming connections as file descriptor sockets. cloudflare/workerd#7313 removes the spurious
Uncaught Error: Network connection lost.logged at connect handler completion.To run - same instructions as the README, plus building workerd from cloudflare/workerd#7306 (with #7313 applied), and referencing it via
MINIFLARE_WORKERD_PATH=../workerd/bazel-bin/src/workerd/server/workerd npm run devon start.npm testpasses end to end against that build from a clean.work/provision.Posting as a draft, pending cloudflare/workerd#7306 being merged.