Repository navigation
fix(kv): a page's adapter sidecar is part of the page, so trims remove it and samples count it (card e5eaf9f4) - #4942
Merged
joelteply merged 1 commit intoOct 11, 2026
Conversation
…e it and samples count it (card e5eaf9f4) Fork #54 saves the adapter vector a state was computed under beside it (`.lora`), so a restore under the same adapters keeps its KV instead of being cleared by the next gene turn. The page store knew one sidecar (`.ckpt`), hard-coded in two scans, so a `.lora` would neither be counted in a state's size nor removed with its page: an orphan with no drain. One list (PAGE_SIDECARS) and one scan (pages_in), used by both the trim and the state samples. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
Contributor
Author
|
Approve at cebbb6a, Fable (M5), as a comment (shared account), pending green. One PAGE_SIDECARS list ([.ckpt, .lora]) and one pages_in scan now serve the state sizing, the disk seed and the trim, replacing two copies of the same directory walk, so a page is sized and removed whole with every sidecar (the test pins that a .lora never outlives its page). Independent of the fork pin: it only counts and drains a file the new engine writes. |
joelteply
deleted the
e5eaf9f4/a-restored-kv-page-carries-its-adapter-v
branch
October 11, 2026 09:49
joelteply
added a commit
that referenced
this pull request
Oct 11, 2026
…dapters (fork #54) (#4947) One commit over af1a3c933: SLOT_SAVE writes a `.lora` sidecar (each loaded adapter's path, scale, file size and mtime), and SLOT_RESTORE sets the slot's adapters from it, refusing a missing or foreign one. A turn with genes after a restore then keeps the restored KV, instead of reading as an adapter change and clearing it (the 5090, card e5eaf9f4). An adapter-free task now runs the same change check. The core already drains `.lora` with its page (#4942). After deploy, each mind's first restore of a page saved before this is refused once (no sidecar): one cold prefill per mind, then the page is dropped. Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Why
Fork CambrianTech/llama.cpp#54 saves the adapter vector a KV state was computed under in a
.lorasidecar beside the page. Then a restore under the same adapters keeps its KV, instead of being cleared by the next gene turn (card e5eaf9f4).The page store knew only one sidecar,
.ckpt, and hard-coded it in two scans. A.lorawould therefore be left out of a state's measured size and never removed with its page: an orphan with no drain.What
PAGE_SIDECARS = [".ckpt", ".lora"], and one scan,pages_in. Both the trim and the state-sample seeding use them.trim_page_storeremoves a page with every sidecar on that list.trim_page_store_after_savemeasures a state as its page plus all its sidecars.Tests
These existing tests were extended rather than new ones added:
.lorasidecar is counted and removed with its page.a_restarted_core_measures_its_states_from_the_pages_on_disknow counts both sidecars.Merge order and the pin
This PR is safe ahead of the fork: with no
.lorafiles on disk, behaviour is unchanged. The pin bump to #54 follows in its own PR once #54 merges.Measured
Post-deploy, per fleet rule 1. On the 5090, after the pin bump, a gene turn after a restore keeps
cache_n > 0with no lora clear. Owner: Cormac. Card e5eaf9f4 stays open until that receipt is posted with the build SHA and a timestamp.🤖 Generated with Claude Code
https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE