Skip to content

A plan fills its mode's fraction of the sustained budget, with no flat reserve on top - #5583

Merged
joelteply merged 1 commit into
canaryfrom
fable/plan-reserve
Oct 29, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fable/plan-reserve

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Live on the M5 since 2026-10-29 01:46Z (core 6640431).

device_budget.rs::plan_fill(live, fraction) is the one rule: the mode's fraction of the sustained budget. The flat 12 GiB ECO_EXIT subtraction stacked on top of the fraction (a guard on a guard) and the unified special case are removed. Test: a_plan_fills_the_modes_fraction_and_nothing_flat.

Measured: with #5579 it took the M5 from 1x27,904 (the night's regression) back to 4x55,407 slots; engine stable 7 h since, no Eco transitions, one capacity refusal in 30 min at 09:05Z.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…t reserve on top

plan_fill subtracted the Eco band's exit edge (12 GiB) from every unified-memory plan, a
second reserve on top of the mode's fraction, added after the 2026-09-19 collapse a month
before the sustained minimum (one relaunch window) fixed that flapping at its source. On a
64 GB node it withheld a fifth of the machine: on the M5, 2026-10-29 01:20-01:35Z, ~25 GB
available left the plan 16.5 GB, three 27,904-token lanes for four residents, and a median
17 s per act waiting for a warm slot (inference.slot_affinity.waited 11-37 s). The mode's
fraction is the one reserve and scales with the machine; the Eco band still decides when the
mode changes. plan_fill loses its unified flag (the same rule on every pool).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

Source review PASS at e342e13. Reviewed all three changed files: the flat unified-memory subtraction and redundant platform branch are removed; callers use the single mode fraction; the downstream sustained-minimum observation and pressure-mode selection remain intact. Current required checks show no failures or pending checks.

The replacement unit test pins the fraction policy across modes and capacities. It does not independently prove the original compressor/Eco oscillation is eliminated: the live stability measurements in the PR remain author-reported. Preserve the post-deployment resident/memory-pressure observation. Minor documentation correction: plan_fill receives the instantaneous replacement budget; budget_readings applies the sustained minimum after plan_fill, rather than before as the new comment says.

@joelteply

Copy link
Copy Markdown
Contributor Author

Review (Cormac) at exact e342e13: PASS, with one doc fix and two notes.

Claim verified, by reading budget.rs at this head: the sustained minimum is applied to the plan's FILL, after plan_fill: let instant = plan_fill(live, mode.serving_fraction()); then self.budget_readings.lock().observe(now, instant).min. The new doc on plan_fill says the budget "is already the sustained minimum" before it; that is the reverse (Codex noted it too). Please fix the sentence. Behaviour is fine either way: the minimum of the fills is at most the fill of the current reading.

The protection this PR now relies on is tested: the 09-19 collapse was a fill with zero slack chasing a wandering available. Without the flat band, the guard is the sustained minimum (system_resources/sustained.rs::a_rise_waits_for_the_window_and_a_fall_shows_at_once). Good: one owner, measured, instead of a constant.

Note 1, the replacement test: a_plan_fills_the_modes_fraction_and_nothing_flat asserts plan_fill(live, f) == live * f, which restates the one-line implementation (CLAUDE.md test rule 6). The invariant worth pinning is the composition: a sequence of available readings shaped like 09-19 (a rise inside the relaunch window), and the usable bytes never take the rise early. If that's covered elsewhere, delete this test instead.

Note 2, the same smell one file over: prompt_cache.rs:430 still sizes the cache grant as available - ECO_EXIT_BYTES, also a flat 12 GiB band used as a capacity reserve. That's not this PR's scope, but it's the same question. Card it with an owner, or say why the cache needs the band when the plan doesn't.

Live receipts (4x55,407 slots on the M5, 7 h stable) are author-reported; I didn't reproduce them.

@joelteply
joelteply merged commit c80fe62 into canary Oct 29, 2026
11 checks passed
@joelteply
joelteply deleted the fable/plan-reserve branch October 29, 2026 17:25
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