Skip to content

A mind's grant follows what her view holds at full detail, never a render her last grant collapsed (card 90197043) - #5973

Merged
joelteply merged 2 commits into
canaryfrom
fable/a-grant-never-ratchets-down-on-an-idle-pool
Nov 13, 2026
Merged

joelteply merged 2 commits into
canaryfrom
fable/a-grant-never-ratchets-down-on-an-idle-pool

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Serves the minds on the one shared engine (order of work line 3/3b, KV capacity and grants): a resident alone on an idle pool keeps the window her work holds, instead of collapsing and re-reading.

Evidence (M5, canary 2b17c41, 2026-11-13)

  • serving.grants 21:40:00Z: pool 247,040, cap 247,040, minds=1, {Aris 8044b75b: 43,807}.
  • Every grant on the descent is exactly 1.25 x (SENT_HEADROOM) one of her delib.turn.demand samples (the ring median at that point):
    109,745 = 1.25 x 87,796; 78,241 = 1.25 x 62,593; 68,642 = 1.25 x 54,914; 47,890 = 1.25 x 38,312; 43,807 = 1.25 x 35,046.
  • Those demands fell from 86-115k to 35-55k as delib.view.turnover collapsed 14-44 items per start.
  • Her need ring at the same time (~/.continuum/personas/8044b75b.../working-set.json) held 12 censored priced bounds of 56,902-99,441 (persona.need.censored, priced Held{held: window}). They were cut down to the collapsed wish's target.

The chain (file:line on 2b17c41)

  1. cognition/llm_deliberation_faculty/prompt/view.rs:244 unfitted_message_tokens = all_messages.tokens() is measured after place_view, so her view is counted as rendered, collapsed at its last start.
  2. view.rs:513-532 demand_tokens is built from that and reg.record(...) writes it into PersonaDemand::recent.
  3. cognition/working_set.rs:212 requirement_tokens takes the median of recent. At working_set.rs:857 it becomes LaneRequirement::wished(wish, SENT_HEADROOM).
  4. engine/inference/planning/window_allocator.rs:202 held(need) applies need.under(target) (observed.rs:107), which cuts the censored bound (99,441) to wish x 1.25.
  5. serving/serving_daemon/grants.rs demand_of produced need = 1.25w and target = need x 1.25. capacity/window_grant.rs DemandFollowing then grants it, releasing a settled grant to that target (holds).
  6. The next start collapses into the smaller grant, the next demand is measured from the collapse, and the grant falls again.

The fix (at the owners, no parallel path)

  • (a) Full-detail measure. New continuum-context View::collapsed_growth (view/held.rs) returns what a start's collapses took away: each collapsed or summarized item's whole minus what is rendered for it. Folded navigation, withheld backlog and repeats are excluded, so this is not the 902k-token inflation from 11-07. Her demand is now render + collapsed growth (view.rs), and the old render-only figure no longer exists anywhere.
  • (b) A grant is a ceiling. window_grant::Demand::of is now the single requirement-to-demand derivation. It moved from the serving daemon, and the wrapper and its call sites were deleted. Her target is max(need x headroom, wish). On an idle pool her grant is therefore never released below her full-detail wish, and it shrinks only when other minds' needs claim the room (DemandFollowing's contention branches are unchanged). The act's priced allocation still decides how much of the ceiling an act holds.
  • (c) Upward probe. WorkingSetRegistry::record now takes the served window. A demand past it is stored in PersonaDemand::overflow_tokens (serde default), and requirement_tokens returns at least that value, so the next publish grants what overflowed. A turn that fits ends the probe.

Lines: +293 / -55. Removed: the serving daemon's 45-line copy of the derivation (demand_of) and every caller, migrated to Demand::of.

Simulation first

capacity/dyno/tests.rs censored_demand (scenario 8 in dyno.rs) drives the real LaneRequirement -> Demand::of -> DemandFollowing path, using her 30 recorded demands (20:42-21:44Z), the bound 99,441, the floor 26,802 and the pool 247,040:

  • before (measured from her collapsed render): her window falls from 109,745 to below her full-detail act (67,828), and at least half her acts overflow. Hand replay: falls to 57,750, 18 of 30 overflow.
  • after (full detail): 0 overflows, every grant >= 67,828, no fall across acts.
  • probe: from 43,807 with her recorded ring, she overflows once and the next publish holds it.

Unit tests:

  • View::collapsed_growth: render + growth equals every item whole; a view that collapsed nothing adds 0.
  • requirement_tokens: the overflow probe raises her requirement and a fitting turn ends it.
  • Demand::of + DemandFollowing: a settled grant on an idle pool never falls below her whole view.

Not compiled locally: the M5 is serving live minds, so CI is the compiler.

Known follow-up (not in this PR)

The launch/lane plan's per-sequence window (ServingDemand::window_target, from sent_median of post-fit sizes, serving_plan/max_lanes.rs:237-269) is a second place that sizes a window from a measure a window bounds. It sizes the engine geometry, not a mind's grant. Migrating it to this requirement needs a design call with Codex (serving owner).

Live receipt to take (after deploy, owner: Fable)

For one hour, before and after, on the M5:

  • per-mind grant vs pool (serving.grants);
  • overflow turnovers per hour per mind (delib.view.turnover alongside delib.turn.demand over_window > 1);
  • her delib.turn.demand with collapsed_growth.

Pass: no mind alone on the pool is granted below her full-detail demand, and overflow turnovers drop.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…nder her last grant collapsed (card 90197043)

Aris alone on a 247,040-token pool (M5, 2b17c41): every grant of 109,745 -> 78,241 -> 68,642 ->
47,890 -> 43,807 was 1.25 x a delib.turn.demand measured from her collapsed view, and the need
ring's priced bounds (56,902-99,441) were cut under that wish target (Observed::under).

- continuum-context: View::collapsed_growth, what a start's collapses took away at the whole level
  (folded, withheld and repeats excluded).
- cognition: her demand is render + collapsed growth; record() takes the served window, and a
  demand past it is her requirement at once (PersonaDemand::overflow_tokens, the upward probe).
- engine: window_grant::Demand::of is the one requirement-to-demand derivation (moved from the
  serving daemon, its wrapper deleted); her target is never below her wish.
- dyno: scenario 8, idle pool / one mind / censored demand, from her recorded demands.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
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