Repository navigation
feat(serving): governor surfaces grid_overflow_lanes — recognize overload, place don't thrash (#234/#56) - #2050
Merged
Conversation
…load, place don't thrash (#234/#56) The serving-quality "2 tok/s" bug is log-proven SLOT CONTENTION, not decode/cache-size: 2 live slots (--parallel 2) < N active personas → the server picks a slot by LRU 65% of the time (vs 35% LCP; when it DOES hit a warm slot sim_best=1.0/f_keep=0.99 and cache-load failures=0), and every LRU pick forces the ~8s KV save+restore round-trip ("prompt cache update took 8235ms"). On one box this is the memory fixpoint (lanes × (KV+compute) ≤ budget; more lanes → per-slot window < the ~9k prompt → --no-context-shift overflow); MAX_LANES=2 is the settled-correct clamp AND the system-wide admission ceiling (resource_admission), so it can't simply be raised. The good-governor fix is to RECOGNIZE the overload instead of silently cramming: plan_serving now emits grid_overflow_lanes = demand_lanes − lanes (saturating; the FULL demand on the fits_on_gpu=false degrade path). That is the honest "over local capacity by N" signal the pooled governor routes to a grid peer — Σdemand vs Σresource, one decision, a single box being the pool-of-one case. Demand is bounded by the actual beings/workloads (one Asha), so pooled grid capacity easily absorbs it and the thrash dissolves. Additive only: no change to lanes/served_context_window; new field surfaced (never a silent clamp), ts-rs ServingPlan.ts binding regenerated, 21 serving_plan tests green incl. the new demand_over_local_capacity_surfaces_grid_overflow_not_silent_cram. The grid-placement CONSUMER of this signal is the next slice. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply
added a commit
that referenced
this pull request
Jul 27, 2026
…Peer commands route
Completes the cross-grid dispatch seam end-to-end. The interceptor holds a
late-bind cell; this fills it. Where the daemon socket is in scope (alongside the
node-presence reader's own clone), create the `Arc<OnceCell<Arc<Airc>>>`, spawn a
task that `Airc::attach_as`es the interceptor's own handle (same daemon_socket +
continuum_root the citizens use) and sets the cell, and hand the SAME cell to
`AircInterceptor::with_airc_cell` at construction. Async attach never blocks the
boot critical path; until it lands, aircPeer commands fail loud (not silent).
With this, `Commands.execute("ai/generate", { aircPeer })` routes over airc to that
peer's continuum-core and returns the result — the grid-distribution lever live.
M5's merged grid_overflow_lanes producer (#2050) consumes it: overflow lanes →
aircPeer = select_grid_peer, so local overload transparently spills to a peer.
Validated: cargo check -p continuum-core --lib clean (0 errors).
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
joelteply
added a commit
that referenced
this pull request
Jul 27, 2026
…ver airc to a peer (#2051) * feat(runtime): wire AircInterceptor::try_route → AircLiveTransport (Commands.execute over airc) The AircInterceptor was a deliberate stub: it discriminated params.aircPeer but failed loud "transport not wired." This fills the transport body — the canonical cross-grid primitive (Commands.execute(cmd, { aircPeer }) routes over airc to that peer's continuum-core, returns the result), NOT a separately-registered adapter. Mirrors GridInterceptor (the sibling that already does capability-based remote routing) per the codebase's own pattern. - Holds a LATE-BIND `Arc<OnceCell<Arc<Airc>>>`: the interceptor is built synchronously during executor construction while `Airc::attach_as` is async, so a spawned boot task fills the cell without blocking the boot critical path. Until filled, an aircPeer target fails loud (no silent fallthrough). - `try_route(aircPeer)` for `ai/generate`: params → TextGenerationRequest → AircLiveTransport.send_request to the peer → response.text_response → CommandResult::json → Handled. AircLiveTransport (airc.request RPC) already exists; this is the "only the transport call body changes" the interceptor doc called out. - Room-broadcast (aircRoom) + generic any-command routing are explicit fail-loud follow-ups (mirror grid dispatch_to_node), never silent gaps. - `new()` keeps the empty-cell stub (tests + unwired call sites unchanged); `with_airc_cell(cell)` + `airc_cell()` are the production seam for the boot wire. Validated: cargo check -p continuum-core --lib clean (0 errors). Next: ipc/mod.rs boot wire (spawn attach_as → fill cell, swap new()→with_airc_cell at :2523) makes it route end-to-end; then M5's governor consumes it (grid_overflow_lanes>0 → aircPeer). Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc * feat(ipc): boot wire — attach the AircInterceptor's Arc<Airc> so aircPeer commands route Completes the cross-grid dispatch seam end-to-end. The interceptor holds a late-bind cell; this fills it. Where the daemon socket is in scope (alongside the node-presence reader's own clone), create the `Arc<OnceCell<Arc<Airc>>>`, spawn a task that `Airc::attach_as`es the interceptor's own handle (same daemon_socket + continuum_root the citizens use) and sets the cell, and hand the SAME cell to `AircInterceptor::with_airc_cell` at construction. Async attach never blocks the boot critical path; until it lands, aircPeer commands fail loud (not silent). With this, `Commands.execute("ai/generate", { aircPeer })` routes over airc to that peer's continuum-core and returns the result — the grid-distribution lever live. M5's merged grid_overflow_lanes producer (#2050) consumes it: overflow lanes → aircPeer = select_grid_peer, so local overload transparently spills to a peer. Validated: cargo check -p continuum-core --lib clean (0 errors). Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc --------- Co-authored-by: Claude Opus 4.8 <[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.
What
plan_servingnow emitsgrid_overflow_lanesonServingPlan— the count of persona lanes that DEMANDED serving but couldn't get a local lane (demand_lanes − lanes; the full demand on thefits_on_gpu=falsedegrade path). The honest "over local capacity by N" signal, instead of silently cramming N personas into the local lanes and thrashing.Why (log-proven)
The serving-quality "2 tok/s" symptom is slot contention, not decode speed or cache size. From the live
llama-server-58057.log:sim_best=1.0,f_keep=0.99on warm hits), RAM prompt-cache never misses (cache-load failures=0);< Npersonas), and every LRU pick forces the ~8s KV save+restore round-trip ("prompt cache update took 8235ms").On one box this is the memory fixpoint (
lanes × (KV+compute) ≤ budget; more lanes → per-slot window< ~9kprompt → overflow).MAX_LANES=2is the settled-correct clamp and the system-wide admission ceiling (resource_admission), so it can't just be raised. The fix is the governor recognizing its overload and surfacing it for grid placement (Σdemand vs Σresource, one decision; single box = pool-of-one).Scope
Additive only — no change to
lanes/served_context_window. New field surfaced (never a silent clamp),ts-rsServingPlan.tsbinding regenerated. 21/21serving_plantests green, incl. newdemand_over_local_capacity_surfaces_grid_overflow_not_silent_cram.Next
The consumer (BigMama's
AircRemoteInferenceAdapter, cross-grid dispatch #17) reads this signal and routes the N overflow lanes to a grid peer — that's where the ~20s→3s win lands. This PR is the producer half.🤖 Generated with Claude Code