Skip to content

fix(serving): the board's serving attribution includes the prompt cache the daemon granted — 8.7 GB of our own --cache-ram read as external and cost the M5 its second lane - #4247

Merged
joelteply merged 1 commit into
canaryfrom
fix/the-serving-attribution-includes-the-cache-it-granted
Sep 20, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/the-serving-attribution-includes-the-cache-it-granted

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The first bounded boot (M5 on fd1960e, 02:4xZ)

The draw bound worked: 4 of 15 minds seated, core RSS 3.4 GB, lane up at 2 × 64,403. The plan still read usable 18 GB → 1 lane at 2,048 and re-homed to it.

serving attribution on the board 22.8 GB — "weights+KV resident (1 lane × 64512)"
the lane's process RSS 27.5 GB
serving.footprint.measured anon 8.27 GB, host_cache_bytes 8.75 GB

The 8.75 GB is the --cache-ram this daemon derived and handed the engine. The attribution is the plan's arithmetic, so the granted cache was filed as external (another holder's bytes) and budget_for_replacing = available + our measured bytes lost it. Under the 12 GiB Eco reserve that is exactly the second lane. Same shape as the KV term (#79) and the compute reserve (G5): a cost we own, charged to someone else.

Fix

serving_footprint_fn(catalog, granted_cache_mib) — the daemon's served_prompt_cache_mib (now Arc<Mutex<u32>>, written at every serve) — and a pure attribute_serving(peak, lanes, grant_mib) that adds the grant to the plan's peak resident bytes. Nothing resident, or no lanes, charges no cache. One footprint authority, now the whole of it.

Test

the_serving_attribution_includes_the_prompt_cache_it_granted; the existing resolver test passes a zero grant.

Receipt

resources/board serving attribution ≈ the lane's RSS; serving.plan usable_gb up by the grant × fill; the M5 plans two lanes with 4 residents.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…he the daemon granted the engine — 8.7 GB of our own --cache-ram read as external and cost the M5 its second lane

The M5 on fd1960e, 02:4xZ 9/20, the first bounded boot (4 of 15 minds drawn, core RSS
3.4 GB): the lane came up at 2 × 64,403 and the plan still read usable 18 GB → 1 lane at
2,048 tokens, and re-homed to it. `resources/board`: serving attributed 22.8 GB ("weights+KV
resident (1 lane(s) × 64512 ctx)") while the lane's process held 27.5 GB RSS.
`serving.footprint.measured`: anon_bytes 8.27 GB, host_cache_bytes 8.75 GB — the `--cache-ram`
this daemon derived and handed the engine, filling over the serve's life. The attribution is
the plan's arithmetic (weights + KV + compute), so the granted cache was filed as EXTERNAL,
another holder's bytes, and `budget_for_replacing` (available + our measured bytes) lost it.
Under the 12 GiB Eco reserve that is exactly the second lane. The same shape as the KV term
(#79) and the compute reserve (G5): a cost we own, charged to someone else.

Fix: `serving_footprint_fn` takes the daemon's granted cache (`served_prompt_cache_mib`, now
shared behind an Arc, written at every serve) and `attribute_serving(peak, lanes, grant_mib)`
— pure — adds it to the plan's peak resident bytes; nothing resident, or no lanes, charges no
cache. One footprint authority, now the whole of it.

Test `the_serving_attribution_includes_the_prompt_cache_it_granted`; the existing catalog
resolver test passes a zero grant.

Receipt: `resources/board` serving attribution ≈ the lane's RSS; `serving.plan usable_gb`
up by the grant × the fill fraction; the M5 plans 2 lanes again with 4 residents.

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

Copy link
Copy Markdown
Contributor Author

APPROVE — reviewed at exact head 14062d0 (checks running at read time; merge on green). The class is the one you name (#79, G5): a cost we own filed as another holder's, and budget_for_replacing losing exactly the second lane under the Eco reserve follows from the numbers (8.27 GB anon against the 8.7 GB grant). Two things I checked before saying so: (1) lanes are --parallel slots in ONE llama-server process and derived_prompt_cache_mib already sizes the single --cache-ram grant for all lanes, so charging the grant once per serve — not lanes × grant — is the right sum; (2) the stash is written at plan time (serving_daemon.rs:2901), before the new lane is up, so during a re-home the board reads the NEXT plan's grant against the OLD lane's peak until the new one is ready — transient, bounded by the settle, and it errs toward attributing more to ourselves, never less; not a condition, just what the receipt will show for one tick. Pure sum, nothing-resident charges nothing, one test pinning the M5 numbers.

@joelteply
joelteply merged commit 6d43075 into canary Sep 20, 2026
6 checks passed
@joelteply
joelteply deleted the fix/the-serving-attribution-includes-the-cache-it-granted branch September 20, 2026 03:10
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