Repository navigation
The engine's pool fits the host and the device; the prompt cache regrows only by measured headroom - #5989
Merged
Conversation
…regrows only by measured headroom The M5 (64 GB, Qwen3.6-35B-A3B), canary 7a29474: the engine launched at -c 623070 (launch.rs launch_pool took the plan's 3 x 207,691 whole, sized against a 46.0 GB budget) beside --cache-ram 8717 while the host had room for ~44.9 GB without displacing anyone; the kernel read pressure within 17 minutes and the embedder's lease was refused at VRAM 0. Then a deficit lowered the cache 8717 -> 1 MiB and two OS-normal polls 9 s later raised it straight back to 8717. - host_fit: the launch pool is the minds' demand fitted to the host's room (available plus a replaced engine's bytes, less compressed and swapped) after the host prompt cache, and to the device's governed budget when it holds serving's own bytes; Bounded launches say so (serving.launch.pool_fit). - HostDeficit::observe returns HostDeficitReading { NoVerdict, Calm { headroom }, Owed }; the headroom is available beyond the most the OS had available while it last read pressure. No poll count decides when memory is retaken. - MemoryReporter::take_again(headroom) -> claimed; the monitor offers the headroom in turn, with no catch_unwind as control flow. The prompt cache raises by at most the headroom less what its current limit has not filled, toward its grant; the stuck_said latch is gone, one absence for the grant (Option<NonZeroU64> at the shedder's seam). - MachVmCounts stores the typed verdict; the monitor's 11-field tuple is a named struct. - Dyno 12 (pool fits the host) and dyno 13 (the take-again flap) reproduce the receipts and pin the fixes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…is only its ceiling Dyno 12 after the first cut still filled the room (566,990 of the boot's reading for needs of 382,706), leaving the core, the embedder's lease and the OS nothing, the 01:22Z failure. The demand is now each seated mind's claim (held need x SENT_HEADROOM, the margin Demand::of uses, or her own wish/declared size) plus the least window per unclaimed sequence; the plan's pool only when nobody is remembered. Dyno 12: 623,073 before, 480,430 after, 142,643 tokens (2,162,895,809 B at the measured 15,163 B/token) freed, 1.64 GB left beside the engine. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply
added a commit
that referenced
this pull request
Nov 14, 2026
…e ratchets Rule 10/11 text: canary's #5986 wording kept, plus the shape-ratchet section, its baselines and the correction that time_bounds and wall_clock never counted sleeps. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply
added a commit
that referenced
this pull request
Nov 14, 2026
* The boot counts the device room: computed beside every other consumer's claim, the embed floor outside it #5989 read the device room only when the board held serving's own bytes, so the boot launch on the M5 (canary 958ea30, 03:35Z, OwnCredit::ToApply, usable 0) sized -c 661410 with no device room, and the embed lane's leases were refused at 0 available 12 times in 26 minutes. - ResourceLeaseLedger::room_beside_others (through the governor and daemon): capacity less every other consumer's max(floor, grant, measured residency), computed from claims, never from physical_used, so a gap reading (a leaving engine's unattributed bytes) cannot read it as 0. - device_budget::boot_device_room feeds it to engine_pool at a boot or a gap; the pool is min(need, host room, device room) from the first launch. - Pinned: ledger::tests::the_embed_floor_survives_a_boot_sizing. Dyno 14 from the 03:35Z receipts. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Files this change touches leave with every unwrap justified; reclaim order is a total order Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Serves the residents' speed (path step 1, Fast) and the one memory control (CONTINUUM-ENGINE.md); order-of-work line 3b (one live engine, one memory budget). An engine pool that overcommits the host swaps every mind's working set; a cache that flaps re-enters pressure.
Measured (live receipts, M5 64 GB, Qwen3.6-35B-A3B, canary 7a29474 deployed 00:57Z, #5980 + #5981)
memory.pressureat 1794617812455): host_available 52,122 MiB, compressed 1,344 MiB, swap 5,915 MiB, OS Normal.serving.launch.planat 1794617823874): stable-arm plan 3 x 207,691,lanes_bound.budget_bytes46,011,570,176 (= board usable 25,592,004,608 + incumbent weights credited), need 382,706 (serving.launch.await_settle); engine-c 623070 --parallel 5 --cache-ram 8717; context_geometry allocated 623,104.~/.continuum/state/lane-footprint.json): 15,163 B/token, anon 24,969,922,712 B, + 20.69 GB weights.footprintat 01:2xZ: 23 GB dirty; vm_stat wired 2,446,745 pages (40.1 GB).memory.pressuredeficit 3,915 MiB; acts since deploy Aiko 5, Atlas 3, Benchy 1, Aris 0; decode ~10.6 tok/s.embed.vram.refusedrequested 186,908,672 B at VRAM available 0 (embeddings degrade to no-relevance); swap 9.2/10.2 GB, compressor 28.4 GB, OS pressure 2.serving.reclaim.prompt_cacheat 1794618412459 (8,717 -> 1 MiB, target 26,471,432,192 B, held 0), thenserving.prompt_cache.take_againat 1794618421570 (1 -> 8,717 MiB), 9.1 s later.Cause
core/continuum-serving/src/modules/serving_daemon/launch.rslaunch_pool(plan_pool.max(fit_pool).max(held), canary line 771):plan_pool= 207,691 x 3 = 623,073 took the plan whole;engine_pool(canary line 40-42) laid it out as 124,614 x 5 = 623,070. No term read the host's memory or the device's governed budget net of other consumers (the embedder).continuum-kernel/.../memory_pressure/host_deficit.rstake_again_due(calm_polls >= 2) plusserving_prompt_cache/lever.rstake_back(the whole grant at once): a poll count decided when memory is retaken, and it was retaken in one jump.Fix
serving_daemon/host_fit.rs(new):HostRoom(available + a replaced engine's own bytes - compressed - swap, fromcontinuum_host::host_memory),Rooms { host, device },PoolFit { Unmeasured, Fits, Bounded { by: Bound::{Host, Device} } }.engine_poolsizes the pool to the seated minds' NEED with the grants' growth margin (need_with_growth: held need xSENT_HEADROOM= 1.25, the marginDemand::ofuses, or her own wish/declared size, capped at the trained window, plus the planner's least window per unclaimed sequence; the plan'slaunch_poolonly when nobody is remembered), then caps it by the smaller room via the plan's one cost arithmetic (window_within, measured per-token cost), the host room after the host prompt cache, the device room =governed_vram_ceiling(replace-myself, net of every other consumer's reserved floor) read only when the budget isOwnCredit::Included. Bounded launches probeserving.launch.pool_fit(demand, fit, bound). The minds' grants share the pool by measured need (unchangedgrants.rs).floor_sizeduses the same fitted pool, so it never relaunches past the host.HostDeficit::observe -> HostDeficitReading { NoVerdict, Calm { headroom }, Owed(NonZeroU64) }: headroom = available beyond the most the OS had available while it last read pressure (never below its free target).MemoryReporter::take_again(headroom) -> claimed; the monitor offers the headroom in turn.Review findings on #5981 (
~/.continuum/evidence/js-shaped-rust-2026-11-14/review.md) fixed here: #1 typedHostDeficitReading; #29calm_pollsgone (measured headroom); #30stuck_saidlatch removed (at-floor is decided synchronously, no probe spam), nocatch_unwindas control flow aroundtake_again; low:MachVmCounts.pressure: Option<OsMemoryPressure>, the monitor's 11-field tuple isstruct Ingested. #2 partly: the shedder and lever see one absence (grant() -> Option<NonZeroU64>,current_limittotal,NoStep::LimitUnknowndeleted); the wire fieldServingSnapshot.host_prompt_cache_mib: u32(ts-rs, ~30 sites across engine/serving/core/academy) is left for its own PR, owner Fable, so this one stays reviewable.Dyno (simulator first;
serving_daemon/tests/dyno.rs)the_pool_fits_the_host: before,launch_poolreproduces 623,073 (-c 623070) and the engine's cost there (48,105,164,561 B by the plan's arithmetic) exceeds the boot room (47,042,265,088 B). After, the pool is the need: 4 held needs summing to 382,706 (the probe recorded the sum; split evenly) x 1.25 + 2,048 scratch = 480,430 tokens,Fitsunder a room that would hold 566,990 (never filled). Freed vs the recorded launch: 142,643 tokens = 2,162,895,809 B at the measured 15,163 B/token; 1,640,613,306 B left beside the engine for the core, the embedder and the OS. A need past the room isBounded { by: Host }; a replaced engine's measured 24,969,922,712 B count as room; no reading launches the need.take_again_flap: before, two OS-normal readings inside the pressure range (4,914-5,979 MiB) carry no headroom, so the old one-jump 8,717 MiB raise had no room; after, lowered to 1 MiB, nothing offered inside the range, then at 8 GB available the cache rises by 1,926 MiB (< headroom), the same offer again raises nothing, and a pressured poll offers nothing: the limits asked are[1, 1927], monotone.host_fitunit tests: the device room bounds a pool host RAM would hold (01:22Z embedder receipt).Not built here (no cargo on the serving M5); CI is the compiler.
Limits named: (a) the room counts swap as displaced, so a host with inert swap sizes conservatively; the floor_sized rule is the upward path. (b) serving learns the cache's contents only from
/prompt-cache/limitreplies, so a raised cache that fills is reported at its last reply until the next shed; owner Fable, next PR on this line. (c) at boot (OwnCredit::ToApply) the device room is not read (the board does not yet hold serving's bytes; reading it then would launch at the floor, the 2,048 regression of card 8569b03d).Measured after deploy: owner Fable, within the hour after this merges and deploys: on the M5,
serving.launch.pool_fitat boot, OS pressure level and compressor at +15 min,embed.vram.refusedcount, acts/h per resident, and zeroserving.prompt_cache.take_againraises above the probed headroom.Lines: 808 added, 247 removed (tests and docs included; production delta in serving_prompt_cache.rs and lever.rs is net negative).
🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo