Skip to content

Plumb wasm features through reencoding/printing - #2797

Open
alexcrichton wants to merge 2 commits into
bytecodealliance:mainfrom
alexcrichton:more-features-more-places
Open

alexcrichton wants to merge 2 commits into
bytecodealliance:mainfrom
alexcrichton:more-features-more-places

Conversation

@alexcrichton

Copy link
Copy Markdown
Member

I've resisted doing this in the past in the hopes that it's unnecessary complexity, but it's again gotten to the point where this is becoming more painful than necessary. Upcoming proposal such as multibyte-array-access and acquire-release-atomics are reinterpreting previously invalid modules with a new meaning. This means that preexisting spec tests often fail when these proposals are implemented unless the old behavior can be preserved. This has historically been fixed for the validate step but the extra testing the wast subcommand does, such as reencoding and round-tripping through prints, does not yet support this.

The goal of this commit is to close these gaps and to plumb WasmFeatures through more steps that wasm-tools wast handles. This ensures that so long as behavior is dynamically gated in BinaryReader and validation, which it easily is, it should be pretty easy to avoid breaking preexisting tests when new proposals are implemented.

I've resisted doing this in the past in the hopes that it's unnecessary
complexity, but it's again gotten to the point where this is becoming
more painful than necessary. Upcoming proposal such as
multibyte-array-access and acquire-release-atomics are reinterpreting
previously invalid modules with a new meaning. This means that
preexisting spec tests often fail when these proposals are implemented
unless the old behavior can be preserved. This has historically been
fixed for the `validate` step but the extra testing the `wast`
subcommand does, such as reencoding and round-tripping through prints,
does not yet support this.

The goal of this commit is to close these gaps and to plumb
`WasmFeatures` through more steps that `wasm-tools wast` handles. This
ensures that so long as behavior is dynamically gated in `BinaryReader`
and validation, which it easily is, it should be pretty easy to avoid
breaking preexisting tests when new proposals are implemented.
@alexcrichton
alexcrichton requested a review from a team as a code owner October 23, 2026 22:29
@alexcrichton
alexcrichton requested review from fitzgen and removed request for a team October 23, 2026 22:29

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant