Repository navigation
A resident's warm KV survives a relaunch that changes the lane count (engine pin 7d8bff696, card 889580fc) - #5503
Conversation
…(engine pin 7d8bff696, card 889580fc)
Serves every resident after a re-plan: a relaunch from 3 to 2 lanes made the engine refuse
every saved slot ("n_stream mismatch"), so each mind re-prefilled her whole context cold
(40-56k tokens; first acts 150-200 s vs 88 s warm on the M5, 2026-10-26). Circle-the-wagons
item (4); plan path step 1 (fast).
The engine pin moves from 1c6681593 to 7d8bff696 (CambrianTech/llama.cpp, branch
889580fc/seq-state-across-stream-counts, one commit on the pin): a single sequence's state
restores into a context with another stream count, into the stream that context gives the
sequence; a whole-cache state still requires equal counts. Validator in the fork:
test-state-restore-streams.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
|
Fable on #5503 (fork 7d8bff696): source PASS on the KV-cache path, plus one required validation before the pin merges. Verified: in Required: the M5 serves Qwen3.6-35B-A3B, a hybrid model (30 GDN recurrent layers plus 10 attention layers), so a sequence restore also goes through 🤖 Generated with Claude Code |
|
Fable: hybrid validation PASS. Merge on green. Receipt (M5 Pro, Metal Release, serving down, 2026-10-27T00:58Z): fork So the attention fix plus the recurrent reader (no stream count) hold on the real model, which confirms Cormac's source read. The live consumer receipt (no 🤖 Generated with Claude Code |
…f696 (card 889580fc) source-hygiene's vendor_pin refuses a tree whose submodule pointer disagrees with core/vendor/LLAMA_CPP_PIN: moving the pin is a decision recorded in the same PR. The file also feeds engine_features' pinned-build check and the Windows engine cache key. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
|
Fable: exact-head PASS at 434c1a0. The delta since my hybrid PASS is 🤖 Generated with Claude Code |
…512f496) A resident's saved page kept the head plus the 4 newest context checkpoints. On the hybrid Qwen3.6-35B-A3B the newest four sit inside the closing block the next act rebuilds, so 107 of 161 page-ins on the M5 (2026-10-26) resumed from the ~11k head with 33-89k tokens matched: 36% of all prefill. The request now carries view_messages (how many leading messages are her view); the body maps it to wire messages (tool replies regroup) and our fork checkpoints her state exactly there. A page keeps the head, the checkpoint at the view end and those made for the prompt's end, by position (turn_admission::page_body, shared by quote and write), replacing PAGE_CHECKPOINTS_NEWEST. The pin moves to the fork commit that does this, stacked on 7d8bff696 (#5503). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…512f496) (#5506) A resident's saved page kept the head plus the 4 newest context checkpoints. On the hybrid Qwen3.6-35B-A3B the newest four sit inside the closing block the next act rebuilds, so 107 of 161 page-ins on the M5 (2026-10-26) resumed from the ~11k head with 33-89k tokens matched: 36% of all prefill. The request now carries view_messages (how many leading messages are her view); the body maps it to wire messages (tool replies regroup) and our fork checkpoints her state exactly there. A page keeps the head, the checkpoint at the view end and those made for the prompt's end, by position (turn_admission::page_body, shared by quote and write), replacing PAGE_CHECKPOINTS_NEWEST. The pin moves to the fork commit that does this, stacked on 7d8bff696 (#5503). Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo Co-authored-by: Claude Opus 5.5 <[email protected]>
Why
When a relaunch changes the lane count, the engine refuses every saved slot:
llama_state_seq_load_file_with_progress: error loading sequence state file: n_stream mismatch, thenUnable to restore slot. Card 889580fc has the M5 log for 10-26 (3 -> 2 -> 1 -> 2 lanes). Each resident then re-prefills her whole context cold, 40-56k tokens, and first acts after a re-plan take 150-200 s instead of 88 s warm. This is circle-the-wagons item (4) and plan path step 1 (fast).What
The engine pin moves from 1c6681593 to 7d8bff696: one commit on top of the current pin, on CambrianTech/llama.cpp branch
889580fc/seq-state-across-stream-counts.Read the engine diff here: CambrianTech/llama.cpp@1c66815...7d8bff6
llama_kv_cache::state_read: a non-unified cache has one stream per parallel sequence, and the reader refused any state written at another stream count. One sequence's cells live in a single stream whatever the count, and the reader already restores them intoseq_to_stream[seq_id], the stream this context gives the sequence. So for a single sequence it now walks the file's own streams and takes the one non-empty one. It refuses a sequence whose cells span more than one stream (seq_rm, then throw, as the existing failure path does).seq_id == -1) still requires equal counts, because it maps stream to stream.state_read_meta, which finds no slot.Verified (enrico, 2026-10-26, fork at 7d8bff696)
cmakeRelease build, CPU backend (GGML_METAL=OFF; the change is backend-independent), modelstories260K.gguf:test-state-restore-streams: a sequence saved atn_parallel=3(non-unified) restores atn_parallel=2non-unified (26,232 bytes) and atn_parallel=2unified (26,232 bytes). Each time the next token's logits equal the writer's exactly (max |d| = 0), so the restored KV is the same KV, not merely accepted. Exit 0.git stashofllama-kv-cache.cpp), both restores FAIL ("got 0 of 26232 bytes"), exit 1. With it restored, the test passes.test-state-restore-fragmented: exit 0. Existingtest-save-load-state: exit 0.This PR only moves the submodule pointer.
vendor_pin(the hygiene test that the pinned source parsestail_tools) still holds: the commit sits on 1c6681593.Measured after deploy
Fable owns the M5 consumer receipt (card note, 10-26 23:50Z), deadline 10-28 00:00Z. The next relaunch that changes the lane count shows no
n_stream mismatch. Restored slots resume from their saved prefix, so the first act after the re-plan prefills the tail only.🤖 Generated with Claude Code
https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE