embedder: enforce stream operation and transfer lifetimes - #335
Merged
Conversation
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.
Summary
Fixes #324. Fixes #326. Fixes #327. Fixes #331.
Semantic review
Authority: Component Model revision
7c676115e93cd7d54c1732d95c54c6a3de7c5ae0,definitions.pyfunctionslift_async_value,stream_copy,future_copy,cancel_copy, andCopyEnd;contracts/embedder-api.mdStreams and futures; architecture §§5–7.lift_async_valuerequires IDLE; stream completion returns to IDLE, while a completed Future becomes DONE. The reference hostlower_stream/lower_futurehelpers construct fresh endpoints without a busy guard, so the JS facade must preserve readable ownership/exclusion before handing values to them. This implements the existing facade contract without changing it or the protocol goldens.Wasmtime source sanity check at pinned
4675ee16b703b33948073a5ff6b961367371e7a1:handle_table.rsbusy removal checks;futures_and_streams.rslift_index_to_transmit, consumingStreamReader::pipe, andstream_closeinvalidation.Actual native component probes ran on installed Wasmtime 48.0.1 (
7bac2c277), distinct from the source pin. A focused busy-readable WAST plus the pinned corpuscancel-stream.wast,closed-stream.wast, andtrap-if-done.wastpassed usingwasmtime wast -W component-model-async=y,component-model-async-stackful=y. They confirm busy transfer rejection, eager/async completed-future rejection, cancel-and-reuse, and reader-drop → writer DROPPED. JS lazy binding and synchronous Promise error timing have no direct equivalent in those native APIs.Verification
just gates < /dev/nullpassed through core/runtime, packaging, conformance, seeded scheduling and shell recipes; its first browser launch required installing this worktree's Playwright browsers.just browsers smoke-tls smoke-c0 < /dev/nullthen passed (exit 0), completing all recipes. Consumer git status unchanged.git diff --checkpassed.Auto-merge will be armed after opening; required core checks must pass.