Add WebAssembly object validation to wave-test artifact contracts
- Dominant language
- Rust
- Stars
- 53
- Forks
- 16
- Avg merge
- 4h 22m
- Merged PRs (30d)
- 46
Description
## Problem
The case matrix compiles wasm32 and wasm64 objects, but `tools/test_contracts.py` validates only ELF object headers. A backend could emit the wrong WebAssembly address width while the compile-only report still passes.
## Scope
- Add dependency-free WebAssembly object/module header validation.
- Represent wasm32 versus wasm64/Memory64 expectations in test metadata or the resolved target contract.
- Validate malformed magic/version data and the expected memory/address-width contract.
- Add synthetic unit fixtures for both widths.
## Completion criteria
- Compile-only wasm32 and wasm64 cases fail on the wrong artifact kind or width.
- Validation does not require `llvm-readobj`, Node.js, or a network download.
- Existing ELF validation is unchanged.
Related: #457
Contributor guide
Research direction
Start in tools/test_contracts.py and trace how the compile-only case matrix and resolved target contract currently validate ELF headers. Add synthetic fixtures covering malformed headers and wasm32 versus wasm64 expectations, then run the relevant contract tests and confirm wrong artifact kinds or widths fail without external tools while ELF validation remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, wasm
- Domain
- compilers, testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100