Repository navigation
feat(grid): a seat advertises its OWN free slots and its OWN queue on the beacon — S1's seat side - #4198
Merged
joelteply merged 1 commit intoSep 18, 2026
Conversation
… the beacon — S1's seat side Governor slice S1, seat half (card c84d885a). Joel: "should have picked S1 first — just get it working well." S2 (#4197) makes a seat size itself for what arrives; S1 stops more arriving than fits. This commit is the half a seat can do alone: say the truth about itself where the truth is measured. TWO FACTS A SEAT NOW CARRIES ON `CapacityOffer` (serde-default, additive): free_slots_live served lanes minus everything in flight on them — local turns AND leased-in generates — read off the seat's own admission gauges. The old `lanes − residents` was roster arithmetic every node evaluated independently, so the M5 and IntelMac each read the 5090 as free and spilled onto the same slot at once. lane_wait_p50_ms the seat's own median receipt-to-first-progress wait for the lane_wait_samples generates it served for other nodes. MEASURED WHERE THE QUEUE FORMS: a citizen's delib.gate.lane_wait is stamped on her home node and includes the wire; this is stamped at the seat's receipt (StreamPublisher.received_at) and closed at the first prefill frame or token it publishes. Paired with the sample count so 0 ms / 0 samples reads as UNMEASURED, never as a fast seat — the absence-read-as-a-value error, closed at the type. WHERE THEY COME FROM: resource_admission gains a bounded ring of first-progress waits and a pure p50 (`p50_of`: median, not mean — one 7,058 s outlier is not the seat's wait); command_handler's stream publisher records the first progress once per generate; grid_capacity::offer_from_board fills the beacon; PeerOffer carries the same three so the chooser can read them. NOT YET (S1b, placement — coordinated with Cormac): choose_offloads still uses lanes − residents and has no queue term. This commit changes NO placement decision; it makes the seat's truth available. The lease (a spill acquires before it moves) rides the same two numbers. Tests: a_seats_measured_wait_is_a_median_with_a_count_and_unmeasured_is_not_fast. Whole-file: resource_admission 19/19, command_handler 17/17, capacity::gossip 5/5, capacity::lease 5/5, grid_capacity 1/1, placement_switch 5/5. No new warnings. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply
enabled auto-merge (squash)
September 18, 2026 20:52
joelteply
deleted the
fix/a-seat-advertises-its-own-free-slots-and-wait
branch
September 18, 2026 21:13
This was referenced Sep 18, 2026
joelteply
added a commit
that referenced
this pull request
Sep 19, 2026
…ll does — the seat's grant bounds the fleet's swing (#4206) 2026-09-19 00:3xZ, the first minutes after the 5090 ran #4198: its beacon carried its measured wait, read QUEUED, and the IntelMac brought all seven bound minds home in one tick — S1b doing its job. The tick that seat's p50 dips under the bound, `decide` says ReturnRemote for all seven at once, and `apply(ReturnRemote)` re-bound WITHOUT a grant: seven returns rebuild the very queue they left, then all seven fall home again — the metronome at fleet scale, one cooldown per swing. The lease (#4199) exists for exactly this; the return path did not use it. Now a return asks the seat for its slot as a spill does (`request_reservation`, bounded by the seat's own freshness window): the seat grants `free_slots_live − outstanding`, the rest stay home until its beacon shows room. Refused or unanswered = Stay, receipted (`placement.return.leased` / `placement.return.refused`). One ledger for both paths, so a return can never take a slot a spill was granted. Test: seven_returning_minds_take_only_the_seats_free_slots_and_the_rest_stay_home — two slots, two returns, five wait, and a spill from another node then finds nothing. Whole-file: placement_switch, placement_reservation, source_hygiene — 32/32. Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo Co-authored-by: Claude Fable 5.1 <[email protected]>
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.
Summary
Governor slice S1, seat half (card c84d885a; follows S2 #4197). S2 makes a seat size itself for what arrives; S1 stops more arriving than fits. This PR is the half a seat can do alone: say the truth about itself, where the truth is measured. It changes no placement decision — it makes the seat's truth available to the chooser (S1b, next PR, with Cormac's word on placement).
Two facts a seat now carries on
CapacityOffer(serde-default, additive;PeerOffermirrors them):free_slots_livelanes − residentswas roster arithmetic every node evaluated on its own — the M5 and IntelMac each read the 5090 as free and spilled onto one slot at oncelane_wait_p50_ms+lane_wait_samplesStreamPublisher.received_at, closed at the first prefill frame or token. A citizen'sdelib.gate.lane_waitis stamped on her home node and includes the wire. The sample count makes 0 ms / 0 samples read as UNMEASURED, never as a fast seatMechanism:
resource_admissiongains a bounded ring (64) of first-progress waits and a purep50_of(median, not mean — one 7,058 s outlier is not the seat's wait);command_handler's publisher records first progress once per generate;grid_capacity::offer_from_boardfills the beacon;grid/mod.rsmaps offer →PeerOffer.Test plan
a_seats_measured_wait_is_a_median_with_a_count_and_unmeasured_is_not_fastlane_wait_p50_mswithlane_wait_samples > 0— the first time the seat has said what its queue is🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo