Stream: git-wasmtime

Topic: wasmtime / PR #14645 cranelift: flush buffered startup fu...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 09 2026 at 23:46):

ctiller opened PR #14645 from ctiller:fix/startup-static-memory-fuel to bytecodealliance:main:

During FuncTranslator::translate_module_startup, fuel costs from earlier startup instructions (such as global.init constant expressions) are buffered in self.fuel_consumed until flushed into the SSA self.fuel_var.

In FuncEnvironment::translate_static_memory_init, the copy-on-write check branches directly to end_block (brif(is_null, end_block, init_block)), while self.fuel_consumed was only flushed inside init_block via fuel_consume_for_bulk_op. When the CoW fast path was taken (is_null != 0), init_block was skipped and the buffered compile-time startup fuel was lost.

Call self.fuel_increment_var(builder) before brif(is_null, end_block, init_block) when consume_fuel is enabled so both arms of the branch see the prior startup fuel.

Assisted-by: Gemini

view this post on Zulip Wasmtime GitHub notifications bot (Oct 09 2026 at 23:46):

ctiller requested fitzgen for a review on PR #14645.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 09 2026 at 23:46):

ctiller requested wasmtime-compiler-reviewers for a review on PR #14645.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 09 2026 at 23:46):

ctiller requested wasmtime-core-reviewers for a review on PR #14645.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 10 2026 at 00:23):

:thumbs_up: alexcrichton submitted PR review:

Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 10 2026 at 00:23):

alexcrichton added PR #14645 cranelift: flush buffered startup fuel before static data segment branch to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 10 2026 at 04:12):

github-merge-queue[bot] removed PR #14645 cranelift: flush buffered startup fuel before static data segment branch from the merge queue.


Last updated: Oct 11 2026 at 04:10 UTC