ctiller opened PR #14647 from ctiller:fix/epoch-check-fuel to bytecodealliance:main:
When both
consume_fuelandepoch_interruptionare enabled,FuncEnvironment::epoch_check_fullemits a conditional call to thenew_epochlibcall at function entry and loop headers. Althoughfuel_checkflushes buffered fuel into the SSA variableself.fuel_varimmediately beforehand,epoch_check_fulldid not storeself.fuel_varback toVMStoreContext::fuel_consumedbefore invokingnew_epochor reload it afterwards.Consequently, if the epoch deadline callback inspected
store.get_fuel()or trapped (UpdateDeadline::Interrupt/Err(...)), all fuel consumed since the last store synchronization was missing from theStore.Save
self.fuel_varbefore callingnew_epochand reloadself.fuel_varafterwards whenconsume_fuelis enabled.Assisted-by: Gemini
ctiller requested cfallin for a review on PR #14647.
ctiller requested wasmtime-compiler-reviewers for a review on PR #14647.
ctiller requested wasmtime-core-reviewers for a review on PR #14647.
:thumbs_up: cfallin submitted PR review:
Thanks!
cfallin added PR #14647 cranelift: save and reload fuel around new_epoch libcall to the merge queue.
github-merge-queue[bot] removed PR #14647 cranelift: save and reload fuel around new_epoch libcall from the merge queue.
Last updated: Oct 11 2026 at 04:10 UTC