dicej opened PR #11123 from dicej:cm-async-plumbing to bytecodealliance:main:
This pulls in the latest Component Model async ABI code from the
wasip3-prototypingrepo, including various API refactors and spec updates.This includes all the changes to the
wasmtimecrate fromwasip3-prototyping
_except_ that theconcurrentsubmodule and child submodules contain only
non-functional stubs. For that reason, and the fact that
e.g.Func::call_asyncis now implemented in terms ofFunc::call_concurrent,
most of the component model tests are failing. This commit is not meant to be
merged as-is; a follow-up commit (to be PR'd separately) will contain the real
concurrentimplementation, at which point the tests will pass again. I'm
splitting these into separate PRs to make review easier.Note that this builds on
https://github.com/bytecodealliance/wasmtime/pull/11114; only the second commit
is new.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
dicej edited PR #11123:
This pulls in the latest Component Model async ABI code from the
wasip3-prototypingrepo, including various API refactors and spec updates.This includes all the changes to the
wasmtimecrate fromwasip3-prototyping_except_ that theconcurrentsubmodule and child submodules contain only non-functional stubs. For that reason, and the fact that
e.g.Func::call_asyncis now implemented in terms ofFunc::call_concurrent, most of the component model tests are failing. This commit is not meant to be merged as-is; a follow-up commit (to be PR'd separately) will contain the real
concurrentimplementation, at which point the tests will pass again. I'm splitting these into separate PRs to make review easier.Note that this builds on https://github.com/bytecodealliance/wasmtime/pull/11114; only the second commit is new.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
dicej edited PR #11123:
This pulls in the latest Component Model async ABI code from the
wasip3-prototypingrepo, including various API refactors and spec updates.This includes all the changes to the
wasmtimecrate fromwasip3-prototyping_except_ that theconcurrentsubmodule and child submodules contain only non-functional stubs. For that reason, and the fact that e.g.Func::call_asyncis now implemented in terms ofFunc::call_concurrent, most of the component model tests are failing. This commit is not meant to be merged as-is; a follow-up commit (to be PR'd separately) will contain the real
concurrentimplementation, at which point the tests will pass again. I'm splitting these into separate PRs to make review easier.Note that this builds on https://github.com/bytecodealliance/wasmtime/pull/11114; only the second commit is new.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
dicej edited PR #11123:
This pulls in the latest Component Model async ABI code from the
wasip3-prototypingrepo, including various API refactors and spec updates.This includes all the changes to the
wasmtimecrate fromwasip3-prototyping_except_ that theconcurrentsubmodule and child submodules contain only non-functional stubs. For that reason, and the fact that e.g.Func::call_asyncis now implemented in terms ofFunc::call_concurrent, most of the component model tests are failing. This commit is not meant to be merged as-is; a follow-up commit (to be PR'd separately) will contain the realconcurrentimplementation, at which point the tests will pass again. I'm splitting these into separate PRs to make review easier.Note that this builds on https://github.com/bytecodealliance/wasmtime/pull/11114; only the second commit is new.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
dicej requested alexcrichton for a review on PR #11123.
dicej updated PR #11123.
alexcrichton updated PR #11123.
alexcrichton updated PR #11123.
alexcrichton updated PR #11123.
alexcrichton updated PR #11123.
alexcrichton updated PR #11123.
alexcrichton submitted PR review:
These are a few comments so far but I've yet to really get into the meat of this. FWIW I also rebased https://github.com/bytecodealliance/wasmtime/pull/11127 on top of some of the local changes I've made, mostly to ensure that the changes don't break the full build.
alexcrichton created PR review comment:
Did this not end up getting stored in
Options?
alexcrichton created PR review comment:
Are these TODOs still applicable? If so mind converting these to doc comments?
alexcrichton created PR review comment:
We'll want to smith this module a bit, mind moving this to a
concurrent_disabled.rsor similar? Otherwise the big-ish changes we'll want here are:
- Types in this module should somehow contain an uninhabited enum. We've got
crate::runtime::Uninhabitedfor this purpose and that'll ensure that we never accidentally create these types.- Ideally there are no
panic!s in this module. If anything takesselfyou canmatch self.uninhabited {}which is a compile-time assertion that it's not possible to be in that method.- For other methods that are panicking they'll want to return an error/trap, at least where possible.
Basically the worry is that if we have substantial #[cfg]'d-out functionality it's basically never tested in this repo so we want to make sure it's as simple as it can be an "obviously correct" for its situation. In that sense my worry here is that I don't want anything to accidentally get into a situation where a runtime panic can happen. In theory many of these methods are dynamically unreachable but it's hard to infer that just from looking at this module, so I'd feel safer transforming things to returning an error to at least know that if we are wrong and these functions are reachable that they'll return some sort of error instead of panicking.
alexcrichton commented on PR #11123:
This may not be plausible as I haven't gotten into the "meat" yet, but I'd like to pursue ideally the ability to land this PR as-is independent of https://github.com/bytecodealliance/wasmtime/pull/11127. Would it be possible to avoid changing
call_asyncin this PR and https://github.com/bytecodealliance/wasmtime/pull/11127 would be where the implementation changes?
dicej submitted PR review.
dicej created PR review comment:
Sorry, I don't think I understand the question. If you're wondering why the field name is prefixed with an underscore, it's because it won't be used until the full async implementation is merged. I can add a comment and/or
#[cfg(allow(dead_code))]if that helps.
dicej submitted PR review.
dicej created PR review comment:
Yes, they're still applicable. I'll convert them.
github-actions[bot] commented on PR #11123:
Subscribe to Label Action
cc @fitzgen
<details>
This issue or pull request has been labeled: "fuzzing", "wasmtime:api", "wasmtime:c-api"Thus the following users have been cc'd because of the following labels:
- fitzgen: fuzzing
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
dicej submitted PR review.
dicej created PR review comment:
I started changing the panics into compile-time assertions or traps, but I quickly realized that in almost all cases the code really should be unreachable, since any attempt to use CM async features should have failed at
wasmparservalidation time. It feels misleading to me to trap in those cases, because it implies that the code _is_ reachable, i.e. that a guest would somehow sneak use of an async feature past the validator.I'll go ahead and switch to traps, but also add comments indicating that it's our (Wasmtime's) fault if they're hit, not the guest's.
Would it be possible to avoid changing
call_asyncin this PR and #11127 would be where the implementation changes?I'll take a shot at it.
dicej updated PR #11123.
dicej updated PR #11123.
Last updated: Dec 06 2025 at 06:05 UTC