Repository navigation
fix(wasm): lift hostcall fuel limit for large component outputs - #111
Merged
Merged
Conversation
Wasmtime's default hostcall fuel (128 MiB) charges a whole `Val` per lifted list element, capping a single call's `list<u8>` output at about 4 MiB and failing large Window builds with "fuel allocated for hostcalls has been exhausted". Scale the fuel by the store's memory limit so any output that fits in guest memory can be lifted, while aliased lists stay bounded. Fixes #97
This was referenced Oct 11, 2026
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.
Fixes #97.
Wasmtime's default hostcall fuel (128 MiB) charges a whole
Val(32 bytes) for each lifted list element. That capped a component call'slist<u8>output at about 4 MiB. Window builds hit the cap somewhere between 10x and 12x the jsx golden case and failed withfuel allocated for hostcalls has been exhausted.new_storenow sets hostcall fuel tomemory_bytes × size_of::<Val>(). That's the cost of lifting the largestlist<u8>that fits in guest memory, so any real output can be returned. Lists that alias the same guest buffer still hit a finite cap, which wouldn't hold withusize::MAX.new_storeis the only place stores are created.lifts_byte_list_beyond_default_hostcall_fuellifts 5 MiB through a newbytesexport on the fixture. It fails without the fix.Window
bench/authoringcold builds, which failed at 12x/15x before this change:Each lifted byte still costs about 32 bytes of host memory. A typed byte-list fast path is listed in chunkzero/window#58.
🤖 Generated with Claude Code