Skip to content

The pool's one relaunch quiesces admission instead of waiting for an idle sample (card 2540194e) - #5748

Merged
joelteply merged 1 commit into
canaryfrom
cormac/growth-quiesces-admission
Nov 3, 2026
Merged

joelteply merged 1 commit into
canaryfrom
cormac/growth-quiesces-admission

Conversation

@joelteply

@joelteply joelteply commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

The pool's one relaunch quiesces admission instead of waiting for an idle sample (card 2540194e)

On the M5 on 2026-11-03 (24e4d2c, then the 90fe06f rollback) the engine launched at 5 x 2,048
and the pool never grew: #5742 waited for a /slots read with no slot processing, and five residents
on 409-token windows acted without pause (112 admission.lane.granted in 7 min), so the read never
came (Fable's evidence: ~/.continuum/evidence/2026-11-03-pool-stuck/).

The relaunch now makes its idle edge:

  • resource_admission::quiesce: every lane request ENTERS one count before either semaphore, then
    checks a flag; a quiesce SETS the flag, then waits for the count to reach zero. Both SeqCst, so
    nothing slips between. Both waits are Notify edges, never a poll. The entry is the permit's LAST
    field, so the lane and the in-flight marker are released before a quiesce sees it gone.
  • The serving daemon, when the first steady plan proves a larger pool, spawns the quiesce and only
    then requests the relaunch. llama_server::pool_growth holds the quiesce across the relaunch: it
    ends after the ensure once the request is spent (a serving engine, or a failure), or when a
    different engine process serves. Never while no engine serves.
  • The pool's one upward relaunch waits for no slot processing, so it never cuts a generation #5742's engine_idle sample, its health-tick writer, no_slot_processing and its test are deleted.

The bound on the hold: the longest in-flight generation, plus up to one serving tick, plus the
relaunch until the new engine answers. Probed: serving.pool.grow_quiesced (drained_ms),
serving.pool.grow_held (held_ms, reason), admission.quiesce.ended (held_ms).

Not covered: external drivers on :58057 reach llama-server without admission, and a relaunch cuts
them (Fable on 2540194e). That's acceptable for this one-time bridge; card to follow.

Measured

Not yet measured live. The receipt is due on the M5 after this merges (Fable offered the serving-down window):

  • serving.pool.grow_quiesced drained_ms and serving.pool.grow_held held_ms on the first steady plan after boot;
  • the pool after the relaunch (context_geometry.allocated_tokens) vs the 2,048 launch;
  • acts in the 15 min after, vs the restart-only control.

The engine crate builds in CI only: it pulls llama.cpp, which the IntelMac does not build beside its residents. CI is the compile check.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…idle sample (card 2540194e)

On the M5 on 2026-11-03 (24e4d2c, then the 90fe06f rollback) the engine launched at 5 x 2,048
and the pool never grew: #5742 waited for a /slots read with no slot processing, and five residents
on 409-token windows acted without pause (112 admission.lane.granted in 7 min), so the read never
came (Fable's evidence: ~/.continuum/evidence/2026-11-03-pool-stuck/).

The relaunch now makes its idle edge:
- resource_admission::quiesce: every lane request ENTERS one count before either semaphore, then
  checks a flag; a quiesce SETS the flag, then waits for the count to reach zero. Both SeqCst, so
  nothing slips between. Both waits are Notify edges, never a poll. The entry is the permit's LAST
  field, so the lane and the in-flight marker are released before a quiesce sees it gone.
- The serving daemon, when the first steady plan proves a larger pool, spawns the quiesce and only
  then requests the relaunch. llama_server::pool_growth holds the quiesce across the relaunch: it
  ends after the ensure once the request is spent (a serving engine, or a failure), or when a
  different engine process serves. Never while no engine serves.
- #5742's engine_idle sample, its health-tick writer, no_slot_processing and its test are deleted.

The bound on the hold: the longest in-flight generation, plus up to one serving tick, plus the
relaunch until the new engine answers. Probed: serving.pool.grow_quiesced (drained_ms),
serving.pool.grow_held (held_ms, reason), admission.quiesce.ended (held_ms).

Not covered: external drivers on :58057 reach llama-server without admission, and a relaunch cuts
them (Fable on 2540194e). That's acceptable for this one-time bridge; card to follow.

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 576d3cc (Fable). Claims verified, and how:

  • No lost wakeup, nothing counted after a cancel. I read quiesce.rs. enter and quiesce each enable their Notify before checking the count or flag. Entry is SeqCst enter-then-check against the quiesce's set-then-wait. A dropped Quiesced, including a cancelled quiesce future, resets the flag and wakes held requests.
  • No deadlock from nested admission. The two paths that acquire a lane each hold the permit across exactly one model call: deliberation (admission.rs:120-170, returned as GenerationAdmission) and the dream distiller (distiller.rs:377-386, released after generate_text). Neither enters admission while holding an entry.
  • The hold spans drain plus relaunch until a new pid serves, and serving.pool.grow_held measures it.
  • M5 serving-down window, 23:42-23:53Z: continuum-engine --lib --features metal 1,417 passed, 5 ignored. continuum-serving --lib 139 passed.

Two clippy flags in health.rs (:168 is_multiple_of, :248 is_none_or) are on lines that predate this PR, in a file it touches. Fix them here if it's cheap; otherwise they're carried in card a94d1634's area.

Minor: pool_growth_tried is stored before the quiesce task runs, so a grow_quiesce_busy outcome means this engine never retries. That can't happen while only growth quiesces. Note it if another quiescer is ever added.

Merge on green. After deploy, the receipt I'll post: serving.pool.grow_held held_ms, and the pool before and after on the M5.

@joelteply
joelteply merged commit b7c8154 into canary Nov 3, 2026
32 checks passed
@joelteply
joelteply deleted the cormac/growth-quiesces-admission branch November 3, 2026 23:54
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