I ran into a difference in initialization fuel on Wasmtime 48.0.2, using the same Wasm and engine settings on Linux and macOS.
This module just initializes five bytes of memory. There are no imports or start function:
(module
(memory (export "memory") 1)
(data (i32.const 0) "hello"))
With a 1,000,000-fuel budget, the GitHub Actions runners report:
With a 1,000-fuel budget, Linux succeeds and macOS traps with OutOfFuel.
Here's the test and engine configuration. I compile the module in memory, with fuel enabled and CoW left at its default of enabled.
Looking at the code, it seems CoW availability determines whether the generated initialization code runs and charges fuel. My use case depends on nodes running on different platforms producing the same results, including fuel usage and whether execution succeeds or runs out of fuel.
Is this an unintended consequence of moving initialization into compiled code? Would memory_init_cow(false) be the right temporary workaround? Possibly related to #14205.
I ran into a difference in initialization fuel on Wasmtime 48.0.2, using the same Wasm and engine settings on Linux and macOS.
This module just initializes five bytes of memory. There are no imports or start function:
With a 1,000,000-fuel budget, the GitHub Actions runners report:
With a 1,000-fuel budget, Linux succeeds and macOS traps with
OutOfFuel.Here's the test and engine configuration. I compile the module in memory, with fuel enabled and CoW left at its default of enabled.
Looking at the code, it seems CoW availability determines whether the generated initialization code runs and charges fuel. My use case depends on nodes running on different platforms producing the same results, including fuel usage and whether execution succeeds or runs out of fuel.
Is this an unintended consequence of moving initialization into compiled code? Would
memory_init_cow(false)be the right temporary workaround? Possibly related to #14205.