Pre-test report — PR #549 "Report KV pages held by active requests" (head bca7358, +202/−34, 8 files)
Recommendation: REFER to hardware testing — but as ONE bounded job (~30 min, 1× GB10 on cn7), gated on CI green first. No throughput A/B.
This reverses my previous "do not test" verdict, because every item I gated on is now fixed at bca7358. I re-verified each in the code, not from the summaries. What remains is idiom duplication, one missing docs sentence, and a coverage nit — none of which changes a gauge value or any assertion a hardware test would carry, so hardware time would not be spent on code that will be rewritten.
1. What the change is
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). The cache half is maintained incrementally on pin/release (helios/src/cache.rs:519-570), never by scanningnodes— the constraint the PR states and the reasonCache::statsstays scan-free in release.flare_reserved_kv_pages= Σ live slots'reserved_pages.len()(scheduler.rs:1221).
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. Supported by new direct_request_pins/request_pins on Checkpoint and a pin_request/unpin_request API that every request-owned pin now routes through.
2. Prior gating items — all verified closed at this head
- Single chain walk.
pin_with/unpin_with(cache.rs:519-570) computechain(id)once (523, 553);pin/unpin(572-578),pin_request(583-585) andunpin_request(587-589) are one-line wrappers. The duplicate walk and duplicateVecallocation I gated on are gone. - Docs ratio fixed.
docs/api.md:308-310now states one ratio,(flare_request_kv_pages + flare_reserved_kv_pages)overflare_total_kv_pages. The self-contradictory "dividing either gauge" sentence is gone. - Publish cadence correct.
docs/api.md:305-307("when a scheduler pass makes progress, and again at startup and after the shutdown drain") matchesruntime.rs:1148-1149,722,743-746. #[cfg(test)]scaffolding removed from the operator API page.- Duplicated tests folded.
cache/tests.rs:320-373is one test (3 not 4 at 334; plain copy-out pin neutral at 342-345; compaction keeps the count at 357-358; 0 on last release at 359-360).scheduler/tests.rs:970-1032is one test (sums at 1021-1023, drain-to-zero at 1027-1031). - The round-one blocker stays fixed.
runtime.rs:2441-2453buildsCopyoutResourceswithSchedulerStats { request_pages: 0, reserved_pages: 0, ..stats() }, compared at2455.runtime.rs:1056is the only otherSchedulerStatscomparison, so the gauges cannot re-offer deferred host copy-outs.
3. Remaining issues — none blocks testing
- Conventions (should fix, non-blocking):
pin_prefix/unpin_prefix(scheduler.rs:2019-2033) are a bool-dispatched second wrapper pair beside the namedpin_checkpoint/unpin_checkpoint(2037-2043), and four request-pin sites bypass them (1882,2970/2972,2990/2991,3148). Behaviour is identical either way; the gauge semantics a test asserts survive any of the proposed fixes. Not a reason to withhold testing. - Docs (nit):
docs/api.md:298-310never says the two gauges are absent from?format=json, although the PR body does andapi.md:292-296routes text-only families explicitly. A JSON consumer reads zeros (api.md:317-318). Test-plan consequence: assert only against/metricstext, never the JSON object. - Coverage (nit, worth one line before merge):
cache.rs:547-548("checkpoint has no request pin to release") now has no reachable caller — plainunpinshort-circuits it becauseunpin_with(id, false)skips the request guard — andbca7358deleted the only test that reached it (cache/tests.rs:336now exercises the plain-unpinguard atcache.rs:550-551). Restore one line, or delete field plus guard; leaving both is the only losing option. - Nit: three passes over
self.slotsinstats()(1213, 1216, 1222-1233) where the new loop already covers them;retirere-readsprefix/error_code(3144-3145) though locals exist (3113, 3110);CopyoutResourcesstill embeds all ofSchedulerStats, so every future field silently joins the copy-out key.
Nothing here is a substantive architecture or quality problem. The accounting is exact: adjustments occur only at the 0↔1 crossings of request_pins; every nodes removal is gated on pins == 0; chain includes the target node, so a publication promoting an already-pinned ancestor cannot double count; compaction asserts ancestor/heir agreement and moves tail pages into the counted heir. The test-only drift assertion (cache.rs:825-846) compares the maintained count with a full scan on every stats() read across the suite — the strongest evidence in the PR and host-independent.
4. What CI already covers — correction to my own earlier claim
I previously said the author's filter omitted server::runtime::phase_tests. That was wrong. phase_tests is declared at runtime.rs:3956-3958, so -- server:: scheduler:: cache:: does select it, and the copy-out deferral tests (phase_tests.rs:6357-6431) and the re-offer counter test (6176-6197) were inside the reported 809-passed run.
More important for resource use: 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 (which also explains the author's single reported failure). :69-77 adds the CLI and flare-app suites.
So Stage 0 is free: get CI green on the head. There are no checks on bca7358. Do not spend a GPU slot running cargo test — that is what CI is for, and running the suite on a GPU host would be the definition of wasted hardware time on an observability-only change.
Genuine test gaps that a unit test should close (author-side, cheap, not hardware work):
publish_boundary'sExisting { ready: true }branch (scheduler.rs:2987-2998) — the shared-checkpoint re-pin, exactly where a double count would hide — has no stats assertion.- The folded scheduler test cancels rather than completes (
tests.rs:1027-1028), so theCreated-retire path is not directly asserted.
5. Expected value of the hardware run — moderate but narrow
What our hardware genuinely adds, and nothing else can:
- The gauges exist and move through a real progress-gated publish cycle in a serving worker (
runtime.rs:1148-1149) — the unit test drivesMetricsdirectly, so it proves rendering, not the loop. - Distinct-page semantics in a live pool. Two requests on the same prompt: the second pins the same checkpoint, so the cache counter does not move and only its private pages add. Assert
R2 − R1is far smaller thanR1. A double count would showR2 − R1 ≈ R1. The author's own numbers show this working (399 → 402, a differential of 3 against a ~29-page shared prompt) but on a fork base absent from this repo. - The
Inbound/restore window, whose size depends on real restore timing (scheduler.rs:1686-1688pops ticket pages fromfree_pages;1882pins only at ticket resolution). Documented as outside both gauges; only real timing shows the window is small. - Optionally, the
runtime.rskey fix under a real host store viaflare_host_cache_reoffer_calls_total(metrics.rs:1172-1179, incremented only on a genuine re-offer atruntime.rs:2482-2494). This bites only when deferred copy-outs exist, so it is optional, not a gate.
What it does not add, and why we are spending only 30 minutes:
- No GPU code is touched — no kernel, numerics, attention/MoE, allocation, eviction, or per-model branch. Blackwell-specific validation (cn5, TP4) buys nothing; the simplest single-GPU pool is the right instrument.
- No throughput risk to A/B. The only conceivable perf effect is the removed duplicate
Vec— already gone, and a host micro-benchmark at most. A main-vs-PR throughput run would be pure waste. - The arithmetic is host-computable. A sum over slot state plus a cache-maintained counter; nothing is booleanized, offset, or rounded at an RPC boundary.
- vLLM parity is a reporter question, not a test. The PR body disclaims cross-runtime comparison; #537's own option 1 is literally "
flare_request_kv_pages/flare_total_kv_pages", which the PR implements. Record the ratio; do not gate on it.
6. Test plan
Stage 0 — free, precondition (author / CI, no hardware)
CI green on the head: native-serving.yml Linux and Windows. Note the PR is still a draft with no checks run; if it is merged or promoted without green CI, bca7358 has never been through cargo test on a clean runner and this PR should not consume hardware before then.
Stage 1 — one job, ~30 minutes, cn7 only
cn7, 1× GB10, nvidia/Qwen3.8-27B-NVFP4 TP1 — the simplest single-GPU KV pool, so the ledger arithmetic has the least confounding machinery. Do not also run cn5/TP4; that would duplicate the same scrape at 4× the cost.
Serve once, no restarts, and scrape /metrics text only. Checks, in one session:
- Idle ledger. No request live:
flare_request_kv_pages == 0andflare_reserved_kv_pages == 0, withflare_cached_kv_pages > 0after a warm request. (Author: 0/0 with cached 2019.) - Publish freshness. Scrape, idle 10 s, scrape again — unchanged; then send one request and scrape again — it moves. This validates the corrected
api.md:305-307and documents that a stalled worker legitimately holds a stale value. Take post-activity scrapes after one further step, not at the instant of cancel. - Shared-prefix differential (the real assertion). Send two concurrent streaming requests on an identical ~1–2k-token prompt,
max_tokens~1500. Scrape; admit the second; scrape again. AssertR2 − R1is on the order of one request's private pages, i.e. much smaller thanR1. This is the distinct-page property nothing else tests live. - The bound. Assert
request + reserved ≤ total − free(the bound the definitions imply). Do not subtractcached— the docs correctly state pinned checkpoints count in both gauges. - Record, do not assert:
(request + reserved) / total, plusfree,cached,total. This is the artifact a maintainer needs for #537; it is the single most valuable output of the run and it must not become a pass/fail gate. - Drain. Cancel one request mid-flight, take one scrape after the next step: both gauges fall to 0 while
flare_cached_kv_pagesstays > 0. (Retirement releases the pin before the slot empties —scheduler.rs:3144-3150— so a stale nonzero at the instant of cancel is expected, not a bug.) - Optional, only if configured anyway: start with
flare run --prefix-cache-memory SIZE(docs/prefix-cache-offload.md:884), recordflare_host_cache_reoffer_calls_totaltwice across decode, confirm no per-step growth. Skip if deferred copy-outs never occur — the key is then never compared against differing resources and the check is vacuous.
Pass criteria: 1, 3, 4, 6 hold; 2 and 7 consistent with the docs; 5 recorded.
Explicitly 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 (fork base 5ffe4d54 is not in this repository, and it answers a reporter question, not a correctness one); no per-model sweeps; no JSON-snapshot assertions (the gauges are deliberately absent, and the docs do not yet say so).
Re-scope trigger: if the maintainer accepts the subtractive suggestion to drop flare_reserved_kv_pages (a gauge #537 did not request), drop checks on it and keep 1, 3, 4, 5, 6 — roughly half the assertions survive unchanged, so the job does not need re-planning.
7. Security / instruction-integrity note
The screening passes (all clear) agree with my own reading: no injection, no agent-directed instruction in the PR body, diff, or discussion. Two items worth naming for completeness, both benign: 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 are an honest measurement caveat ("the instance also served this agent session's own requests"), not an instruction.
8. Decision
Refer — bounded. Expected value is moderate but narrow: one ~30-minute cn7 job validates the parts only a live worker can show (gauge movement, distinct-page semantics under a real shared prefix, the restore window, the drain) on a change whose accounting is already proven correct and whose unit coverage comes free from existing CI. The PR is worth landing: it is correctly layered, model-agnostic, respects the Cache::stats no-scan constraint, and closes a reported observability gap.
Before merge, and not gating the hardware run: restore the unpin_request guard test (or delete the field plus guard), collapse or rename pin_prefix/unpin_prefix, add the one sentence that the two gauges are Prometheus-only, and get CI green on the head.