Repository navigation
Optionally charge lifted hostcall fuel against store fuel - #15104
Open
RajaBabu15 wants to merge 1 commit into
Open
RajaBabu15 wants to merge 1 commit into
RajaBabu15 wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #14430
Implements the approach agreed in the issue: optionally charge Store fuel for the work done while lifting guest values into the host, at
LiftContext::consume_fuel.Store::set_hostcall_fuel_consumes_store_fuel(bool)(plus getter andStoreContextMutmirrors). Off by default; only has an effect withConfig::consume_fuel(true).Trap::OutOfFuel. Charges already made earlier in the same lift stay charged.get_fuel/set_fuelhelpers. A charge that fits in the active (injected) window only bumps that counter, leaving the reserve and the async yield cadence alone.Optioncheck inconsume_fuel.Tests:
tests/all/component_model/import.rs: flag off (default), flag on, flag on with too little fuel (OutOfFuel, fuel is 0, host fn never runs), and flag on withoutConfig::consume_fuel.runtime/store.rs.component_model(264),fuel(75) andwasmtime --lib(183) tests pass; fmt and clippy are clean. The C API was not built locally (no cmake).Open questions:
Store(next toset_hostcall_fuel) or onConfig.Config::consume_fuel; should it return an error likeset_fueldoes?🤖 Generated with Claude Code