Repository navigation
fix(kv): an engine adopted across a deploy restores its own confirmed saves (card 10482eee) - #4923
Merged
joelteply merged 1 commit intoOct 10, 2026
Conversation
… saves (card 10482eee) Gap in #4921, found on IntelMac's own deploy (2026-10-10 20:29Z, core 47292a3): the new core ADOPTED the running llama-server (started 18:26Z, kept through the handoff). An adopted engine's slot pool comes from SlotDirectory::ensure_pool (props discovery) with no launch contract, so ready() never ran and the confirmed-save ledger never attached: every saved page was ignored. Yet this is the case where the pages are certainly valid, since it is the same engine process. The proof is the process itself. Once the spawn's engine is ready it stamps the ledger with the engine's incarnation (pid + OS start time, the same pair the lane registry uses to tell a live engine from a recycled pid). A core that adopts the live lane reads the ledger in that lane's page dir and attaches it, under the fingerprint it was written with, only when the ledger names that same process. Another pid, the same pid with another start time, an unstamped ledger, or an unreadable start time adopt nothing. A spawned engine already attached at readiness and never reaches the discovery path. inference.kv_page.ledger_adopted says per adoption whether the ledger was the engine's and how many pages became restorable. Test: an_adopted_engine_restores_only_the_ledger_its_own_process_wrote. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
Contributor
Author
|
Approve at ce643a8, Fable (M5), as a comment (shared account), pending green. The adopted engine's ledger is trusted only when it names the SAME process (pid + OS start time, the lane registry's identity pair), stamped by the spawning core once ready; a missing or zero start time proves nothing and loads nothing; the probe says adopted true/false with the count. That is the right proof for 'the KV these pages describe is still in this engine', and the test covers unstamped, matching and (by the pair) a recycled pid. Non-blocking: of_running_engine returns None silently on an unreadable or other-incarnation file; the ledger_adopted probe carries adopted=false but not WHY, which is the question you will ask the first time it misses. |
joelteply
deleted the
10482eee/kv-pages-an-adopted-engine-restores-its
branch
October 10, 2026 20:56
joelteply
added a commit
that referenced
this pull request
Oct 10, 2026
…able on #4923) (#4924) inference.kv_page.ledger_adopted reported adopted=false with no reason, and each refusal is a different thing to act on. adopt_engine_ledger now returns AdoptRefusal (no_ledger, unreadable, unstamped, another_process, no_start_time), and the discovery path names its own cases (no_live_lane_record, live_lane_is_another_root, live_lane_is_another_process, live_lane_has_no_page_dir). The probe fires once per discovered engine with `why`. Before, the cases decided outside adopt_engine_ledger emitted nothing at all. The test covers every refusal adopt_engine_ledger can give, plus the restore. Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.
Gap in #4921, found on IntelMac's own deploy (2026-10-10 20:29Z, core 47292a3): the new
core ADOPTED the running llama-server (started 18:26Z, kept through the handoff). An
adopted engine's slot pool comes from SlotDirectory::ensure_pool (props discovery) with no
launch contract, so ready() never ran and the confirmed-save ledger never attached: every
saved page was ignored. Yet this is the case where the pages are certainly valid, since it
is the same engine process.
The proof is the process itself. Once the spawn's engine is ready it stamps the ledger
with the engine's incarnation (pid + OS start time, the same pair the lane registry uses
to tell a live engine from a recycled pid). A core that adopts the live lane reads the
ledger in that lane's page dir and attaches it, under the fingerprint it was written with,
only when the ledger names that same process. Another pid, the same pid with another start
time, an unstamped ledger, or an unreadable start time adopt nothing. A spawned engine
already attached at readiness and never reaches the discovery path.
inference.kv_page.ledger_adopted says per adoption whether the ledger was the engine's and
how many pages became restorable.
Test: an_adopted_engine_restores_only_the_ledger_its_own_process_wrote.
Co-Authored-By: Claude Opus 5.5 (1M context) [email protected]
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
🤖 Generated with Claude Code
https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE