Stack switching cranelift and tests (Pre-Review)#3
Open
posborne wants to merge 35 commits into
Open
Conversation
This initial commit represents the "pr2" base commit with minimal merge conflicts resolved. Due to OOB conflicts, this commit is not functional as-is, but using it as a base in order to allow for easier reviewing of the delta from this commit to what will be used for the PR against upstream. Co-authored-by: Daniel Hillerström <daniel.hillerstrom@ed.ac.uk> Co-authored-by: Paul Osborne <paul.osborne@fastly.com>
This first set of changes updates the base pr in order to compiled and pass basic checks (compile, clippy, fmt) with the biggest part of the change being to eliminate injection of tracing/assertions in JIT'ed code.
…c_environ members
At this point, the only bit we really branch on is what we do in order to avoid problems tying into wasmtime_environ. This is basd on the approach and macro used by the gc code for converting presence/absence of the cranelift feature flag to cranelift compile time. This is a bit of a half-measure for now as we still compile most stack-switching code in cranelift, but this does enough to avoid causing problems with missing definitions in wasmtime_environ.
Replace either with infallible From or fallible, panicing TryFrom alternatives where required.
After removing emission of runtime trace logging and assertions, there were several unused parameters. Remove those from the ControlEffect signatures completely.
This matches a change to the mirrored runtime type in the upstream changes.
posborne
force-pushed
the
stack-switching-cranelift-and-tests
branch
from
June 10, 2025 16:18
a944408 to
38e35b8
Compare
Co-authored-by: Daniel Hillerström <daniel.hillerstrom@ed.ac.uk>
The extra parameters here used to be used for emitting runtime assertions, but with those gone we just had unused params and lifetimes, clean those out.
There's already a stub elsewhere and this is not called, when exceptions are added and it is time to revisit, this method can be restored.
Rename VMHostArray -> VMHostArrayRef Change impl to compute address with offset upfront rather than on each load.
This matches the directory structure for gc and aids in visibility for a few members required by stack-switching code in cranelift.
…nelift As part of this, updated translate_ref_is_null to use the wasm type rather than brancing on the ir type being an i128.
In the course of the various runtime updates, the layout of the runtime VMContObj got switched around. This resulted in failures when doing certain table operations on continuations. This change fixes that layout problem and adds some tests with offsets to avoid the problem. Due to the way that we interact with the VMContObj in cranelift, we don't use these offsets outside of the tests.
This method isn't required as sized_stack_slots is already pub.
posborne
force-pushed
the
stack-switching-cranelift-and-tests
branch
from
July 14, 2025 22:33
38e35b8 to
e6ab7f2
Compare
posborne
force-pushed
the
stack-switching-cranelift-and-tests
branch
5 times, most recently
from
July 16, 2025 18:36
2f736e7 to
692cc9f
Compare
…nelift Resolved a few conflicts manually, blessed disas tests, and made a few non-conflicting updates to func_environ.rs and code_translator.rs (but pretty trivial).
This change migrates VMContObj and its usages in cranelift and runtime to work with the VMContObj fat pointer as two words in order to better target different architectures (still gated to x86_64 for now). To support this, a size type was plumbed into the builtins function signature types (as is done for component types) that maps to usize.
(cherry picked from commit 2121568) Signed-off-by: Paul Osborne <paul.osborne@fastly.com> stack-switching: update stack-switch dwarf test to work with latest suite framework Updates to work through test failures Mostly restricting the cases in which we'll try to run various test cases to only be x64 linux for now. fuzzing: Fix plumbing of configuration for stack-switching Fix VMContObj alignment on 32-bit targets fmt Adjust wast tests for stack-switching Trying a different wast setup for mac x86_64 try unix instead of linux for wast should_fail fmt
posborne
force-pushed
the
stack-switching-cranelift-and-tests
branch
from
August 27, 2025 17:15
9f3029c to
2bccb93
Compare
This type is not fully complete until continuation/gc integration is revisited (bytecodealliance#10248) but without these changes, test cases are now failing on panics as we need some representation of continuation references in the runtime Val enumeration. Runtime errors with TODO notes are added for the stubbed code paths to revisit later.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Throwing this up for review of test failures/etc. prior to upstream PR.