Stream: git-wasmtime

Topic: wasmtime / PR #13448 Test/adjust fuel consumption in bulk...


view this post on Zulip Wasmtime GitHub notifications bot (May 22 2026 at 06:04):

alexcrichton opened PR #13448 from alexcrichton:bulk-ops to bytecodealliance:main:

This commit is the final step of #13387 to add tests for all bulk operations and ensure that everything stays in sync. Notably all instructions have tests that their "infinite" version traps on out-of-fuel and additionally each version consumes a set amount of fuel. This required adjusting the fuel consumption loops as to where fuel was tweaked/flushed to ensure that fuel wasn't double-counted during loops and to also ensure that 1 fuel was consumed per-loop.

This does surface some slightly odd behavior where sometimes fuel is counted as a per-byte operation and sometimes it's counted as a per-element operation. This happens due to how the code is structured where sometimes array.fill, for example, is a memset and sometimes it's per-element. The fuel consumption of memset is byte-based, for example, while it's per-element based for the manual loop. Regardless though it's still always deterministic for a particular wasm, and notably execution will still be limited by the dynamic operation size of these instructions.

Closes #13387

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (May 22 2026 at 06:04):

alexcrichton requested cfallin for a review on PR #13448.

view this post on Zulip Wasmtime GitHub notifications bot (May 22 2026 at 06:04):

alexcrichton requested wasmtime-compiler-reviewers for a review on PR #13448.

view this post on Zulip Wasmtime GitHub notifications bot (May 22 2026 at 06:04):

alexcrichton requested wasmtime-core-reviewers for a review on PR #13448.

view this post on Zulip Wasmtime GitHub notifications bot (May 22 2026 at 12:39):

alexcrichton updated PR #13448.

view this post on Zulip Wasmtime GitHub notifications bot (May 22 2026 at 17:06):

:thumbs_up: cfallin submitted PR review:

Looks good!

This does surface some slightly odd behavior where sometimes fuel is counted as a per-byte operation and sometimes it's counted as a per-element operation. This happens due to how the code is structured where sometimes array.fill, for example, is a memset and sometimes it's per-element. The fuel consumption of memset is byte based, for example, while it's per-element based for the manual loop. Regardless though it's still always deterministic for a particular wasm, and notably execution will still be limited by the dynamic operation size of these instructions.

That seems fine to me; we've never made any guarantees about what one unit of fuel means (so we're free to increase or decrease "fuel efficiency[^1]" as our needs require that...)

[^1]: drive an electric Wasmtime today for incredible fuel efficiency! inquire inside for conditions of offer

view this post on Zulip Wasmtime GitHub notifications bot (May 22 2026 at 17:07):

cfallin added PR #13448 Test/adjust fuel consumption in bulk ops to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (May 22 2026 at 17:31):

:check: cfallin merged PR #13448.

view this post on Zulip Wasmtime GitHub notifications bot (May 22 2026 at 17:31):

cfallin removed PR #13448 Test/adjust fuel consumption in bulk ops from the merge queue.


Last updated: Jun 01 2026 at 09:49 UTC