Repository navigation
fix(serving): a cache grant never fills into the Eco pressure band — it leaves ECO_EXIT_BYTES free after it fills, so a full cache cannot step the serving mode down and cut its own lanes - #4222
Merged
joelteply merged 1 commit intoSep 19, 2026
Conversation
…the grant leaves ECO_EXIT_BYTES free after it fills, so a full cache cannot step the serving mode down and cut its own lanes Measured 2026-09-19 on the M5 (build 2491308): the prompt cache was granted 17,021 MiB from 29.6 GB available. It filled; available fell to 7 GiB; the live budget's pressure mode stepped Comfort → Eco (serving fraction 0.80 → 0.55); the plan cut to one lane; at 12:19Z the reconcile RELAUNCHED the lane at `--parallel 1` — five coders on one lane, "STARVED: the planner owes lanes" — and the relaunch derived the same 17 GB grant again from the RAM the dead engine had just freed. The box crossed Comfort ↔ Eco five times in the morning (available 7 ↔ 12 GiB). Two hours earlier the same seat had read HEALTHY at three lanes @ 67k with writes 2. The daemon's own cache was driving the daemon's own pressure mode. Fix at the grant (one clause in `prompt_cache_decision`, beside #4216's co-consumer share): the grant is capped at `available − ECO_EXIT_BYTES` before the share is taken, so what remains after the cache fills stays above the Eco EXIT band and a full cache can never enter Eco by itself. No new constant: ECO_EXIT_BYTES is the pressure law's own number. The unknown- availability arm is unchanged. Test: for available readings of 13 / 20 / 29 / 46 GiB the post-fill remainder stays above the exit band, the grant is monotone in room, and with 46 GiB free the cache is still a real cache (> 8 GiB). The existing "bounded by what the box can give now" pin takes the new bound. Card 1c0b60a9 (grant half; the plan-side term stays with Kimi). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Contributor
Author
|
APPROVE — reviewed at exact head eccb0e6; merge on green. Checked:
Receipt to look for on the M5 after it lands: |
joelteply
enabled auto-merge (squash)
September 19, 2026 12:32
joelteply
deleted the
fix/a-cache-grant-never-fills-into-the-eco-band
branch
September 19, 2026 12:44
This was referenced Sep 19, 2026
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.
Measured 2026-09-19 on the M5 (build 2491308): the prompt cache was granted 17,021 MiB
from 29.6 GB available. It filled; available fell to 7 GiB; the live budget's pressure
mode stepped Comfort → Eco (serving fraction 0.80 → 0.55); the plan cut to one lane; at
12:19Z the reconcile RELAUNCHED the lane at
--parallel 1— five coders on one lane,"STARVED: the planner owes lanes" — and the relaunch derived the same 17 GB grant again
from the RAM the dead engine had just freed. The box crossed Comfort ↔ Eco five times
in the morning (available 7 ↔ 12 GiB). Two hours earlier the same seat had read HEALTHY
at three lanes @ 67k with writes 2.
The daemon's own cache was driving the daemon's own pressure mode. Fix at the grant
(one clause in
prompt_cache_decision, beside #4216's co-consumer share): the grant iscapped at
available − ECO_EXIT_BYTESbefore the share is taken, so what remains afterthe cache fills stays above the Eco EXIT band and a full cache can never enter Eco by
itself. No new constant: ECO_EXIT_BYTES is the pressure law's own number. The unknown-
availability arm is unchanged.
Test: for available readings of 13 / 20 / 29 / 46 GiB the post-fill remainder stays above
the exit band, the grant is monotone in room, and with 46 GiB free the cache is still a
real cache (> 8 GiB). The existing "bounded by what the box can give now" pin takes the
new bound. Card 1c0b60a9 (grant half; the plan-side term stays with Kimi).
Test plan
cargo test -p continuum-core --lib serving_daemon(new:a_full_cache_never_steps_the_serving_mode_down_by_itself; updated:the_cache_never_promises_past_what_is_available_now)serving.prompt_cache.derivedshowsderived_mib ≤ (available − 12 GiB) × 0.85; noserving.mode.transition → Ecowhile the cache fills; the lane relaunches at ≥ 2 lanes @ 67k;[health]stops saying STARVED.🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo