Skip to content

fix(serving): the LIVE free read keeps the same OS floor the planned term keeps — a 24 GB sidecar no longer fits into 26.7 GB "free" - #4202

Merged
joelteply merged 1 commit into
canaryfrom
fix/the-live-free-read-keeps-the-same-os-floor-the-planned-term-keeps
Sep 18, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/the-live-free-read-keeps-the-same-os-floor-the-planned-term-keeps

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary

21:56:03Z today on the M5 the vision sidecar (Ornith-35B, 24.1 GB) was admitted beside the 27B on live_free 26.7 GB, planned_headroom 31.8 GB — swap 6.7/8 GB, compressor 20 GB, the serving node paging, background jobs killed for memory. The 9/16 fix (#4099) made admission the tighter of the live read and the planned headroom; the planned term keeps host_os_floor_bytes (physical/8) — the live read was compared raw, and available_bytes counts purgeable/inactive pages as free.

One floor everywhere: sidecar_admissible_bytes = min(live_free − floor, planned). With the measured numbers: 26.7 − 8 = 18.7 GB < 24.1 → refused at the same tick; a 4 GB VL sidecar still admitted. Pure fn; the measured numbers are the test. Probe serving.vision.sidecar_headroom gains live_free_after_floor and admissible.

Live today: the sidecar was killed by hand; the daemon's own re-evaluation refused the respawn (planned 10.4 GB < 24.1) — the rule holds once the lane is loaded; this closes the window.

Still owed (not code): a small VL row on disk so sight never costs a mind-sized model.

Test plan

  • the_live_free_read_keeps_the_same_os_floor_the_planned_term_keeps — every measured tick of the 21:5x boot refuses; the planned term wins when tighter; 4 GB admitted; over-full → 0
  • serving_daemon whole-file 93/93; source_hygiene ratchets green
  • live: next M5 boot shows sidecar_no_budget with admissible < need for the 35B row and no swap growth

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…term keeps — a 24 GB sidecar no longer fits into 26.7 GB "free"

2026-09-18 21:56:03Z on the M5 (64 GB), at the 1800bd9 deploy: the vision sidecar
(Ornith-1.5-35B-A3B, need 24.1 GB) was refused twice, then admitted on
sidecar_headroom {live_free 26.7 GB, planned_headroom 31.8 GB}. Both terms said yes.
Result: swap 6.7 of 8 GB, compressor 20 GB (the idle sidecar paged out beside the live
27B lane), free 23%, watchers killed for memory on the serving node. Killed by hand →
compressor 1.3 GB, free 46% within a minute; the daemon then refused the respawn.

The 9/16 fix (#4099) made admission the tighter of the live read and the PLANNED headroom,
and the planned term keeps host_os_floor_bytes (physical/8, min 2 GB) for the OS, the page
cache and everything else resident. The LIVE read was compared RAW — and `available_bytes`
counts purgeable and inactive pages as free — so 24.1 into 26.7 "fit" with 2.6 GB of slack
on a box whose core alone holds 2.4 GB.

One floor everywhere: `sidecar_admissible_bytes = min(live_free − floor, planned)`. With the
measured numbers every tick of that boot refuses it (26.7 − 8 = 18.7 < 24.1); the planned
term still wins when it is the tighter; a 4 GB VL sidecar is still admitted — sight is not
refused, a mind-sized sidecar is. Probe carries live_free_after_floor and admissible.

Test: the_live_free_read_keeps_the_same_os_floor_the_planned_term_keeps (the measured
numbers). serving_daemon whole-file 93/93; hygiene ratchets green.

Still owed beside it (the 9/16 note): a SMALL VL row on disk so sight never costs a 24 GB
mind — an operator model pull, not code.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply force-pushed the fix/the-live-free-read-keeps-the-same-os-floor-the-planned-term-keeps branch from 33b36e5 to 98facbd Compare September 18, 2026 23:06
@joelteply
joelteply enabled auto-merge (squash) September 18, 2026 23:17
@joelteply
joelteply merged commit 7c48e91 into canary Sep 18, 2026
6 checks passed
@joelteply
joelteply deleted the fix/the-live-free-read-keeps-the-same-os-floor-the-planned-term-keeps branch September 18, 2026 23:24
joelteply added a commit that referenced this pull request Sep 19, 2026
…tprint subtracts its own `--cache-ram`, an unattributable sample retires the record, and the grant leaves co-consumer headroom (#4216)

* fix(serving): the prompt cache the daemon granted is not KV — the measured lane footprint subtracts its own `--cache-ram` before attributing bytes to tokens, an unattributable sample retires the record, and the cache grant leaves the planner's co-consumer headroom

The M5, 2026-09-19 03:25–04:30Z, build 1d2ae5f: the lane ran `--parallel 2 -c 134680
--cache-ram 19519` while the health line said "lanes 1 @ 67k — STARVED: 5 minds on 1
lanes" and the hour delivered 6 acts, 0 writes. The plan said one lane; the process ran
two. Three reads in one line:

1. `lane_footprint::per_token_from` divides the process's whole anonymous footprint by
   lanes × window. The host prompt cache (`--cache-ram`, a grant the daemon itself made)
   fills that same footprint over the serve's life: 16.7 → 20.4 GB across the hour, and
   the reading went 105,919 → 133,720 B/token against a 32,768 estimate. `corrects()`
   fired, the plan's kv/token became ~107k, two lanes at 67k no longer fit usable 26–34 GB,
   and the planner starved the seat it was still running two lanes on.
   Fix: subtract the granted cache before dividing. The reading becomes a LOWER bound on
   the KV-attributable bytes — the only direction a footprint may correct an estimate.

2. The record is persisted (`state/lane-footprint.json`) and fresh for an hour. When the
   new process's sample reads "nothing beyond the cache", `observe` returned None without
   touching the record — the stale 133,720 would have ruled the plan from disk through the
   relaunch that was supposed to fix it. Fix: an unattributable sample RETIRES the record
   (`apply_sample`, pure over the map, tested).

3. `prompt_cache_decision` granted everything above the OS floor: afford 20,468 MiB →
   `--cache-ram 19519`. A cache fills to its grant by design, so that is a grant to end the
   serve at the floor with nothing left for the co-consumers the planner reserves for
   (the core's growth, a sidecar, the eye): the box sat 6 GB into swap with 25 GB in the
   compressor, and a 37,020-token prompt prefilled in 367 s with 0 cached. Fix: the grant
   leaves `CO_CONSUMER_HEADROOM` — the planner's own constant, one place, both decisions.

Probe `serving.footprint.measured` now carries `host_cache_bytes` so the subtraction is
readable on the wire. No change to the lifetime-peak read (#4165) — with the grant
subtracted, the peak's cache component is bounded by the number we subtract.

Card 1c0b60a9 (settles inflated). Related: #4165, #4202, #4207.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* test(serving): the three prompt-cache afford pins take the co-consumer share — a cache fills to its grant, so no arm is promised everything above the floor

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

---------

Co-authored-by: Claude Fable 5.1 <[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