Specify maximum static size for component value types - #688
Conversation
Require resolved type AST nodes to satisfy elem_size <= 2^28 - 1 for both i32 and i64 pointer types using overflow-safe validation, closing fixed-length-list sizing hazards (WebAssembly#682). Signed-off-by: Gaurav Chaudhary <chaudharygaurav2004@gmail.com>
Apply despecialize at each recursive check_resolved_type_size call so nested map/option/record nodes are validated, not only top-level types. Add regression tests for option<map<...>> and record fields (WebAssembly#682). Signed-off-by: Gaurav Chaudhary <chaudharygaurav2004@gmail.com>
|
Thanks for working on this! To resolve #682, I had been thinking that perhaps we could reuse the |
Replace the duplicate checked_* Python with one Element Size invariant (every despecialized AST node, both pointer widths) and short pointers in Binary, Explainer, and canonopt validation. Keep WAST coverage and drop the run_tests.py validator tests. Signed-off-by: Gaurav Chaudhary <chaudharygaurav2004@gmail.com>
|
@lukewagner Thanks for the feedback Validation now reuses the existing elem_size definition instead of adding a separate checked_* algorithm. The full rule is in Element Size in CanonicalABI.md (every despecialized AST node, both i32 and i64), with short pointers in Explainer.md, Binary.md, and canonopt validation. WAST tests cover the edge cases; nyi.txt until wasm-tools/Wasmtime implement the validator. @alexcrichton please review this PR and give your feedback , thanks |
Fixes #682
Summary
Adds a spec-defined maximum static value size of
2^28 - 1bytes for Component Model value types.Validation now:
i32andi64pointer types;Includes Python and WAST regression tests for fixed-length lists, compound types, nested maps, pointer-width differences, and integer-overflow cases.
The WAST test remains in
nyi.txtuntil wasm-tools/Wasmtime implement the corresponding validator rule.