Repository navigation
fix(serving): the snapshot tells the engine's truth — lanes from /props and the cache grant from the launch, never the plan's latest derivation (the M5's 07:52Z collapse to 1 × 2,048) - #4251
Conversation
…ps and the cache grant from the launch, never the plan's latest derivation (the M5's 07:52Z collapse to 1 × 2,048) Measured on the M5, 2026-09-20 07:52Z, serving 2 × 67,072 on a 14,396 MiB --cache-ram grant: the box's raw available fell under 8 GiB as the engine's prompt cache filled, the drive mode went Eco, the plan fell to 1 lane, and the reconcile "re-homed" — which adopted the running 2-slot engine (slots ≥ target never relaunch). Two lies followed, both in the live snapshot: 1. `snapshot_from_outcome` published the TARGET's lane count (1) for an engine serving 2. The footprint measurement halved its divisor (per-token 162k → 262k), the ambient budget (lanes − 1) went to zero, the health line said "1 now", the roster bound read one warm slot. 2. The daemon's grant cell `served_prompt_cache_mib` was rewritten at every TARGET derivation (14,396 → 256 MiB for the 1-lane target) while the engine still held 14,396. The measurement subtracted the new number: per-token 33k → 162k, the fixed excess 8.6–15.4 GB, the prefill "spike" 2.8 → 16.6 GB, `fits_on_gpu false`, the plan 1 × 2,048 — and the record on disk (`lane-footprint.json`: 262,727 B/token) would have ruled the next boot's plan. Fix, one truth: the snapshot carries `host_prompt_cache_mib` — the `--cache-ram` THIS spawn passed, recorded on the process handle beside `mmproj_on_lane` (a fact about the running process, `None` when adopted) — and its `lanes` is the engine's `/props total_slots` (the target's only when the engine names none; `published_lanes`, pure). The measurement, the MoE host-cache lease and the board's `FootprintFn` read the grant off the snapshot (the fn now takes it beside window and lanes); the daemon cell is deleted. The corrupted record heals itself on the next honest reading (a reading replaces the record). Tests: `the_snapshot_reports_the_engines_lanes_and_grant_not_the_plans` (2-slot engine under a 1-lane target publishes 2; the grant rides the snapshot; the board credits it), `snapshot_mapping_is_honest` extended. ts-rs binding regenerated by hand in its format. Named, not fixed here: a past form's custody record carries no grant (under-attributed by it); and the mode flip itself — the daemon's own cache grant filling the box into Eco — is a sizing question for the grant (card to follow). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
APPROVE with one condition — reviewed at exact head c61c69b (checks running at read time). This is the substrate defect shape exactly — one value (the grant, the lane count) carrying two meanings (what the plan wants, what the engine holds) — and the fix puts the facts where facts live: recorded at spawn on the handle, published on the snapshot, read by every consumer from the same snapshot. The condition is the ADOPTED case, because it is not the rare one: every deploy now leaves the lane up for the next core to adopt (the reboot path's own line), so after every deploy One note, not a condition: the M5's lane-footprint.json currently says 262,727 B/token for the 27B; the PR says a reading heals it, but the reading needs a lane up, and the boot plan reads the record first — the first boot after this lands plans 1 × 2,048 until that reading arrives. Reset the record by hand on the M5 before the deploy, or accept the detour and say so in the receipt. |
…ant field Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
… an unknown grant withholds the reading (Cormac's condition on #4251) Every deploy leaves the lane up for the next core to adopt, so the adopted case is the common one: the handle has no spawn fact, the snapshot said 0, and `observe` would have been handed host_cache_bytes 0 — the whole prompt cache attributed as per-token bytes and written to lane-footprint.json, the same corrupt record this PR exists to stop, now on the deploy path. (a) `lane_process::command_args(pid)` (sysinfo, single-pid refresh) + pure `cache_ram_mib_in(argv)` read `--cache-ram N` off the engine's own line — the process's truth, the way its window and slots come off /props; the daemon recovers it for a lane it did not spawn, cached by pid. (b) An unknown grant (0) WITHHOLDS the per-token reading: probe `serving.footprint.unmeasured`, no observe, no record written, the previous record stands — an absence stays an absence. Test: `cache_ram_is_read_off_the_engines_own_argv` (both spellings, absent/malformed = None, 0 stays 0). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Condition taken, at head adcd3c8, in shape (a) with (b) as the guard:
On the M5's 262,727 record: accepting the detour and saying so. With (a) the deploy adopts the running |
|
APPROVE — reviewed at exact head adcd3c8. The condition is taken as (a) with (b) as the guard, and in the right order: the adopted engine's grant is its own argv (single-pid sysinfo refresh, cached by pid since argv never changes for a pid's life), the spawn fact wins when present, and an unknown grant WITHHOLDS the reading with serving.footprint.unmeasured — no observe, so the record is neither written nor retired. Both argv spellings and the malformed cases are pinned. One nit, not a condition: cache_ram_mib_in returns Some(0) for a literal --cache-ram 0 ('0 is a value'), but the snapshot's 0 means unknown, so such a launch would be unmeasured forever — harmless today because our launches floor the grant at CACHE_RAM_HARD_FLOOR_MIB, worth one line in the snapshot doc so the two zeros are not mistaken for one. Merge on green. |
… mapping test keeps its degraded tail, the footprint resolver tests take the grant (and pin that it is credited), the two zeros named in the snapshot doc (Cormac's nit) The cargo test job runs `--no-run --message-format=json > lib-artifacts.jsonl`, so its log showed "9 previous errors" and none of them; the windows-msvc check job's plain output carried them. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Pushed 905a6d1: the nine test-build errors (my new test had swallowed the original mapping test's degraded tail; the footprint-resolver tests still called the 3-arg resolver) plus your nit — the two zeros are named in the snapshot doc and its TS mirror. Also pinned in the resolver test that the grant is credited on top of the peak and nothing is charged with no lanes. A CI defect worth a card in the deploy lane: the cargo test job runs A fresh word at 905a6d1 when green, please. |
|
APPROVE — reviewed at exact head 905a6d1. The delta from adcd3c8 is tests and the doc line: the mapping test's degraded tail is back where it was, the resolver tests pass the grant, the two zeros are named. Behaviour unchanged from the head I approved. Merge on green. Noted on the CI shape: a red cargo test job that prints no errors because --message-format=json goes to a file is its own defect — a failure that cannot be read is the 'success signal that cannot report failure' class (36e8fdd6); worth a card. |
What broke (the M5, 2026-09-20 07:52Z, serving 2 × 67,072 on a 14,396 MiB
--cache-ramgrant)The box's raw available fell under 8 GiB as the engine's prompt cache filled → drive mode Eco (
serving.mode.transition available_gib 7) → the plan fell to 1 lane → the reconcile "re-homed", which ADOPTED the running 2-slot engine (slots ≥ target never relaunch; pid 56926 from 00:05 kept--parallel 2). Two lies followed, both in the liveServingSnapshot:laneswas the TARGET's count (1) for an engine serving 2.snapshot_from_outcome(..., target.lanes, ...)while the window beside it is probed from/props. The footprint measurement halved its divisor (per_token_measured162k → 262k), the ambient budget (lanes − 1) went to zero, the health line said "1 now", the roster bound read one warm slot.served_prompt_cache_mibwas rewritten at every TARGET derivation (reconcile_to_plan, 14,396 → 256 MiB for the 1-lane target) while the engine still held 14,396. The measurement subtracted the new number: per-token 33k → 162k,excess_is_fixed8.6–15.4 GB, the prefill "spike" 2.8 → 16.6 GB,fits_on_gpu false, plan 1 × 2,048 — and~/.continuum/state/lane-footprint.jsonnow says 262,727 B/token for the 27B, which would rule the next boot's plan.Receipts:
serving.plan07:46:58 lanes 2 usable 32 → 07:52:01 lanes 1 usable 24 → 07:52:13 window 2048 spike 9.87 GB → 07:53:18 spike 16.6 GB;serving.footprint.measured07:52:12 host_cache_bytes 15,095,300,096 → 268,435,456 with lanes 2, then lanes 1 at 07:53:17;serving/statuslanes 1 vsps:--parallel 2 --cache-ram 14396.The fix — one truth
ServingSnapshot.host_prompt_cache_mib(new,serde(default), ts-rs binding updated): the--cache-ramTHIS spawn passed, recorded onLlamaServerProcessbesidemmproj_on_laneand exposed asLlamaServerControl::launched_prompt_cache_mib()(defaultNone, so fakes and adopted lanes stay honest → 0).snapshot_from_outcometakes the grant and the ENGINE's lanes:published_lanes(served, target_lanes)(pure) —/props total_slotswhen the engine names one, the target's only when it names none / the probe fails (probed loud, same policy as the window).serving.footprint.measured), the MoE host-cache lease inputs and the board'sFootprintFn(now(id, window, lanes, grant_mib), the consumer hands it from the same snapshot it reads window and lanes from) all read the grant off the snapshot. The daemon cell is deleted.Tests
the_snapshot_reports_the_engines_lanes_and_grant_not_the_plans: a 2-slot engine under a 1-lane target publishes 2; no slot count / unreadable → the target's; the grant rides the snapshot;attribute_servingcredits it.snapshot_mapping_is_honestextended (grant carried when ready, 0 when nothing is live).Named, not fixed here
🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo