Skip to content

Update spec test suite submodule#2485

Merged
alexcrichton merged 2 commits intobytecodealliance:mainfrom
alexcrichton:update-testsuite
Apr 10, 2026
Merged

Update spec test suite submodule#2485
alexcrichton merged 2 commits intobytecodealliance:mainfrom
alexcrichton:update-testsuite

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

  • Add support for assert_{invalid,malformed}_custom directives
  • Shuffle around how @custom is printed to improve round-trip-ability
  • Disallow multiple @metadata.branch_hint annotations on one instruction.
  • Skip a custom-page-sizes test for now until the test upstream is updated.
  • Adjust the name section emitted during text-to-binary to happen after user-specified @custom sections to make round-tripping work.

@alexcrichton alexcrichton requested a review from a team as a code owner April 10, 2026 14:48
@alexcrichton alexcrichton requested review from pchickey and removed request for a team April 10, 2026 14:48
(@metadata.code.branch_hint "\00")
(@metadata.code.branch_hint "\00")
if
(@metadata.code.branch_hint "\00")
Copy link
Copy Markdown
Contributor

@keithw keithw Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re: the no-test-foldedon this file. The folding printer is rejecting this because of the branch hint on an end operator. Branch hints seem to be only allowed on br_if and if -- we could avoid having to make this test no-test-folded if we either:

  • remove this particular branch hint (the one just before the end) from the test, or
  • make it an assert_malformed_custom, and enforce the "branch hints are only allowed on br_if or if` rule in the parser

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I end up sort of doing this for the tests/cli/folding/branch-hinting-simple.wast file where I deleted some of the annotations to get the test to pass, so this test here is asserting that if the hints are present it at least round-trips without folding.

Otherwise though for assert_malformed_custom, it's a bit tricky. Technically this needs to be assert_invalid_custom because the branch hint section isn't malformed with hints on weird instructions, it's only invalid because it's not allowed on those instructions. Right now wasm-tools doesn't have any validators for custom sections, though, so the assert_invalid_custom directive is basically ignored.

Copy link
Copy Markdown
Contributor

@pchickey pchickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs the merge with main to get rid of the typos CI pass

* Add support for `assert_{invalid,malformed}_custom` directives
* Shuffle around how `@custom` is printed to improve round-trip-ability
* Disallow multiple `@metadata.branch_hint` annotations on one
  instruction.
* Skip a custom-page-sizes test for now until the test upstream is
  updated.
* Adjust the `name` section emitted during text-to-binary to happen
  after user-specified `@custom` sections to make round-tripping work.
@alexcrichton alexcrichton enabled auto-merge April 10, 2026 20:07
@alexcrichton alexcrichton added this pull request to the merge queue Apr 10, 2026
Merged via the queue into bytecodealliance:main with commit 77ea5b6 Apr 10, 2026
37 checks passed
@alexcrichton alexcrichton deleted the update-testsuite branch April 10, 2026 20:21
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.

3 participants