Skip to content

Remove thread-switching around completed futures/streams - #14906

Merged
cfallin merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:remove-thread-switching
Oct 23, 2026
Merged

cfallin merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:remove-thread-switching

Conversation

@alexcrichton

Copy link
Copy Markdown
Member

This commit adjusts the behavior added in #12736 where the thread identity was saved/restored around component model futures/streams being completed. Later in #13949 though the spec was refined to clarify that thread identity during lowering is not possible to witness, which meant that after that change the thread-switching was technically all dead code. Thread IDs can go away at any time and aren't required to outlive future/stream operations, so this now-vestigial code can lead to spurious traps using wrong table slots. Here all the switching is just removed entirely since it's no longer necessary.

This commit adjusts the behavior added in bytecodealliance#12736 where the thread
identity was saved/restored around component model futures/streams being
completed. Later in bytecodealliance#13949 though the spec was refined to clarify that
thread identity during lowering is not possible to witness, which meant
that after that change the thread-switching was technically all dead
code. Thread IDs can go away at any time and aren't required to outlive
future/stream operations, so this now-vestigial code can lead to
spurious traps using wrong table slots. Here all the switching is
just removed entirely since it's no longer necessary.
@alexcrichton
alexcrichton requested a review from a team as a code owner October 21, 2026 16:00
@alexcrichton
alexcrichton requested review from cfallin and removed request for a team October 21, 2026 16:00
@github-actions github-actions Bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label Oct 21, 2026
@cfallin
cfallin added this pull request to the merge queue Oct 23, 2026
Merged via the queue into bytecodealliance:main with commit ffc2f36 Oct 23, 2026
53 checks passed
@alexcrichton
alexcrichton deleted the remove-thread-switching branch October 24, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasmtime:api Related to the API of the `wasmtime` crate itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants