Skip to content

fix(serving): an adopted lane is held to the KV decision a spawn would make NOW — last deploy's cache type is a stale lane, relaunched once and named (card 977842fd) - #4288

Merged
joelteply merged 1 commit into
canaryfrom
fix/adopt-against-the-kv-decision
Sep 21, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/adopt-against-the-kv-decision

Conversation

@joelteply

@joelteply joelteply commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

The composition of two correct changes: the KV cache type is applied at engine SPAWN
(#4285), an engine now survives a core stop (#4284), and the adopt rail compared model +
window + lanes + sight — never the KV decision. Measured on the 5090, 2026-09-21 00:33Z:
the new core read the q8_0 decision, found its healthy f16 engine at 26,880, adopted it,
and the decision never reached the process it was written to change; three minds fell
home from that seat within seven minutes ("seat window below her turn").

  • lane_process::LaunchKv + launch_kv_in(argv): the running engine's cache type and
    flash-attention read off its OWN argv (--cache-type-k, --flash-attn on|off|auto,
    bare and = forms) — the same recovery the --cache-ram grant already uses for an
    adopted lane. No flag = the engine's f16 default, a value.
  • LlamaServerControl::launch_kv(): the real control resolves the live lane's pid from
    the registry and reads its argv; a fake models it (launched_with); unknown = None.
  • ensure_model_serving: kv_ok beside window_ok / lanes_ok / sight_ok — the
    running decision against kv_cache_plan::resolve() (what a spawn would do now). A
    mismatch is serving.grow with both geometries named, then the relaunch the other
    axes already take; a window drift still adopts (fix(stop+adopt): the reboot path keeps its promise — a stop spares the live lane on Unix, the lane is its own process group, and an adoptee that is busy is not reaped (card 59052747) #4284's warm-lane economy stands);
    an unknown launch is not a mismatch.

Pinned: an engine on the other decision → Spawned once; the same decision → AlreadyServing,
0 respawns; unknown → AlreadyServing. launch_kv_in on every flag shape.

Receipt: lib inference::llama_server::tests 59 passed / 0 failed (+ lane_process),
REAL_EXIT 0. On the 5090 after this lands: serving.grow kv_ok=false planned_kv=q8_0 running_kv=f16 once, then a lane at roughly double the window.

Faster or slower: one argv read per ensure pass on an adopted lane; a stale lane costs
ONE relaunch, which is the cost of the decision reaching the engine at all.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…d make NOW — last deploy's cache type is a stale lane, relaunched once and named (card 977842fd)

The composition of two correct changes: the KV cache type is applied at engine SPAWN
(#4285), an engine now survives a core stop (#4284), and the adopt rail compared model +
window + lanes + sight — never the KV decision. Measured on the 5090, 2026-09-21 00:33Z:
the new core read the q8_0 decision, found its healthy f16 engine at 26,880, adopted it,
and the decision never reached the process it was written to change; three minds fell
home from that seat within seven minutes ("seat window below her turn").

- `lane_process::LaunchKv` + `launch_kv_in(argv)`: the running engine's cache type and
  flash-attention read off its OWN argv (`--cache-type-k`, `--flash-attn on|off|auto`,
  bare and `=` forms) — the same recovery the `--cache-ram` grant already uses for an
  adopted lane. No flag = the engine's f16 default, a value.
- `LlamaServerControl::launch_kv()`: the real control resolves the live lane's pid from
  the registry and reads its argv; a fake models it (`launched_with`); unknown = `None`.
- `ensure_model_serving`: `kv_ok` beside `window_ok` / `lanes_ok` / `sight_ok` — the
  running decision against `kv_cache_plan::resolve()` (what a spawn would do now). A
  mismatch is `serving.grow` with both geometries named, then the relaunch the other
  axes already take; a window drift still adopts (#4284's warm-lane economy stands);
  an unknown launch is not a mismatch.

Pinned: an engine on the other decision → Spawned once; the same decision → AlreadyServing,
0 respawns; unknown → AlreadyServing. `launch_kv_in` on every flag shape.

Receipt: lib `inference::llama_server::tests` 59 passed / 0 failed (+ lane_process),
REAL_EXIT 0. On the 5090 after this lands: `serving.grow kv_ok=false planned_kv=q8_0
running_kv=f16` once, then a lane at roughly double the window.

Faster or slower: one argv read per ensure pass on an adopted lane; a stale lane costs
ONE relaunch, which is the cost of the decision reaching the engine at all.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVE at 421a07f — Fable. This is the sequel your own #4284 created, and it closes the hole cleanly.

The judgement I most wanted to see is the one you made: kv_ok sits BESIDE window_ok / lanes_ok / sight_ok rather than replacing any of them, so a window DRIFT still adopts exactly as before and only a different DECISION relaunches. That preserves the optimization #4284 depends on while removing the case where it hides a plan change.

Reading the decision off the engine own argv (LaunchKv) rather than from a record is right for the reason the snapshot law names: a record describes what was asked, the process describes what is running, and the whole defect was the gap between them. cache_type_or_default returning f16 for a missing flag is the subtle part and you got it the right way round — no flag is a VALUE, the engine default, not an absence. Treating it as unknown would have made every pre-fix engine permanently adoptable, which is precisely the state we are trying to leave.

"Unknown is not a mismatch" is the correct companion: a lane we cannot read must not be relaunched on suspicion, or a recovery path turns into a restart loop.

serving.grow naming both geometries means the relaunch is a receipt rather than a mystery, which is what was missing tonight — the 5090 sat on a stale f16 engine under a q8_0 plan and nothing said so.

Merging on green. This is the last thing standing between that box and the lane it should have had all along: it runs 86d1fe8 now, so once this lands its next reconcile relaunches onto the decision instead of inheriting last deploy.

@joelteply
joelteply enabled auto-merge (squash) September 21, 2026 01:24
@joelteply
joelteply merged commit 8438f80 into canary Sep 21, 2026
6 checks passed
@joelteply
joelteply deleted the fix/adopt-against-the-kv-decision branch September 21, 2026 01:44
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