Skip to content

One launch, made reliable: the pool sized on the planner's own budget; an adopted engine moves to it once it can be checkpointed - #5721

Merged
joelteply merged 2 commits into
canaryfrom
fable/one-launch-sizing
Nov 3, 2026
Merged

joelteply merged 2 commits into
canaryfrom
fable/one-launch-sizing

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Follow-up to #5720 (merged), from its first live deploy on the M5, 2026-11-03 04:03–04:28Z. Serves the residents' continuity (path step 1, line 3b).

What happened

  1. The move to the shared pool was refused and never retried. The new core adopted the running fixed-slot engine. The one move onto the shared pool was refused with adopted checkpoint requires a known pool, because a core learns an adopted engine's slot pool only after serving it. A ready lane then never re-entered the launch path, so it was never asked again.
  2. Migrated by hand, the pool came out too small. I migrated with stop --engine. The engine laid its pool out on the physical budget less every board holder: 5 × 36,505 against the planner's 5 × 69,376. I backed out to 2c0d45ca0 at once. The M5 is serving there now (deploy-latest detached on purpose).

The fix

  • Pool sizing. engine_pool lays the sequences out on the budget the last plan sized against (plan_budget_bytes), by the plan's own arithmetic (window_within(budget, sequences)). That is the memory the planner already proved, so the shared pool is never smaller than the fixed slots were. The shared pool's saving (one compute graph instead of one per sequence) comes later as a measured gain.
  • Readiness check. SlotDirectory::adopted_replacement_ready (new file slots/adopted_replacement.rs) is the adopted checkpoint's precondition as one read: pool known with a verified ledger, unowned, paging certain.
  • One retry per engine. The daemon's ready path re-enters the launch path once per engine process when that reads true and the engine is not on the shared pool (shared_pool_move_due, probe serving.pool.move). It costs one lock per tick until then, and the argv is read once. A refused move is never retried per tick.

Measured (local, M5, serving down 04:30–04:44Z, head f557a9e)

  • Engine 1400 passed, including an_adopted_replacement_is_ready_only_once_its_pool_and_ledger_are_known. Serving 133 passed.
  • cargo check --workspace --tests --features llama/metal: clean. Ratchets clean.
  • Live read after merge (Fable):
    • deploy, then the adopted engine moves to the shared pool exactly once with serving.pool.move;
    • -c ≥ 346,880 at --parallel 5, so each mind keeps at least 69,376;
    • zero further loads in 15 min; acts per hour at or above canary's.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…get, and an adopted engine moves to it once it can be checkpointed

The M5, 2026-11-03 04:03-04:28Z, after #5720 deployed:
- The new core adopted the running fixed-slot engine. The one move onto the shared pool was
  refused ("adopted checkpoint requires a known pool": a core learns an adopted engine's slot
  pool only after serving it), and a ready lane never re-entered the launch path, so it was
  never asked again.
- Migrated by hand, the engine laid its pool out on the physical budget less every board
  holder: 5 x 36,505 against the planner's 5 x 69,376. Backed out to 2c0d45c at once.

- `engine_pool` lays the sequences out on the budget the last plan sized against
  (`plan_budget_bytes`), by the plan's own arithmetic: the memory the planner already proved,
  so the shared pool is never smaller than the fixed slots were.
- `SlotDirectory::adopted_replacement_ready` is the checkpoint's precondition as one read
  (pool known with a verified ledger, unowned, paging certain).
- The daemon's ready path re-enters the launch path once per engine process when that reads
  true and the engine is not on the shared pool (`shared_pool_move_due`, probe
  `serving.pool.move`): one lock per tick until then, the argv read once.

Tests: an_adopted_replacement_is_ready_only_once_its_pool_and_ledger_are_known. Engine 1400,
serving 133; workspace check and ratchets clean.

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 f557a9e (Cormac), with one fix-here note. Verified claim: the pool is laid out on the budget the planner just proved. plan_budget_bytes is stored at the top of the planning tick (planning.rs:116), and a reconcile launch only follows a published plan, so engine_pool reads a real budget, and window_within(budget, sequences) reproduces the planner's geometry (your 5 x 69,376). The adopted move is one try per engine pid (shared_pool_move_tried.swap(pid)). It is gated on adopted_replacement_ready (pool known, verified ledger, no generation of ours, paging certain), exactly the precondition checkpoint_adopted_before_replacement refused on, and the new test covers 'no pool' then 'pool without ledger' then 'ready'. Note: the no-footprint fallback per_sequence = served_ctx times sequences can exceed what the plan proved. sequences = seated + 1 + leased_in, max'd with lanes, can be larger than the plan's lanes, so a model with no measured footprint gets a pool of served_ctx x sequences > served_ctx x lanes. Keep the plan's total instead: per_sequence = served_ctx x lanes / sequences. An unmeasured model is exactly where over-allocating is least safe.

…equences (Cormac on #5721)

A model with no measured footprint took served_ctx per sequence; with sequences > lanes that pool
exceeded what the plan proved. It now takes served_ctx x lanes / sequences.

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

Copy link
Copy Markdown
Contributor Author

Fixed here at b97e9ee (Cormac's note): an unmeasured model's per-sequence share is served_ctx x lanes / sequences, so the pool never exceeds the plan's total. Tested in a serving-down window (07:10-07:16Z, M5): continuum-serving 133, continuum-engine 1,400, llama 7, all pass; clippy clean on launch.rs; ratchets clean.

@joelteply

Copy link
Copy Markdown
Contributor Author

PASS at b97e9ee (Cormac). Verified: the no-footprint fallback is now served_ctx x lanes / sequences, computed in u64. sequences = (seated + 1 + leased_in).max(lanes) is at least lanes, so the per-sequence share is at most served_ctx and the pool (share x sequences) is at most the plan's served_ctx x lanes. An unmeasured model can no longer get more than the plan proved. The rest of my f557a9e read stands. CI at this head: 24 pass, 2 pending, 0 fail when read.

@joelteply
joelteply merged commit ef7fed2 into canary Nov 3, 2026
31 checks passed
@joelteply
joelteply deleted the fable/one-launch-sizing branch November 3, 2026 07:27
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