Skip to content

The boot counts the device room, the embed floor outside it - #5993

Merged
joelteply merged 2 commits into
canaryfrom
fable/boot-counts-the-device-room
Nov 14, 2026
Merged

joelteply merged 2 commits into
canaryfrom
fable/boot-counts-the-device-room

Conversation

@joelteply

@joelteply joelteply commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

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)

  • Boot plan on OwnCredit::ToApply (serving.plan.branch 1794627093748: stable, usable 0, credited 0); serving.launch.plan 1794627096777 (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; no serving.launch.pool_fit (uncapped: need x 1.25 for 5 seated minds).
  • 04:01Z: 40 acts in ~26 min (Aris 7 vs 0 before), OS pressure 1, swap flat 5.8/7.2 GB, 0 prompt-cache reclaims; but free 0.1 GB, compressor 18.8 -> 25.2 GB in 10 min, embed.vram.refused x12 (186,908,672 B requested, 0 available).
  • Device total 55,662,788,608 B (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).
  • Also on the board in that hour: embedding.neural.failed "13547 MiB requested, 0 MiB governed-available" and embed.vram.refused requested 14,205,059,072 at 13,915,160,576 available (03:35Z), and resource_drift serving measured 55.1 GB vram with 0 granted.

Cause

#5989 serving_daemon/launch.rs engine_pool: Some(OwnCredit::ToApply) | None => None for 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 from physical_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.
  • Pinned: 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).
  • Dyno 14 boot_counts_the_device_room: before, the only reading is 0 and the launch is Unmeasured; after, room 55,475,879,936 B, the 661,410 need Fits (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's physical_used is 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), which embed_lane_memory::lease raises into its standing floor by fetch_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.refused count, serving.launch.pool_fit at 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_cmp instead of partial_cmp(..).unwrap_or(Equal).

Lines: 167 added, 18 removed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…'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
@joelteply
joelteply merged commit d7bd842 into canary Nov 14, 2026
37 checks passed
@joelteply
joelteply deleted the fable/boot-counts-the-device-room branch November 14, 2026 04:47
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant