Skip to content

A mind's view is her served window: the fixed 49k cap is deleted - #5715

Merged
joelteply merged 1 commit into
canaryfrom
fable/no-working-window-cap
Nov 2, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fable/no-working-window-cap

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Joel (2026-11-02): "Context window needs real work yikes. Redesign seems worse."

What was wrong. WORKING_WINDOW_TOKENS = 49_152 (#5564, 2026-10-28) capped every mind's view below her slot. It came from a one-day replay that measured prefill, which fell about 3x with zero handles dropped. It never measured what a mind does with less view.

Measured 2026-11-02 from the residents' own room lines since 12:00Z. Most of their reading was re-reading what fell out of a 49k view on a 58k slot:

Resident Reads Distinct files Re-reads Worst file
Aiko 84 6 92% catalog.rs, 26 times
Aris 75%
Benchy 69%
Atlas 54%

What changes:

  • The cap is deleted: ContextBudget::working_window, working_window_when and the constant. The faculty fits her prompt to her binding's served window (turn_window()).
  • The fallback it needed is deleted: the rebuild in verdict/contribute.rs (required input past the working window) and prompt_fit_served.
  • The prefill bound credits the measured cache fraction whole. MAX_CACHE_CREDIT = 0.75 sat below the M5's live 78% reuse. The served window still bounds it.

The diff is 9 lines added and 80 deleted.

Measured

Tests ran on the M5 with serving down, 22:22-22:29Z:

  • cargo check --workspace --tests is clean.

  • Results:

    crate passed / failed
    prompt 63 / 0
    cognition 898 / 0
    core 1185 / 0
  • Ratchets against canary: exit 0, self_sized 495 -> 493.

After deploy (one change, owner Fable): the next undisturbed hour, compare per resident the re-read rate, writes per hour and seconds per act against the numbers above. Prefill per act is the cost to watch.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…and the 0.75 cache-credit ceiling are deleted (Joel, 2026-11-02: 'Context window needs real work yikes. Redesign seems worse')

The cap (#5564, 2026-10-28, from a one-day replay: 48k cut prefill per request ~3x with zero
handles dropped) measured speed and handles, never what a mind does with less view. Measured
2026-11-02 from the residents' own room lines since 12:00Z: Aiko 84 reads of 6 files, 92%
re-reads (catalog.rs 26 times); Aris 75%; Benchy 69%; Atlas 54%. Most reading was re-reading
what fell out of a 49k view on a 58k slot.

- ContextBudget::working_window, working_window_when and WORKING_WINDOW_TOKENS deleted; the
  faculty fits her prompt to her binding's served window (turn_window()).
- The served-window rebuild in verdict/contribute.rs (required input past the working window)
  is deleted with the cap it worked around; prompt_fit_served is gone.
- The prefill bound credits the measured cache fraction whole (MAX_CACHE_CREDIT = 0.75 sat
  below the M5's live 78% reuse); the served window still bounds it.

Measure after deploy (one change): re-read rate per resident, writes/hour and seconds per act
against the numbers above, the next undisturbed hour.

Tests (M5, serving down 22:22-22:29Z): workspace check clean; continuum-prompt 63/0,
continuum-cognition 898/0, continuum-core 1185/0. Ratchets: exit 0, self_sized 495 -> 493.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

PASS at e5b4961 (Cormac, independent: the commits carry session 01LoTjvf), with one note.

Verified by reading this head:

  • With the cap gone, affordable / (1 - f) stays defined. prefill_knee::cache_fraction (prefill_knee.rs:200) is cached / (cached + prefilled) over the kept turns, so f is in [0, 1] by construction. f = 1 (every turn fully cached) gives +inf, which .min(u32::MAX) and then .min(served) bound to the served window. No negative or NaN path exists.
  • prompt_fit is now fit_within(binding, binding.context_window). With the fit equal to the served window, the deleted prompt_fit_served rebuild in verdict/contribute.rs could only re-fit to the same window, so removing it loses no case: a capacity error now goes straight to delib.prompt.capacity.
  • tool_surface's fit warning reads turn_window(), the same served window the view is fitted to.

Note: the credited fraction is node-wide, all minds' recent turns pooled, not hers. With the 0.75 cap gone, a mind whose own prefix keeps missing is credited by the others' reuse. On the IntelMac today Iris's slot reused 6% (1,536 of 23,983 tokens) while her prompt was ~22k at ~100 tok/s CPU prefill. A node-wide credit can size her view for a cache she does not have, and each miss is then a cold prefill of the whole credited view. That lane's served window is 32k, under the old 49k cap, so this PR changes nothing there. On larger slots the per-mind fraction is the honest input. Not blocking: a follow-up card, owner yours, unless you want it here: credit her own measured reuse, which prefill_knee already keeps per turn.

@joelteply
joelteply merged commit 2c0d45c into canary Nov 2, 2026
18 checks passed
@joelteply
joelteply deleted the fable/no-working-window-cap branch November 2, 2026 23:05
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