Skip to content

Support (module definition ...) and (module instance ...) in WAST spec tests#8058

Merged
stevenfontanella merged 17 commits into
WebAssembly:mainfrom
stevenfontanella:module-definition-and-instance-cp
Dec 3, 2025
Merged

Support (module definition ...) and (module instance ...) in WAST spec tests#8058
stevenfontanella merged 17 commits into
WebAssembly:mainfrom
stevenfontanella:module-definition-and-instance-cp

Conversation

@stevenfontanella
Copy link
Copy Markdown
Member

@stevenfontanella stevenfontanella commented Nov 18, 2025

  • Add support for (module definition ...) and (module instance ...) in WAST spec tests
    • Syntax reference
    • These statements are skipped by the WAST splitter, since wasm-opt can't understand them. In the future, we need some extra work to handle explicit module instantiations correctly here.
    • This fixes the memory.wast spec test. The remaining 3 that currently depend on this syntax still break for other reasons (mentioned in shared.py)
  • Remove extra unneeded call to run_spec_test

@stevenfontanella stevenfontanella force-pushed the module-definition-and-instance-cp branch 3 times, most recently from 2480082 to 7b98b2e Compare November 18, 2025 22:57
Copy link
Copy Markdown
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

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

A few initial comments while this is still under construction.

Comment thread scripts/test/support.py Outdated
Comment thread src/parser/wast-parser.cpp
Comment thread src/parser/wat-parser.h Outdated
Comment thread src/tools/wasm-shell.cpp Outdated
Comment thread src/wasm.h Outdated
@stevenfontanella stevenfontanella force-pushed the module-definition-and-instance-cp branch from 7b98b2e to 616165c Compare November 19, 2025 22:21
@stevenfontanella
Copy link
Copy Markdown
Member Author

(Sorry for the force-push, I already made these changes locally before your comments)

@stevenfontanella stevenfontanella force-pushed the module-definition-and-instance-cp branch from 616165c to e5c9ab4 Compare November 20, 2025 00:24
Comment thread src/parser/wat-parser.h Outdated
Comment thread check.py
Comment thread src/tools/wasm-shell.cpp Outdated
Comment thread src/tools/wasm-shell.cpp
Comment thread src/tools/wasm-shell.cpp Outdated
Comment thread src/tools/wasm-shell.cpp Outdated
Comment thread src/tools/wasm-shell.cpp Outdated
Comment thread src/parser/wast-parser.cpp
Comment thread src/parser/wast-parser.cpp Outdated
Comment thread src/parser/wast-parser.cpp Outdated
Comment thread src/parser/wat-parser.cpp
* Fixes for lastModule / lastInstance
* Fix for python f-string in lower python versions
* Fix for Module registration when some params aren't specified
@stevenfontanella stevenfontanella marked this pull request as ready for review November 26, 2025 20:48
Comment thread src/parser/wast-parser.cpp Outdated
Comment thread src/parser/wast-parser.cpp
Comment thread src/parser/wast-parser.cpp Outdated
Comment thread src/parser/wat-parser.cpp Outdated
Comment thread src/parser/wat-parser.cpp
@stevenfontanella
Copy link
Copy Markdown
Member Author

Just realized I can't base this PR on top of #8080 because this branch comes from my fork. For now until #8080 is merged and I re-merge this branch from main, the diff will show up here.

stevenfontanella added a commit that referenced this pull request Dec 1, 2025
For use in #8058. In some cases (e.g. for parsing `(module definition
...)`), we want to parse the body of a module without the initial
`(module name? ...)` S-expression. `parseModule` parses *either* the
full `(module ...)` S-expression or just the module body since some
cases consist only of a module body. Add `parseModuleBody` which only
parses the module body.
Copy link
Copy Markdown
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

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

LGTM!

@stevenfontanella stevenfontanella merged commit c0bcdd6 into WebAssembly:main Dec 3, 2025
17 checks passed
@stevenfontanella stevenfontanella linked an issue Feb 3, 2026 that may be closed by this pull request
91 tasks
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.

Improve interpreter spec test coverage

2 participants