alexcrichton opened PR #10096 from alexcrichton:pulley-provenance
to bytecodealliance:main
:
This commit adds a test to CI and a script locally to execute which will run an entire wasm module under Pulley. The goal of this commit is to add The Test for miri execution of wasm. In general miri is too slow to run for the full test suite and even for this single test it takes a very long time to compile the one small module here. To help with this the module is precompiled on native for Pulley and then deserialized in miri itself, meaning that we skip miri execution of Cranelift entirely.
The goal of this commit is to eventually expand this test to cover lots of little and basic operations of wasm which touch VM state. For now it's just a simple smoke test that doesn't run much but it will be expanded over time. Making it much larger than now already turns up miri violations so I wanted to land an initial scaffold first before expanding later.
Getting this test to pass requires changing the
VmPtr<T>
introduced in #10043 to use aNonZeroUsize
internally rather thanNonNull<T>
. This is because Pulley is only compatible with exposed provenance which means we need to actually expose the provenance of pointers.Both Pulley and Wasmtime need to deal with exposed provenance APIs, but such APIs are not available in Wasmtime's current MSRV of 1.82. These APIs were instead introduced as stable in Rust 1.84. In lieu of waiting a few months because I'm impatient I've added a small build script to both crates to detect the rustc version and see whether provenance APIs are available. These build script modifications will no longer be necessary once our MSRV is 1.84+.
prtest:miri
<!--
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
-->
alexcrichton requested dicej for a review on PR #10096.
alexcrichton requested wasmtime-default-reviewers for a review on PR #10096.
alexcrichton requested wasmtime-core-reviewers for a review on PR #10096.
alexcrichton updated PR #10096.
dicej submitted PR review.
dicej created PR review comment:
Nit: Could use
version.split_once('.')?
here (and in pulley/build.rs) to simplify the code a bit.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Sort of but it'd end up requiring two invocations: one for looking at
rustc 1
and the next for looking at the N inrustc 1.N.0
. Given that I think I'll leave it as.split('.')
, but I'm also just copy/pasting this detection code around so I could also be missing something
alexcrichton merged PR #10096.
Last updated: Feb 28 2025 at 03:10 UTC