Skip to content

Update extended-name-section proposal implementation - #2658

Merged
fitzgen merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:more-extended-name-section
Sep 14, 2026
Merged

fitzgen merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:more-extended-name-section

Conversation

@alexcrichton

Copy link
Copy Markdown
Member

Notably implement the parameter and tag-parameter subsections. These are then integrated in all the relevant locations throughout the tools.

Notably implement the parameter and tag-parameter subsections. These are
then integrated in all the relevant locations throughout the tools.
@alexcrichton
alexcrichton requested a review from a team as a code owner September 14, 2026 17:02
@alexcrichton
alexcrichton requested review from fitzgen and removed request for a team September 14, 2026 17:02
@fitzgen
fitzgen added this pull request to the merge queue Sep 14, 2026
Merged via the queue into bytecodealliance:main with commit ff5d6b8 Sep 14, 2026
37 checks passed
@alexcrichton
alexcrichton deleted the more-extended-name-section branch September 14, 2026 18:35
@bvisness

Copy link
Copy Markdown
Contributor

Very glad to see this done so quickly! Saves me the trouble of making my own patches 😄

Does this mean the extended names implementation is complete and passing all the tests that were recently upstreamed in WebAssembly/testsuite#167?

@alexcrichton

Copy link
Copy Markdown
Member Author

Sort of and sort of not -- there's three main gotchas to the test coverage:

  • One is that I haven't actually updated the submodule here yet so there's some other misc changes needed. I'll have that update ready after Support multiple supertypes in everything but validation #2652 is figured out, however.
  • Another gotcha is that wasm-tools doesn't actually validate custom sections at all so assert_invalid_custom is basically an unimplemented directive. IIRC it was just branch hinting that previously used this and that was pretty minor. Otherwise though wasmparser's architecture isn't very amenable to validation the name custom section right now API-wise, so I haven't figured out how best to do that. Notably validating the name section requires knowledge of all parsed functions to validate labels and locals. Anyway, just wanted to point this out b/c I wouldn't consider wasm-tools a conforming implementation until that directive is implemented.
  • The final gotcha is that wasm-tools uses *.wast tests to go a bit further than the spec tests have on the surface, specifically w.r.t. round-tripping the module. All preexisting tests assert that if you parse text to a binary, then print a binary, then parse that back to binary again, that the two binaries produced are the exact same. This works out because the text section can't represent things like empty function sections, but the tests outlined in my comment here don't round-trip because the name section doesn't pop out the other end (the text format can't represent a name section, or at least not too easily in the current impelmentation). That means that wasm-tools wast fails on those tests, but only for the more strict assertions that wasm-tools has internally in a sense. That's where I was thinking a separate assert_valid_custom directive would be a good indicator for "don't roundtrip test this" or something like that.

For phase-advancement purposes it may be there though? None of these issues have anything to do with the extended-name-section proposal itself, all of what I've described here is a property of the name section already as-specified.

If you're curious, alexcrichton@088508b is the commit I'm working on to update the submodule to have the extended-name-section tests. The current failures look like this

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