Skip to content

fix(serving): the window follows the roster's typical prompt, not the outlier — one 145k prompt ever sent sized every boot to 2 × 179k (card 29e4ab34) - #4237

Merged
joelteply merged 2 commits into
canaryfrom
fix/the-window-follows-the-typical-prompt-not-the-outlier
Sep 19, 2026
Merged

joelteply merged 2 commits into
canaryfrom
fix/the-window-follows-the-typical-prompt-not-the-outlier

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What the M5 showed (8eab259, 19:37Z today)

The knee fix (#4234) held: decode_knee.clamped named the 27B at boot and clamped 17 → 2 before any launch. But the boot launched 2 × 179,258: serving.reconcile.window kept-window-exceeds-physical-fit kept_window=181114 bound_to=179258 physical_usable_gb=44. 181,114 = 144,891 × 1.25 — the largest prompt any resident ever sent, with headroom — while the roster's typical prompt is 51,242 (typical_prompt_tokens in the store). 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 × 179k, serving took 44.5 GB on a box whose steady budget is 27 GB, available went to 0, Eco entered, and the plan collapsed to one lane — the same shape as this afternoon's 161k lane.

Fix

window_target takes the typical sent prompt with headroom when one is known (measured this boot, or remembered — 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 × 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_with_headroom_and_the_sticky_window_can_cover_it pins the M5 numbers: target 64,052, and choose_served_window serves the remembered 67,584 verbatim.
  • 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 (the old a < b window assertion encoded the outlier sizing the box).

Receipt on the M5

A boot serves 2 × 67,584 with no relaunch; serving.reconcile.window never reports a kept window above the remembered one; resources/board available ≥ 12 GiB after boot; the next [health] line at lanes 2 with writes > 0.

Refs: #4227 (the remembered geometry — this is why it did not stick), #4234, #4235, card 29e4ab34, the working-set max-only peak (still open: the 505k demand ceiling).

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

… 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
@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVE — reviewed at exact head f287f95. The window target now follows the same statistic the lanes already follow — the typical sent prompt with headroom — and the one-off outlier is that turn's trim, not the box's shape; the fall-through order (median, else peak, else untrimmed demand, capped by the demand) keeps every earlier behaviour where no median exists. The M5 pin is the right one: 51,242 × 1.25 = 64,052 and the remembered 67,584 covers it, so the boot serves the remembered geometry verbatim instead of launching 2 × 179k under the transient budget. The reversed assertions in the median test are the honest consequence (with the typical prompt the window is narrower and the roster keeps its lanes), and the comment says why. Merge on green.

…ut 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
@joelteply

Copy link
Copy Markdown
Contributor Author

CI fix at 1f3d975: my rewrite of lanes_multiply_to_the_roster_at_the_typical_prompt_not_the_outlier's last two assertions was wrong — without a median the plan still packs lanes at the bootstrap floor (48,470 < 50,000), so the original a < b and b.lanes + 2 ≥ a.lanes hold unchanged under the new target and are restored verbatim. The target change is untouched; the M5 pins in the other test stand.

@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVE — reviewed at exact head 1f3d975; the delta from f287f95 restores the two original assertions in the outlier test (the floor, not the target, is what packs lanes — the direction I had also read as reversed in the earlier head, and CI was right). The fix is untouched. Merge on green.

@joelteply
joelteply merged commit e8e1e7f into canary Sep 19, 2026
6 checks passed
@joelteply
joelteply deleted the fix/the-window-follows-the-typical-prompt-not-the-outlier branch September 19, 2026 20:15
joelteply added a commit that referenced this pull request Sep 19, 2026
…e core arm converges the tracked checkout; #4237) — the mac orchestrator takes the same take/failed shape; one finish_install for both platforms
joelteply added a commit that referenced this pull request Sep 20, 2026
… samples its demand, a refused prompt samples its size (#4256)

The 5090, 2026-09-20, build e1c9e41 (canary tip, the S4U consumer's first
deploy): serving 2 × 2048 and refusing 2,932 prompts — p10 8k, p50 56k, p90
136k — while served-window.json remembered typical_prompt_tokens = 828 and
serving.geometry.settled wrote 2048 × 2 as the geometry the next boot plans
first. Every turn on the grid routed to this seat and bounced (Fable's
remote_lane.answered served_window Some(2048) → "refusing to generate").

The seal, two sample sites:
- local: `record_sent` took the POST-FIT size. A fit is bounded by the window
  by construction, so under 2048 every 56k turn sampled ~828, the median read
  828, `window_target` floored 828 × 1.25 to MIN_SERVE_CTX = 2048, and the
  store remembered it. The window measured itself.
- remote: `note_leased_in_sent` fired only on a served generate; a prompt the
  guard REFUSED never reached the pool. The seat's median saw only what fit.

Fix, one rule: a prompt the window failed votes at its real size.
- `WorkingSetRegistry::sent_sample_for_plan(demand, sent, window)`: at a
  window that trimmed the turn (demand > window) the untrimmed demand is the
  sample; at a window that held it, what was sent is. Pure, pinned with the
  5090's numbers (56,057 / 828 / 2048 → 56,057).
- `serving_guard`'s refusal notes the refused size into the seat's pool
  (`note_refused_prompt`), beside served leased-in prompts.

Fable's #4237/#4238 lane (the store must not seed a starved geometry; no
footprint reading at a starved window) is the same fault from the store's
side; this is the sample side. Together: a starved boot climbs out on its
own first plan tick instead of remembering the starvation.


Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

Co-authored-by: Claude Opus 5 <[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