Stream: git-wasmtime

Topic: wasmtime / PR #14644 cranelift: preserve fuel across stac...


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

ctiller opened PR #14644 from ctiller:fix/stack-switching-fuel to bytecodealliance:main:

When consume_fuel is enabled, FuncEnvironment caches the in-flight fuel counter in a function-local Cranelift SSA Variable (self.fuel_var) and synchronizes it with VMStoreContext::fuel_consumed across calls, returns, and exception handlers.

Previously, stack-switching instructions (resume, resume_throw, resume_throw_ref, suspend, and switch) did not flush/save self.fuel_var before switching stacks or reload self.fuel_var upon returning or resuming, and translate_resume_impl did not reload self.fuel_var at the entry of suspend_block before dispatching to (on $tag $label) handler blocks. As a result, fuel consumed inside a continuation was overwritten whenever control switched back to the parent or target stack.

Save self.fuel_var in fuel_before_op prior to resume*, suspend, and switch, reload self.fuel_var in fuel_after_op on normal return/wake-up, and call env.on_catch_block_entry(builder) at the start of suspend_block.

Assisted-by: Gemini

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

ctiller requested cfallin for a review on PR #14644.

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 #14644.

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 #14644.

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

ctiller updated PR #14644.

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

:thumbs_up: cfallin submitted PR review.

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

cfallin added PR #14644 cranelift: preserve fuel across stack-switching instructions 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 #14644 cranelift: preserve fuel across stack-switching instructions from the merge queue.


Last updated: Oct 11 2026 at 04:10 UTC