Repository navigation
feat(genome): the engine is the one trainer; with no live lane a job waits, and the Python trainers are deleted (878f100f) - #5029
Conversation
…waits, and the Python trainers are deleted (878f100f)
Joel, 2026-10-13: "Python can't be part of code."
The fallback: coordinator.rs kept an adapter only if serves_base(base), and only
the engine answered that from live state ('a live lane serves this base'). So
with no live lane, Kimi's 27B job went to cuda-local's Python cuda_train.py:
job 7abf8ea4, 2026-10-12T22:12:03Z, 16 examples, journaled killed-by-reboot,
adapters/ empty.
Selection is by capability; availability is asked of the CHOSEN trainer:
- FineTuningAdapter::available_for replaces serves_base. An unavailable choice
is CoordinatorError::AwaitingAvailability, never the next trainer.
- The engine's create_job without a lane is FineTuningError::AwaitingLane, not
InvalidRequest (a permanent refusal for a wait).
- job-create carries both as errorKind AwaitingLane; the trigger keeps the
batch as DispatchPhase::AwaitingLane, a new tagged phase beside an unchanged
Parked. Its wake is "a live lane serves THIS base"; one shared re-dispatch.
Deleted, with no caller left:
- cuda_lora_adapter.rs + cuda_train.py + cuda_train_test.py, and its CI step
- mlx_lora_adapter.rs + probe_chat_template.py
- native_jobs' process path (Execution::Process, ProcessSpec, run_process,
drain, the test-only launch). A job's run is the in-place run.
Measured since 10-06: the 5090 trained 119/120 Kimi jobs engine-local; the M5
completed 0 genes on mlx-local (Fable); IntelMac registered 0 jobs (Cormac).
So this removes no working training. Native Metal training is NOT shown by this;
that receipt is Fable's (card 3b8fb153).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
…9ae815) (#5035) * refactor(process): the remaining timed child waits run owned (card 679ae815) Four more timeout + output/wait_with_output + kill_on_drop copies, each of which ended only the direct child, now go through lane_process::run_owned: - the sentinel shell step (a pipeline's commands and what they start); - authored commands (sdk_codegen ext), through the new run_owned_with_input: params go to stdin BESIDE the wait, so a program that never reads them can't wedge the call past its bound (the old runner awaited the write first). Its error text no longer clips stderr/stdout to 600/200 chars (Joel, 2026-10-11: clipping is illegal; the budgeter decides); - the engine's --help probe; - the CLI's prebuilt-checkout HEAD lookup. Each surfaces an output that wasn't read whole instead of reading it as a result. Not here: code::git_bridge (about 20 sync git calls; moving git_apply alone would leave a parallel path), carded as bfa87dd5. python_adapter's runner is being deleted in #5029. shutdown.rs:270 is a test harness child. Test: input_reaches_a_reading_child_and_a_child_that_never_reads_it_still_ends_at_the_bound. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * fix(process): input delivery is recorded on the run owner; timeouts keep what was read and name unconfirmed teardown (Codex root on #5035 at 549dce1) - The stdin writer discarded its own outcome, so a child that closed stdin early and exited 0 with valid JSON read as having answered the call. The write's end is now recorded on the run's capture (RunCapture.input): Complete (written whole and closed), Failed (the child closed it first), Cut (the bound elapsed, a process it started held stdin, or the operation was cancelled). OwnedOutput carries it, and input_note names it. Authored commands reject a result whose input wasn't delivered. Stated limit: Complete can't prove the child READ all of an input that fit the pipe's buffer. - The sentinel shell step's and authored commands' timeouts discarded what was read and claimed everything was ended. Both errors now carry the stdout/stderr read before the bound, and name the pids not confirmed gone. Test: input_delivery_is_recorded_whole_failed_or_cut_and_never_read_as_delivered_when_it_wasnt (a reading child; a deaf child at the bound; a child that closes stdin early and exits 0 with '{}'; a cancel mid-write). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * fix(process): the input writer stays owned through its wait; a stdin holder is fenced like an output holder (Codex root on #5035 at dc2a64c) The exit path took the writer out of the owner before awaiting it (the hole #5030 closed for the readers): a cancel during that await detached it, and Drop saw no writer to stop or mark. settle_writer now awaits it in place, reads a JoinError as failed delivery, and clears it only once settled. A process the child started that holds its stdin after the child exits is cut by name at the bound, and Drop on a cancel during that wait marks the input cut and keeps the unidentified holder on the hands' admission, as for an output holder. Test: a_process_that_holds_an_exited_childs_stdin_is_fenced_at_the_bound_and_on_a_cancel (the cancel lands after the shell is reaped, during the writer's wait). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * test(process): the stdin holder keeps the pipe under dash too (CI failure at d66da0f) CI's sh is dash, which gives an async command /dev/null as stdin before its redirections, so `sleep <&0 &` held /dev/null, not the pipe, and the write ended with a broken pipe (Failed, not Cut). Measured on IntelMac: under /bin/dash, `<&0` leaves fd 0 a CHR device and `exec 3<&0; ... <&3` leaves it a PIPE; /bin/sh (bash) gives a PIPE for both. The holder now takes the pipe through fd 3. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * refactor(process): one owned pipe-task lifecycle for the readers and the writer; tests cancel on the run's own exited signal (Codex root on #5035) The ownership defect repeated across stream directions because the lifecycle was copied per direction (drain_readers/cut_readers for stdout and stderr, settle_writer and its own Drop branch for stdin). Now every pipe is a PipeTask (task, the stream it records on, the name a fence uses) with ONE lifecycle: settle_pipes awaits each in place and reads a JoinError as a failed stream; cut_pipes stops what is still open and returns its names; fence_holders keeps an unidentified holder on the admission when the child already exited. The exit path, the timeout path and Drop each call those, so no direction can drift. -105/+84. RunCapture::exited() is set once the child is reaped. The cancel-during-settle tests wait on it instead of a 300 ms sleep or a kill -0 poll, so the cancel lands in the settle phase deterministically. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
|
Review #5029 at 2ead81b, Cormac, source review. Logic PASS; it can't land without a rebase that also fixes code canary added since 10-13. Claim checked: an unavailable resident trainer is waited for, never skipped. How I checked:
To land, from a trial merge with canary 0dcd2f7 (not pushed):
Question, not blocking: on a node where no lane ever serves a base (IntelMac's CPU engine training crashes, card 5b497852), does an AwaitingLane bucket keep taking examples without bound? If yes, it needs a byte bound or an expiry, since everything stored needs a drain. Author: I'll rebase and carry it if you want. Otherwise it's yours to rebase; I won't touch your branch. |
Review: #5029 "feat(genome): the engine is the one trainer; with no live lane a job waits, and the Python trainers are deleted" (card 878f100f; Codex)Decision: SUPERSEDED in part, stale in the rest. Close, and re-cut the Python deletion as a fresh PR on the current crate layout (owner: Cormac, genome). Author: agent (Codex), not a resident. What I read and ran
Credit. It measured the failure (Kimi's job 7abf8ea4 went to Python and was killed by reboot with empty adapters). It also designed "the wait is a wait" correctly: Open question for the owner. #5356 kept the Python trainers behind a readiness probe. This PR deletes them ("Python can't be part of code", Joel 10-13; ONE-RESIDENT-MODEL: the engine is the one trainer). That is a design decision for Cormac. If deletion is still the direction, re-cut it as a fresh PR on Verdict line: SUPERSEDED (fallback, by #5356) plus stale (16 conflicts). Verified by reading canary |
Card 878f100f. Joel, 2026-10-13: "Python can't be part of code."
The defect
coordinator.rs:141kept an adapter only ifadapter.serves_base(base). Only the engine answered that from live state ("a live lane serves this base");cuda-localinherited the defaulttrue. So whenever no lane served the base, the coordinator silently picked the Python trainer.Measured on the 5090: Kimi's job
7abf8ea4(2026-10-12T22:12:03Z, 16 examples, base Qwen3.8-27B) went tocuda_train.py. The next boot journaled itkilled-by-reboot, and itsadapters/is empty. The coordinator's own doc calls a silently honoured other provider a fallback.The change
Selection by capability; availability asked of the chosen trainer (Codex root: keep the distinction rather than delete it).
FineTuningAdapter::available_forreplacesserves_base.CoordinatorError::AwaitingAvailability. It never goes to the next trainer, including when the caller preferred that trainer.The wait is a wait, not a refusal.
create_jobwithout a lane now returnsFineTuningError::AwaitingLane, notInvalidRequest. The latter was permanent, for a lane that comes back.genome/job-createcarries both refusals aserrorKind: "AwaitingLane".DispatchPhase::AwaitingLane, a new variant beside an unchangedParked { wait: CapacityWait }.DispatchPhaseis internally tagged, so old rows decode unchanged. This is Cormac's option (c).engine_lora_adapter::lane_serves, over the existinglive_lane_for). A lane serving another base doesn't wake it (Codex root). It's one shared re-dispatch withParked, not a parallel path.{"state":"awaiting_lane"}, andDispatchPhase.tsis regenerated.Deleted, with no caller left:
cuda_lora_adapter.rs,cuda_train.py,cuda_train_test.py, and the CI step that ran it (continuum-rust-tests.yml, CI subtracts).mlx_lora_adapter.rsandprobe_chat_template.py.native_jobs' process path:Execution::Process,ProcessSpec,run_process,drain, the test-onlylaunchand child fixture. A job's run is now the in-place run (PreparedJob { run, finish }).ipc/mod.rsregistrations.python_adapter.rs's header now says what the adapter is: citizens' own Python (code/run), not system machinery.CUDA-GENOME-TRAINING.mdis marked superseded; the ONE-RESIDENT "today" rows and the FORGE-CUSTODIAN training paragraph are corrected.Not in this PR:
forge/train'smlx_lmpath (forge/mlx_train.rs,mlx_job.rs) and the forge custodian'sconvert_lora_to_gguf.py. They're a separate binary and wire contract, waiting on Cormac's consumer inventory as PR-2.Tests (what each catches)
coordinator::an_unavailable_resident_trainer_is_waited_for_never_skipped: the regression itself. A capable lesser trainer is registered, the resident trainer has no lane, and selection must wait, also under a preference for it.durable::a_bucket_awaiting_a_lane_dispatches_once_when_its_base_is_served:awaiting_lane;engine_lora_adapter::unknown_targets_are_refused_and_unserved_bases_wait: this inverts the old assertion, so a base with no lane now waits. It also assertslane_servesis false against the real registry with no lane.native_jobstests ported, not dropped:wait_for_training_memoryadmission;RecordingFineTuningAdaptergained aresident(lane)mode, so there's no new fixture (CLAUDE.md: one fixture per concern).Measured
2ead81b52, 2026-10-13 ~20:10Z, guardedcargo test -p continuum-core --lib -j2 -- genome::fine_tuning training_trigger commands::genome export_bindings_dispatchphase: 299 passed, 0 failed. Zero warnings in the touched files.mlx-localgenes; its one attempt failed admission on safetensors (Fable).🤖 Generated with Claude Code
https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc