Skip to content

A resident's parked training examples become a typed reservation on her lane requirement, so serving can grow her window for learning without muting her (card ea157b1a, gate 3) - #5557

Merged
joelteply merged 4 commits into
canaryfrom
ea157b1a/a-resident-s-parked-training-need-become
Oct 28, 2026
Merged

joelteply merged 4 commits into
canaryfrom
ea157b1a/a-resident-s-parked-training-need-become

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Kimi's reviewed correction (11 lived turns, 51,670-64,041 tokens) parked for good at a
served window of 49,664: the training planner never trains past what serving holds, and
nothing told serving what her learning needs.

  • training_demand.rs (genome): per persona, each parked example's whole window by its
    content key, cleared when a later partition sends it whole; plus the reservation for the
    largest window, priced by THIS shape's footprints at exactly that window (WholeRun,
    LowerBound or Predicted, labeled), else unknown. A price for another window is never read.
  • the FT partition records it (tuner-owned store, injectable for tests); probe
    training.demand.unresolved carries reserve_bytes/reserve_source.
  • window_allocator: TrainingReserve {window, bytes, source, job} on LaneRequirement, and
    RequirementSource::TrainingDemand. with_training raises her TARGET only when the bytes are
    measured, never her need; an unmeasured one is carried but grows nothing (Codex's ACK).
  • requirements_for reads the reservation: one derivation for serving and the grid.

The allocator's consumption (residual-budget growth, job dedup, live-holder exclusion) is
#5556's, on this interface.

Co-Authored-By: Claude Opus 5.5 (1M context) [email protected]
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…er lane requirement, so serving can grow her window for learning without muting her (card ea157b1a, gate 3)

Kimi's reviewed correction (11 lived turns, 51,670-64,041 tokens) parked for good at a
served window of 49,664: the training planner never trains past what serving holds, and
nothing told serving what her learning needs.

- training_demand.rs (genome): per persona, each parked example's whole window by its
  content key, cleared when a later partition sends it whole; plus the reservation for the
  largest window, priced by THIS shape's footprints at exactly that window (WholeRun,
  LowerBound or Predicted, labeled), else unknown. A price for another window is never read.
- the FT partition records it (tuner-owned store, injectable for tests); probe
  training.demand.unresolved carries reserve_bytes/reserve_source.
