Skip to content

Keep earned grant handoffs across evaluations and resizing - #6093

Merged
joelteply merged 2 commits into
canaryfrom
codex/grant-handoff-boundary-20261116
Nov 16, 2026
Merged

joelteply merged 2 commits into
canaryfrom
codex/grant-handoff-boundary-20261116

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Aiko and Atlas remained owed memory while holders started back-to-back acts. An evaluation after a terminal receipt reset the holder's yield baseline to that receipt, allowing its next act. Resizing a grant could erase the same obligation by changing its revision.

Keep the original receipt baseline while the same mind, engine incarnation and owner continuously hold the seat. Refresh its stamped lease for admission checks. Existing handoff, waiter departure and engine fencing still remove obsolete obligations. This changes the existing reservation owner; no new scheduler, queue, copying path or reclamation mechanism.

Validation: replay against deployed 2695c5f reproduced all three new failures (14 existing cases passed). Replays cover evaluation between completion and reserve, repeated publication, act admission, and growth/shrink. The broader window-grant suite is running; result will be attached before merge. Fable independently reviewed the mechanism and identified the resize case. Production source changes are 11 lines; tests derive from Fable's live-trace fixture.

Deployment gate: exact-head CI and independent source review, then the supported core-only M5 prebuilt deployment preserving engine PID14844 and resident state, followed by a 15-minute comparison of actual waiter admission/acts, timing, memory and failures. No live recovery claimed yet.

joelteply and others added 2 commits November 16, 2026 16:29
Replay the M5 completion/evaluation/re-entry race at the existing reservation owner. Retain the original receipt boundary while a seat remains held by the same owner on the same engine; refresh the stamped lease without forgiving its yield.

Co-authored-by: Claude Opus 5.5 <[email protected]>
@joelteply

Copy link
Copy Markdown
Contributor Author

Independent source review at 3da6185 (Fable): approve, gated on exact-head CI. (Posted as a comment: GitHub refuses an approving review from the shared account.) Verified by reading, not running (no build beside the M5's serving lanes):

  • fair.rs:279-298: the earned yield's receipt baseline survives a publication when the previously armed lease has the same engine and owner, including a resize (a new revision from stamp_revisions). It resets on a new engine or a new owner, and is dropped when the holder leaves next.by_mind (handoff), when no waiter is owed (departed), or when the engine is fenced (engine.is_some() false).
  • The window that starved Aiko: a holder whose act has ended is no longer acting, so re-arming depends on reclaimable_for (fair.rs:91-101). Her receipt revision now exceeds the one recorded when she was seated (served > seat_served), so she IS re-armed with the preserved baseline, and her next reserve or hold is refused at the receipt boundary. The refused_at exclusion is unchanged.
  • Tests: the fixture's first case plus the resizes (57->50, 57->65) while another holder acts cover the reserve and hold paths across repeated publications; the cached-seat assertion corrected to the reserve/hold boundary is right.

Deploy: I own the core-only rollout on the M5 from the merged commit's canary release (continuum reboot --prebuilt, engine pid 14844 preserved, 15-minute read with Aiko's delib.window.waiting as the signal).

🤖 Generated with Claude Code

@joelteply

Copy link
Copy Markdown
Contributor Author

Exact-head confirmation at 73526b4 (Fable): git diff 3da61858f 73526b4e0 touches only fair/tests.rs (+4/-1); fair.rs is byte-identical to the reviewed delta (0 diff lines). The test change is the right precondition: the small holder now reserves before the owed publication, yield_after is asserted to contain it, and its terminal receipt is settled after. My review stands: approve, gated on exact-head CI.

🤖 Generated with Claude Code

@joelteply

Copy link
Copy Markdown
Contributor Author

Exact head 73526b4: all 43 window-grant tests pass (0.01s), including request/act admission, repeated evaluations, resizing, existing physical-reclamation HTTP proof, cancellation custody, and departed-waiter behavior. The original deployed production code reproduced the evaluation race and resize failures; the repeated-evaluation fixture was then corrected to establish an actually armed holder before its terminal receipt. No production changes were needed after the first patch.

Fable independently approved the production source at 3da6185 and verified exact 73526b4 has byte-identical production code plus the fixture correction. CI is pending. No merge/deployment or performance improvement claimed.

M5 baseline supplied by Fable at 22:31Z: Aiko 408 and Atlas 411 five-second waits since 21:59; engine14844/core2695; median decode6.3 tok/s, prefill79.5 over60 requests; swap5.3GB. Concurrent resident builds confound timing/memory comparisons and will be recorded, preserved, and not killed.

@joelteply
joelteply merged commit 5a754ad into canary Nov 16, 2026
32 checks passed
@joelteply
joelteply deleted the codex/grant-handoff-boundary-20261116 branch November 16, 2026 22:55
joelteply added a commit that referenced this pull request Nov 17, 2026
…duler only picks who decodes (Joel: "Very unreliable logic. It just gives up and breaks.")

The M5 read after #6093: rotation fixed, but one mind seated at a time (grants 158-207k = untrimmed view x 1.25 vs a
300,850 pool; real sequences 50-93k), so four residents never batched. Admission summing view ceilings is the defect;
the owed queue / BehindActs / reclaim handoffs / armed yields exist only to cope with it. Replacement: residency via
#139, one memory owner admitting by engine-reported live cells with paging and typed deferral, grants only as view
ceilings, scheduler picks who decodes and batches every ready mind. Gate: four resident, batched decode, aggregate
tok/s vs 80.

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

Copy link
Copy Markdown
Contributor Author

Live acceptance for the narrow earned-yield repair, reported by Fable, deployment owner: exact post-start window 2026-11-17 00:09:35–00:24:35 UTC; core build 5a754ad / PID42136, preserved engine14844. Root independently verified the deployed executable path and SHA256 5aacd4f40780a4fa84f429c4f37d28c15d35ad68737121330edaac7c3c2961d8.

Three actual completed-holder/older-waiter overlaps exercised the repaired boundary with no earned-yield re-entry: 00:12:17 Aris to Aiko (158608 cells); 00:17:58 Aiko to Atlas (189232); 00:19:35 Atlas to Benchy (159501). Per-mind report: one observed act each for Aiko, Atlas and Benchy, plus one unobserved-mutation event for Benchy; one refused act for Aris. Do not count the mutation event or refusal as completed useful work.

Limits: admission remained serial, approximately four acts per quarter hour; five-second wait events Aiko97 / Atlas145 / Benchy104 / Aris157. Throughput probes measured 13.89 and 13.30 tok/s versus expected56.10; previous baseline median6.3 was a different sample/load and does not establish a causal speedup. Swap5222/6144MB; resident builds ran until about00:20, confounding timing and memory. Existing pre-deploy swap was about5.3GB. This verifies the narrow fairness behavior, not throughput recovery or durable learning.

Fable's trace source: core logs .1 + current, saved as scratchpad/m5-read-0009-0024.log on her host. Absolute path requested for durable evidence attachment. View-ceiling versus physical-allocation admission is tracked in design #6092 sections4.11.9–4.13; no further grant-policy workaround is authorized by this receipt.

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