jrandolf edited PR #14843.
jrandolf updated PR #14843.
jrandolf updated PR #14843.
jrandolf edited PR #14843:
This adds map support where Wasmtime prints and parses WAVE values, using wasm-tools 1.263.0, now on
mainvia #15097:
wasmtime run --invoke,Val::to_waveandVal::from_waveprint and parse maps as{key: value, ...}(bytecodealliance/wasm-tools#2782). WAVE merges duplicate keys, keeping the last value.map-types.wastuses the existingmap.constsupport to check that guest-returned maps and map arguments retain duplicate keys. This covers the duplicate-keys test that #14834 dropped, as suggested there.$ wasmtime run -W component-model-map --invoke 'echo({3: 4, 1: 2, 3: 5})' component-map.wat {3: 5, 1: 2}Closes #14811
jrandolf edited PR #14843:
Component maps are currently unsupported by Wasmtime's WAVE integration. Implement the wasm-wave map traits for
component::Typeandcomponent::Valincrates/wasmtime/src/runtime/wave/component.rs, enablingVal::to_wave,Val::from_wave, andwasmtime run --invoketo handle maps through the existing parsing and display helpers.WAVE merges duplicate keys, keeping the last value:
$ wasmtime run -W component-model-map --invoke 'echo({3: 4, 1: 2, 3: 5})' tests/all/cli_tests/component-map.wat {3: 5, 1: 2}CLI tests cover empty maps, map arguments and results, and duplicate keys. WAST tests use the existing
map.constsupport to check thatVal::Mapretains duplicate entries when lowering arguments and lifting results.Closes #14811
jrandolf commented on PR #14843:
@pchickey This PR is now ready :smiley:
:thumbs_up: alexcrichton submitted PR review.
alexcrichton added PR #14843 Support map values in WAVE to the merge queue.
github-merge-queue[bot] removed PR #14843 Support map values in WAVE from the merge queue.
jrandolf requested alexcrichton for a review on PR #14843.
alexcrichton added PR #14843 Support map values in WAVE to the merge queue.
:check: alexcrichton merged PR #14843.
alexcrichton removed PR #14843 Support map values in WAVE from the merge queue.
Last updated: Nov 19 2026 at 20:05 UTC