Repository navigation
The boot counts the device room, the embed floor outside it - #5993
Merged
Merged
Conversation
…'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
…order is a total order 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
…en embeds, cleared only when it unloads (#6006) The M5 (canary 7f875cc, engine -c 551865, booted ~07:52Z 2026-11-14): after #5996 the embed requests are small (186,908,672 and 373,817,344 B), but by 08:16Z embed.vram.refused = 13 and embedding.neural.failed = 11, all at available=0. #5996's floor fell to the weights between embeds, so the engine's pool and the other claims took the next context's room. EmbedResidency (embed_lane_memory.rs) is the embed lane's resident claim: weights plus one window context (~2.1 GB on the device at most), reserved per pool from the first embed and held by the backend (LlamaCppBackend::embed_residency). It is cleared only in its Drop, when the embedder unloads. Leases are granted inside it and never move it. #5993's room_beside_others counts the reservation, so a boot or a regrowth sizes beside it. The LaneFloors grant/release bookkeeping is deleted. Pinned: an_embed_after_an_idle_gap_is_granted_beside_an_engine_that_fills_the_room, a_refused_request_leaves_the_floor_unchanged, unloading_the_embedder_clears_its_floor. 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 and senses (path step 1; line 3b, one memory budget): the boot pool must leave the embed lane its floor, or recall degrades to no-relevance for every mind.
Measured (live, M5, canary 958ea30 = #5989, engine up ~03:35Z)
OwnCredit::ToApply(serving.plan.branch1794627093748: stable, usable 0, credited 0);serving.launch.plan1794627096777 (lanes_bound device_bytes 26,411,614,548, budget 30,149,031,321); engine-c 661410 --parallel 5 --cache-ram 5122, allocated 661,504, RSS 32.3 GB; noserving.launch.pool_fit(uncapped: need x 1.25 for 5 seated minds).embed.vram.refusedx12 (186,908,672 B requested, 0 available).serving.vram_ceiling_prior.seeded); measured engine cost 13,520 B/token at 661,500 (state/lane-footprint.json, anon 20,695,612,592 B).embedding.neural.failed"13547 MiB requested, 0 MiB governed-available" andembed.vram.refusedrequested 14,205,059,072 at 13,915,160,576 available (03:35Z), andresource_driftserving measured 55.1 GB vram with 0 granted.Cause
#5989
serving_daemon/launch.rsengine_pool:Some(OwnCredit::ToApply) | None => Nonefor the device room (my decision there): at a boot or gap the board's replace-myself budget is a gap reading (a leaving engine's bytes are physically used, serving's own not attributed: 0), so the room was skipped and the pool launched beside no device bound.Fix
ResourceLeaseLedger::room_beside_others(kernel, via governor and daemon): capacity less every OTHER consumer's max(reserved floor, grant, measured residency), computed from claims, never fromphysical_used; serving's own bytes never count against it.device_budget::boot_device_room: at ToApply/no plan, engine_pool's device room is that (None only while the pool's capacity has not reported). The pool is min(need, host room, device room) from the first launch; steady launches keep the governed replace-myself budget.resources::ledger::tests::the_embed_floor_survives_a_boot_sizing(gap reading 0, computed room = capacity - embed floor; residency past the floor counted once; own bytes never counted).boot_counts_the_device_room: before, the only reading is 0 and the launch isUnmeasured; after, room 55,475,879,936 B, the 661,410 needFits(device fit 1,310,720), and a crowded device bounds it (Bound::Device).What the receipts say about the refusals (labelled: from the numbers above, not a live test of this PR)
On these receipts the device room does NOT bind: the engine's device cost at 661,410 (weights 20.69 GB + 5 compute floors + 661,410 x 16,900 B) is 38.3 GB of a 55.5 GB room. So this PR closes the boot gap but will not by itself stop the hour's
embed.vram.refused. On unified memory the Vram row'sphysical_usedis the host (total - free), and free was 0.1 GB: the refusals are the host side filling after boot (compressor +6.4 GB in 10 min), plus the embed lane asking for a 13,547 MiB context (embedding.neural.failed), whichembed_lane_memory::leaseraises into its standing floor byfetch_max. Next on this line (owner Fable): why an embedding context sizes at 13.5 GiB, and sizing the host room against the host's measured non-serving growth rather than the boot reading.Not built locally (serving live on the M5); CI is the compiler. Measured after deploy: owner Fable, within the hour of deploy:
embed.vram.refusedcount,serving.launch.pool_fitat boot, compressor at +15 min.Ratchet: every unwrap in the touched kernel/serving files now carries its reason, and the ledger's reclaim order uses
total_cmpinstead ofpartial_cmp(..).unwrap_or(Equal).Lines: 167 added, 18 removed.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo