wasi-shims: loopback integration gate — a real guest drives wasi:sockets TCP end to end - #126
Merged
Merged
Conversation
…ets TCP end to end The tcp-echo fixture (examples/guests/tcp-echo; wasi:sockets@0.3.0 + wasi:clocks@0.3.0 WIT vendored verbatim from upstream — the revision the iroh/wosh consumer family links) closes the composed-path gap the provider and runtime suites approximated from either side: guest wit-bindgen calls -> plan dispatch -> conventions adapter (A12 future results, A13 resource-element streams) -> the a la carte sockets provider -> Deno sockets -> real loopback TCP -> back Two legs (wasi-shims/tests/integration_sockets_test.ts; skip-if-absent on the shim + fixture corpus, like the runtime's embedder tests): - client: echo-client is the wosh listener's exact driving shape (create / connect / send-stream / receive-stream). An 8 KiB patterned payload round-trips byte-identical through a host echo server, and the onCall log reads back the guest wire's exact sequence — the polymorph-iroh#69 exam idiom, now in-repo. - server: start-echo-server binds 127.0.0.1:0, listens, reports the ephemeral port, and serves two connections from a DETACHED guest task — no export call in flight while the dials echo, so the A11 settlement pump is what drives the accepts. stream<tcp-socket> elements arrive in the guest as live resources (accept -> receive -> send per connection); the completion rides a guest-created future<u32>. Teardown is the full A13 chain observed from the OS: the guest drops its accept stream -> the pump's producer-cancellation hook -> the provider closes the listener -> the port refuses a fresh dial (ECONNREFUSED, raw). Both legs also pass under the seeded-shuffle scheduler (DELTIC_SCHED_SEED=1, =4242). Gates: test-wasi-shims (111, +2), examples, publish-check, test-sockets-node.
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.
The decision
The composed-path gap noted on #125 closes in-repo instead of waiting for a consumer smoke: a real guest component linking the REAL
wasi:sockets@0.3.0(WIT vendored verbatim from upstream — the revision the iroh/wosh family links) drives the à la carte provider over live loopback sockets, through the full stack:The two legs (
tests/integration_sockets_test.ts+examples/guests/tcp-echo)Client —
echo-clientis the wosh listener's exact driving shape (create/connect/send-stream/receive-stream, transcribed fromlistener-core/src/tcp.rs). An 8 KiB patterned payload round-trips byte-identical through a host echo server; theonCalllog reads back the guest wire's exact sequence — the polymorph-iroh#69 exam idiom, now in-repo.Server —
start-echo-serverbinds127.0.0.1:0, listens, reports the ephemeral port, then serves two connections from a detached guest task: no export call is in flight while the dials echo, so the A11 settlement pump is what drives the accepts.stream<tcp-socket>elements arrive in the guest as live resources; completion rides a guest-createdfuture<u32>. Teardown is the full A13 chain observed from the OS: guest drops its accept stream → pump cancellation hook → provider closes the listener → the port refuses a fresh dial (raw ECONNREFUSED).Both legs pass under the seeded-shuffle scheduler (
DELTIC_SCHED_SEED=1,=4242).Skip-if-absent on the shim + fixture corpus, same as the runtime's embedder tests; CI core builds both before
test-wasi-shims, so the gate is live there.Gates
just test-wasi-shims(111, +2),examples(new fixture builds + validates),publish-check,test-sockets-node. No src changes — fixture + tests + docs only.Refs #4.