Refactor how concurrency support is enabled in a Store#12416
Merged
alexcrichton merged 5 commits intobytecodealliance:mainfrom Jan 23, 2026
Merged
Refactor how concurrency support is enabled in a Store#12416alexcrichton merged 5 commits intobytecodealliance:mainfrom
Store#12416alexcrichton merged 5 commits intobytecodealliance:mainfrom
Conversation
This commit is an extension/refactor of bytecodealliance#12377 and bytecodealliance#12379. Notably this decouples the runtime behavior of Wasmtime from enabled/disabled WebAssembly proposals. This enables the `wasmtime serve` subcommand, for example, to continue to disallow component-model-async by default but continue to use `*_concurrent` under the hood. Specifically a new `Config::concurrency_support` knob is added. This is plumbed directly through to `Tunables` and takes over the preexisting `component_model_concurrency` field. This field configures whether tasks/etc are enabled at runtime for component-y things. The default value of this configuration option is the same as `cfg!(feature = "component-model-async")`, and this field is required if component-model-async wasm proposals are enabled. It's intended that eventually this'll affect on-by-default wasm features in Wasmtime depending if the support is compiled in. This results in a subtle shift in behavior where component-model-async concurrency is used by default now because the feature is turned on by default, even though the wasm features are off-by-default. This required adjusting a few indices expected in runtime tests due to tasks/threads being allocated in index spaces. Finally, this additionally denies access at runtime to `Linker::*_concurrent` when concurrent support is disabled as otherwise the various runtime data structures won't be initialized and panics will happen. Closes bytecodealliance#12393
Used to update disas tests to show that, when disabled, old codegen quality is preserved
Member
Author
|
cc @dicej too |
dicej
approved these changes
Jan 23, 2026
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.
This commit is an extension/refactor of #12377 and #12379. Notably this
decouples the runtime behavior of Wasmtime from enabled/disabled
WebAssembly proposals. This enables the
wasmtime servesubcommand, forexample, to continue to disallow component-model-async by default but
continue to use
*_concurrentunder the hood.Specifically a new
Config::concurrency_supportknob is added. This isplumbed directly through to
Tunablesand takes over the preexistingcomponent_model_concurrencyfield. This field configures whethertasks/etc are enabled at runtime for component-y things. The default
value of this configuration option is the same as
cfg!(feature = "component-model-async"), and this field is required ifcomponent-model-async wasm proposals are enabled. It's intended that
eventually this'll affect on-by-default wasm features in Wasmtime
depending if the support is compiled in.
This results in a subtle shift in behavior where component-model-async
concurrency is used by default now because the feature is turned on by
default, even though the wasm features are off-by-default. This required
adjusting a few indices expected in runtime tests due to tasks/threads
being allocated in index spaces.
Finally, this additionally denies access at runtime to
Linker::*_concurrentwhen concurrent support is disabled as otherwisethe various runtime data structures won't be initialized and panics will
happen.
Closes #12393