Repository navigation
server: POST /lora-adapters/snapshot writes a mind's shadow to an immutable GGUF between steps, and /learn reports the shadow's committed step - #86
Closed
joelteply wants to merge 3 commits into
Conversation
joelteply
force-pushed
the
cormac/per-mind-shadow
branch
from
November 7, 2026 17:21
12cf0ea to
7d885c8
Compare
joelteply
force-pushed
the
cormac/shadow-snapshot
branch
from
November 7, 2026 17:21
264a110 to
ba57277
Compare
… its own optimizer, /learn trains any loaded shadow, and unload releases it A serving context trained exactly one shadow per server run (learn_lora_id): the second mind's /learn was refused, so only one resident could ever learn in place (continuum S4 (a), card eaeb2b87). - llama_context keeps an optimizer per shadow (opt_minds); opt_ctx and opt_shadow point at the active one, so every training site reads the active pair as before. llama_opt_init with another adapter on a configured context selects it (opt_select), creating its optimizer the first time and keeping each shadow's moments and accumulators across switches. Only the active shadow's tensors carry the PARAM flag, so a graph never carries a parameter the active optimizer was not built with. - opt_configured() is "this context is sized for training" (scheduler and graph): it was read as opt_ctx != nullptr, which a released active shadow would have falsified while other shadows' optimizers still held the scheduler. - llama_opt_release forgets one shadow's optimizer; the server's unload releases a shadow that learned (its moments go; a snapshot is the durable form) instead of refusing it forever. - learn-every-format.py --two-minds: two shadows from the same file learn alternately; their losses match step for step (4.3179, 4.3179, 3.5043, 3.5043 on Qwen2.5-0.5B, IntelMac CPU), which holds only if each keeps its own weights and optimizer. --shadow-retirement now unloads a bound shadow and learns on a reloaded one. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…g changes, never asserted (Fable on #85) opt_select (another mind's shadow) GGML_ASSERTed on caller input: a learn naming a loaded F16 copy of a shadow killed the serving process (exit 134 at llama-context-opt.cpp:205), and the same asserts sat on the first learn. Now one validator, llama_context::opt_untrainable (attached at a non-zero scale, every A/B F32, the filter selecting at least one tensor), runs in opt_init and opt_select before any parameter flag changes; on failure opt_failure says why and llama_opt_init returns false. The /learn path restores her adapter set and refuses the learn by name; /train fails the run by name. Test: learn-every-format.py --non-f32-refused (make-f16-shadow.py writes the F16 copy): the F32 shadow learns, its F16 copy is refused naming non-F32, /health answers, and the F32 shadow learns again. The default and --two-minds modes pass unchanged (CPU, Qwen2.5-0.5B, --no-repack). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply
force-pushed
the
cormac/per-mind-shadow
branch
from
November 7, 2026 18:58
7d885c8 to
f359df5
Compare
…utable GGUF between steps, and /learn reports the shadow's committed step
What a shadow learned on a serving context lived only in memory: a restart
lost it, and nothing could hand it to a gene trial (continuum S4 (d), card
76b05d2a; ONE-RESIDENT-MODEL §9.2 "Snapshot").
- POST /lora-adapters/snapshot {id, name}: on the server loop, between
steps (never a half-applied update), the adapter's current weights are
written beside the name and renamed into place inside --train-dir
(confine_out, the load route's rule). An existing name is refused: a
snapshot is immutable. The reply carries the path, bytes and the steps
the shadow had committed.
- /learn's outcome carries step: the shadow's committed optimizer steps
after this one (each shadow counted on its own; unload forgets it), the
commit the core's cursor stands on.
- learn-every-format.py --snapshot: two steps (step 1, 2), a snapshot at
steps 2, a second snapshot of that name refused, and the snapshot loaded
under a new id shows the forward loss the shadow showed at its third
step (2.526167, both), so the file is the trained weights. Qwen2.5-0.5B,
IntelMac CPU, fresh server.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply
force-pushed
the
cormac/shadow-snapshot
branch
from
November 7, 2026 19:24
ba57277 to
570984c
Compare
joelteply
force-pushed
the
cormac/per-mind-shadow
branch
from
November 8, 2026 22:23
f359df5 to
c534ae8
Compare
Author
|
Superseded by the one save route: Codex's #81 /lora-adapters/save (immutable publication via staging + no-replace link) now carries this PR's committed-step report, ported as cormac/save-reports-steps 665f80d and merged on codex/s4-per-mind-integration at c96c2bb. The step count is the shadow's own optimizer's (llama_opt_shadow_steps), not this PR's server-side learn_steps tally. Branch kept, not deleted. |
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.
What a shadow learned on a serving context lived only in memory: a restart
lost it, and nothing could hand it to a gene trial (continuum S4 (d), card
76b05d2a; ONE-RESIDENT-MODEL §9.2 "Snapshot").
steps (never a half-applied update), the adapter's current weights are
written beside the name and renamed into place inside --train-dir
(confine_out, the load route's rule). An existing name is refused: a
snapshot is immutable. The reply carries the path, bytes and the steps
the shadow had committed.
after this one (each shadow counted on its own; unload forgets it), the
commit the core's cursor stands on.
steps 2, a second snapshot of that name refused, and the snapshot loaded
under a new id shows the forward loss the shadow showed at its third
step (2.526167, both), so the file is the trained weights. Qwen2.5-0.5B,
IntelMac CPU, fresh server.
Co-Authored-By: Claude Opus 5.5 (1M context) [email protected]
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE