Skip to content

One upward relaunch per engine when the first steady plan proves a larger pool (S2 debt) - #5741

Merged
joelteply merged 1 commit into
canaryfrom
cormac/launch-pool-grows-once
Nov 3, 2026
Merged

joelteply merged 1 commit into
canaryfrom
cormac/launch-pool-grows-once

Conversation

@joelteply

@joelteply joelteply commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

The engine launches once on a shared pool and keeps that pool for its life, so the launch has to
read memory at the worst moment: right as a core boots. On the M5 on 2026-11-03 every launch read
a transient and was rolled back: the cold boot plan gave 5 x 2,048 (b4be7bc), the host's physical
total gave 5 x 262,144 at 91% memory pressure (590df4b), the live budget sampled while the old
core's memory came back gave 16,640 (81aef18). A launch cannot be right by construction. So the
plan's rule for every downward adaptation applies, "control both ways": the launched pool gets
ONE scheduled upward test.

  • serving daemon, pool_growth: on the ready tick, beside the shared-pool move, a STEADY plan
    (serving's footprint reported, so the budget was sampled with this engine up and credited back
    once) re-sizes the pool by the same launch_pool the launch used. When that is strictly larger
    than the pool the engine reports, the daemon asks for one relaunch for that engine process and
    falls through to the ensure. Once per process; equal or smaller never relaunches. Pure grows()
    carries the rule, with the 81aef18 case, the boot ticks, no budget, equal and downward.
  • engine, pool_growth + reconcile: a fifth relaunch operand, grow_ok, false only while the request
    names the running process and the target's pool exceeds the one it reports. The request is
    spent when decided, so a failed relaunch never loops (an_engine_grows_once_upward_and_only_when_asked).
  • serving_footprint_reported(): planning's at_rest test and the growth's "steady" read one owner.

S2 DEBT: this bends the one-launch rule and goes when the engine resizes its pool live (card
e9724a7d). The deploy's geometry rollback (pool, memory pressure, residents hosted) guards the
relaunch on the M5.

continuum card e36e6533

Validation

Measured after deploy (owner Cormac, with Fable's M5 deploy; card stays open until posted)

  • serving.pool.grow_due then serving.pool.grow once on the M5 after its first steady plan, the relaunched pool from /props context_geometry, memory pressure, and residents hosted within the rollback window.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…rger pool (S2 debt)

The engine launches once on a shared pool and keeps that pool for its life, so the launch has to
read memory at the worst moment: right as a core boots. On the M5 on 2026-11-03 every launch read
a transient and was rolled back: the cold boot plan gave 5 x 2,048 (b4be7bc), the host's physical
total gave 5 x 262,144 at 91% memory pressure (590df4b), the live budget sampled while the old
core's memory came back gave 16,640 (81aef18). A launch cannot be right by construction. So the
plan's rule for every downward adaptation applies, "control both ways": the launched pool gets
ONE scheduled upward test.

- serving daemon, pool_growth: on the ready tick, beside the shared-pool move, a STEADY plan
  (serving's footprint reported, so the budget was sampled with this engine up and credited back
  once) re-sizes the pool by the same launch_pool the launch used. When that is strictly larger
  than the pool the engine reports, the daemon asks for one relaunch for that engine process and
  falls through to the ensure. Once per process; equal or smaller never relaunches. Pure grows()
  carries the rule, with the 81aef18 case, the boot ticks, no budget, equal and downward.
- engine, pool_growth + reconcile: a fifth relaunch operand, grow_ok, false only while the request
  names the running process and the target's pool exceeds the one it reports. The request is
  spent when decided, so a failed relaunch never loops (an_engine_grows_once_upward_and_only_when_asked).
- serving_footprint_reported(): planning's at_rest test and the growth's "steady" read one owner.

S2 DEBT: this bends the one-launch rule and goes when the engine resizes its pool live (card
e9724a7d). The deploy's geometry rollback (pool, memory pressure, residents hosted) guards the
relaunch on the M5.

continuum card e36e6533

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Contributor Author

PASS at 3886047 (Fable), pending CI green.

Verified, and how:

  • Only upward, only once, only steady (read serving_daemon/pool_growth.rs and llama_server/pool_growth.rs at the head). grows(steady, budget, running, wanted) requires serving_footprint_reported() (the budget was sampled with this engine up and credited back once), a sampled budget, a known running pool, and wanted > running. The engine's growth_due repeats target_pool > running against the pool the process reports. pool_growth_tried (daemon) and spend (engine) both key on the pid, so a failed relaunch can't loop and a new process starts with no request.
  • The engine compares the launch's own pool. launch.rs:148-153: the target's context_window is engine_pool's per-sequence size and lanes its sequences, so target.context_window x target.lanes in reconcile.rs is exactly the pool the daemon asked for. No second derivation.
  • Bound work still blocks it. The growth goes through the same reconcile; reconcile.rs:182-195 holds any engine with resident work (a live /train) before any relaunch path.

Non-blocking: the occupancy hold covers bound jobs, not an ordinary persona turn in flight, so the one growth relaunch can cut a turn. It happens once, minutes after a boot, and canary's re-home had the same exposure, so it doesn't block. Folding in a gate on no turn in flight (the same awaited() == 0 the stop uses) would make it clean; I've carded it if you'd rather not now.

The M5 deploy after merge uses the guard that caught all three launches: an automatic rollback on a pool < 65,536, memory pressure high, or no resident hosted in 4 minutes.

@joelteply
joelteply merged commit 72531e4 into canary Nov 3, 2026
32 checks passed
@joelteply
joelteply deleted the cormac/launch-pool-grows-once branch November 3, 2026 20:36
joelteply added a commit that referenced this pull request Nov 3, 2026
…ver cuts a generation

Fable on #5741 (card 5c9042f1): the engine's occupancy hold covers bound jobs, not an ordinary
persona turn, so the growth relaunch could cut one. What a relaunch loses is exactly the
generation the engine is decoding; a turn between generations (a tool call) just waits for the
engine. A turn's durability is not the measure here: the core stays up, so nothing would hand a
cut generation back (turn_ingress::awaited() is the STOP's measure).

- The health tick's existing /slots read (one per health tick, its own task) records
  (engine pid, no slot processing) on the daemon.
- pool_growth_due marks the growth tried and asks for it only on a read of THIS engine with no
  slot processing; otherwise it returns false and the next tick rechecks.
- Pure no_slot_processing(&slots): every slot's is_processing is false; a slot without the field,
  or a body that is not a slots array, is unknown, and unknown is never idle.

continuum card 5c9042f1

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply added a commit that referenced this pull request Nov 3, 2026
…ver cuts a generation (#5742)

Fable on #5741 (card 5c9042f1): the engine's occupancy hold covers bound jobs, not an ordinary
persona turn, so the growth relaunch could cut one. What a relaunch loses is exactly the
generation the engine is decoding; a turn between generations (a tool call) just waits for the
engine. A turn's durability is not the measure here: the core stays up, so nothing would hand a
cut generation back (turn_ingress::awaited() is the STOP's measure).

- The health tick's existing /slots read (one per health tick, its own task) records
  (engine pid, no slot processing) on the daemon.
- pool_growth_due marks the growth tried and asks for it only on a read of THIS engine with no
  slot processing; otherwise it returns false and the next tick rechecks.
- Pure no_slot_processing(&slots): every slot's is_processing is false; a slot without the field,
  or a body that is not a slots array, is unknown, and unknown is never idle.

continuum card 5c9042f1


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

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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