Repository navigation
Backend lanes and hourly memory runs - #251
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Their fixtures still used the llama.cpp reasoner that 2730ef8 replaced, so the backfill resolved no subject-merge target and both tests failed whenever a test database was configured. The fresh-migration test drops its migration 180 round trip: later migrations rename and widen the pool that the 180 down migration requires, and the storage live tests cover 180 directly.
Only the dialog sets a deadline, so history summary, YouTube, the media optimizer, vision, image and music requests would otherwise wait in a busy lane without limit. They now get an admission deadline 300 s after the run starts, the old all-busy cap; background work still waits for its lane.
|
Unbounded lane waits without a deadline. Valid. Only the dialog passes a deadline. History summary, YouTube, the media optimizer, vision, image and music requests would have waited in a busy lane without limit. Fixed in 4a543d5:
Tests: |
|
Danger: large PR. Kept as one change on purpose. About 1,900 of the changed lines are the design spec and the implementation plan. The lane queue, walker, worker sizing, pool migrations and hourly memory runs have to deploy together, because the walker relies on the new pool names, the workflow columns and the worker counts. |
Summary
Each remote inference backend is now loaded at its physical width. A request waits in its own backend's queue. It moves to a fallback model only when the primary fails or when waiting would use up the request's time budget, not when the primary is busy.
Design:
docs/superpowers/specs/2026-10-12-backend-lanes-design.md. Plan:docs/superpowers/plans/2026-10-12-backend-lanes.md.Changes
router/capacity.rs):Notifywake-all race is gone.routed_attempts.rs):deadline − workflows.fallback_reserve_ms. The last candidate keeps no reserve.waiters ahead / width × mean hold) exceeds the budget. Such a skip records alane_bypassevent.lane_waitevents.primary_slot_wait,max_slot_waitandDIALOG_AIFARM_POOL_PRIMARY_CAPACITY_WAIT_MS.workflows.lane_priorityandworkflows.fallback_reserve_ms.aifarm-<device>-<purpose>:aifarm-gpu0-dialog,aifarm-gpu2-utility,aifarm-gpu1-media,aifarm-embedder(8) andaifarm-gpu1-privacy(4).PERSISTENT_QUEUE_DIALOG_WORKERS_PER_LANE(default 2).PERSISTENT_QUEUE_MEMORY_WORKERS_PER_LANE(default 2).PERSISTENT_QUEUE_MEMORY_CONSOLIDATION_WORKERSis the floor, and the default cap is now 32.PERSISTENT_QUEUE_DIALOG_UNPOOLED_SHAREis removed. Fallback capacity no longer counts as throughput.lane_checks.rs):lane_config_mismatchevents and thelane_configreadiness detail. It never fails readiness.HH:02UTC and enqueues every chat hour that completed. An hourly tick scans the last two completed hours. Startup and the03:02tick scan the whole retention window.MEMORY_DAILY_SCHEDULEandMEMORY_DAILY_WINDOW_HOURSare removed.quinn-proto0.11.15 → 0.11.19 (lockfile only) for RUSTSEC-2026-0338 to RUSTSEC-2026-0342, which the dependency gate reported on this branch.name,queuedper priority,mean_hold_msand wait percentiles.llmLanes.Compatibility
primary_slot_waitandcapacity_pool_waitare replaced bylane_waitandlane_bypass.capacity_wait_timeoutand its retryable message prefix stay.DIALOG_AIFARM_POOL_PRIMARY_CAPACITY_WAIT_MS,PERSISTENT_QUEUE_DIALOG_UNPOOLED_SHARE,MEMORY_DAILY_SCHEDULEandMEMORY_DAILY_WINDOW_HOURSare ignored if they are still set.Verification
cargo fmt --all -- --check: clean.cargo clippy --workspace --all-targets -- -D warnings: clean.cargo test --workspace: all pass. One run hit a flaky temp-directory failure inopenplotva-promptsprompt_store_resolves_custom_root_and_partials, a crate this branch does not touch; it passed on rerun.cargo audit --ignore RUSTSEC-2023-0071,cargo deny checkandcargo machete: clean.pgvector/pgvector:pg17, run serially:openplotva-storageoutbox_roundtrip_is_idempotent_ordered_and_fenced live_: 30 passed. The newlive_memory_runs_are_enqueued_through_the_last_complete_hourcovers the recent and full scans and the current-hour boundary.openplotva-appmodel_routing: 28 passed. Two backfill live tests were already broken onmain: their fixtures used the GPU2 reasoner that 2730ef8 replaced, and CI does not run them. This branch points them at the current reasoner. The fresh-migration test drops its migration 180 round trip, because later migrations rename and widen the pool that the 180 down migration requires. The storage live tests cover migration 180 directly.Deployment risk