driver: an export call is not done while any activation is hop-parked (#280) - #283
Merged
Conversation
…#280) The export driver's exit predicate (`resolvedSeen && !midWasmCall()`) scoped its mid-wasm-call test to the export's OWN task. When a background task's async host import settled on a microtask while another export call's driver was live, that driver's `tick` resumed the background task's callback activation — a promising entry, hop-parked in `store.awaiting` with no SuspensionPoint owner — and then declared itself done. Nobody owned the hop: the settlement pump arms only on outstanding real host calls, and the one that caused the resumption had already settled. The activation sat unserviced until an unrelated later call drove the store (or forever). A settle one macrotask later dodged it only because no driver was live at settle time and the pump owned it. A hop is something the driver itself put in flight and that lands within a microtask on the engine's own schedule; the driver that caused it must see it land. The predicate now also requires no hop-parked thread of ANY task store-wide, via `entryHopThreads` generalized to an optional instance filter. `midWasmCall` stays for the export task's own genuinely JSPI-suspended thread, which the hop test deliberately excludes. Repro pinned in e2e_cancel_import_test.ts: the cancel-import guest's detached task parked on a hand-held promise, resolved synchronously as a second export call's driver starts; pre-fix the driver exits with `awaiting=1 hostCalls=0` (the issue's `#25 EXIT-done` trace verbatim). Closes #280.
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 export driver's exit predicate (
resolvedSeen && !midWasmCall())scoped its mid-wasm-call test to the export's OWN task. When a background
task's async host import settled on a microtask while another export
call's driver was live, that driver's
tickresumed the backgroundtask's callback activation — a promising entry, hop-parked in
store.awaitingwith no SuspensionPoint owner — and then declared itselfdone. Nobody owned the hop: the settlement pump arms only on outstanding
real host calls, and the one that caused the resumption had already
settled. The activation sat unserviced until an unrelated later call
drove the store (or forever). A settle one macrotask later dodged it only
because no driver was live at settle time and the pump owned it.
A hop is something the driver itself put in flight and that lands within
a microtask on the engine's own schedule; the driver that caused it must
see it land. The predicate now also requires no hop-parked thread of ANY
task store-wide, via
entryHopThreadsgeneralized to an optionalinstance filter.
midWasmCallstays for the export task's own genuinelyJSPI-suspended thread, which the hop test deliberately excludes.
Repro pinned in e2e_cancel_import_test.ts: the cancel-import guest's
detached task parked on a hand-held promise, resolved synchronously as a
second export call's driver starts; pre-fix the driver exits with
awaiting=1 hostCalls=0(the issue's#25 EXIT-donetrace verbatim).Closes #280.
Gates run locally: check, test-runtime, conformance, sched-seeds, smoke-c0, smoke-tls, test-ct-runner, test-bundle.
Automerge armed. The
await macrotask()workaround in polyengine-dioxushost/src/eval.tscan be removed once this ships.