#1 [high] PR #549 verified findings (pre-test)
PR #549 "Report KV pages held by active requests" (draft, head 5ed7af8, +218/-10, 7 files, author WynnD, assoc NONE). Closes #537.
VERIFIED TRUE:
- SchedulerStats derives PartialEq/Eq (scheduler.rs:112); embedded whole in CopyoutResources (runtime.rs:1053-1059); compared at runtime.rs:2448 to gate retry_copyouts. New request_pages(reserved_pages) therefore join a behavioural key. CONFIRMED structurally.
- refill_reservations (scheduler.rs:1383-1425) pops from free_pages into reserved_pages -> free_pages changes on refill; commit (2433-2438) moves reserved->private with free_pages unchanged. So magnitude of extra copy-out retries is plausible but NOT proven statically.
- pin_request (cache.rs:551-563) calls self.pin(id)? then self.chain(id)? again; unpin_request (565-580) same -> 2 chain walks + 2 Vec allocs per call.
- Drift assertion #[cfg(test)] cache.rs:817-837 now compares request_pinned_pages vs full scan filtered request_pins>0. Runs on EVERY stats() read across the suite. This is the strongest correctness evidence and is host-independent.
- Compaction correct: compact_ancestor cache.rs:613-646, uncount(616)+tail_pages restore(617), debug_assert_eq!(node.request_pins, child.request_pins) at 627, heir inherits pages 629-631.
- eviction_candidates (658-664) requires pins==0 for leaf; compaction only when direct_pins==0 && child_count==1 -> request-pinned node never leaves nodes as leaf. Sound.
- unchecked usize subtraction cache.rs:576 (request_pinned_pages -= tail_pages.len()) guarded only by direct_request_pins==0 early-out (566) + subset invariant -> release build would wrap. Latent.
- retire order: request.take() at 3143, unpin_request(prefix)? at 3159 -> an Err leaks the pin after slot emptied. Latent.
- Inbound: ticket pages popped at 1704-1706, live request private_pages=Vec::new() at 1803, phase Inbound 1737 -> in neither gauge.
- docs/api.md:302 "read from scheduler state on each scrape" FALSE: metrics.rs render loads atomics only; stored only on progress passes (runtime.rs:1148-1149).
- PR body shared-ancestor sentence ("counts once for every request") contradicts code+test (counts once total; test asserts 3 not 4).
- PR body "a checkpoint leaves nodes only at zero pins" wrong for compaction.
- Test duplication: new scheduler test (tests.rs:970-1034) repeats branching_requests_own_distinct_tail_pages_and_terminal_snapshots (1036-1081) step for step.
- direct_request_pins used ONLY for the guard at cache.rs:566 (grep: 83,461,553,566,570).
VALUE GAP (own evidence): 399/21504 = 0.0186 request share vs #537's vLLM reference ~9% on comparable load. Narrows bounds but does not achieve vLLM parity; #537's cheaper option (split cached into pinned/idle) not taken nor explained.
HARDWARE: cn5 = 4x RTX PRO 6000 Blackwell SM120, models listed GLM-5.3-Flash-NVFP4 (TP4) + dinov2. cn7 = 1x GB10 arm64 SM121, Qwen3.8-27B-NVFP4 TP1 (documented qualified native ARM64 path, docs/windows.md:179,361). 16 GiB scratch both. No GPU kernel, no numerics, no throughput change, no per-model code -> A/B throughput test would be pure waste.
#3 [high] PR #549 head 9cca87ac — delta vs prior report, verified
Head 9cca87ac (draft, +246/−16, 8 files). Discussion: 1 bot review (Changes Requested, 2026-11-26), author asks for re-review 2026-11-27 04:56. No CI checks.
FIXED at this head (verified in code):
- Copy-out retry key: runtime.rs:2441-2450 builds CopyoutResources with SchedulerStats { request_pages: 0, reserved_pages: 0, ..stats() }; compared at 2455
retry_copyouts = retry || progress || self.copyout_resources != Some(resources). Restores pre-PR behaviour. CopyoutResources declared runtime.rs:1053-1059. - retire() ordering: unpin_request at scheduler.rs:3155 precedes request.take() at 3157 — a failed release now leaves the slot intact.
- cache.rs:548-550 doc comment corrected (cache now describes only tail_pages; private pages noted as scheduler-owned).
- docs/api.md:302 now says worker publishes (not "read from scheduler state on each scrape").
- Three mirrored
if inbound.is_none()pin blocks replaced by pin_prefix/unpin_prefix (scheduler.rs:1643-1645, 1656, 1678; helpers at 2025-2040).
STILL OPEN:
- pin_request/unpin_request walk chain twice: cache.rs:552
self.pin(id)?(chain at 523) then 554self.chain(id)?again; unpin mirrors at 569/571. Four reviews + synthesizer call this should-fix; the fold (pin_with(id, request)) rewrites exactly the functions that own the counter. - Three ways to take a request pin: pin_prefix(.., true) + direct cache.pin_request/unpin_request at scheduler.rs:1889, 2977, 2979, 2997, 2998, 3155.
- docs/api.md:307-310 self-contradictory: says request+reserved is the comparable figure, then says "Dividing either gauge by flare_total_kv_pages excludes ...".
- docs/api.md:311-312 documents a #[cfg(test)] drift assertion in the operator API page.
- docs/api.md:302 "on every scheduler pass" overstates: published only when progress (runtime.rs:1148-1149), plus startup 722 and drained shutdown 745.
- docs/api.md field table (332-362) has no rows for the two gauges; JSON snapshot deliberately excludes them but api.md never says so.
- PR body still says "counts once for every request that references it" (code/test: once total, test asserts 3 not 4) and "a checkpoint leaves nodes only at zero pins" (false for compaction).
- New scheduler test tests.rs:970-1034 replays branching_requests... (1036-1081) step for step; only 1010-1033 is new.
CORRECTION to my prior §2.2: #537's own option 1 is literally "flare_request_kv_pages ... then request/total matches vLLM". The PR implements that. The 399/21504 = 1.9% vs #537's ~9% comparison is NOT apples-to-apples (different model, pool size 21504, different load), so "off by 5x / does not deliver" was overstated. Reframe: ratio comparability with vLLM is unverified and is a reporter question, not a hardware question.
COVERAGE GAP: author's reported run --lib -- cache:: scheduler:: server::metrics does NOT select server::runtime::phase_tests, so the runtime.rs change (copy-out key) is unexercised by the 508-test claim. Copy-out deferral tests exist at helios/src/server/runtime/phase_tests.rs:6357-6431 (local_copyout_defers_without_a_pin..., local_copyout_rechecks_headroom_after_each_queued_pin, local_copyout_discards_an_evicted_unpinned_deferral) and 6176 reoffer_counters.
#4 [high] Report of 2026-11-27 (head 9cca87ac) — recommendation flips to host-only
Head 9cca87ac. Recommendation: DO NOT refer to hardware test. The one behaviour-changing defect (gauges in the copy-out retry key) is fixed, and what remains is (a) should-fix structural/doc items that do not change the assertions a test would carry, (b) a coverage gap in the author's own reported test run, and (c) an observability-only change whose arithmetic is host-computable. So hardware time buys ~nothing; host CI + one scrape is the right spend. Key content: verified-fixed list, remaining items (pin_request double chain walk; three request-pin entry points; docs/api.md:307-310 contradiction, 311-312 cfg(test) in API page, 302 publish cadence, 332-362 missing rows / JSON omission unstated; PR body's two false sentences; duplicated scheduler test), coverage gap (508-test filter omits server::runtime::phase_tests which hold the copy-out deferral tests at phase_tests.rs:6357-6431, 6176), correction of my prior §2.2 overstatement, contingency one-job cn7 plan.
#6 [high] PR #549 head bca7358 — my prior gates all closed, verified
PR #549 head bca7358 (+202/−34, 8 files, still open/draft). My prior report's four gates are CLOSED, verified in code:
- Single chain walk — cache.rs:519-570
pin_with/unpin_with;pin/unpinat 572-578,pin_requestat 583-585,unpin_requestat 587-589 are one-line wrappers. chain computed once each (523, 553). My §2.2 gate gone. - docs/api.md:308-310 now a single correct ratio:
(flare_request_kv_pages + flare_reserved_kv_pages)overflare_total_kv_pages. Old self-contradictory "dividing either gauge" sentence gone. - Publish cadence correct: api.md:305-307 "publishes both when a scheduler pass makes progress, and again at startup and after the shutdown drain" matches runtime.rs:1148-1149 (if progress), 722, 743-746.
#[cfg(test)]assertion sentence removed from operator page.- Duplicated scheduler test folded: scheduler/tests.rs:970-1032 is now one test (setup 972-1009, assertions 1010-1031, cancel-drain 1027-1031).
- cache/tests.rs:320-373 single cache test: 3 not 4 (334), plain copy-out pin neutral (342-345), compaction keeps count (357-358), 0 on last release (359-360).
Copy-out retry key still correctly defused: runtime.rs:2441-2453 builds CopyoutResources with SchedulerStats{request_pages:0,reserved_pages:0,..stats()}; compared at 2455. CopyoutResources declared 1054.
Gauge plumbing verified: metrics.rs:265-266 atomics, 517-518 store, 1309-1318 exposition with help text, test at 1782-1843 asserts gauge type+value for request_kv_pages 4 and reserved_kv_pages 2. NOT in Snapshot.
Scheduler sums: scheduler.rs:1200-1235; one loop 1205-1209 covers active_requests/private/reserved; request_pages: request_pages + cache.request_pinned_pages at 1220.
Drift assertion: cache.rs:825-846 #[cfg(test)] compares ready/unready/tail/request_pinned_pages against full scan on EVERY stats() read.
Pin sites (verified in code): admission request_pin = inbound.is_none() at 1636, pin_prefix 1638, rollback unpins 1649/1671; ticket parent plain unpin 1864/1900; ticket waiter pin_request 1882; publication Created pin_request 2970/unpin parent 2972; publication Existing{ready:true} pin_request 2990/unpin 2991; retire unpin_request 3148 BEFORE request.take() 3150. pin_prefix/unpin_prefix at 2019-2033; pin_checkpoint/unpin_checkpoint 2037-2043.
Coaching: no CI on head; author's 809-passed run filtered to cache::/scheduler::/server:: so server::runtime::phase_tests (copy-out key file) may not be selected. PR is draft in the API listing but shows as open; discussion is bot-only plus one author request.
#8 [high] PR #549 — testing decision and hardware plan at bca7358
DECISION at bca7358: REFER to hardware testing, but staged: Stage 1 host-only is the precondition (free, catches suite regressions + the runtime.rs copy-out key), Stage 2 is ONE cn7 job ~30 min. No throughput A/B.
Why the prior "do not test" gate expired: every item I gated on is fixed at bca7358 (pin_with fold, docs ratio, publish cadence, cfg(test) sentence, duplicated test folded). What remains is idiom duplication (pin_prefix/unpin_prefix vs pin_checkpoint), one docs sentence about the JSON snapshot, and coverage nits — none changes a gauge value or an assertion, so hardware time is not spent on code that will be rewritten.
Expected value assessment: MODERATE and narrow, not low.
- The arithmetic is host-tested already (metrics.rs:1827-1843 asserts request_kv_pages 4 / reserved_kv_pages 2 in the exposition; scheduler/tests.rs:1021-1031 asserts sums and drain).
- The genuinely GPU/live-path-only claims are: (a) the gauges appear and move in a real worker publish cycle with real prefill/restore timing; (b) the "shared prefix counted once" property observable in a live pool (2 identical-prefix requests => increase < first request's contribution); (c) the Inbound/restore window where ticket pages are in neither gauge; (d) with a host store configured, flare_host_cache_reoffer_calls_total (metrics.rs:1172-1179) does not grow per decode step — the runtime.rs:2441-2455 key fix.
- No GPU kernel, numerics, attention/MoE, allocation, eviction or per-model code is touched, so Blackwell/GB10-specific validation and TP4 add nothing: reason to avoid cn5 TP4 and pick the simplest single-GPU pool.
Stage 1 (host, free): cargo test --release --lib with NO path filter (author's filter cache:: scheduler:: server:: metrics does not obviously select server::runtime::phase_tests; phase_tests declared runtime.rs:3958, referenced docs/scheduling-runtime-design.md:737). That is where copy-out deferral lives. Plus the drift assertion coverage (cache.rs:825-846 runs on every stats() read).
Stage 2 (cn7, 1x GB10, nvidia/Qwen3.8-27B-NVFP4 TP1, ~30 min, one serving session, no restart): idle 0/0; two identical-prefix streams => request_kv_pages rises by less than the first request's contribution and reserved is small; request+reserved <= total-free; record (request+reserved)/total without gating on vLLM; cancel mid-flight => both drop to 0 immediately while pages drain; one scrape against a stalled/idle worker to confirm the value reflects the last progressing pass; with --prefix-cache-memory set, record flare_host_cache_reoffer_calls_total twice across decode and confirm no per-step growth.
Explicitly excluded: throughput A/B vs main, soak, multi-model matrix, repeat of the author's two-GPU DeepSeek scrape (fork base 5ffe4d54 absent from repo), per-model sweeps.
#10 [high] PR #549 — correction on coverage and what CI already covers
CORRECTION to my earlier coverage-gap claim: the author's filter -- server:: scheduler:: cache:: DOES select server::runtime::phase_tests (declared helios/src/server/runtime.rs:3956-3958), so the copy-out deferral tests (phase_tests.rs:6357-6431) and the re-offer counter test (6176-6197) WERE included in the reported 809-passed run. My earlier note that the filter omitted them was wrong.
Further: the repo's own CI already runs exactly the Stage-1 suite on every PR — .github/workflows/native-serving.yml:56-68 runs cargo test --locked --release --manifest-path helios/Cargo.toml --features runtime-core,server on ubuntu-24.04 AND windows-2022, with FLARE_TEST_TEMPLATE_DIR prepared at :28-31 (which also resolves the author's single reported failure). :69-77 adds the CLI and flare-app suites.
Consequence for resource use: Stage 1 (full unit/integration suite) should come from the PR's CI, not from a hardware job. There are no CI checks on head bca7358, so the correct ask is "get CI green", not "spend a GPU slot running cargo test".
Therefore the ONLY thing our hardware can add is the live end-to-end scrape in a real worker:
- gauges appear and move through a real progress-gated publish cycle (runtime.rs:1148-1149);
- distinct-page semantics under real shared-prefix prefill/restore (author's 399 -> 402 differential of 3 against a ~29-page shared prompt);
- the Inbound/restore window, whose size depends on real restore timing (scheduler.rs:1686-1688 pops ticket pages from free_pages; 1882 pins only at resolution);
- with --prefix-cache-memory set (docs/prefix-cache-offload.md:884), flare_host_cache_reoffer_calls_total (metrics.rs:1172-1179, incremented only on a genuine re-offer at runtime.rs:2482-2494) does not climb per decode step, which is the live check of the runtime.rs:2441-2455 key fix. Note this only bites when deferred copy-outs exist (headroom deferrals), so it is optional and not a gate.
#7 [medium] PR #549 remaining non-blocking items at bca7358
Remaining at bca7358, judged non-blocking for a hardware test decision (none changes gauge values or the assertions a test would carry):
A. Conventions "should fix": scheduler.rs:2019-2033 pin_prefix/unpin_prefix are a bool-dispatched second wrapper pair beside the named pin_checkpoint/unpin_checkpoint (2037-2043), and four request-pin sites bypass them (1882, 2970/2972, 2990/2991, 3148). Style/idiom duplication only; no behaviour differs.
B. Prose nit 1: docs/api.md:298-310 never says the two gauges are Prometheus-text-only / absent from ?format=json, while the PR body does and api.md:292-296 routes text-only families explicitly; JSON field table has no rows. A JSON consumer would read zeros (api.md:317-318 "absent fields as zero"). One-sentence fix.
C. Prose nit 2: api.md:308-310 says the ratio "is the share comparable to vLLM's kv_cache_usage_perc" unqualified while the PR body disclaims cross-runtime comparison.
D. Coverage: (i) publish_boundary's Existing{ready:true} branch (scheduler.rs:2987-2998) has no stats assertion — the shared-checkpoint case; (ii) the folded scheduler test cancels rather than completes, so Created-retire is only reached via cancel; (iii) cache.rs:547-548 "checkpoint has no request pin to release" now has NO reachable caller (plain unpin short-circuits the request guard because unpin_with(id,false) skips it) and bca7358 deleted the only test that reached it (cache/tests.rs:336 now tests the plain-unpin guard at cache.rs:550-551). One line restores it, or delete field+guard.
E. Nits: three passes over self.slots in stats (1213, 1216, 1222-1233); retire re-reads prefix/error_code (3144-3145) though locals exist (3113, 3110); direct_request_pins has one reader; CopyoutResources still embeds whole SchedulerStats so future fields silently join the copy-out key.
F. Correctness nit: docs/api.md:304-305 "not written yet" is imprecise — commit pops reservations into private_pages before the GPU writes complete, so a page counts in request_kv_pages while still unwritten.
G. Process: no CI on head; PR body's live scrape ran on 9cca87a (docs/tests/structure differ only at bca7358 — body says so); scrape base is fork commit 5ffe4d54 not in this repo, so not reproducible from the branch.
#9 [medium] PR #549 — exact hardware checks and gotchas
Live-check specifics for the cn7 job, derived from the code:
- Exposition names: flare_request_kv_pages, flare_reserved_kv_pages, flare_cached_kv_pages, flare_free_kv_pages, flare_total_kv_pages, flare_active_requests, flare_host_cache_reoffer_calls_total (metrics.rs:1172-1179, 1309-1318, 1827-1843).
- What request_kv_pages means: sum over slots with a request of private_pages.len() (scheduler.rs:1205-1208) + cache.request_pinned_pages (1220). request_pinned_pages = sum of tail_pages of every checkpoint with request_pins > 0 (cache.rs:825-846 filter node.request_pins>0).
- Discriminating shared-prefix assertion: request B on the same prefix pins the same checkpoint, so the cache counter does not move; only B's private pages add. So R2 - R1 = B's private pages, well below R1. A double count would show R2 - R1 ≈ R1.
- reserved_kv_pages is small under streaming load (author observed 2-3 of 21504) — assert it is >= 0 and consistent, do not gate on magnitude.
- Drain: retirement releases the request pin before the slot empties (scheduler.rs:3144-3150), so request_kv_pages must fall to 0 while flare_cached_kv_pages stays > 0. A stale nonzero value right after cancel is NOT a bug (publish is progress-gated, runtime.rs:1148-1149) — take the scrape after one further step of activity.
- Freshness: the gauge is the last published value, so scrape, idle the worker 10 s, scrape again unchanged; then send one request and scrape again to see it move. That validates api.md:305-307.
- Host store:
flare run --prefix-cache-memory SIZE(docs/prefix-cache-offload.md:884) to exercise deferred copy-outs; if no store is configured the retry key is never compared against differing resources, so the runtime.rs change goes untested on hardware.