Skip to content

feat(serving): a new gene joins the running engine in place, no relaunch (charter S1; pin fb6b7fdb4) - #4467

Merged
joelteply merged 5 commits into
canaryfrom
feat/a-new-gene-joins-the-running-engine
Sep 27, 2026
Merged

joelteply merged 5 commits into
canaryfrom
feat/a-new-gene-joins-the-running-engine

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Until now a changed gene set on the same base was a relaunch: every turn in flight
killed and every slot re-prefilled, for an adapter of a few MB. The fork (#26) now
loads and retires adapters at runtime, so the genome check asks the engine first:

  • LlamaServerControl::adopt_genome_in_place (default: Unsupported, the old relaunch).
    The engine stages each new gene into its --train-dir (a hard link, else a copy) under
    gene_stage_name (a bare .gguf, hashed on the full path so two adapter.gguf never
    collide), POSTs /lora-adapters/load (dormant at scale 0), and retires each dropped
    gene with /unload by the id GET /lora-adapters reports.
  • Retire first: an unload refused because a turn holds the gene (503) changes nothing,
    and the whole change waits a tick (serving.genome.in_place_busy) instead of killing
    that turn. An engine without the routes (404), or no --train-dir, relaunches as
    before; any other failure relaunches onto the target set (in_place_failed).
  • The OpenAI adapter resolves a request's gene by its staged name too, since the
    catalog lists a runtime-loaded gene under its --train-dir path.
  • LLAMA_CPP_PIN and the submodule move to fb6b7fdb4 (fork Prepare for Lerna 8 upgrade #26).

Not compiled locally (the M5 serves); CI compiles. Engines converge onto fb6b7fdb4 through #4464 on the Macs and continuum install on Windows.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…nch (charter S1, card 49b5e806; pin fb6b7fdb4)

Until now a changed gene set on the same base was a relaunch: every turn in flight
killed and every slot re-prefilled, for an adapter of a few MB. The fork (#26) now
loads and retires adapters at runtime, so the genome check asks the engine first:

- LlamaServerControl::adopt_genome_in_place (default: Unsupported, the old relaunch).
  The engine stages each new gene into its --train-dir (a hard link, else a copy) under
  gene_stage_name (a bare .gguf, hashed on the full path so two adapter.gguf never
  collide), POSTs /lora-adapters/load (dormant at scale 0), and retires each dropped
  gene with /unload by the id GET /lora-adapters reports.
- Retire first: an unload refused because a turn holds the gene (503) changes nothing,
  and the whole change waits a tick (serving.genome.in_place_busy) instead of killing
  that turn. An engine without the routes (404), or no --train-dir, relaunches as
  before; any other failure relaunches onto the target set (in_place_failed).
- The OpenAI adapter resolves a request's gene by its staged name too, since the
  catalog lists a runtime-loaded gene under its --train-dir path.
- LLAMA_CPP_PIN and the submodule move to fb6b7fdb4 (fork #26).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

CHANGES REQUESTED at 36eb75d (Cormac). I read the code and did not build it.

Blocking 1: CI is red. source-hygiene fails on unjustified production unwraps: 2258 (baseline 2257). The new self.served_adapters.lock().unwrap() in adopt_genome_in_place (read at the top, write at the end) carries no same-line justification. The file's convention is // JUSTIFIED: poison means a prior panic ....

Blocking 2: Busy returns AlreadyServing ahead of every other reason to relaunch. ensure_model_serving_if_current returns early on GenomeInPlace::Busy, before the window grow-back, the lane grow-back, the KV/sight checks and #4464's engine-convergence operand. So while a retiring gene is active in some turn, a starved window, a lane squeezed to 1, or a stale engine is not looked at that tick. A persona with back-to-back turns on its old gene keeps the retire refused for as long as its turns run, and #4453/#4455 made those turns longer. The fix is small: treat Busy as "the served set stands for this tick" (genome_matches = true plus the probe) and fall through. If another check relaunches, the relaunch lands the target set anyway, and it had its own reason to.

Reads right:

Non-blocking:

  • stage_gene takes "same size" as "already staged". LoRA files of one rank and target set have identical sizes, so a gene rewritten at the same genome path (or a leftover link from a remove that failed) stages the OLD bytes, and a hard link keeps the old inode after a write-and-rename. Remove and re-link every time: the link costs nothing, and the copy fallback is rare.
  • LORA_LOAD_TIMEOUT is 120 s per gene inside one reconcile step, and the daemon calls a step wedged at 180 s (serving.reconcile.wedged). Two slow loads would read as a wedge. Either one budget for the whole change, or have the wedge bound count the loads.
  • The Busy arm has a test, but nothing covers the partial-retire or partial-load paths. A FakeControl that answers Done then Busy would pin the "nothing half-applied is recorded" claim.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

@joelteply

Copy link
Copy Markdown
Contributor Author

@fable #4467 at f962af8: APPROVED (Cormac). 8/8 green, lib-test included, so the new axum regression runs in CI. I read the code and did not build it.

  • My two blockers are fixed. Busy keeps the served set for the tick and falls through to the window, lane and engine checks. Both lock unwraps are justified.
  • Genes are always re-staged (remove, then link or copy), so a same-size retrain can't load the old bytes.
  • Codex's partial-retire finding is fixed. Each accepted step is recorded as it happens (record(false) on unload or absent, record(true) on load). The recorded set stays sorted, and adapter_paths() sorts too, so a completed change compares equal and doesn't re-adopt every tick. The axum test pins [A,B]→[C] with B busy: Busy, the served set is exactly [B], and zero loads of C.
  • The pin to fb6b7fdb4 is fork Prepare for Lerna 8 upgrade #26 as merged.

Still open, non-blocking: LORA_LOAD_TIMEOUT 120 s per gene inside one reconcile step, against the 180 s wedge bound.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

@joelteply
joelteply merged commit 493ee66 into canary Sep 27, 2026
8 checks passed
@joelteply
joelteply deleted the feat/a-new-gene-joins-the-running-engine branch September 27, 2026 18:31
joelteply added a commit that referenced this pull request Sep 27, 2026
…eval A/B beside it (integrated gate, slice 3)

The completion sentinel ran cognition/eval in A/B mode on a forked copy of her mind and
paged the gene in on lift > 0: the parallel path Joel ruled out ("The point is integrated
not parallel"). Now a completed job is converted as before, then:

- pre-filter: training's own held-out loss must be a finite number (a diverged or
  unmeasured run never reaches her work), probe genome.trial.refused otherwise;
- registered in the adapter manifest under its served base, so the engine loads it in
  place and dormant (#4467); engine-trained GGUF genes were never registered before;
- a GeneTrial opens (slice 2's file), probe genome.trial.opened.

Nothing is paged in here and nothing is decided: each card she works now draws an arm,
and the gate (next slice) promotes or retires the gene from the room's outcomes. The
recipe's eval gym is no longer required; the signature stamp stays.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Sep 27, 2026
… jobs instead of never running (the M5 could not deploy) (#4478)

* fix(deploy): a warm build beside a lane that fills memory takes fewer jobs instead of never running (the M5 could not deploy)

The warm build refused below a fixed 12 GiB free. The M5 serving the 27B at 4 lanes
(llama-server 29.5 GB, core 4.4 GB) sat at 10.4 GiB, so every tracker pass from 19:33Z
on 2026-09-27 was refused ("no artifact to hand the supervisor") and the node stayed on
c9ee8b1 under a day of merges (#4457, #4467, #4468, #4471). A node whose lane fills
its memory never deployed.

Now 12 GiB free still runs at cargo's own job count; below it the build takes one job
per 3 GiB above a 4 GiB reserve for the citizens and the core (rustc's codegen threads
draw on the same jobserver, so fewer jobs is less memory), at least one; the refusal
moves to the floor of one job plus the reserve (7 GiB). When a CPU-served lane also caps
the build (#4471), the smaller budget wins. The engine build reads the same
CARGO_BUILD_JOBS.

Pre-registered: the M5's first warm build under this runs at 2 jobs at ~10 GiB free and
completes with memory.pressure never reaching critical and no citizen generation dropped
during the build window.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* refactor(deploy): the warm build's memory budget lives in the lib beside the CPU budget, so CI runs its test (Codex on #4478: CLI tests run only by name)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
joelteply added a commit that referenced this pull request Sep 27, 2026
…eval A/B beside it (integrated gate, slice 3)

The completion sentinel ran cognition/eval in A/B mode on a forked copy of her mind and
paged the gene in on lift > 0: the parallel path Joel ruled out ("The point is integrated
not parallel"). Now a completed job is converted as before, then:

- pre-filter: training's own held-out loss must be a finite number (a diverged or
  unmeasured run never reaches her work), probe genome.trial.refused otherwise;
- registered in the adapter manifest under its served base, so the engine loads it in
  place and dormant (#4467); engine-trained GGUF genes were never registered before;
- a GeneTrial opens (slice 2's file), probe genome.trial.opened.

Nothing is paged in here and nothing is decided: each card she works now draws an arm,
and the gate (next slice) promotes or retires the gene from the room's outcomes. The
recipe's eval gym is no longer required; the signature stamp stays.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Sep 27, 2026
…eval A/B beside it (integrated gate, slice 3; stacked on #4474) (#4475)

* feat(genome): her genes ride her card: gene trials, a per-card arm, pinned around each work turn (integrated promotion gate, slice 2)

Joel, 2026-09-27: "The point is integrated not parallel." A trained gene is judged in
her own work. genome/gene_trial.rs holds the trial file (~/.continuum/genome/trials.json,
bounded by genes ever trialled): a GeneTrial per candidate gene (persona, alias, path,
base, share, state Trial/Promoted/Retired, the verdict and its counts: the adoption
receipt and the rollback record). GeneTrial::candidate_arm draws one arm per (trial,
card), so every turn of a card, across restarts, runs the same genome; genes_for_turn
gives her promoted genes plus each open trial's gene when the card drew it, and on a
turn with no card (conversation) the promoted genome alone.

persona/act_question.rs pins those genes on her cycle before a work turn and puts her
promoted genome back after it, the same seam that roots her hands at the card's
workspace. Probe persona.genome.card_genes. An unreadable trial file or no served base
leaves her genome as it is (genome.trial.unreadable).

PERSONA-COGNITION-PIPELINE.md's landing table gets the row. Next slices: the completion
sentinel opens a trial instead of its eval A/B, and the gate tallies settled credit by
receipt genes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(genome): her genome is restored from a pre-turn snapshot in a drop guard, so a cancelled turn or an unreadable trial file never leaves a trial gene on her conversation turns (Cormac on #4474)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* feat(genome): a trained gene opens a trial in her work instead of an eval A/B beside it (integrated gate, slice 3)

The completion sentinel ran cognition/eval in A/B mode on a forked copy of her mind and
paged the gene in on lift > 0: the parallel path Joel ruled out ("The point is integrated
not parallel"). Now a completed job is converted as before, then:

- pre-filter: training's own held-out loss must be a finite number (a diverged or
  unmeasured run never reaches her work), probe genome.trial.refused otherwise;
- registered in the adapter manifest under its served base, so the engine loads it in
  place and dormant (#4467); engine-trained GGUF genes were never registered before;
- a GeneTrial opens (slice 2's file), probe genome.trial.opened.

Nothing is paged in here and nothing is decided: each card she works now draws an arm,
and the gate (next slice) promotes or retires the gene from the room's outcomes. The
recipe's eval gym is no longer required; the signature stamp stays.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
joelteply added a commit that referenced this pull request Sep 28, 2026
…read it (#4520)

* fix(genome): a gene trial's receipt names the loss it read, held-out or training, and eval_set docs stop claiming adoption reads it (Codex, attempt 2)

The sentinel's pre-filter fell back from final_validation_loss to final_loss and
reported either one as validation_loss, which the probe text called held-out. A run
with val_split 0 has no held-out proof, so its receipt claimed one. The probes now carry
loss plus loss_kind (held_out | training), and the gate says what it is: a sanity check,
never evidence of gain.

Three doc comments (TrainingJobRequest::eval_set, WatchedJob::eval_set, the trigger
bucket's eval_set) still said the sentinel passes eval_set to an A/B cognition/eval and
refuses to adopt without it. It does neither since the integrated trial (#4467 era).
They now say it is a manual spot-check gym that adoption does not read.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* scope: leave the sentinel's loss provenance to #4519 (Codex); this PR keeps only the eval_set docs

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* docs(genome): the two remaining eval_set docs, and regenerate the three ts-rs bindings that carry them

training_trigger/submit.rs and persona/training_producer.rs said the sentinel
refuses to adopt without a gym. TrainingJobRequest.ts, JobCreateParams.ts (flattened)
and SubmitParams.ts carry the doc comments, so they change with them (Cormac on #4520).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

---------

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