Pre-test report — PR #549 "Report KV pages held by active requests" (head bca7358c, +202/−34, 8 files)
Recommendation: DO NOT REFER to hardware testing. Return to the author for one short round; when it lands, validation is host-side (CI + two unit assertions) and any GPU contact is an optional 10–15 minute scrape piggybacked on an already-scheduled run, not a dedicated job.
This reverses my previous run's "refer, one bounded cn7 job". The reversal is driven by new information, not by the code: the author's own 2026-11-28 validation numbers now show the gauges moving 54–80 pages of a 20,480-page pool (~0.3 %) with ~50 % jitter between scrapes at fixed load — which destroys the one assertion my plan relied on hardware to make — and an active proposal in this review round is to delete half the new surface outright.
1. What the change is (re-verified in code, not from summaries)
Two Prometheus-text-only gauges, closing #537:
flare_request_kv_pages= Σ live slots'private_pages.len()+CacheStats::request_pinned_pages(helios/src/scheduler.rs:1205-1209,1220).flare_reserved_kv_pages= Σ live slots'reserved_pages.len()(scheduler.rs:1221).
The cache half is maintained incrementally on pin/release (helios/src/cache.rs:519-570: pin_with/unpin_with, plus the one-line wrappers pin 572, unpin 576, pin_request 583, unpin_request 587), adding at the request_pins 0→1 crossing (539) and subtracting at 1→0 (565) — never by scanning nodes, which is the constraint the PR states and the reason Cache::stats stays scan-free in release. Rendered beside cached_kv_pages (helios/src/server/metrics.rs:1309-1318), stored from SchedulerStats (metrics.rs:517-518), deliberately absent from the JSON Snapshot (metrics.rs:68-129).
2. Why it is not ready to consume hardware
2.1 (Gating) The head has never been built or tested by anything
Head bca7358c has no CI checks (search_history confirms it is the newest commit; the PR is a draft with no human review). The repository's own CI runs exactly the suite a tester would run — .github/workflows/native-serving.yml:56-68 (not opened) executes cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) --features runtime-core,server on ubuntu-24.04 and windows-2022, with FLARE_TEST_TEMPLATE_DIR prepared at :28-31, and :69-77 adds the CLI and flare-app suites. Running the suite on a GPU host would be the first execution anywhere, and the definition of wasted hardware time on an observability-only change. The author's "809 passed" is a filtered local run (-- server:: scheduler:: cache::) on an unstated host; the Windows build is explicitly unrun.
2.2 (Gating) Half the changed surface is an active deletion candidate
The subtractive review — repeated across three review rounds, now with stronger arithmetic — asks to delete flare_reserved_kv_pages entirely (~20 lines across scheduler.rs:132-133, 1204, 1208, 1221, metrics.rs:266, 518, 1314-1318, 1791, 1836, runtime.rs:2448, docs/api.md:304-305, 308-309, scheduler/tests.rs:1019 (not opened), 1023, 1030) because #537 asks only for request-held pages. The author's own numbers now make that argument stronger, not weaker: reserved measured 16–22 pages of 20,480 (0.08–0.11 %) on Blackwell and 2–3 of 21,504 on DeepSeek. A test plan written today would spend assertions on a gauge that may not exist at merge.
2.3 (Gating) Two should-fix items named by the bot review on this same head
helios/src/scheduler.rs:2019-2033:pin_prefix/unpin_prefixis a second, bool-dispatched pin mechanism beside the named, documentedpin_checkpoint/unpin_checkpoint(2037-2043), and six request-pin sites bypass it (1882,2970/2972,2990/2991,3148). Request pins get two entry points where copy-out pins get exactly one. Behaviour is identical either way — but the fix rewrites the pin dispatch a test would be written against.helios/src/cache/tests.rs:336:bca7358silently deleted the only assertion that reachedunpin_request's release guard (cache.rs:547-549, "checkpoint has no request pin to release"). I verified this: the two survivingunpin_requestcalls (cache/tests.rs:338,359) are both preceded bypin_request, andunpin_with(id, false)short-circuits the guard. So the PR ships a new guard branch plus adirect_request_pinscounter (cache.rs:83, 461, 531, 547-549, 556) that no test reaches — against AGENTS.md:194-199 (not opened). One line restores it:assert!(cache.unpin_request(parent).is_err());beforecache/tests.rs:338(parent holds only descendant request pins, so the guard fires).
These are cheap fixes, not a redesign — but they mean assertions written now would test code that changes before merge, which priority 1 rules out.
2.4 The new live numbers invalidate the hardware plan's core assertion
Author's 2026-11-28 comment: 16 concurrent streams on one RTX PRO 6000 Blackwell serving the prepared Qwen3.8-Flash-Next-FLARE gb202 package (20,480 KV pages) → flare_request_kv_pages 54–80, flare_reserved_kv_pages 16–22. Two-GPU DeepSeek-V4.1-Flash, 2 concurrent chats → 399–402 request, 2–3 reserved, of 21,504.
- My prior plan's strongest live check was a shared-prefix differential: with two concurrent streams on one prompt,
R2 − R1should be far smaller thanR1(a double count would make them comparable). AtR1 = 54–80pages with a ~50 % scrape-to-scrape spread at fixed load, that differential is dominated by jitter. The check cannot discriminate. This is the single biggest reason the GPU job's value collapses. - The numbers are also 0.26–0.39 % of the pool against #537's ≈9 % vLLM reference on a different model, pool and load. The honest position (which I set out last run and restate): comparability is a reporter question for #537, not something a scrape on our fleet can settle. A run here yields one more self-consistent number.
- The image that produced these numbers was built from upstream main with this PR, #548 and #560 merged, on fork base
5ffe4d54which is not in this repository. Nothing about it is reproducible from the branch, and it isolates nothing.
2.5 There is no GPU-specific behaviour to validate
- No kernel, numerics, attention/MoE, allocation, eviction or per-model branch is touched. Blackwell/GB10-specific validation buys nothing.
- No throughput path changes; no A/B against main is meaningful. The only conceivable perf effect — a duplicate
Vecper pin — was removed atbca7358by thepin_withfold (cache.rs:523,553computechain(id)once). - The quantity is host-computable arithmetic: a sum over slot state plus a cache-maintained counter, with nothing booleanized, offset or rounded at an RPC boundary. A host test exercises exactly what the worker executes.
- The strongest evidence in the PR is host-side and already written: the
#[cfg(test)]drift assertion atcache.rs:825-846comparesrequest_pinned_pageswith a fullnodesscan on everystats()read, so the whole cache and scheduler suite checks the invariant.
3. Verified sound — this is why the PR is worth landing
I re-derived these at bca7358 rather than trusting the summaries:
- Pin symmetry. Invariant audited:
LiveRequest::prefix == Some(id)iff exactly one request pin is held. Admission binds the kind once (scheduler.rs:1636request_pin = inbound.is_none(), dispatch at1638with releases reusing the same flag at1649,1671); ticket waiters re-pin withpin_request(1882); both boundary outcomes pin the new checkpoint and release the parent (2970-2972Created,2990-2991Existing{ready:true}); retirement releases before the slot empties (3144-3150). Host-store ticket parents and copy-out/export pins correctly keep the plain API (1864,1900,2037-2043), so the new "no request pin to release" error has no reachable caller in production. - The counter cannot drift or underflow. All guards precede mutation in
pin_with/unpin_with; the counter moves only at 0↔1 crossings;retire_leaf/compact_ancestorare reachable only atpins == 0(cache.rs:659,670) andrequest_pins ≤ pins, so no counted node can leavenodes; compaction asserts ancestor/heir agreement (cache.rs:636) and leaves the pages in the already-counted heir (638-640); a test pins the arithmetic numerically 3 → 2 → 2 → 2 → 0 (cache/tests.rs:334-360). - The one real hazard is defused.
SchedulerStatsderivesPartialEqand is embedded whole inCopyoutResources(runtime.rs:1053-1059), so decode crossing a page boundary would have re-offered deferred host copy-outs.runtime.rs:2441-2450zeroes both fields in the key with a comment saying why;runtime.rs:1055is the only other comparison. The pre-PR semantics (retry || progress || resources changed) are restored exactly. - Docs match the code where they matter:
docs/api.md:298-310states the definitions, the non-disjointness withflare_cached_kv_pages, the exclusions (draining pages, restore-ticket pages), the progress-gated publish cadence (matchingruntime.rs:1148-1149,722,743-746) and one ratio,(request + reserved)/total.
Remaining non-blocking items worth folding into the same round: docs/api.md:298-310 never says the two gauges are absent from ?format=json (a JSON consumer reads zeros per api.md:317-318, and the field table at api.md:330-360 gains no row) — test-plan consequence: assert only against /metrics text, never the JSON object; stats() still scans self.slots four times (scheduler.rs:1213, 1216, 1222-1233); retire re-reads prefix/error_code already bound at 3113/3110; CopyoutResources still embeds all of SchedulerStats, so each future field silently joins the copy-out key.
Two genuine test gaps a unit test should close (author-side, not hardware):
publish_boundary'sExisting { ready: true }branch (scheduler.rs:2987-2999) — the shared-checkpoint re-pin, exactly where a double count would hide — has nostats().request_pagesassertion.- The folded scheduler test cancels rather than completes (
scheduler/tests.rs:1027-1030(not opened)), so theCreated-retire path is not directly asserted.
4. Test plan (for when the preconditions land — do not run today)
Stage 0 — free, and the actual validation (author + CI, no hardware)
- CI green on the head, Linux and Windows, via
native-serving.yml(not opened) (full helios suite, not the filtered local run). This has never happened onbca7358. - Restore the guard assertion (
cache/tests.rs:336) or deletedirect_request_pinsplus the guard — not both. Confirm the drift assertion atcache.rs:825-846stays silent across the cache, scheduler and lifecycle tests. - Add the two missing unit assertions from §3 (the
Existing{ready:true}re-pin, and one completed retirement beside the two cancels). Both are host-side and cost minutes.
Stage 1 — optional, ~10–15 min, cn7 only, and only piggybacked
Do not book a slot for this. If a dashboard or qualification run is already going out on cn7 (1× GB10, nvidia/Qwen3.8-27B-NVFP4 TP1 — the simplest single-GPU KV pool, least confounding arithmetic), add five scrapes of /metrics text. Do not also use cn5/TP4; that duplicates the same scrape at 4× the cost.
- Idle ledger. No request live:
flare_request_kv_pages == 0,flare_reserved_kv_pages == 0,flare_cached_kv_pages > 0after a warm request. - Publish freshness. Scrape, idle 10 s, scrape again — unchanged; send one request, scrape after one further step — it moves. Validates the corrected
api.md:305-307and documents that a stalled worker legitimately holds a stale value. - Ledger bound.
request + reserved ≤ total − free. Do not subtractcached: the docs correctly state pinned checkpoints count in both gauges. - Differential — record, do not assert. Two concurrent streams on one ~1–2k-token prompt; log
R1,R2,cached,free,total. Given §2.4 the spread swamps the signal, so treat it as data for #537, not a pass/fail. - Drain. Cancel one request mid-flight, scrape after the next step: both gauges fall to 0 while
flare_cached_kv_pagesstays > 0. (A stale nonzero at the instant of cancel is expected — retirement releases the pin before the slot empties.) - Record
(request + reserved) / total. The single most valuable output, and the only thing that helps a maintainer judge #537. Never a gate.
Excluded, with reasons: no throughput A/B against main (no perf path changed); no soak; no multi-model or multi-hardware matrix; no repeat of the author's two-GPU DeepSeek scrape (unreproducible fork base, answers a reporter question); no JSON-snapshot assertions (gauges deliberately absent); nothing at all on flare_reserved_kv_pages if §2.2 is accepted — a re-scope of that item drops checks 1's second gauge but leaves 2–6 intact.
5. Expected value
- Today: low. A dedicated job would be the first build/test of a draft head, would spend assertions on a gauge under deletion, and would chase a differential that the author's own numbers show to be jitter-dominated. No GPU, kernel or numerics behaviour is engaged.
- After the round in §2–§3 lands: still low for hardware, high for a merge decision. The change's correctness rests on the maintained counter, the drift assertion, the compaction/eviction invariants and the copy-out key fix — all host-verifiable. Hardware adds exactly one thing: confirmation that the gauges move through a real progress-gated publish cycle in a serving worker and drain to zero, which is worth 10–15 piggybacked minutes and not a booked slot.
6. Recommendation and re-referral condition
Not referred to hardware testing. Return to the author for: CI green on the head; the unpin_request guard assertion restored (or field+guard deleted); pin_prefix/unpin_prefix collapsed or the six direct sites routed; the Prometheus-only/JSON sentence in docs/api.md; and a decision on whether flare_reserved_kv_pages stays. None of this is a redesign — the accounting has been independently traced as exact across admission, ticket resolution, both boundary outcomes, compaction, eviction, retirement, cancel, preemption and shutdown, and the copy-out retry key is correctly insulated.
Re-refer only if the maintainer wants a fleet-measured KV figure for #537 after the above lands — and then as the 10–15 minute piggyback scrape above, not a dedicated job.
7. Security / instruction-integrity note
The screening passes (all clear) agree with my own reading: no prompt injection or agent-directed instruction in the PR body, diff or discussion. Two benign items for completeness: the author's one-line "review the pushed changes" comment is an ordinary workflow request, and the #autobot:ignore opt-out token appears only in this repository's own automation boilerplate. The PR body's live-scrape figures carry an honest measurement caveat ("the instance also served this agent session's own requests"), not an instruction. Nothing in the review material attempts to direct this assessment.