Skip to content

Dead code: three placement systems with zero production callers, and grid_overflow_lanes has no reader #2227

Description

@joelteply

Symptom

The Academy benchmark team (Atlas / Benchy / Anwen / Asha) is live and cycling on hard-rs cards, and every turn dies. Observed: resident_personas=4, warm_slots=1.

The warm-slot math is CORRECT — do not "fix" it

serving_plan.rs computes lanes as the largest lane count whose per-slot window >= BOOTSTRAP_WORKING_SET, correctly determines only 1 of 4 minds clears the full-turn floor, fires the warm-slot-oversubscribed probe, and at :590 sets:

grid_overflow_lanes: demand_lanes.saturating_sub(lanes),

with the comment "carries the same count to the governor for off-box placement."

Do NOT unwedge this by raising warm_slots to 4. The floor gate is what keeps each slot able to see one full turn; raising it trades the wedge for 4 warm-but-blind minds — the 4-lanes-@-6k starvation the 2026-07-17 revert already caught.

Defect 1 — nothing READS grid_overflow_lanes

rg grid_overflow across the entire repo, all file types. Outside serving_plan.rs it appears in exactly three places:

  • core/continuum-core/src/commands/serving/plan.rs:94
  • core/continuum-core/src/commands/serving/pin.rs:201
  • core/continuum-core/src/modules/serving_daemon.rs:4543

All three are grid_overflow_lanes: 0, struct-literal initializers. Zero readers. It is not serialized to TypeScript/protocol either, so it never reaches a UI or the wire.

Defect 2 — nothing CALLS the planner

core/continuum-core/src/resources/placement.rs:309

pub fn plan_grid_placement(nodes: &[GridNode], demand: &LaneDemand) -> GridPlacement

Its own doc comment calls it "THE grid admission planner." It has zero production callers: #[cfg(test)] mod tests starts at :334, and every call site (525, 544, 554, 572, 588) is inside it.

The shape

Two complete, well-tested halves and no join. serving_plan.rs:1185 even asserts "the 2 unslotted minds are surfaced for grid placement" — a test that passes while placement never happens.

This is the disk_eviction pattern from CLAUDE.md exactly: unit-green components with dead wiring. Third instance of that class found on 2026-08-10.

Consequence: the 3 unslotted minds are neither queued nor placed. They stay resident and LRU-clobber each other's KV, re-prefilling ~10k cold every turn (#266's 96%-prefill / 0%-cache-reuse story). That is the wedge.

The fix

serving_daemon already publishes the plan on plan_tx: watch::Sender<Option<ServingPlan>> (:246, send_replace at :2046, subscribe() at :587) — the canonical RTOS shape CLAUDE.md prescribes. So the join is a subscriber, NOT a hot-path edit: no pressure interpretation inside compute_plan, no parallel allocator, nothing added to the tick.

  1. A placement task subscribes to plan_tx.
  2. On a plan with grid_overflow_lanes > 0, build GridNodes from the live capacity::grid::GridSnapshot.
  3. Call resources::plan_grid_placement(nodes, &LaneDemand).
  4. Act on the verdict: Place { node_id, placement } -> dispatch the overflow mind to that peer. NoNodeReachable -> loud, because silently keeping it local is today's wedge.

Which planner: resources::plan_grid_placement — its signature already takes LaneDemand, which is what serving_plan produces. provisioning::placement_planner is footprint-shaped and answers a different question (does THIS model fit THAT peer); it should not become a second caller. Settling this matters — adding a caller without deciding creates the third parallel allocator CLAUDE.md forbids.

Required alongside the wire: a chain-level guard

Per the disk_eviction precedent in CLAUDE.md, the fix is not only the wire. That lesson pairs it with broker_relieve_actually_deletes_from_an_over_budget_pool, which pins pressure -> broker -> real deletion end-to-end precisely because unit-green-with-dead-wiring is what it catches.

Add the analogue here: a test driving plan-with-overflow -> placement -> real dispatch, so this cannot silently regress into another green assertion over a placement that never happens.


Found while unblocking the Academy team. Diagnosis confirmed independently in-file by M5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions