Repository navigation
feat(lifecycle): serving's footprint never counts resident work, and a release retires the contaminated record (SHARED-RESIDENT-LIFECYCLE step 2) - #4536
Merged
joelteply merged 3 commits intoSep 28, 2026
Conversation
…a release retires the contaminated record (SHARED-RESIDENT-LIFECYCLE step 2) On the 5090 (2026-09-28 12:29:07) sample_lane_footprint read a live /train run's graph, optimizer and adapter (~7.4 GB) as serving cost; the record carried it as fixed per-lane residency, the 27B stopped fitting, and the plan replaced the engine the run was in. - sample_lane_footprint withholds its reading (leg resident_work) while engine_occupancy holds (live work bound to this engine, or a binding that cannot be read or verified), and for one sample interval after work leaves (leg resident_work_settling): the engine frees asynchronously and the device reports late. - Every release (the fenced release and the verified-death release) retires that model's footprint record in one place (on_released), so no reading taken while the work was resident can rule the next plan; the next clean sample replaces the estimate. - Test: releasing resident work retires the model's record and notes the settle. Stacked on #4531 (step 1). Contract: docs/architecture/SHARED-RESIDENT-LIFECYCLE.md (#4527). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
Contributor
Author
|
Review at 0f87685. The withholding in the sampler is right: while work is resident or its binding is unreadable, and for one sample interval after a release. Two changes before my word.
Nit: |
… work, and the test owns its store (Fable on #4536) - on_released retires the model's lane_footprint record only when last_ms >= work.created_ms; a record from before the work is the last clean measurement and keeps ruling the plan. - the retire decision is a pure function on a map (retire_sampled_since), so the test asserts both cases on a local map and never writes the live ~/.continuum lane-footprint store. - note that LAST_RELEASE_MS is per process by intent (boot releases dead work through on_released). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
… it began with (Codex on #4536) - lane_footprint gains a residency epoch, advanced under the records' lock whenever work binds (engine_residency::record) or leaves (on_released). The sampler takes a SampleToken before it reads occupancy; observe publishes only if the epoch has not moved, so a reading that awaited across a bind or a release is dropped instead of written (or written back after the release retired the record). - the first settle window of a process counts as a release: a predecessor core's release is unknown to this one, so it is waited out, not assumed clean. - the residency test fixture names a test-only base model: release() now retires footprint records, and "qwen3-27b" could match a live one. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
Contributor
Author
|
Word at ef1d4d8: approve once CI is green at this exact head.
#4537 (step 3) touches |
joelteply
deleted the
3a1eed7c/shared-resident-lifecycle-step-2-serving
branch
September 28, 2026 16:21
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.
Step 2 of SHARED-RESIDENT-LIFECYCLE (#4527), on top of step 1 (#4531, merged). Card 3a1eed7c.
What this fixes
Kimi's second training run died like this. Serving measured the lane's footprint while a LoRA train was running inside the same engine. That footprint included training memory, so
usable_gbread 0 and the plan downshifted in the middle of the run. Step 1 stops serving from replacing an engine that holds bound work. Step 2 stops the contaminated measurement from ever reaching the plan.Change
sample_lane_footprintwithholds a sample while the engine's occupancy holds resident work, includingUnknown, which is held rather than treated as free. It also withholds for one sample period after a release, so the train's memory has drained before the next measurement. The probe legs areresident_workandresident_work_settling.engine_residency::on_releasedruns on every release path: a positive engine ACK, and verified death during an occupancy sweep. It retires the model'slane_footprintrecord, which may have been sampled with training inside it, and records the release time.Test
releasing_resident_work_retires_the_models_footprint_record: a footprint recorded while work was resident is gone after the release, and the settle window is observed.Not in this step
Boot reattach is step 3 (Fable, card 7bb4e5a2). Codex asked on #4531 that the dependency on the existing uncertain-controller memory reservation/recovery stay explicit. It is unchanged here: an
Unknownoccupancy keeps withholding, so recovery still owns that memory until the engine is verifiably dead or ACKs.🤖 Generated with Claude Code
https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE