Skip to content

A relaunch sizes the engine pool from the seated minds held needs, and may grow back to its proven pool (P0, card 9ffcb1b5) - #5835

Merged
joelteply merged 1 commit into
canaryfrom
9ffcb1b5/relaunch-pool-from-needs
Nov 7, 2026
Merged

joelteply merged 1 commit into
canaryfrom
9ffcb1b5/relaunch-pool-from-needs

Conversation

@joelteply

@joelteply joelteply commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Card 9ffcb1b5 (P0). How this serves the minds: after an engine exit, every resident gets a lane that holds what she actually needs, instead of being refused for capacity until a core restart. Path step 1 (Fast) and goal 9 (one scheduler): the pool follows measured need, never a floor.

The incident (the M5, 2026-11-07, Fable's digest 4786182c)

The in-engine trainer aborted llama-server at 16:13:58Z (fork #99, now merged and pinned by #5834). The relaunch sized 5 lanes × 35,328 (allocated_tokens 176,640) while the minds needed 50-70k, so every mind was capacity-refused from 16:15 to 16:59Z: 45 minutes of zero acts. No pool-growth line appeared in that window.

Cause (code trace on canary 9528422)

  1. The dead engine's own bytes read 0, so the credit was ToApply, and planning.rs:145 stored that gap reading (usable 0) as the launch budget.
  2. launch_pool = max(plan window × plan lanes, fit within that budget). With a 0 budget the fit is 0, leaving the plan's two lanes' worth (2 × 88,320), split over 5 sequences.
  3. The needs had survived the abort (the working set, in memory and persisted); only the launch ignored them.
  4. pool_growth_models allows one growth per model per core run, and if this core had already grown the pool, nothing repaired it.

Change (in the owner, serving_daemon/launch.rs and pool_growth.rs)

  • launch_pool takes Seated { need, proven }. The pool is at least the sum of the seated minds' held needs, each capped at the trained window. A wish is a target with headroom and never counts as a need; Aiko's 902k is bf3b6d68, and Her need is the window her act chose: the priced optimum, never floors and never her uncollapsed overflow #5833 makes the held need the priced window.
  • The floor's cap is proven capacity. It is the larger of the live fit and, only while the budget is a gap reading, the largest pool this model ran at in this core run. A steady budget's live fit stays the authority, so a stale maximum never overrides a real measurement.
  • The daemon records that largest pool per model when the engine reports its pool.
  • Growth can repair a relaunch. A running pool below the proven pool is a recovery, not a chain, so the one-try record does not hold it; growth upward past it is still one try per model.

Tests (IntelMac, 335b92e on canary 7b7d277)

  • a_relaunch_from_a_gap_budget_holds_every_seated_need_up_to_the_proven_pool:
    • the 16:14Z relaunch reproduced (176,640 without the floor);
    • every capped held need held with it (570,059);
    • never above the proven pool, and nothing floored before a proven run;
    • a steady budget's fit unchanged.
  • a_pool_below_the_largest_this_model_ran_at_is_a_recovery.
  • Results: one_launch 4/4, pool_growth 3/3, cargo check -p continuum-serving --tests --features metal,test-fixtures clean, ratchets 87/87 on both trees.
  • Not run green here:
    • budget::serving_budget_plans_around_other_consumers_floors and budget::without_a_past_form_of_ourself_a_six_gigabyte_box_really_does_downshift fail on this loaded IntelMac. The first asserts on a 20 ms-tick daemon right after start; the second plans against live memory. Neither reaches engine_pool, seated_for or pool_growth, so CI on a clean runner decides them.
    • The reconciliation tests wedge here with --features metal (a known IntelMac Metal hang).

Measured after deploy (owed)

The next engine exit on the M5 relaunches at or above the seated held needs: serving.reconcile shows the pool and grid.mind.unservable shows none. Owner Cormac, read on the first exit after deploy.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

… and a relaunch below its proven pool may grow back (M5 2026-11-07 16:14Z: 5 x 35,328 lanes vs 50-70k needs, 45 min of zero acts; card 9ffcb1b5)

The engine aborted; its own bytes read 0, so the plan's budget was a gap reading (usable 0) and
launch_pool fell to the plan's window x 2 lanes: 176,640 split over 5 sequences = 35,328 each,
while the five minds held 44-70k. Their needs had survived the abort (the working set); only the
launch ignored them, and the one-growth-per-model rule then held the bad pool for 45 minutes.

- launch_pool takes Seated { need, proven }: the pool is at least the sum of the seated minds'
  HELD needs (each capped at the trained window; a wish is a target with headroom, never a need),
  capped by the larger of the live fit and, only while the budget is a gap reading, the largest
  pool this model ran at in this core run. A steady budget's fit stays the authority.
- The daemon records that largest pool per model when the engine reports its pool.
- pool_growth: a running pool below that proven pool is a recovery, not a chain, so the one-try
  record does not hold it.
- Tests: the 16:14Z relaunch reproduced (176,640 without the floor, every capped need held with it,
  never above the proven pool, nothing floored before a proven run, steady fit unchanged), and the
  recovery rule. The dyno test's unused `use super::*` goes with the edit.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply joelteply changed the title A relaunch sizes the engine's pool from the seated minds' held needs, and a relaunch below its proven pool may grow back (M5 2026-11-07 16:14Z: 5 x 35,328 lanes vs 50-70k needs, 45 min of zero acts; card 9ffcb1b5) A relaunch sizes the engine pool from the seated minds held needs, and may grow back to its proven pool (P0, card 9ffcb1b5) Nov 7, 2026
@joelteply
joelteply merged commit 943db1f into canary Nov 7, 2026
9 of 10 checks passed
@joelteply
joelteply deleted the 9ffcb1b5/relaunch-pool-from-needs branch November 7, 2026 18:56
joelteply added a commit that referenced this pull request Nov 7, 2026
…ent, so the reconcile no longer deadlocks and the core boots (#5837)

#5835's engine_pool read planned_budget.lock() inside launch_pool's argument list, where the
guard lives to the end of the statement, while seated_for (also an argument) locked it again;
parking_lot is not reentrant, so the reconcile hung, no module past grid-capacity initialized,
and the core never bound its IPC socket (the M5, 2026-11-07 19:11Z; boot wedged 300 s, restart loop).


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

Co-authored-by: Claude Opus 5.5 <[email protected]>
joelteply added a commit that referenced this pull request Nov 7, 2026
…(regression for the M5 boot wedge, #5835 -> #5837) (#5839)

* The engine pool never relocks its budget: each lock is its own statement, so the reconcile no longer deadlocks and the core boots

#5835's engine_pool read planned_budget.lock() inside launch_pool's argument list, where the
guard lives to the end of the statement, while seated_for (also an argument) locked it again;
parking_lot is not reentrant, so the reconcile hung, no module past grid-capacity initialized,
and the core never bound its IPC socket (the M5, 2026-11-07 19:11Z; boot wedged 300 s, restart loop).

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

* test: engine_pool returns on a real daemon with a planned budget set (regression for the M5 boot wedge, #5835 -> #5837)

#5835 held a planned_budget guard as a temporary in launch_pool's argument list while seated_for,
another argument, locked the same non-reentrant mutex: the serving reconcile deadlocked and the
core never bound its socket (the M5, 2026-11-07 19:08Z). Its tests covered only launch_pool as a
pure function. This one calls engine_pool on a real ServingDaemonModule with a planned budget set,
under both credit facts, on a thread with a 10 s deadline, so a deadlock fails in seconds instead
of wedging a node. Mutation-proved: with the guard back in the argument list the test fails at its
deadline (11.34 s); with #5837's separate statements it passes (one_launch 5/5).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
joelteply added a commit that referenced this pull request Nov 7, 2026
…e engine and KV plan it ran on (card 8a983e31, slice 1) (#5846)

The largest pool each model ran HEALTHY at floors a relaunch from a gap reading (#5835). It was a
map in the serving daemon's memory keyed by model alone, so a core restart onto a dead engine found
it empty (Fable on #5835), and a pool proven under one engine build or KV layout stood for another
(#5838 pattern 3).

Now it is continuum-engine's ProvenPools kind on the one saved-state contract
(state/proven-pools.json, Rebuildable):
- Contract = PoolContract { engine build (the slot stamp), cache_type, flash_attn, backend } from
  their typed owners (engine_slots, kv_cache_plan::resolve), never argv text;
- recorded under the RUNNING engine's build (PoolContract::running), read under the build the NEXT
  launch uses (PoolContract::live), so an engine installed since a proof inherits nothing;
- a changed contract loads Diverged and the node proves from nothing; growing toward the old proof
  as an upward trial waits on the trunk returning the stored value (Fable's card 18184d0b).

The daemon's last_healthy_pool map and its three uses (launch.rs record + seated_for,
pool_growth.rs) move to proven_pool::{observe, proven}.


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

Co-authored-by: Claude Opus 5.5 (1M context) <[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