Skip to content

One owner of a mind's checkpoints (checkpoint_store) - #140

Open
joelteply wants to merge 3 commits into
fable/mind-switch-s4from
fable/checkpoint-store
Open

joelteply wants to merge 3 commits into
fable/mind-switch-s4from
fable/checkpoint-store

Conversation

@joelteply

Copy link
Copy Markdown

Stacked on #139. Each mind's checkpoints are what make her switch nearly free and her learning possible; today 13 call sites across 5 files each decided part of what she keeps. Two of today's defects were one site not knowing another's rule:

  • the close-checkpoint eviction erased learn pins, so no pin survived her next turn;
  • the host budget and the count evicted in two different orders.

server_prompt::checkpoints is now a checkpoint_store, and its list is private. Callers read it or call one of its methods (make_room, keep, evict_one, drop_past_position, cut_back_to, release, learned_at, replace, take, clear, stop_at_user_start), so the compiler stops a new rule landing at a call site.

One eviction order for the count and the budget: never a pin; first the oldest that is neither her head nor her newest; then her head; her newest last.

Measured (M5, 2026-11-16)

  • test-server-checkpoint-store: 11/11 (the 6 placed-checkpoint cases kept, 5 added for the defects above).
  • qwen35-0.8b, --cache-ram 60, three minds through two lanes, 3 rounds: 6/6 returns cache_n 3300, 8 trips to flash, 0 refusals (same as before).
  • Learn pins: parked, sent to flash, and released while on flash all behave as before.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

joelteply and others added 2 commits November 16, 2026 15:49
…eckpoint_store whose list is private (Joel: "the problem is decentralized management")

Thirteen erase/evict sites in five files each decided part of what a mind keeps, and each had to know about pins,
the host budget, supersede and invalidation. Two of today's defects were one site not knowing: the close-checkpoint
eviction erased learn pins (no pin survived her next turn), and the host budget and the count evicted in two
different orders. Now the store is the only code that may change the list; callers read it or ask a verb:
make_room / keep (with its pin) / evict_one (the host budget) / drop_past_position (a diverged resume) /
cut_back_to (a slot learn) / release(pin) / learned_at / replace / take / clear / stop_at_user_start.

One eviction order, used by the count and the budget alike: never a pin; first the oldest that is neither her head
nor her newest; then her head; her newest (her resume point) last. The count with two checkpoints used to evict the
newest.

server-checkpoint-policy.h -> server-checkpoint-store.h; its test now drives the store: the six placed-checkpoint
cases kept, five added (a pin survives the close eviction, a full store of pins keeps one more, budget and count in
one order, release by id, divergence and cut-back).

Receipt (M5): test-server-checkpoint-store 11/11 ok. qwen35-0.8b, --cache-ram 60, three minds through two lanes,
3 rounds: 6/6 returns cache_n 3300, 8 to flash, 0 refusals (unchanged). Pins: parked / flash / released-on-flash
all as before. 0 warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…he previous commit carried only the renames: my git add failed on the moved path)

See the PR description and the previous commit message for the change and its receipt (11/11 native; 6/6 whole
returns under --cache-ram 60; pins parked / flash / released-on-flash unchanged).

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant