runtime: settle async results before suspended producer exit - #334
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 #323.
Allow an async export driver to finish once its result is captured and entry hops are clear, even while its producer remains genuinely JSPI-suspended. The existing settlement pump owns continuation and late failures. Sync-typed lifts retain activation-completion requirements.
Adds real-Wasm coverage for result delivery before gate release, task.return after an earlier suspension, a nonblocking JSPI hop before another suspension, continued producer progress, and retained guest/host failures. A store-level test checks that unrelated failures do not unwind the live producer.
Ordering sanity check
Inspected Wasmtime at the repository's pinned revision
4675ee1:task_return/task_completesend the host result immediately (concurrent.rs:3507–3557,3606–3608), andrun_concurrentpolls the caller future before background futures (1320–1328). This corroborates separate result and producer lifetimes; the Component Model reference and embedder contract remain the authorities. This was a source-level check, not a Wasmtime differential execution.Validation
just gates < /dev/nullpassed, including Chromium/Firefox page, worker, shared-worker lanes and consumer smokes; independently repeated by review.just fmt-check,git diff --check, and Wasm fixture validation passed.Automerge will be armed after opening this PR.