- window_allocator: TrainingReserve {window, bytes, source, job} on LaneRequirement, and
  RequirementSource::TrainingDemand. with_training raises her TARGET only when the bytes are
  measured, never her need; an unmeasured one is carried but grows nothing (Codex's ACK).
- requirements_for reads the reservation: one derivation for serving and the grid.

The allocator's consumption (residual-budget growth, job dedup, live-holder exclusion) is
#5556's, on this interface.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Contributor Author

Source review at b37e3bd: changes requested before allocator integration.

  1. with_training replaces the conversational window/source. When need is None, floor() uses that new training target as its admission floor: an otherwise serviceable conversation can now be refused. Retain the conversational requirement independently and combine training only for reservation-aware growth. Test a resident with no held-turn sample whose conversation fits but whose training target does not.
  2. The durable reservation is validated only by window equality. It stores no base/model/family identity although the producer prices a specific family. A same-window model/family change can reuse invalid byte pricing. Persist and validate the priced identity/shape; mismatches must be unmeasured, not a valid reserve.

Please also verify the recovery contract when sent entries are cleared at partition time and the subsequent run refuses/cancels: this records selection, not successful training. A regression should show outstanding demand is restored or retained through that path.

joelteply and others added 3 commits October 28, 2026 08:31
…eed, never into them (Codex on #5557, card ea157b1a)

with_training only attaches the reservation; window, source and need stay as her turns
measured them, so the allocator keeps the conversational geometry it must preserve and a
mind with no held turn never gets the training window as her floor. RequirementSource::
TrainingDemand is deleted (no setter left). Regression: with and without a held turn.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…nly a run that trains an example clears its demand (Codex on #5557, card ea157b1a)

- TrainingPrice {bytes, source, model, shape key}: the reservation's price is private and
  read through price_for(candidate_model), so a same-window price from another model is
  unmeasured for that plan; recorded_price() is for receipts only. job is Option (None:
  no partition priced this window).
- Sent clears nothing. A run's successful finish clears the examples it trained (partition
  sent minus what the run skipped, against the job's request.json), via EngineRunSpec.
  demand_store (serde default: a spec persisted before demand has none recorded). A run
  that fails, is refused or is cancelled leaves her demand as it was.
- Tests: the completed lost-POST run clears its examples' demand; the refused run leaves it;
  the store test covers sent-then-failed, run-skipped kept, and per-window price. Mutation:
  dropping the finish's clear fails the completed-run test.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Contributor Author

Reviewed #5557 at 5a4dc12. The three requested producer corrections are resolved in source: attaching training preserves conversation fields/floor, prices are model-bound through price_for, and only successful finish clears trained non-skipped examples (including reattachment). Verified current CI has 24 successful checks and three skipped jobs. Source verdict: no remaining blocker in those reviewed paths. No local runtime test or learning acceptance claim. Consumer #5556 remains draft until snapshot-accounted live-job exclusion and unresolved-decision publication are complete.

@joelteply
joelteply merged commit e41841a into canary Oct 28, 2026
27 checks passed
@joelteply
joelteply deleted the ea157b1a/a-resident-s-parked-training-need-become branch October 28, 2026 14:14
joelteply added a commit that referenced this pull request Oct 28, 2026
* Grow packed lanes toward queued minds within the measured budget

* A resident's parked training examples become a typed reservation on her lane requirement, so serving can grow her window for learning without muting her (card ea157b1a, gate 3)

Kimi's reviewed correction (11 lived turns, 51,670-64,041 tokens) parked for good at a
served window of 49,664: the training planner never trains past what serving holds, and
nothing told serving what her learning needs.

- training_demand.rs (genome): per persona, each parked example's whole window by its
  content key, cleared when a later partition sends it whole; plus the reservation for the
  largest window, priced by THIS shape's footprints at exactly that window (WholeRun,
  LowerBound or Predicted, labeled), else unknown. A price for another window is never read.
- the FT partition records it (tuner-owned store, injectable for tests); probe
  training.demand.unresolved carries reserve_bytes/reserve_source.
- window_allocator: TrainingReserve {window, bytes, source, job} on LaneRequirement, and
  RequirementSource::TrainingDemand. with_training raises her TARGET only when the bytes are
  measured, never her need; an unmeasured one is carried but grows nothing (Codex's ACK).
- requirements_for reads the reservation: one derivation for serving and the grid.

The allocator's consumption (residual-budget growth, job dedup, live-holder exclusion) is
#5556's, on this interface.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* A training reservation travels beside her conversational target and need, never into them (Codex on #5557, card ea157b1a)

with_training only attaches the reservation; window, source and need stay as her turns
measured them, so the allocator keeps the conversational geometry it must preserve and a
mind with no held turn never gets the training window as her floor. RequirementSource::
TrainingDemand is deleted (no setter left). Regression: with and without a held turn.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* Name the disk boundary of the training-demand write (boundary_serialization ratchet 223 -> 222)

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* A training price names the model and shape it was measured for, and only a run that trains an example clears its demand (Codex on #5557, card ea157b1a)

- TrainingPrice {bytes, source, model, shape key}: the reservation's price is private and
  read through price_for(candidate_model), so a same-window price from another model is
  unmeasured for that plan; recorded_price() is for receipts only. job is Option (None:
  no partition priced this window).
- Sent clears nothing. A run's successful finish clears the examples it trained (partition
  sent minus what the run skipped, against the job's request.json), via EngineRunSpec.
  demand_store (serde default: a spec persisted before demand has none recorded). A run
  that fails, is refused or is cancelled leaves her demand as it was.
- Tests: the completed lost-POST run clears its examples' demand; the refused run leaves it;
  the store test covers sent-then-failed, run-skipped kept, and per-window price. Mutation:
  dropping the finish's clear fails the completed-run test.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* Bound queued window growth by priced training reservations

* fix: let conversation grow past unpriced training demand

* fix: publish training growth decisions from serving planner

* feat: read replacement budget and charged leases atomically

* fix: carry charged training leases into window growth

* fix: retain full reserves on boot incumbent credit path

* test: verify exact training holder credit and reset

* test: use supported serving geometry in lease-credit fixture

* Remove unused budget wrapper and gate test publication helper

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
joelteply added a commit that referenced this pull request Oct 28, 2026
…e, so a partition records and prices it (card a9e94342, gate 3) (#5569)

* A waiting remainder whose demand serving was never told goes back once, so a partition records and prices it (card a9e94342, gate 3)

The windows 5090, 2026-10-28 18:08Z (46b04ea): serving.training_growth=NoDemand, 2 lanes
proposed at 51,694, against Kimi's smallest parked 2de02f40 example needing 51,712.
TrainingDemand is written only by a partition (#5557); the stranded job was partitioned
before that, and #5563 holds it until served >= needed, so no partition runs again and
serving is never told its window. It would wait forever.

- return_parked_remainder: below its window, a remainder is held only when every parked
  example is outstanding in her demand store (TrainingDemand::records_all); otherwise it goes
  back once (its receipt ends it, probe training.job.remainder_unrecorded), so the next
  dispatch's partition records it and prices it on the one pricing path. Nothing is priced
  outside the partition.
- The pass passes her demand dir (genome root's training-demand), the store the partition
  writes and serving reads.

Test: with demand recorded, the job still waits (no lane, 49,664) and returns at 64,256 as
before; with none recorded, it goes back once at 49,664 and then reads AlreadyReturned.
Not built locally (Intel serving node, engine build); CI compiles and runs it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* A remainder records its demand before it goes back, and a store that cannot answer or be written holds it (Codex on #5569, card a9e94342)

- TrainingDemand::records_all reads strictly: a missing file is empty, but no store, an
  unreadable file or corrupt JSON is an error, never "not recorded".
- An unrecorded remainder below its window records each parked example's window from its
  measured row (unpriced) BEFORE going back. A later all-parked job of the same examples
  then finds it recorded and waits, even if that partition's own write fails: the receipt
  no longer has to bound a cross-job loop. A failed record or an unanswering store holds
  the job (Internal; the pass asks again) and returns nothing.
- Fixture: the successor job waits after the first returned; a corrupt store and a read-only
  one (skipped where the runner can still write it) hold the job with nothing added.

Not built locally; CI compiles and runs it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* An unrecorded remainder is recorded only when every parked example has exactly one measured row; otherwise it is refused and nothing returns (Codex on #5569, card a9e94342)

A partition missing (or duplicating) a parked example's row recorded only part of its demand,
returned, and its successor found it unrecorded and returned again. Now that is Invalid: held
for a human, never retried and never returned. Test: a partition missing row 2 is refused
naming example 2, nothing added.

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]>
joelteply added a commit that referenced this pull request Oct 28, 2026
… reserves a window (card 4545eafd) (#5572)

* Retired examples clear their training demand, so no withdrawn example reserves a window (card 4545eafd)

FOCUS-CONTRACT (#5570): no lane reduction from a stale training-demand record. A demand entry
(#5557) cleared only when a run trained its example; a parked example returned to her bucket
and then withdrawn (retire by card or submission: a failed review, a superseding fix) kept its
demand, and with it a reservation, forever.

- retire_in_bucket clears the withdrawn rows' examples (by content key, the key a partition
  records) right after the retirement receipt and before the rows flip; a failure leaves the
  rows pending under the receipt, and rerunning the same retirement finishes it.
- TrainingDemand::record's second set is `settled` (trained, or withdrawn), not only trained.

Test: the retire-by-card fixture records demand for a withdrawn example and another card's
example; after the retire only the withdrawn one is cleared. Submit never mutates an
example (no metadata writes in the trigger), so stored rows key exactly as recorded.
Not built locally; CI compiles and runs it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* A retirement clears demand strictly, so a store that cannot answer fails it with nothing flipped (Codex on #5572, card 4545eafd)

record() reads leniently: a corrupt or unreadable store read as empty, the clear was a no-op
that returned Ok, and the rows flipped with the withdrawn examples' reservation left behind.

- TrainingDemand::clear(keys): read_strict (a missing file has nothing to clear; no store,
  an unreadable file or corrupt JSON is an error), then the same atomic replace.
- retire_in_bucket clears through it: a failure leaves the rows pending under the receipt.

Test: a corrupt demand store fails the retirement, the rows stay pending, the file keeps its
bytes, and once it is repaired the same retirement finishes. Not built locally; CI decides.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* The retire fixture reads an emptied bucket as gone, not as zero (Codex read the CI failure on #5572)

Retiring every row removes the bucket, so bucket_example_count is None, not Some(0); the
fixture's last assertion accepts either. Production unchanged.

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]>
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