Skip to content

fix(serving): on unified memory the plan never fills within the Eco band — the third lane went in with zero slack and the box collapsed to one - #4235

Merged
joelteply merged 1 commit into
canaryfrom
fix/a-unified-plan-never-fills-within-the-eco-band
Sep 19, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/a-unified-plan-never-fills-within-the-eco-band

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What the M5 showed (7b69109, 17:56–18:20Z today)

After #4230 the plan sized to the mode's budget. At rest the budget was 40 GB and the fit said 3 × 67k (31.6 GB) fits — with nothing to spare. roster_short_of_slots (my #4230 mirror) made it evidence, the lane relaunched 2 → 3, the compressor then took 6 GB of other processes' pages, "external" read 15 → 23 GB, the budget fell 40 → 33, Eco entered (available 0.9 GB), the plan collapsed to one lane at the floor and admission followed it. The 18:20Z health line: 5 minds on 1 lane (of 3 slots), 663 of 664 pulls deferred, STARVED — acts 16 / writes 2 in the hour, but on one slot.

Comfort keeps 20% of a 40 GB budget = 8 GB, which is under the 12 GiB Eco exit line: a full Comfort fill on unified memory is already inside the band. The 15% #4230 removed had been keeping the fill above the band by accident, not by design.

Fix (one place, the band the mode machinery already defines)

plan_fill(live, fraction, unified): on unified memory the fill stops ECO_EXIT_BYTES short of the budget — unless Eco's own fraction is tighter (Eco rules) or the box is small enough that the band would leave less than Eco does (the mode alone, as before). Discrete VRAM is a different pool from host memory; unchanged. On the M5: 40.3 GB → 27.4 GB → 2 × 67k, never 3; the box keeps ≥ 12 GiB free and Eco never enters from our own fill.

Test

a_unified_plan_never_fills_within_the_eco_band — the M5 numbers: two lanes clear the floor at the ceiling, three do not, and under the bare fraction three fit with nothing to spare (the collapse); Eco tighter than the band; a small box; discrete.

Receipt on the M5

serving.plan lanes 2 at rest and never 3 while external is ~15 GB; resources/board available ≥ 12 GiB after the settle; no Eco transition from our own fill; the next [health] line at lanes 2 with writes > 0.

Refs: #4230 (the mirror this one completes), #4222 (the same rule for the cache grant), card 29e4ab34.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…and — the third lane went in with zero slack and the box collapsed to one (the mirror #4230 owed)

Measured 2026-09-19 17:56-18:20Z on the M5 (64 GB, Comfort, budget 40 GB): 2 x 67k
(27 GB) became 3 x 67k (32 GB) the tick the fit allowed it, with zero slack; the compressor
took 6 GB of other processes' pages, "external" read 15 -> 23 GB, the budget fell 40 -> 33,
Eco entered (available 0.9 GB), the plan collapsed to one lane at the floor and admission
followed it: the 18:20Z health line read 5 minds on 1 lane (of 3 slots), 663 of 664 pulls
deferred. Comfort's 20% of a 40 GB budget is 8 GB - UNDER the 12 GiB Eco exit line - so a
full Comfort fill is already inside the band; #4230 removed the 15% that had kept the fill
above it by accident.

plan_fill(live, fraction, unified): on unified memory the fill stops ECO_EXIT_BYTES short
of the budget - the band the mode machinery already defines, one place - unless Eco's own
fraction is tighter (then Eco rules) or the box is small enough that the band would leave
less than Eco does (then the mode alone, as before). Discrete VRAM is a different pool from
host memory; unchanged. On the M5: 40.3 GB -> 27.4 GB -> 2 x 67k, never 3; the box keeps
12 GiB free and Eco never enters from our own fill.

Test: a_unified_plan_never_fills_within_the_eco_band pins the M5 numbers (two lanes clear
the floor at the ceiling, three do not; under the bare fraction three fit with nothing to
spare), Eco tighter than the band, a small box, discrete.

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 039d4d0. This is the mirror #4230 owed and the arithmetic is the same shape #4222 gave the cache grant: on unified memory the plan's fill and the pressure monitor read one pool, so the fill stops ECO_EXIT_BYTES short of the replace-myself budget — the box can never step itself into Eco by filling. The three arms are the right ones and the test walks each with the M5's own numbers: the band caps Comfort at 40.3 GB (2 × 67k, never the zero-slack third lane), Eco's own fraction rules when tighter, a small box keeps the mode alone, discrete VRAM unchanged; and the accessor it branches on (system.gpu_memory_mode()) is the existing one. Two mechanisms now leave the same 12 GiB free — the cache grant and the plan fill — keyed on one constant, which is one place. Merge with #4234 in the batch.

@joelteply
joelteply merged commit 8eab259 into canary Sep 19, 2026
6 checks passed
@joelteply
joelteply deleted the fix/a-unified-plan-never-fills-within-the-eco-band branch September 19, 2026 18:47
joelteply added a commit that referenced this pull request Sep 19, 2026
-#4235) — textual resolution only; the two install verbs are reconciled in the next commit
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