Skip to content

A smoke decode never takes a slot holding a mind (the M5's cold misses) - #5405

Merged
joelteply merged 1 commit into
canaryfrom
fable/smoke-never-over-a-resident
Oct 25, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fable/smoke-never-over-a-resident

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Why

This serves plan path step 1 (fast: median act under 60 s at four residents). On the M5, 6 of 19 generations re-prefilled from token 0. That was ~830 s of the window's 1,618 s of prefill, and it is the main reason residents there looked dead next to the 5090's.

The cause: the reconciler re-proves decode with the count-to-ten smoke prompt on every ensure tick, for any engine the core did not spawn itself. Since stop --keep-engine and reboot adoption, every engine is one. With no scratch slot, the probe landed on a resident's slot and replaced her KV:

  • it ran at 02:34:53Z and 02:36:49Z, right after each 're-homing' tick;
  • her next turn came back cached 0;
  • her next page save wrote the probe as her page: 24-byte checkpoint sidecars, and a 158 MB slot for a ~600 MB conversation.

The guard written for the 5090's identical incident (card 9e3350bd) lived only in the health heartbeat.

What

  • decode_smoke_ok decides the seat once, for every caller: the heartbeat, the reconciler's adoption probe, and readiness.
  • It reads the server's own /slots. Seat order: the scratch slot; any slot when the server holds nothing (a fresh spawn); otherwise no synthetic decode (serving.smoke.deferred_to_delivery). The lane answered, and her deliveries prove decode.
  • An unreadable /slots is never read as empty.
  • smoke_attempt's duplicate scratch lookup now uses the same scratch_slot_for.

Tests (local, M5 macOS, serving down, 2026-10-25)

cargo test -p continuum-engine --lib --features metal: 1331 passed, 0 failed, 5 ignored. This includes a_smoke_decode_never_takes_a_slot_holding_a_mind (scratch, fresh, resident, busy, unreadable).

Measured after deploy (owner Fable)

A 15-minute read on the M5 against the 02:41Z baseline (19 generations, 52% reuse, 6 cold, 3,344 s). Pass criteria:

  • no cached 0 from a turn whose page restored;
  • no sidecar under 1 KB in the page actions;
  • serving.smoke.deferred_to_delivery fires where the probe used to run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

… once, in decode_smoke_ok, for every caller

The guard against a synthetic decode replacing a resident's KV (card 9e3350bd) lived only in the
health heartbeat. The reconciler re-proves decode on every ensure tick for an engine the core did
not spawn, and since `stop --keep-engine` / reboot adoption every engine is one: on the M5
(2026-10-25 02:34Z, 02:36Z) the count-to-ten probe landed on a resident's slot right after each
"re-homing" tick, so 6 of 19 generations re-prefilled from 0 (~830 s of 1,618 s prefill) and page
saves captured the probe (24-byte checkpoint sidecars, a 158 MB slot for a 600 MB conversation).

decode_smoke_ok now reads the server's own /slots and seats the probe on the scratch slot, or
anywhere only when the server holds nothing; otherwise no synthetic decode (probe
serving.smoke.deferred_to_delivery): the lane answered and her own deliveries prove decode.
smoke_attempt's scratch lookup goes through the same scratch_slot_for.

Local, M5 macOS, serving down, 2026-10-25: cargo test -p continuum-engine --lib --features metal
-> 1331 passed, 0 failed, 5 ignored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply merged commit 414c558 into canary Oct 25, 2026
21 checks passed
@joelteply
joelteply deleted the fable/smoke-never-over-a-resident branch October 25, 2026 03:36
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