Skip to content

A persona checkpoint rewinds her to a stable boundary without moving her - #153

Open
joelteply wants to merge 4 commits into
fable/kv-stream-blocksfrom
fable/recurrent-checkpoint
Open

joelteply wants to merge 4 commits into
fable/kv-stream-blocksfrom
fable/recurrent-checkpoint

Conversation

@joelteply

Copy link
Copy Markdown

On the M5 a mind re-prefilled her whole prompt every act: reused 0 of 11k-30k tokens, and prefill was 65-85% of turn time (probe persona.engine.turn, continuum b762170061, 2026-11-18 23:55Z-00:00Z). Her prompt is append-only up to a volatile trailer: consecutive prompts share 90-97% of their characters (Aris's captures). But a hybrid's recurrent state can't go back, so once the trailer changed, nothing she held could be reused.

  • llama_persona_checkpoint_take copies a BOUND sequence's recurrent rows (every snapshot group), position and rollback index, without moving her. Her attention KV is not copied.
  • llama_persona_checkpoint_rewind writes the rows back and cuts what she holds past the checkpoint (seq_rm on attention). The next decode continues from the boundary.
  • Two-phase. A refused rewind leaves her as she was. A refused take leaves no checkpoint, so a later rewind refuses no_checkpoint instead of restoring a stale one. A rewind never moves forward (checkpoint_ahead). One checkpoint rewinds any number of times.
  • Per Codex's review on airc: no full native copy per turn, only the recurrent rows. The caller owns when to take one, at a stable prompt boundary, not at a chunk start.

Tested

  • Added test-persona-blocks case 8. After she decodes past the checkpoint, a rewind and then a different continuation must be byte-identical to decoding it in place. It runs twice from one checkpoint. A rewind of nothing taken, and a forward rewind, are both refused and change nothing. It runs under the existing hybrid and rollback-group tests.
  • Not compiled locally. The M5 is serving residents, so fork CI is the first build.

Measured

None yet. The live receipt is owed after the continuum driver uses it: reused tokens per act, checkpoint bytes, and act time on the M5. Owner Fable.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…moving her (CONTINUUM-ENGINE 4.15)

A mind re-prefilled her whole prompt every act on the M5 (2026-11-18, reused 0 of 11k-30k tokens per
act): her prompt is append-only up to a volatile trailer, but a hybrid's recurrent state cannot go back,
so nothing she held could be reused once the trailer changed.

llama_persona_checkpoint_take copies a BOUND sequence's recurrent rows (every snapshot group), position
and rollback index, without moving her; her attention KV is not copied. llama_persona_checkpoint_rewind
writes the rows back and cuts what she holds past the checkpoint (seq_rm on attention), so the next
decode continues from the boundary. Two-phase: a refused rewind leaves her as she was; a refused take
leaves no checkpoint; a rewind never moves forward (checkpoint_ahead); one checkpoint rewinds any number
of times. test-persona-blocks case 8: a different continuation after a rewind is byte-identical to
decoding it in place, twice, on the plain KV model, the hybrid, and the hybrid with rollback groups.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply and others added 2 commits November 18, 2026 18:41
…age (Codex on #153)

- A rewind checked only slot validity and position, so after a slot was reused the same layout and position
  could splice A's recurrent rows onto B's KV. Now llama_kv_cells carries a lineage, minted fresh on every reset
  and swapped with her cells between streams, and the lowest position cut since her last checkpoint (seq_rm,
  seq_add, seq_div note it). A rewind is refused checkpoint_stale for cells of another lineage or cut at or below
  its position, and wrong_owner for another persona or epoch (take and rewind now name the owner).
- A take on a memory with no persona move returned before clearing the old checkpoint; every refused take now
  leaves none.
- llama_persona_checkpoint_bytes reports allocated capacity, what the governor must count, not the last take's size.
- test-persona-blocks case 8 adds: B in A's slot (same layout, same length) refuses A's checkpoint as stale and
  under B's owner as wrong_owner, B untouched; and A's checkpoint follows her through a save and a load into the
  other stream, continuing byte-identically.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…serial on her cells; Codex on #153 at 12a9877)

A take reset the lowest-cut receipt, so an older checkpoint whose positions were cut and refilled to the same
length kept rewinding. The cells now carry a checkpoint serial (swapped with them); each take bumps it and a
rewind requires it. test-persona-blocks case 8: take A, cut below it and refill a different suffix, take B; A is
refused checkpoint_stale and B still rewinds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
… hybrid's attention lineage guards a rewind

Codex on #153: on pure recurrent memory persona_check_rewind had no lineage, newest-take or
lowest-cut check, so after slot reuse an unshared tail at a sufficient position could pass where the KV path would
refuse. Recurrent memory has no lineage to check, so it no longer overrides the checkpoint verbs: standalone, it
inherits the base refusal (unsupported). Its row copies become persona_check_checkpoint_rows and siblings, called only
by llama_memory_hybrid after its attention half has checked lineage, serial and lowest cut.

Built and tested inside persona-files (test-persona-blocks on the hybrid test model and synthetic qwen35moe, both ok,
2026-11-19 08:47Z). test-persona-blocks does not run on pure recurrent memory: on synthetic mamba it fails at an earlier
attention-only stream case ('load over b's stream'), so the standalone refusal holds by construction (no override),
not by that test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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