-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support executing Pulley in Wasmtime #9744
Support executing Pulley in Wasmtime #9744
Conversation
I'll note that this is in draft form as it currently is based on #9743. I'm going ahead and opening this up to see what CI has to say about this. |
Label Messager: wasmtime:configIt looks like you are changing Wasmtime's configuration options. Make sure to
To modify this label's message, edit the To add new label messages or remove existing label messages, edit the |
This commit is the initial implementation of executing the Pulley interpreter from the `wasmtime` crate. This gives access to all of the `wasmtime` crate's runtime APIs backed by execution of bytecode in Pulley. This builds on the previous PRs I've been making for support in Pulley to culminate in testing on CI in this PR. This PR handles some final tidbits related to producing a runnable image that can be interpreted by the `wasmtime` crate such as: * Pulley compilation artifacts are no longer marked as natively executable, just read-only. * Pulley compilation artifacts include wasm-to-array trampolines like normal platforms (removes a pulley special-case). * Dispatch of host calls from Pulley to the Wasmtime runtime are implemented. * Pulley's list of panicking wasm features is slimmed down as most are covered by "this lowering isn't supported" errors. * Execution of wasm code now has an `if` to see whether Pulley is enabled within a `Store` or not. * Traps and basic "unwinding" of the pulley stack are implemented (e.g. a "pulley version" of `setjmp` and `longjmp`, sort of) * Halting the interpreter has been refactored to help shrink the size of `ControlFlow<Done>` and handle metadata with each done state. Some minor refactorings are also included here and there along with a few fixes here and there necessary to get tests passing. The next major part of this commit is updates to our `wast` test suite and executing all `*.wast` files. Pulley is now executed by default for all files as a new execution engine. This means that all platforms in CI will start executing Pulley tests. At this time almost all tests are flagged as "expected to fail" but there are a small handful of allow-listed tests which are expected to pass. This exact list will change over time as CLIF lowerings are implemented and the interpreter is extended. Follow-up PRs will extend the testing strategy further such as: * Extending `#[wasmtime_test]` to include Pulley in addition to Winch. * Getting testing set up on CI for 32-bit platforms. prtest:full
Enable pulley for wasmtime/wasmtime-cli and also enable all features for wasmtime-environ
140d787
to
2045330
Compare
2045330
to
77e209d
Compare
@fitzgen ok should be rebased and updated, I believe s390x CI is failing but I think most of the rest should be passing. Once results come in I'll figure out how to best ignore s390x for now. |
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.
Very nice! Super excited to see this progress!
A few nitpicks and suggestions below, but nothing major
(rule 1 (lower (trapz (icmp cc a b @ (value_type (fits_in_64 ty))) code)) | ||
(rule 1 (lower (trapz (icmp cc a b @ (value_type (ty_32_or_64 ty))) code)) |
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.
Curious: why was this change needed?
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.
Ah this is due to some other rule only accepting 32 or 64-bit inputs which causes ISLE to panic as something not a partial constructor. Basically tests panic unless this is here, so a future refactoring will need to flesh out more lowering rules for 8/16-bit types.
This commit is the initial implementation of executing the Pulley
interpreter from the
wasmtime
crate. This gives access to all of thewasmtime
crate's runtime APIs backed by execution of bytecode inPulley. This builds on the previous PRs I've been making for support in
Pulley to culminate in testing on CI in this PR. This PR handles some
final tidbits related to producing a runnable image that can be
interpreted by the
wasmtime
crate such as:executable, just read-only.
normal platforms (removes a pulley special-case).
implemented.
covered by "this lowering isn't supported" errors.
if
to see whether Pulley isenabled within a
Store
or not.a "pulley version" of
setjmp
andlongjmp
, sort of)ControlFlow<Done>
and handle metadata with each done state.Some minor refactorings are also included here and there along with a
few fixes here and there necessary to get tests passing.
The next major part of this commit is updates to our
wast
test suiteand executing all
*.wast
files. Pulley is now executed by default forall files as a new execution engine. This means that all platforms in CI
will start executing Pulley tests. At this time almost all tests are
flagged as "expected to fail" but there are a small handful of
allow-listed tests which are expected to pass. This exact list will
change over time as CLIF lowerings are implemented and the interpreter
is extended.
Follow-up PRs will extend the testing strategy further such as:
#[wasmtime_test]
to include Pulley in addition to Winch.