Skip to content

Native proof for llama.cpp#121: the head survives a full and a low-capacity store; a divergence resumes from exactly the held checkpoint - #6082

Open
joelteply wants to merge 1 commit into
canaryfrom
fable/native-121-proof
Open

joelteply wants to merge 1 commit into
canaryfrom
fable/native-121-proof

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Gate for fork #121 (placed checkpoints), as Codex asked: exact head restoration on a full store and at low capacity, with a precise resume assertion instead of cache_n > 0.

Run (2026-11-16, gemma-3-270m-it-Q8_0, sliding-window so its prompts checkpoint)

  • Build(deps): Bump actions/stale from 9 to 10 #121 e6cd328ce: 2 passed. Store 4 held [194, 292, 309, 326], diverged at token 213, cached 193 (= head 194 − 1). Store 2 held [210, 326], cached 209.
  • Pinned engine b5534b531: both red (/slots names no checkpoint positions).

What it asserts

  • The head keeps its exact position through every act with view spans, and the store never grows past its size.
  • A prompt diverging at the first act boundary past the head, found from the engine's own tokens (/apply-template + /tokenize), resumes from exactly the largest held checkpoint at or before the divergence. A restore resumes at that checkpoint's pos_max (fork server-context.cpp: pos_next = min(pos_next, max(pos_min + 1, pos_max)), upstream TAG_PROMPT_LOGITS), so cache_n = expected − 1.

The earlier version's divergence fell before the head under this model's template, so cached 0 was correct behaviour, not a failed restore. Choosing the divergence from tokens removes that guess. Oversized entries and failed-copy preservation are pool behaviours (CONTINUUM-ENGINE 4.7.6 reservations, #6081) and get proven by the pool's native tests.

Run: CONTINUUM_NATIVE_ENGINE_BIN=<fork llama-server> CONTINUUM_NATIVE_CHECKPOINT_MODEL=<sliding-window or hybrid gguf> cargo test -p continuum-engine --lib native_checkpoints -- --ignored --test-threads 1

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…pacity store, and a divergence resumes from exactly the held checkpoint

Codex on #121 (e6cd328ce): "prove exact head restoration with full store/low capacity ... cache_n>0
is insufficient". The proof is now one helper run at a store of 4 and of 2. Each fills the store
with blind step checkpoints, acts with view spans, and asserts the head's exact position after every
act and the store never past its size. It then diverges at the first act boundary past the head,
found from the engine's own tokens (/apply-template, /tokenize), and asserts the resume is exactly the
largest held checkpoint at or before the divergence. A restore resumes at that checkpoint's pos_max,
one before its token count (fork server-context.cpp, upstream TAG_PROMPT_LOGITS), so cache_n is
expected - 1.

Run 2026-11-16 with gemma-3-270m-it-Q8_0 (sliding-window, so its prompts checkpoint):
- #121 e6cd328ce: 2 passed. Store 4 held [194, 292, 309, 326], diverged at 213, cached 193.
  Store 2 held [210, 326], cached 209.
- pinned engine (b5534b531): both red, "the engine names its checkpoint positions (llama.cpp#121)".

The first version's divergence (the first act with a new ask) fell before the head with this
model's template, so cached 0 was correct behaviour, not a failed restore; choosing the divergence by
tokens removes that guess. Oversize and failed-copy preservation are pool behaviours (CONTINUUM-ENGINE
4.7.6 reservations) and are proven by the pool's native tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
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