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 asglobal.initconstant expressions) are buffered inself.fuel_consumeduntil flushed into the SSAself.fuel_var.In
FuncEnvironment::translate_static_memory_init, the copy-on-write check branches directly toend_block(brif(is_null, end_block, init_block)), whileself.fuel_consumedwas only flushed insideinit_blockviafuel_consume_for_bulk_op. When the CoW fast path was taken (is_null != 0),init_blockwas skipped and the buffered compile-time startup fuel was lost.Call
self.fuel_increment_var(builder)beforebrif(is_null, end_block, init_block)whenconsume_fuelis enabled so both arms of the branch see the prior startup fuel.Assisted-by: Gemini
ctiller requested fitzgen for a review on PR #14645.
ctiller requested wasmtime-compiler-reviewers for a review on PR #14645.
ctiller requested wasmtime-core-reviewers for a review on PR #14645.
:thumbs_up: alexcrichton submitted PR review:
Thanks!
alexcrichton added PR #14645 cranelift: flush buffered startup fuel before static data segment branch to the merge queue.
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