Update the pinned Wasmtime revision and thread MemoryKind through the limiter - #3765
Merged
Conversation
✅ Deploy Preview for golemcloud canceled.
|
kmatasfp
force-pushed
the
wasmtime-update
branch
from
August 25, 2026 08:04
306bbad to
748cb5f
Compare
vigoo
approved these changes
Aug 25, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Picks up golemcloud/wasmtime#8 (GOL-424, GOL-425).
mainalready sits on9f2c0b4a, which is one parent of #8's merge commit252ab61f, so the lockfile moves by exactly that merge and nothing else. Only the rev strings change inCargo.lock;cargo check --lockedpasses without rewriting it.Limiter callbacks now carry a
MemoryKindmemory_growing,memory_grownandmemory_grow_failedtake the kind of heap being grown.DurableResourceLimiterthreads it through and filters in one place, so the threeResourceLimiterAsyncimpls (default, debug, test-utils) stay thin.Golem's accounting covers guest linear memory only.
MemoryKind::GcHeapgrowth is admitted without taking an admission grant and correspondingly never releases one.This fixes a leak rather than adding information. Before #8,
memory_growingfired for GC heap growth too, but the callback could not tell the two apart, soadmit_unshared_memory_growthtook a real grant throughtry_acquire_linear_memoryand retained it.memory_grownthen fired only forLinearMemory, so nothing ever resolved that grant. Every GC heap growth would have eroded host admission headroom until the store unloaded. That is GOL-425.Counting GC heap into the same pool is not the fix.
LinearMemoryTrackeralso drives the durable oplog grow hints, the per-agent memory meter, and replay reconciliation. That last one rules it out:initially_reserved_bytesderives from the persisted linear-memory size, and GC heap bytes have no counterpart there, so replay would under-prepay and re-acquire admission it already holds. If GC is ever enabled, the collector's heap wants its own pool.Golem does not enable GC
create_wasmtime_configstarts fromConfig::default()and never callswasm_gc(true). Wasmtime's default set isWasmFeatures::WASM2plus a handful of extras, and GC is a wasm 3.0 feature that is not among them, so no store allocates a GC heap andMemoryKind::GcHeapis unreachable today.gc_proposal_is_disabledingolem-common/src/wasmtime_config.rspins that: it compiles a module with astructtype and asserts the engine rejects it. Flippingwasm_gc(true)fails the test, which is the point, since the accounting decision above has to be revisited first.Testing
cargo check --locked --workspace --all-targetscleancargo clippy --workspace --all-targetscleancargo test -p golem-worker-executor --lib: 1119 passedcargo test -p golem-common --lib wasmtime_config: 2 passed, including the new GC assertion