Stream: git-wasmtime

Topic: wasmtime / PR #10096 pulley: Execute a wasm module under ...


view this post on Zulip Wasmtime GitHub notifications bot (Jan 23 2025 at 22:52):

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 a NonZeroUsize internally rather than NonNull<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:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Jan 23 2025 at 22:52):

alexcrichton requested dicej for a review on PR #10096.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 23 2025 at 22:52):

alexcrichton requested wasmtime-default-reviewers for a review on PR #10096.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 23 2025 at 22:52):

alexcrichton requested wasmtime-core-reviewers for a review on PR #10096.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 23 2025 at 22:58):

alexcrichton updated PR #10096.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 23 2025 at 23:04):

dicej submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 23 2025 at 23:04):

dicej created PR review comment:

Nit: Could use version.split_once('.')? here (and in pulley/build.rs) to simplify the code a bit.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 23 2025 at 23:29):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 23 2025 at 23:29):

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 in rustc 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

view this post on Zulip Wasmtime GitHub notifications bot (Jan 23 2025 at 23:50):

alexcrichton merged PR #10096.


Last updated: Feb 28 2025 at 03:10 UTC