Stream: git-wasmtime

Topic: wasmtime / issue #13987 Component-model fixed-length-list...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 25 2026 at 20:20):

alexcrichton opened issue #13987:

This test:

use wasmtime::component::{Component, Linker, Val};
use wasmtime::{Config, Engine, Result, Store};

const C: &str = r#"
(component
  (type $l (list u32 4))
  (type $t (tuple u32 $l))
  (import "f" (func $f (result $t)))
  (core module $mem (memory (export "memory") 1))
  (core instance $memi (instantiate $mem))
  (core func $f2 (canon lower (func $f) (memory $memi "memory")))
  (core module $m
    (import "" "f" (func $f (param i32)))
    (import "mem" "memory" (memory 1))
    (func (export "run") (result i32)
      (call $f (i32.const 0))
      (i32.load (i32.const 0)))
  )
  (core instance $ci (export "f" (func $f2)))
  (core instance $mi (instantiate $m (with "" (instance $ci)) (with "mem" (instance $memi))))
  (func (export "run") (result u32) (canon lift (core func $mi "run") (memory $memi "memory")))
)
"#;

#[test]
fn smoke() -> Result<()> {
    let mut config = Config::new();
    config.wasm_component_model(true);
    config.wasm_component_model_fixed_length_lists(true);
    let engine = Engine::new(&config)?;
    let component = Component::new(&engine, C)?;
    let mut linker = Linker::new(&engine);
    linker.root().func_new("f", |_, _, _params, results| {
        results[0] = Val::Tuple(vec![
            Val::U32(0xaaaaaaaa),
            Val::FixedLengthList(vec![
                Val::U32(0x11111111),
                Val::U32(0x22222222),
                Val::U32(0x33333333),
                Val::U32(0x44444444),
            ]),
        ]);
        Ok(())
    })?;
    let mut store = Store::new(&engine, ());
    let inst = linker.instantiate(&mut store, &component)?;
    let run = inst.get_typed_func::<(), (u32,)>(&mut store, "run")?;
    assert_eq!(run.call(&mut store, ())?, (0xaaaaaaaa,));
    Ok(())
}

currently fails:

running 1 test
test smoke ... FAILED

failures:

---- smoke stdout ----

thread 'smoke' (2681695) panicked at src/lib.rs:58:5:
assertion `left == right` failed
  left: (286331153,)
 right: (2863311530,)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    smoke

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

error: test failed, to rerun pass `--lib`

and it's due to lowering for fixed-length-lists with Val not correctly accounting for offset

view this post on Zulip Wasmtime GitHub notifications bot (Jul 25 2026 at 20:20):

alexcrichton added the bug label to Issue #13987.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 25 2026 at 20:20):

alexcrichton added the wasm-proposal:component-model label to Issue #13987.


Last updated: Jul 29 2026 at 05:03 UTC