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.
alexcrichton commented on PR #14645:
@ctiller would you be up for resolving CI and rebasing here too?
ctiller updated PR #14645.
cfallin 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.
cfallin commented on PR #14645:
@ctiller it looks like this is yet again a merge conflict as one of your other PRs merged first -- could you resolve again?
(In the future if submitting a cluster of PRs that will mutually conflict, we're happier to take a slightly larger single PR with everything pre-merged, if that's easier -- it certainly reduces this kind of churn for us!)
cfallin edited a comment on PR #14645:
@ctiller it looks like this is yet again a merge conflict as one of your other PRs merged first -- could you resolve again?
(In the future if submitting a cluster of PRs that will mutually conflict, we're happy to take a slightly larger single PR with everything pre-merged, if that's easier -- it certainly reduces this kind of churn for us!)
fitzgen removed the review request for fitzgen from PR #14645.
Last updated: Oct 31 2026 at 23:03 UTC