Stream: git-wasmtime

Topic: wasmtime / PR #13369 Exhaustively test GC object type x c...


view this post on Zulip Wasmtime GitHub notifications bot (May 14 2026 at 19:26):

fitzgen opened PR #13369 from fitzgen:wasmtime-gc-exhaustive-tests to bytecodealliance:main:

These tests take 1m to run for me locally. Didn't catch any bugs, even though there is at least one known copying collector bug that this should have caught in theory, so I'm not sure we want to merge this as-is. Open to suggested tweaks, options that are missing here, options that we can safely ignore, etc...

Probably you want to just look at generate.py.

Generates tests of the following shape:

  (func (export "run") $PARAMS_IF_NEEDED
    (local $x (ref null $obj))
    (local $i i32)
    (local $j i32)
    $EXTRA_LOCALS_IF_NEEDED

    ;; Execute the test body a few times to increase the chance of interesting
    ;; interactions with e.g. GC heap growth.
    (loop $outer
      (if (i32.ge_u (local.get $i) (i32.const 10))
        (then (return))
      )

      ;; Get or create the object.
      (local.set $x $GET_OR_CREATE_OBJ)

      ;; Access the object, GC, and then assert that the object looks as
      ;; expected.
      $ACCESS
      (call $gc)
      $ASSERT

      (local.set $j (i32.const 0))
      (loop $inner
        ;; Do that dance again, this time inside a loop, to exercise GVN/LICM
        ;; interactions.
        $ACCESS
        (call $gc)
        $ASSERT

        (if (i32.eqz (local.get $j))
          (then
            (local.set $j (i32.const 1))
            (br $inner)
          )
        )

        (local.set $i (i32.add (local.get $i) (i32.const 1)))
        (br $outer)
      )
    )
  )

view this post on Zulip Wasmtime GitHub notifications bot (May 14 2026 at 19:26):

fitzgen requested wasmtime-core-reviewers for a review on PR #13369.

view this post on Zulip Wasmtime GitHub notifications bot (May 14 2026 at 19:26):

fitzgen requested pchickey for a review on PR #13369.

view this post on Zulip Wasmtime GitHub notifications bot (May 15 2026 at 01:30):

fitzgen updated PR #13369.

view this post on Zulip Wasmtime GitHub notifications bot (May 15 2026 at 01:32):

fitzgen commented on PR #13369:

Okay I tweaked the generator and it successfully reproduces the bug(s) fixed in https://github.com/bytecodealliance/wasmtime/pull/13381

So I think this is good for review, assuming we are okay with adding about a whole minute's worth of GC tests.

view this post on Zulip Wasmtime GitHub notifications bot (May 15 2026 at 01:32):

fitzgen requested alexcrichton for a review on PR #13369.

view this post on Zulip Wasmtime GitHub notifications bot (May 15 2026 at 02:02):

alexcrichton commented on PR #13369:

Personally I think this is probably overkill. Perhaps a decent basis for a misc fuzzer though?

view this post on Zulip Wasmtime GitHub notifications bot (May 15 2026 at 21:14):

fitzgen requested wasmtime-fuzz-reviewers for a review on PR #13369.

view this post on Zulip Wasmtime GitHub notifications bot (May 15 2026 at 21:14):

fitzgen requested wasmtime-default-reviewers for a review on PR #13369.

view this post on Zulip Wasmtime GitHub notifications bot (May 15 2026 at 21:14):

fitzgen updated PR #13369.

view this post on Zulip Wasmtime GitHub notifications bot (May 15 2026 at 21:15):

fitzgen commented on PR #13369:

Personally I think this is probably overkill. Perhaps a decent basis for a misc fuzzer though?

Okay, reworked this into a new generator+oracle pair and hooked that up to the misc fuzzer!


Last updated: Jun 01 2026 at 09:49 UTC