Skip to content

fix(serving): the decode knee is the model's, not the lane's — a boot before any lane reports its model reads the remembered model's knee (card 29e4ab34) - #4234

Merged
joelteply merged 2 commits into
canaryfrom
fix/the-knee-is-the-models-not-the-lanes-a-boot-reads-the-remembered-model
Sep 19, 2026
Merged

joelteply merged 2 commits into
canaryfrom
fix/the-knee-is-the-models-not-the-lanes-a-boot-reads-the-remembered-model

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

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

serving.decode_knee.clamped at 17:20:35Z: clamped=false knee=17 model="" roster_lanes=17 — no lane had reported its model yet (the adopted lane was still being recorded), so the knee read as unknown and the roster's 17 runtimes went unclamped into the demand. The plan said 8 lanes under the transient boot budget and relaunched the warm adopted 1 × 161k lane into 8 × 49k. At 17:20:48Z the 27B's knee of 2 arrived (clamped=true knee=2) and it relaunched again to 2 × 67,340. Three geometries in two minutes; the adopted lane was wasted; KV pages cold twice.

Fix

The knee is a property of the model on this box, not of whether a lane is ready. knee_model(active, remembered) — the model a lane is serving, else the model this box served last (the remembered geometry in served_window_store) — is what the knee lookup keys on. A reported model still wins; a box that remembers nothing plans the roster, as before.

Test

a_boot_before_any_lane_reports_its_model_reads_the_remembered_models_knee — the boot window plans the last model; a serving lane's model wins; nothing remembered = the roster; and with the remembered knee (2) the roster of 17 is clamped at boot, without it not.

Receipt on the M5 after deploy

serving.decode_knee.clamped at boot names the 27B and clamps 17 → 2 before any launch; a boot that adopts a lane keeps it or relaunches once to the steady geometry; serving.geometry.settled fires once per boot.

Refs: card 29e4ab34 (the rest of it — demand counting runtimes seated elsewhere, and the cap holding until the first settle — stays open), #4227, #4230.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

… before any lane reports its model reads the remembered model's knee (card 29e4ab34)

Measured 2026-09-19 17:20:35Z on the M5 (7b69109): for the thirteen seconds between boot
and the adopted lane reporting its model, current_serving().active_model was None, so the
knee lookup keyed on "" (serving.decode_knee.clamped: clamped false, knee 17, model ""),
the roster's 17 runtimes went unclamped into the demand, the plan said 8 lanes under the
transient boot budget (32-35 GB) and relaunched the warm adopted 1 x 161k lane into
8 x 49k; at 17:20:48Z the 27B's knee of 2 arrived and it relaunched again to 2 x 67k.
Three geometries in two minutes, the adopted lane wasted, the KV pages cold twice.

The knee is a property of the model on this box. knee_model(active, remembered) = the
model a lane is serving, else the model this box served last (served_window_store); the
lookup keys on that. A reported model still wins; a box that remembers nothing plans the
roster, as before. One pure fn, one test pinning the window.

Receipt on the M5: serving.decode_knee.clamped at boot names the 27B and clamps 17 -> 2
before any launch; a boot that adopts a lane keeps it or relaunches ONCE to the steady
geometry; serving.geometry.settled fires once per boot.

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 208238b. The rule is right and the test pins the stair (17 → 2 with the remembered knee, 17 without). One nit, not a condition: the call site evaluates the remembered geometry eagerly — served_window_store::load_geometry() is a disk read on every plan tick, taken even when a lane has reported its model and the value is discarded. knee_model(active, || remembered) with or_else keeps the read to the boot window it is for. Merge with the batch after 18:20Z as you laid out.

@joelteply

Copy link
Copy Markdown
Contributor Author

Nit taken at ec1ba5a: knee_model(active, remembered: impl FnOnce() -> Option<String>) — or_else, so the store is read only in the boot window; the test now asserts the closure is never called while a lane is serving.

@joelteply
joelteply merged commit c47c653 into canary Sep 19, 2026
6 checks passed
@joelteply
joelteply deleted the fix/the-knee-is-the-models-not-the-lanes-a-boot-reads-the-remembered-model branch September 19, 2026 18:47
joelteply added a commit that referenced this pull request Sep 19, 2026
… outlier — one 145k prompt ever sent sized every boot to 2 × 179k (card 29e4ab34) (#4237)

* fix(serving): the window follows the roster's TYPICAL prompt, not the outlier — one 145k prompt ever sent sized every boot to 2 x 179k (card 29e4ab34)

Measured 2026-09-19 19:37Z on the M5 (8eab259): the boot planned 2 lanes (the knee,
#4234, clamped 17 -> 2 before any launch) but at a 179,258 window: serving.reconcile.window
"kept-window-exceeds-physical-fit kept_window 181114 bound_to 179258". 181,114 = 144,891
x 1.25 - the largest prompt any resident ever sent, with headroom - while the roster's
typical prompt is 51,242 (the remembered typical_prompt_tokens). The lanes already follow
the typical prompt (the per-lane floor); the window followed the PEAK, so the remembered
67,584 could not "cover" the target and was discarded, the boot's transient budget (the
device prior, 44 GB) fit 2 x 179k, the launch took 44 GB of serving on a box whose steady
budget is 27 GB, available went to 0, Eco entered, and the plan collapsed to one lane.

window_target now takes the typical sent prompt with headroom when one is known (measured
this boot, or remembered from the last serve - TypicalPrompt::Remembered already seeds
sent_median at boot), else the peak with headroom, else the untrimmed demand; capped by
the demand as before. On the M5: target 64,052, the remembered 67,584 covers it, the boot
serves 2 x 67,584 verbatim and never relaunches into the transient budget. A single
outlier prompt is that turn's cost (trimmed to the window); it does not size the box.

Tests: the_window_follows_the_sent_prompt... pins the M5 numbers (64,052; the remembered
window covers it); lanes_multiply_to_the_roster_at_the_typical_prompt_not_the_outlier now
asserts the outlier-only plan is WIDER with no more lanes than the typical plan.

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

* test(serving): the outlier test keeps its original assertions — without a median the plan packs lanes at the bootstrap floor, so its window is the narrower one; the target change does not alter that

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

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
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