fix(tasks): reject cancelled value results - #2906
Open
slepp wants to merge 2 commits into
Open
Conversation
slepp
force-pushed
the
fix/cancelled-task-result-authority
branch
from
August 12, 2026 05:32
f8f24c6 to
7404dc9
Compare
I make task result publication explicit and preserve exact-once cleanup for unconsumed owned values.
I record the intentional shared final-suspend block in the native and WASM byte-identity corpus.
slepp
force-pushed
the
fix/cancelled-task-result-authority
branch
from
August 17, 2026 08:39
d85305d to
70361c6
Compare
Contributor
Author
|
I rebased this onto current main and force-pushed |
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.
A value-returning task cancelled between allocation and entry published a zeroed value as a successful result. The caller received
x=0 y=0from a body that returnsPoint { x: 11, y: 22 }, with no indication anything had gone wrong.An ABI-only zero looked complete because the wrapper published every return, and await consumed the payload bytes without first honouring terminal status. Completion was inferred from readable memory rather than established by the task.
Await now takes terminal status as its authority, and publication is suppressed when the task did not reach the point of producing a value.
Behaviour at each cancellation window
Verification
A genuine zero return must remain distinguishable from a cancelled task, since that is the pair a naive fix conflates. Both are covered: cancellation surfaces as cancellation, and a task that really returns zero still succeeds with that value.
An owned result belonging to a cancelled task is released exactly once, checked with the leak oracle. Runtime task tests pass 66/66, task IR emission 2/2, the forced-cancel compiled probe passes, and the vertical-slice suite is green. New runtime exports are classified and
make verify-ffimatches.