Repository navigation
feat(lifecycle): a core restart re-attaches a still-training engine run under the same id and never POSTs it again (step 3, card 7bb4e5a2) - #4537
Conversation
…un under the same id and never POSTs it again (SHARED-RESIDENT-LIFECYCLE step 3, card 7bb4e5a2) At boot the job board journals every open job killed-by-reboot and the trigger resumed it from its input as a NEW job: for an in-engine run that survived a core-only restart, a second POST /train into the engine the first run is still training in. - ResidentWork carries job_spec: Option<EngineRunSpec>, written with the binding inside the admission hold: the adapter path, job dir, epochs, the asked split (SplitPpm, an exact integer so the record stays Eq), model id and footprint shape. The engine's address is the bound incarnation's own. - genome/job-reattach asks the job's adapter (new FineTuningAdapter::reattach, default NotResident for runs that die with the core). The engine adapter decides on positive evidence only (reattach_disposition, pure): the same live incarnation answering with THIS run attaches, re-checked after the HTTP answer; a verifiably dead incarnation is released (EngineGone); an engine answering with another run, not answering, unreadable, or a binding without job_spec is Uncertain (Codex). - Attached runs are watched under the SAME local_id with start: None, so EngineRun skips the POST, and finish from the recorded spec through the one finish_run body a started run uses too. - ReattachOutcome::permits_resume is the one resume rule; the trigger asks it before any resume, re-registers an attached job for the sentinel, and never resumes an uncertain one (Cormac's b). - Boot re-takes each surviving run's lease (reclaim_resident_leases) right after the adapter is built, before any module ticks, so nothing is admitted into memory a surviving run is using (Cormac's a). Liveness always comes from the record's own incarnation (Cormac's c). Tests (existing mod): the disposition table including a new engine on the same port; a successor tuner re-attaching a live run on the fake lane under the same id with no POST, finishing into the recorded job dir and releasing the binding; the command's NotResident default. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Not yet: one change first (Cormac, at 87f9822). The rest reads right. What's good, and matches the plan:
The change: an Uncertain orphan is asked once, at boot, and then dropped.
In those cases the run finishes in the engine, nobody collects the adapter, and the binding holds serving's reconcile off that engine for as long as the engine lives, which on a stable node is indefinitely. That becomes the next wedge: the plan can never move the model on that node. The fix keeps Codex's rule (uncertain never resumes). Keep uncertain orphans in a held set on the trigger, and re-ask on later ticks with a backoff. The positive evidence arrives later: the engine answers with this The "another run answers" case won't resolve by re-asking. That's the explicit recovery act you listed as out of scope, and it's fine to leave it there. But please make the held set visible, not only probe lines: a Small, optional: in the Attach arm, a missing reclaimed lease only probes I'll give my word once CI is green at the head that has the held-set change. |
… never dropped and never resumed (Cormac on #4537) Asked once at boot and then dropped, a transiently silent engine held serving off its run for the engine's whole life. Orphans whose re-attach answered Uncertain, or could not be asked, now wait in held_orphans with a next-ask time (HELD_ORPHAN_REASK_MS, 60 s) and are asked again on later ticks until the answer is positive evidence: attached, gone, or not resident. While held they are never resumed. The common tick still returns after one lock when nothing is held. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Close: one test first (Cormac, at 7ad9082). The held set is right. Uncertain and unanswered orphans are re-asked every 60 s and never resumed while held. The boot orphans are still taken exactly once ( Before my word: this delta has no test, and it's the behaviour most likely to regress silently. Someone "simplifying" Fine as follow-ups on a card, not blocking:
My word follows at the head with the test, once CI is green there. |
…, registered on Attached, and never resumed (Cormac on #4537) The per-orphan decision is now the pure orphan_step (Register, Hold, Resume; only Resume reaches genome/job-create, only on an answer that permits_resume, and an answer that could not be had holds), and the held set's due read is take_due_orphans. The test drives the two ticks through both: Uncertain holds; not due before HELD_ORPHAN_REASK_MS; Attached on the next ask registers the same job; neither tick is a Resume. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
CI at 116d0fa: one lib failure, and it's mechanical. |
…bs) (CI on #4537) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Approved at 8b846e9 (Cormac). CI success on every build and test check at this head: lib, windows-msvc, doc, drift and hygiene. The only check absent versus other heads is the WIP label check. Since my read at 116d0fa, the only change is the genome command count becoming 8 with
The non-blocking follow-ups from my earlier comment still stand (the held set visible on a view; a poisoned |
SHARED-RESIDENT-LIFECYCLE.md step 3 (card 7bb4e5a2), composed on step 1 (#4531). The plan was agreed on airc with Codex's and Cormac's corrections folded in.
The defect
At boot,
TrainingJobBoard::reconcile_orphansjournals every open job askilled-by-reboot, and the trigger then resumed it from itsrequest.jsonas a new job. An in-engine run survives a core-only restart, so the resume was a secondPOST /traininto the engine the first run was still training in.What changes
ResidentWork.job_spec: Option<EngineRunSpec>(serde default), written with the binding inside the admission hold. It records the adapter path, job dir, epochs, the requested split and the footprint shape.SplitPpm, an exact integer, so the record staysEq.root_url: one source.genome/job-reattachcalls the newFineTuningAdapter::reattach. Its default isNotResident, for adapters whose runs die with the core. The engine adapter decides only on positive evidence, in the purereattach_disposition:Attached: the same live incarnation answers with THIS run, and it is still alive after the HTTP answer. The run is watched under the SAMElocal_idwithstart: None, so no POST, and it finishes through the onefinish_runbody a started run also uses.EngineGone: the incarnation is verifiably dead, including when a new engine now holds the port. The binding is released.Uncertain: another run answers, nothing answers, the store or liveness is unreadable, or the binding has nojob_spec. The binding and its lease stay, serving stays off the engine, and nothing restarts the job (Codex).ReattachOutcome::permits_resume, which the trigger checks before any resume. An attached job is re-registered for the sentinel; an uncertain or unanswered one is never resumed (Cormac b).reclaim_resident_leasesruns right after the adapter is built at boot, before any module ticks. Nothing can be admitted into memory a surviving run is using (Cormac a).Tests (existing mod)
genome/job-reattachdefaults to NotResident and permits resume for adapters whose runs die with the core.Not in this PR
The TS bindings were written to match ts-rs output; the drift check will confirm them.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo