-
Notifications
You must be signed in to change notification settings - Fork 1.5k
update component-model-async
plumbing
#11123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This commit replaces the stub functions and types in `wasmtime::runtime::component::concurrent` and its submodules with the working implementation developed in the `wasip3-prototyping` repo. For ease of review, it does not include any new tests; I'll add those in a follow-up commit. Note that this builds on bytecodealliance#11114 and bytecodealliance#11123; only the third commit is new. Signed-off-by: Joel Dice <[email protected]>
This commit replaces the stub functions and types in `wasmtime::runtime::component::concurrent` and its submodules with the working implementation developed in the `wasip3-prototyping` repo. For ease of review, it does not include any new tests; I'll add those in a follow-up commit. Note that this builds on bytecodealliance#11114 and bytecodealliance#11123; only the third commit is new. Signed-off-by: Joel Dice <[email protected]>
This commit replaces the stub functions and types in `wasmtime::runtime::component::concurrent` and its submodules with the working implementation developed in the `wasip3-prototyping` repo. For ease of review, it does not include any new tests; I'll add those in a follow-up commit. Note that this builds on bytecodealliance#11114 and bytecodealliance#11123; only the third commit is new. Signed-off-by: Joel Dice <[email protected]>
This commit replaces the stub functions and types in `wasmtime::runtime::component::concurrent` and its submodules with the working implementation developed in the `wasip3-prototyping` repo. For ease of review, it does not include any new tests; I'll add those in a follow-up commit. Note that this builds on bytecodealliance#11114 and bytecodealliance#11123; only the third commit is new. Signed-off-by: Joel Dice <[email protected]>
This pulls in the tests from the `wasip3-prototyping` repo, minus the ones requiring WASIp3 support in `wasmtime-wasi[-http]`, which will be PR'd separately. Note that this builds on bytecodealliance#11114, bytecodealliance#11123, and bytecodealliance#11127; only the fourth commit is new. Signed-off-by: Joel Dice <[email protected]>
This commit replaces the stub functions and types in `wasmtime::runtime::component::concurrent` and its submodules with the working implementation developed in the `wasip3-prototyping` repo. For ease of review, it does not include any new tests; I'll add those in a follow-up commit. Note that this builds on bytecodealliance#11114 and bytecodealliance#11123; only the third commit is new. Signed-off-by: Joel Dice <[email protected]>
This pulls in the tests from the `wasip3-prototyping` repo, minus the ones requiring WASIp3 support in `wasmtime-wasi[-http]`, which will be PR'd separately. Note that this builds on bytecodealliance#11114, bytecodealliance#11123, and bytecodealliance#11127; only the fourth commit is new. Signed-off-by: Joel Dice <[email protected]>
This pulls in the latest Component Model async ABI code from the `wasip3-prototyping` repo, including various API refactors and spec updates. This includes all the changes to the `wasmtime` crate from `wasip3-prototyping` _except_ that the `concurrent` submodule and child submodules contain only non-functional stubs. For that reason, and the fact that e.g. `Func::call_async` is now implemented in terms of `Func::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 `concurrent` implementation, at which point the tests will pass again. I'm splitting these into separate PRs to make review easier. Signed-off-by: Joel Dice <[email protected]>
This commit replaces the stub functions and types in `wasmtime::runtime::component::concurrent` and its submodules with the working implementation developed in the `wasip3-prototyping` repo. For ease of review, it does not include any new tests; I'll add those in a follow-up commit. Note that this builds on bytecodealliance#11123; only the most recent commit is new. Signed-off-by: Joel Dice <[email protected]>
This pulls in the tests from the `wasip3-prototyping` repo, minus the ones requiring WASIp3 support in `wasmtime-wasi[-http]`, which will be PR'd separately. Note that this builds on bytecodealliance#11123 and bytecodealliance#11127; only the most recent commit is new. Signed-off-by: Joel Dice <[email protected]>
No longer necessary after other refactors
(deferred for future PR)
Looks like it may have been lost by accident
This commit replaces the stub functions and types in `wasmtime::runtime::component::concurrent` and its submodules with the working implementation developed in the `wasip3-prototyping` repo. For ease of review, it does not include any new tests; I'll add those in a follow-up commit. Note that this builds on bytecodealliance#11123; only the most recent commit is new. Signed-off-by: Joel Dice <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are a few comments so far but I've yet to really get into the meat of this. FWIW I also rebased #11127 on top of some of the local changes I've made, mostly to ensure that the changes don't break the full build.
Subscribe to Label Actioncc @fitzgen
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:
To subscribe or unsubscribe from this label, edit the |
This commit replaces the stub functions and types in `wasmtime::runtime::component::concurrent` and its submodules with the working implementation developed in the `wasip3-prototyping` repo. For ease of review, it does not include any new tests; I'll add those in a follow-up commit. Note that this builds on bytecodealliance#11123; only the most recent commit is new. Signed-off-by: Joel Dice <[email protected]>
This pulls in the tests from the `wasip3-prototyping` repo, minus the ones requiring WASIp3 support in `wasmtime-wasi[-http]`, which will be PR'd separately. Note that this builds on bytecodealliance#11123 and bytecodealliance#11127; only the most recent commit is new. Signed-off-by: Joel Dice <[email protected]>
@dicej ok cba8a79 is the culmination of my attempt to keep I ran out of time to get to the rest of |
Self::lower_args(cx, ty, dst, params) | ||
})?; | ||
|
||
// TODO: need to place a dtor on the stack referencing the store |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is definitely critical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah my thinking is that this'll be easier to write up in the next PR once concurrent.rs
is filled out
Speeds up host calls by ~20% and puts them back on parity with the beforehand numbers Wasmtime has.
Use slices for both instead of vecs for one and slices for the other. Required some slight rejiggering. Apparently one can solve a closure problem with another closure, then one surely has no more closure problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok @dicej I'm comfortable with everything here. Mind giving it another once-over on your end to confirm too? If you're ok with it all feel free to enqueue for merge.
I'll say I was originally planning to squash everything into one commit but we had some merge commits along the way which makes that slightly annoying so I'm content to let github merges figure out how to squash it instead. |
(also, to reiterate, thank you again for being patient with my review on this!) |
Thanks for persisting with this, @alexcrichton! Your changes look good to me. |
This commit replaces the stub functions and types in `wasmtime::runtime::component::concurrent` and its submodules with the working implementation developed in the `wasip3-prototyping` repo. For ease of review, it does not include any new tests; I'll add those in a follow-up commit. Note that this builds on bytecodealliance#11123; only the most recent commit is new. Signed-off-by: Joel Dice <[email protected]>
This pulls in the tests from the `wasip3-prototyping` repo, minus the ones requiring WASIp3 support in `wasmtime-wasi[-http]`, which will be PR'd separately. Note that this builds on bytecodealliance#11123 and bytecodealliance#11127; only the most recent commit is new. Signed-off-by: Joel Dice <[email protected]>
…)" This reverts commit b221fca.
This reverts commit b221fca.
This pulls in the tests from the `wasip3-prototyping` repo, minus the ones requiring WASIp3 support in `wasmtime-wasi[-http]`, which will be PR'd separately. Note that this builds on bytecodealliance#11123 and bytecodealliance#11127; only the most recent commit is new. Signed-off-by: Joel Dice <[email protected]>
This pulls in the tests from the `wasip3-prototyping` repo, minus the ones requiring WASIp3 support in `wasmtime-wasi[-http]`, which will be PR'd separately. Note that this builds on bytecodealliance#11123 and bytecodealliance#11127; only the most recent commit is new. Signed-off-by: Joel Dice <[email protected]>
This pulls in the tests from the `wasip3-prototyping` repo, minus the ones requiring WASIp3 support in `wasmtime-wasi[-http]`, which will be PR'd separately. Note that this builds on bytecodealliance#11123 and bytecodealliance#11127; only the most recent commit is new. Signed-off-by: Joel Dice <[email protected]>
* implement Component Model async ABI This commit replaces the stub functions and types in `wasmtime::runtime::component::concurrent` and its submodules with the working implementation developed in the `wasip3-prototyping` repo. For ease of review, it does not include any new tests; I'll add those in a follow-up commit. Note that this builds on #11123; only the most recent commit is new. Signed-off-by: Joel Dice <[email protected]> * clear params pointer in `call_async` when future is dropped This ensures that the closure we pass to `prepare_call` will never see a stale pointer. Note that this could potentially be made more efficient; I'm starting with a simple solution, and we can refine from there. Signed-off-by: Joel Dice <[email protected]> * Remove unsafety from accessing concurrent async state * Remove a dead variant when async is disabled * Add tests for `tls.rs` unsafe code * Refactor `AbortHandle` * Don't close over the entire future in the `AbortHandle`, instead change it to just the bare minimum state to manage aborts. * Move aborting logic into a helper `AbortHandle::run` function which handles the is-this-aborted-check internally. * Refactor some logic around spawns how `AbortHandle` is managed/created. * Internalize some functions/types * add FIXME comment to `states.rs` Signed-off-by: Joel Dice <[email protected]> * reference issue 11190 in `table.rs` TODO Signed-off-by: Joel Dice <[email protected]> * switch `use` directives to conventional syntax Signed-off-by: Joel Dice <[email protected]> * remove redundant accessor methods Signed-off-by: Joel Dice <[email protected]> * reference issue 11191 in `yield` TODO comments Signed-off-by: Joel Dice <[email protected]> * replace `dummy_waker` with `Waker::noop` Signed-off-by: Joel Dice <[email protected]> * remove obsolete `AsyncState::spawned_tasks` field Signed-off-by: Joel Dice <[email protected]> * only call post-return automatically for `call_concurrent` This restores the original behavior of requiring explicit post-return calls for `call[_async]` invocations. Signed-off-by: Joel Dice <[email protected]> * Favor function arguments before closures * Simplify `watch` a bit Mostly move unnecessary state out of the `Arc`. * fix task handle leaks and add test coverage We weren't always disposing of guest or host task handles once they became unreachable. This adds a couple of hidden methods which integration tests may use to guard against use-after-delete, double-delete, and leak bugs regarding waitable handles. It also tightens up handle management in `concurrent.rs` to ensure those tests pass. Signed-off-by: Joel Dice <[email protected]> * Encapsulate type erasure in stream buffers Don't rely on all buffers to handle `TypeId` and assertions and such, instead have a helper type which is the one location of the assertions and everything else can stay typed. * Remove some methods ending in underscores * Refactor unsafety in `buffers.rs` Mostly move away from raw pointers and instead use utilities like `&[MaybeUninit<T>]`. Also make `WriteBuffer` an `unsafe` trait after absorbing the `TakeBuffer` trait. Update all safety-related comments here and there too. * remove task on drop in `TypedFunc::call_async` This avoids the need for an `Arc`. Signed-off-by: Joel Dice <[email protected]> * remove obsolete clause from `FutureReader::read` docs Signed-off-by: Joel Dice <[email protected]> * unhide and expand docs for `WriteBuffer` and `ReadBuffer` Signed-off-by: Joel Dice <[email protected]> * add optional `component-model-async-bytes` feature This gates interop with the `bytes` crate, making it optional and non-default. Signed-off-by: Joel Dice <[email protected]> --------- Signed-off-by: Joel Dice <[email protected]> Co-authored-by: Alex Crichton <[email protected]>
This pulls in the latest Component Model async ABI code from the
wasip3-prototyping
repo, including various API refactors and spec updates.This includes all the changes to the
wasmtime
crate fromwasip3-prototyping
except that theconcurrent
submodule and child submodules contain only non-functional stubs. A follow-up PR will contain the realconcurrent
implementation.