Repository navigation
chore(deps): bump the wasm-tools family to 0.263, decoding memargs as 0.262 did - #1707
Merged
Merged
Conversation
… 0.262 did Moves wasmparser, wasm-encoder, wit-parser, wit-component (0.262 -> 0.263), wat (1.262 -> 1.263) and wast (262.0 -> 263.0) together in the workspace Cargo.toml, with a targeted `cargo update -p` of the family (plus its wasm-metadata companion). The Cargo.lock delta equals dependabot's. The wat requirement is raised to 1.263 as well, which dependabot left at 1.262; the lock resolves 1.263.0 either way. API breaks, both in synth-core: - wasm_encoder::MemArg replaced `memory_index: u32` with `target: MemArgTarget` and added `ordering: Option<MemArgOrdering>`. arena_bind's allocator body now builds `target: Memory(0), ordering: None`, which encodes the same bytes as `memory_index: 0`. - wasmparser::MemArg replaced `memory: u32` with `target: MemArgTarget` (`Memory(u32)` or the new `Array(u32)`, a GC array type). The decoder's memarg helper is renamed memarg_target and returns the target; a `Memory(k > 0)` op is wrapped in MultiMemory as before, and an `Array` target loud-skips the function instead of being lowered as a linear-memory access. Semantic change, neutralised: Parser::new enables WasmFeatures::all(), and 0.263 added acquire-release-atomics and multibyte-array-access to it. Both reassign memarg flag bits 4 and 5, which 0.262 (and the standard encoding) read as alignment. A hand-built probe set showed the branch decoding differently from base: flags 0x12 and 0x32 became a hard decode error, and flags 0x20/0x22 consumed an extra LEB as an array type index and loud-skipped the function. The decoder now parses with those two features removed (decode_parser), and all six probes are byte-identical to base again. Synth lowers neither proposal. Two synth-core unit tests pin the 0.262 reading of flags 0x12 and 0x22. Paired control: with decode_parser reverted to the default feature set, both tests fail. Evidence, base 617e440 vs this branch, both built with default features: - Census: 554 inputs (tests/**, scripts/repro, examples, and the 257 top-level spec .wast files) x 8 configs (cortex-m4, cortex-m7dp, cortex-m4 --relocatable, the same plus --debug-line, cortex-m4 --safety-bounds software, cortex-r5, riscv rv32imac, aarch64) = 4432 pairs. 1792 have byte-identical outputs, and 2516 refusals have the same rc and output. The other 124 have identical rc and output files, and their diagnostic text differs only because MemArg's Debug output changed (`memory: 0 }` became `target: Memory(0), ordering: None }`) in the unsupported-op warnings of 16 simd_*.wast files. Applying that one substitution leaves 0 differences. The census was rerun with --allow-skipped-exports, so a module with a declined export still emits an object: 2208 objects are byte-identical, 2100 refusals are identical, and the same 124 pairs differ in text only. - The #418 arena-bind path is the only site whose emitted bytes this change touches. The cabi_arena_bind_418 execution oracle passes on base and on the branch, with identical logs, and its compile output is byte-identical (the ELF sha256 matches). - The spec_compile_census.py pins pass. - Spec execution oracle (spec_exec_1636_differential.py): PASS on both binaries, 35676 directives executed (cortex-m4 11634, cortex-m7dp 24042), 53 failures, all exact baseline entries. The per-directive --json ledgers of base and branch are byte-identical. - fmt, clippy -D warnings, cargo test --workspace (3271 passed, 0 failed, before the two tests were added; synth-core lib 253 passed after), the riscv, verify and z3-solver,arm feature sets, and check_version_pins.py all pass. Refs #1649 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1649
This moves the wasm-tools family from 0.262 to 0.263: wasmparser, wasm-encoder, wit-parser and wit-component go to 0.263, wat to 1.263, and wast to 263.0. The bump is a
cargo update -pof those crates plus wasm-metadata. The resultingCargo.lockdelta is the same as dependabot's. One change goes beyond #1649: thewatrequirement is raised to1.263, which dependabot left at1.262. The lock resolves 1.263.0 either way.API breaks (both in synth-core)
arena_bind.rs(allocator body)wasm_encoder::MemArgreplacedmemory_indexwithtarget: MemArgTargetand addedorderingtarget: MemArgTarget::Memory(0), ordering: None. This encodes the same bytes asmemory_index: 0.wasm_decoder.rs(memarg helper)wasmparser::MemArgreplacedmemory: u32withtarget: MemArgTarget::{Memory(u32), Array(u32)}memarg_target. AMemory(k > 0)target is wrapped inMultiMemoryas before. AnArraytarget (a GC array payload) loud-skips the function instead of being lowered as a linear-memory access.A semantic change that this PR switches off
Parser::newenablesWasmFeatures::all(). In 0.263 that set gained two in-flight proposals, acquire-release-atomics and multibyte-array-access. Both give new meanings to memarg flag bits 4 and 5, which 0.262, and the standard wasm 3.0 encoding, read as part of the alignment exponent.Six hand-built probe modules showed the bumped decoder diverging from base 617e440:
0x12and0x32became a hardFailed to decodeerror.0x20and0x22consumed an extra LEB as an array type index, then loud-skipped the function.The decoder now parses through
decode_parser(), which removes those two features. All six probes are byte-identical to base again. Synth lowers neither proposal. TheArrayarm above is therefore unreachable today and stays only as a defence.Two synth-core unit tests,
memarg_bit{4,5}_is_alignment_*_1649, pin the 0.262 reading of flags0x12and0x22. Paired control: withdecode_parser()reverted to the default feature set, both tests fail.These probes are invalid wasm (an alignment larger than natural), and base accepts them. That is the existing invalid-accept class, and this PR leaves it unchanged.
Evidence: base 617e440 vs this branch, both built with default features (riscv)
tests/**,scripts/repro,examples, plus the 257 top-level spec.wastfiles) × 8 configs give 4432 pairs. The configs are cortex-m4, cortex-m7dp, cortex-m4--relocatable, the same with--debug-line, cortex-m4--safety-bounds software, cortex-r5, riscv rv32imac and aarch64.simd_*.wastfiles. In each case the change isMemArg'sDebugoutput inside an unsupported-op warning:memory: 0 }becametarget: Memory(0), ordering: None }. After applying that one substitution, 0 differences remain.spec_compile_census.pypins all 257 spec files and passes on the branch.--allow-skipped-exports, so a module with a declined export still emits an object. That run has 2208 byte-identical objects, 2100 identical refusals, and the same 124 pairs that differ in text only.cabi-arena-reallocto the native TCB arena allocator #418 arena-bind.allocator_bodyis the only site whose emitted bytes this change touches.cabi_arena_bind_418_differential.pypasses on base and on the branch with identical logs. Its compile output is byte-identical: the ELF sha256 matches.scripts/repro/spec_exec_1636_differential.py). It passes on both binaries: 35676 directives executed, 11634 on cortex-m4 and 24042 on cortex-m7dp. There are 53 failures, all exact baseline entries. The per-directive--jsonledgers of base and branch are byte-identical.cargo fmt --checkandcargo clippy --workspace --all-targets -- -D warningspass.cargo test --workspace --no-fail-fast: 3271 passed, 0 failed. That run predates the two new tests; after adding them, the synth-core lib tests pass 253 of 253.--features riscv(async_intrinsics_gate): 2 passed.-p synth-cli --features verify: 479 passed.-p synth-verify --features z3-solver,arm: 278 passed.scripts/check_version_pins.pypasses. Bazel resolves crates fromCargo.lock(crate.from_cargo), so neitherMODULE.bazelnorcrates/BUILD.bazelpins these crates.MODULE.bazel.lockis not kept in sync with crate bumps: the 0.262 bump (chore(deps): bump the wasm-tools family to 0.262 #1591) did not touch it either, so this PR leaves it alone.Rebased onto 5dc4e28
The evidence above was measured on base 617e440. On base 60170da (after #1697, #1702 and #1705) the branch was re-checked:
cargo fmt --check, clippy clean,cargo test --workspace --no-fail-fast3299 passed / 0 failed, Claim Check 55/55, and the spec-suite workflow steps (compile census PASS on all five backends, #1225 PASS, #1441 PASS, spec execution #1636 PASS: 35715 directives, baseline 54/54).It was then rebased onto 5dc4e28, which adds only
[profile.dev.package.ordeal*]toCargo.toml(#1706) in a hunk disjoint from this one. On that head onlycargo metadata --lockedandcargo fmt --checkwere run locally, because the host was out of disk; CI is the full check for this head.🤖 Generated with Claude Code
https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L