Stream: git-wasmtime

Topic: wasmtime / issue #13960 Atomic store erroneously optimize...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 24 2026 at 18:38):

alexcrichton opened issue #13960:

This input:

(module
  (memory (export "mem") 1 1)
  (func (export "f") (param $d i32) (result i32)
    (i32.atomic.store (i32.const 0) (i32.const 1))
    (i32.div_u (i32.const 100) (local.get $d))
    (i32.atomic.store (i32.const 0) (i32.const 2)))
  (func (export "get") (result i32) (i32.load (i32.const 0)))
)
(assert_trap (invoke "f" (i32.const 0)) "integer divide by zero")
(assert_return (invoke "get") (i32.const 1))

fails with:

$ cargo run wast foo.wat
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.10s
     Running `target/debug/wasmtime wast foo.wat`
Error: failed to run script file 'foo.wat'

Caused by:
    0: failed directive on foo.wat:10
    1: result 0 didn't match
    2: expected                  1 / 0x0000000000000001
actual                    0 / 0x0000000000000000

$ cargo run wast -O opt-level=0 foo.wat
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.11s
     Running `target/debug/wasmtime wast -O opt-level=0 foo.wat`

an LLM diagnosis, if helpful, is here

cc @fitzgen

view this post on Zulip Wasmtime GitHub notifications bot (Jul 24 2026 at 18:38):

alexcrichton added the bug label to Issue #13960.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 24 2026 at 18:43):

alexcrichton added the cranelift label to Issue #13960.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 28 2026 at 15:52):

cfallin closed issue #13960:

This input:

(module
  (memory (export "mem") 1 1)
  (func (export "f") (param $d i32) (result i32)
    (i32.atomic.store (i32.const 0) (i32.const 1))
    (i32.div_u (i32.const 100) (local.get $d))
    (i32.atomic.store (i32.const 0) (i32.const 2)))
  (func (export "get") (result i32) (i32.load (i32.const 0)))
)
(assert_trap (invoke "f" (i32.const 0)) "integer divide by zero")
(assert_return (invoke "get") (i32.const 1))

fails with:

$ cargo run wast foo.wat
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.10s
     Running `target/debug/wasmtime wast foo.wat`
Error: failed to run script file 'foo.wat'

Caused by:
    0: failed directive on foo.wat:10
    1: result 0 didn't match
    2: expected                  1 / 0x0000000000000001
actual                    0 / 0x0000000000000000

$ cargo run wast -O opt-level=0 foo.wat
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.11s
     Running `target/debug/wasmtime wast -O opt-level=0 foo.wat`

an LLM diagnosis, if helpful, is here

cc @fitzgen


Last updated: Jul 29 2026 at 05:03 UTC