Repository navigation
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
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
/slotsnames no checkpoint positions).What it asserts
/apply-template+/tokenize), resumes from exactly the largest held checkpoint at or before the divergence. A restore resumes at that checkpoint'spos_max(forkserver-context.cpp:pos_next = min(pos_next, max(pos_min + 1, pos_max)), upstream TAG_PROMPT_LOGITS), socache_n= expected − 1.The earlier version's divergence fell before the head under this model's template, so
cached 0was 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