Repository navigation
fix(inference): busy is not dead at the header wait — a local lane's 300 s bound is a checkpoint on the engine's progress, not a deadline (card 6f3218ed) - #4453
Merged
Conversation
…300 s bound is a checkpoint on the engine's progress, not a deadline (card 6f3218ed) IntelMac, 2026-09-27, one hour with no build running: 45 generations ended, 42 failed and 2 completed (501 s, 830 s). 32 of the failures were "no response headers for 300s after POST". The lane was not hung. /slots showed six slots each 32k deep, prefilling one 2,048-token ubatch per ~45 s. Slot 0 was at 12,288 then 13,448 of a 14.9k prompt, and the rest sat queued at 0 processed. The header timeout killed every request that was queued behind another slot or still advancing its own prefill. On a local single-resident lane the header wait now uses the engine-progress wait the KV page switch already has (BigMama's, card 8c06f778), moved from turn_admission to llama_server beside engine_probe so both callers share it: - at each bound the engine's /slots work fingerprint is read; while it moves, the request is busy and the wait goes on; - processing with nothing moving is stuck, and ends the wait at that checkpoint; - quiet (nothing moved, nothing processing) gets ONE grace checkpoint here, not the page switch's eight: a save/restore is invisible to the counters, a generation is not; - an unreachable engine ends it. The quiet allowance is now a parameter. turn_admission keeps its 8 through a thin wrapper, so its tests are untouched. A remote endpoint has no /slots and keeps the elapsed bound. The trip message and the prefill observation now use the real wait, not the bound. Test (llama_server, existing mod): a moving engine holds the wait for five bounds and the response is returned; a quiet engine ends after one grace checkpoint; processing with nothing moving ends at the first. Not in this PR, same card: the act bound (TICK_DEADLINE, 25 min) reaps long-but-alive generations on the caller side with the same elapsed rule. That is the next change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
Contributor
Author
|
Fable: APPROVED at d714835, pending green (the word is on airc). Read in full.
Not blocking, and it is the next change on your card: the fingerprint is engine-wide, so a request lost inside an engine that is busy with other slots keeps waiting while the others move. Its only outer bound is then TICK_DEADLINE (25 min). When that bound becomes progress-based too, it wants a per-request signal (this request's slot or task id advancing), not the engine-wide one, or a lost request never ends. |
joelteply
added a commit
that referenced
this pull request
Sep 27, 2026
…ed — the act bound extends by checkpoint on its pinned slot, up to 3x (card 6f3218ed) (#4455) * fix(cognition): an act whose own generation is advancing is not stalled — the act bound extends by checkpoint on its pinned slot, up to 3x (card 6f3218ed) The other half of 6f3218ed after #4453. The act bound (TICK_DEADLINE, 25 min, raised only by a MEASURED turn) is pure elapsed time. IntelMac, 2026-09-27: five of seven cancellations in one hour were "request future dropped before a terminal response" at 24.6 to 25.0 min. They were generations alive and queued or prefilling, reaped because the measured turn that would raise the bound is exactly what this tier rarely completes. A per-request signal, per Fable on the design: an engine-wide fingerprint would let a request lost inside a busy engine ride other slots' progress forever. Turn traffic already pins `id_slot` to the admission lease's slot (openai_adapter, inference.slot_pin.decision). The adapter now registers that (root, slot) for the persona while the generation runs (`llama_server::InFlightSlotGuard`, cleared on drop). At the act deadline, settle reads that slot: - first checkpoint: processing extends by one bound; - later checkpoints: the SAME task with its work moved extends again; - a new task on the slot, an idle or silent slot, or no pinned slot ends the act exactly as before; - at most two extensions (3x the bound), so even a moving act can't hold the lane past it. Probe: settle.tick.extended (slot, extensions, bound_s). Tests: `slot_advanced` / `slot_work_of` rules (llama_server), and settle's no-pinned-slot act ends at its bound as the plain timeout did. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * fix(cognition): box the settle step inside the act-stall wrapper — holding it by value overflowed the layout query depth (card 5625d5e3) Co-Authored-By: Claude Opus 5.5 <[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
Sep 27, 2026
… so a relaunch's drain cannot keep the node dark (card 7c5f0a08) (#4468) When the serving daemon condemns a lane it flips its snapshot not-ready, and the relaunch's transition_if takes a write on the endpoint gate: it waits for every admitted turn to drop its guard, with new admissions barred behind it. The busy-is-not-dead waits (#4453's header wait, #4455's act extension) kept renewing on the condemned engine because it was still prefilling, so the drain ran as long as the turns did. On the IntelMac on 2026-09-27 that was 15:44-16:09Z, 16:33-17:19Z and again from 17:47Z: no lane and 0 acts in each window. engine_probe now answers EngineProbe::Condemned while the snapshot is not-ready (false before the daemon installs its state), and wait_while_engine_progresses ends there at the checkpoint (probe inference.wait.engine_condemned). The act deadline never extends on a condemned engine. Busy is still not dead on a live engine; a dying one is simply not worth waiting on, since its relaunch cuts the work anyway. The drain is now bounded by one checkpoint (<= 300 s header wait). Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
IntelMac, 2026-09-27, one hour with no build running: 45 generations ended, 42 failed and 2
completed (501 s, 830 s). 32 of the failures were "no response headers for 300s after POST".
The lane was not hung. /slots showed six slots each 32k deep, prefilling one 2,048-token
ubatch per ~45 s. Slot 0 was at 12,288 then 13,448 of a 14.9k prompt, and the rest sat
queued at 0 processed. The header timeout killed every request that was queued behind
another slot or still advancing its own prefill.
On a local single-resident lane the header wait now uses the engine-progress wait the
KV page switch already has (BigMama's, card 8c06f778), moved from turn_admission to
llama_server beside engine_probe so both callers share it:
request is busy and the wait goes on;
switch's eight: a save/restore is invisible to the counters, a generation is not;
The quiet allowance is now a parameter. turn_admission keeps its 8 through a thin
wrapper, so its tests are untouched. A remote endpoint has no /slots and keeps the
elapsed bound.
The trip message and the prefill observation now use the real wait, not the bound.
Test (llama_server, existing mod): a moving engine holds the wait for five bounds and the
response is returned; a quiet engine ends after one grace checkpoint; processing with
nothing moving ends at the first.
Not in this PR, same card: the act bound (TICK_DEADLINE, 25 min) reaps long-but-alive
generations on the caller side with the same elapsed rule. That is the next change.
Not compiled on the IntelMac: its deploy build holds the machine. CI is the compile.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE