Put cooperative threads into their own per-component-instance table#600
Merged
lukewagner merged 1 commit intomainfrom Jan 27, 2026
Merged
Put cooperative threads into their own per-component-instance table#600lukewagner merged 1 commit intomainfrom
lukewagner merged 1 commit intomainfrom
Conversation
alexcrichton
approved these changes
Jan 22, 2026
dicej
added a commit
to dicej/component-model
that referenced
this pull request
Jan 22, 2026
While rebasing bytecodealliance/wasmtime#12379 onto Wasmtime's `main` branch, I found I needed to tweak the expected resource handle values and trap messages due to subtle changes to when Wasmtime allocates a thread handle. Once WebAssembly#600 lands and is implemented in Wasmtime, we should be able to clean all this up once and for all; for now we just muddle along.
dicej
approved these changes
Jan 22, 2026
lukewagner
pushed a commit
that referenced
this pull request
Jan 22, 2026
While rebasing bytecodealliance/wasmtime#12379 onto Wasmtime's `main` branch, I found I needed to tweak the expected resource handle values and trap messages due to subtle changes to when Wasmtime allocates a thread handle. Once #600 lands and is implemented in Wasmtime, we should be able to clean all this up once and for all; for now we just muddle along.
alexcrichton
added a commit
to alexcrichton/component-model
that referenced
this pull request
Feb 4, 2026
Numbers in tests were updated to account for WebAssembly#600
alexcrichton
added a commit
to alexcrichton/wasmtime
that referenced
this pull request
Feb 4, 2026
This accounts for WebAssembly/component-model#600 and mostly updates various test expectations to match this. Closes bytecodealliance#11954
lukewagner
pushed a commit
that referenced
this pull request
Feb 4, 2026
Numbers in tests were updated to account for #600
alexcrichton
added a commit
to alexcrichton/wasmtime
that referenced
this pull request
Feb 4, 2026
This accounts for WebAssembly/component-model#600 and mostly updates various test expectations to match this. Closes bytecodealliance#11954
github-merge-queue bot
pushed a commit
to bytecodealliance/wasmtime
that referenced
this pull request
Feb 4, 2026
* Move threads to their own index space in components This accounts for WebAssembly/component-model#600 and mostly updates various test expectations to match this. Closes #11954 * Fix conditional compiles
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.
As described in a new blurb in this PR (in the Thread State section in CanonicalABI.md), the main motivation this change is to help an optimization engine cheaply lazily allocate thread elements, saving the real initialization until a real stack-switching operation occurs. Having threads in the same handle table as everything else would otherwise thwart this optimization since unrelated resource/waitable handle allocations would shift the indices around. This also has the pleasant effect of reverting what was otherwise a semantic change from when cooperative threads were added: an export's implicit thread is allocated a thread index which observably shifts indices (thereby causing annoyance when enabling/disabling the coop-threads feature changes index allocation).