Skip to content

fix(boot): busy is not dead — ONE lane verdict (bounded, retried /health AND the process's own activity) with a receipt per pid; the shell's second criterion that reaped the M5's lane mid-generation is deleted (card b57b19fd) - #4252

Merged
joelteply merged 2 commits into
canaryfrom
fix/busy-is-not-dead-one-lane-verdict-with-a-receipt
Sep 20, 2026

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What broke (the M5, 2026-09-20, twice in one morning)

The box sat at 0 GB free / 4.9 GB swap (the engine's cache grant had filled it), the tracker stopped the core for a source build, and start-server.sh's adopt_or_reap_llama_lanes ran one 3 s curl against a 32 GB lane 6,460 tokens into a turn at 11.9 t/s. The HTTP thread answered late; the lane was killed as "unhealthy" (✗ reaping unhealthy llama lane (pid 56926 … then 82041)). Cost each time: every mind's KV, a cold 27B load, a boot at 1 × 2,048 with a 26 GB grant, a grow-back relaunch. Joel: "Timeouts are where I see AIs typically ruin a project out of instability."

Two owners of one kill decision: the Rust boot plan (step_adopt_lanes → lane_health_by_pid, one 3 s probe) and the bash loop — the same guess in two places.

The fix — one verdict, two signals, a receipt

  • lane_process::lane_verdict(pid) -> LaneVerdict { Healthy{attempt}, Busy{cpu_pct,last_error}, Dead{reason} }: identity-verified, then /health asked LANE_PROBE_ATTEMPTS × LANE_PROBE_BOUND_S (3 × 5 s — constants named with the measurement that sized them) and the process's CPU share (cpu_pct_of, sysinfo single-pid across its minimum interval).
  • PURE verdict_from(answered_on, cpu_pct, last_error): answered → Healthy; missed + working (≥ LANE_BUSY_CPU_PCT) → Busy, adopted (the core's readiness check proves decode before a citizen is seated and relaunches if not); missed + frozen or unsampled → Dead. An absence never exonerates.
  • boot_plan::step_adopt_lanes adopts Healthy and Busy, reaps only Dead; the boot line reads N adopted, M reaped [pid X: busy (…cpu 140% — decoding, adopted); …] and a boot.lane_verdict probe carries pid / adopt / evidence per lane, so a reap is auditable.
  • The bash loop is deleted (the strangler its own comment promised). The core's step is the only place a boot decides a lane's fate; the script's row now says so.

Tests

  • busy_is_not_dead_the_verdict_needs_two_signals — the verdict table (answered; missed+working → adopt; missed+frozen → dead; unsampled → dead).
  • a_slow_answer_within_the_bound_is_healthy — a TCP listener that answers 4 s late is Healthy under the 5 s bound (the old 3 s shot read it dead); a port nobody listens on misses every attempt with the reason carried.

Not in this PR

The pressure that made the box slow (the cache grant sized against the free memory it then consumes) is card 7b01ed65, next.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…ealth AND the process's own activity) with a receipt per pid; the shell's second criterion that reaped the M5's lane mid-generation twice is deleted (card b57b19fd)

2026-09-20, the M5, two deploys in one morning: the box sat at 0 GB free / 4.9 GB swap (the
engine's cache grant had filled it), the tracker stopped the core for a source build, and
tools/scripts/start-server.sh's adopt_or_reap_llama_lanes ran ONE 3 s curl against a 32 GB lane
6,460 tokens into a turn at 11.9 t/s. The HTTP thread answered late under pressure; the lane was
killed as "unhealthy". Cost each time: every mind's KV, a cold 27B load, a boot at 1 × 2,048 with
a 26 GB grant, a grow-back relaunch. Joel: "Timeouts are where I see AIs typically ruin a project
out of instability."

Two owners of one kill decision was the defect: the Rust boot plan (`step_adopt_lanes`, a single
3 s probe via `lane_health_by_pid`) and the bash loop — the same guess in two places.

Now:
- `lane_process::lane_verdict(pid) -> LaneVerdict { Healthy, Busy, Dead }` — identity-verified,
  then TWO signals: `/health` asked LANE_PROBE_ATTEMPTS × LANE_PROBE_BOUND_S (3 × 5 s, sized for
  a loaded box and named with the measurement that sized them) AND the process's CPU share
  (`cpu_pct_of`, sysinfo single-pid). PURE `verdict_from(answered_on, cpu_pct, last_error)`:
  answered → Healthy; missed + working (≥ LANE_BUSY_CPU_PCT) → Busy (ADOPTED — the core's
  readiness check proves decode before a citizen is seated); missed + frozen or unsampled → Dead.
- The boot step adopts Healthy and Busy, reaps only Dead, and every fate is a receipt: the boot
  line carries "pid N: <evidence>" and a `boot.lane_verdict` probe carries pid/adopt/evidence.
- The bash loop is deleted (strangler rule, as its own comment promised); the core's step is the
  only place a boot decides a lane's fate.

Tests: `busy_is_not_dead_the_verdict_needs_two_signals` (the four cells of the verdict table),
`a_slow_answer_within_the_bound_is_healthy` (a listener that answers 4 s late is healthy under
the 5 s bound where the old 3 s shot read it as dead; a port nobody listens on misses with the
reason carried).

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

Copy link
Copy Markdown
Contributor Author

APPROVE — reviewed at exact head 2a67e81 (checks running at read time; merge on green).

The class is the one I keep a rule for — a timeout sized against the fast tier fails silently on the slow one, and an expired guard is indistinguishable from no guard — and the fix is the right shape: two signals, a pure verdict_from with an absence that never exonerates, every fate a receipt (the boot line and boot.lane_verdict carry pid + evidence), and the second owner of the kill decision deleted rather than aligned. Two things I checked before saying so: (1) the bash loop ran only inside start-server.sh, and continuum start runs boot_plan::run_before_phase (which carries adopt-or-reap-lanes) before it invokes the script — so every path the bash covered, the Rust verdict now covers first; the launchd and S4U paths launch the core directly, ran no bash reap either, and leave a lane's fate to the serving daemon's readiness check as before. (2) cpu_pct_of does the two refreshes across sysinfo's minimum interval, so the second read is a real share, not the first-sample zero.

One nit, not a condition, for the doc on LANE_BUSY_CPU_PCT: a lane still LOADING its weights answers /health 503 (curl -f → "non-2xx") and can sit near 0% CPU in I/O wait — it reads Dead under this verdict exactly as it did under the old one, so no regression, but the evidence line will say "frozen" for a lane that was merely mmap-reading; a boot that lands seconds after a relaunch is the case. If it ever shows up in a receipt, the third signal is the process's RSS/I/O advancing, not CPU. Worth one sentence so the next reader does not chase it as a wedge.

@joelteply

Copy link
Copy Markdown
Contributor Author

Nit taken at 29a9e7b (doc only): the loading-lane blind spot is named on LANE_BUSY_CPU_PCT — a 503 near 0% CPU in I/O wait reads Dead as before, its evidence line says frozen, and the third signal if it ever shows is RSS/I/O advancing, not CPU. A fresh word at 29a9e7b when green, please.

@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVE — reviewed at exact head 29a9e7b; the delta from 2a67e81 is the doc sentence and nothing else. Merge on green.

@joelteply
joelteply enabled auto-merge (squash) September 20, 2026 09:54
@joelteply
joelteply merged commit 4b75680 into canary Sep 20, 2026
7 checks passed
@joelteply
joelteply deleted the fix/busy-is-not-dead-one-lane-verdict-with-a-receipt branch September 20, 2026 10:14
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