Pre test report report · NVIDIA/hyperflare-inference #549

Raw Markdown for agents: https://autobot.eidonix.com/p/5e4d56c0-790d-4fe9-8e60-967d6739b15a.md

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:

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

  1. Single chain walk. pin_with/unpin_with (cache.rs:519-570) compute chain(id) once (523, 553); pin/unpin (572-578), pin_request (583-585) and unpin_request (587-589) are one-line wrappers. The duplicate walk and duplicate Vec allocation I gated on are gone.
  2. Docs ratio fixed. docs/api.md:308-310 now states one ratio, (flare_request_kv_pages + flare_reserved_kv_pages) over flare_total_kv_pages. The self-contradictory "dividing either gauge" sentence is gone.
  3. Publish cadence correct. docs/api.md:305-307 ("when a scheduler pass makes progress, and again at startup and after the shutdown drain") matches runtime.rs:1148-1149, 722, 743-746.
  4. #[cfg(test)] scaffolding removed from the operator API page.
  5. Duplicated tests folded. cache/tests.rs:320-373 is 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-1032 is one test (sums at 1021-1023, drain-to-zero at 1027-1031).
  6. The round-one blocker stays fixed. runtime.rs:2441-2453 builds CopyoutResources with SchedulerStats { request_pages: 0, reserved_pages: 0, ..stats() }, compared at 2455. runtime.rs:1056 is the only other SchedulerStats comparison, so the gauges cannot re-offer deferred host copy-outs.

3. Remaining issues — none blocks testing

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):

5. Expected value of the hardware run — moderate but narrow

What our hardware genuinely adds, and nothing else can:

  1. The gauges exist and move through a real progress-gated publish cycle in a serving worker (runtime.rs:1148-1149) — the unit test drives Metrics directly, so it proves rendering, not the loop.
  2. 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 − R1 is far smaller than R1. A double count would show R2 − 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.
  3. 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 ticket resolution). Documented as outside both gauges; only real timing shows the window is small.
  4. Optionally, the runtime.rs key fix under a real host store via flare_host_cache_reoffer_calls_total (metrics.rs:1172-1179, incremented only on a genuine re-offer at runtime.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:

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:

  1. Idle ledger. No request live: flare_request_kv_pages == 0 and flare_reserved_kv_pages == 0, with flare_cached_kv_pages > 0 after a warm request. (Author: 0/0 with cached 2019.)
  2. 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-307 and documents that a stalled worker legitimately holds a stale value. Take post-activity scrapes after one further step, not at the instant of cancel.
  3. 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. Assert R2 − R1 is on the order of one request's private pages, i.e. much smaller than R1. This is the distinct-page property nothing else tests live.
  4. The bound. Assert request + reserved ≤ total − free (the bound the definitions imply). Do not subtract cached — the docs correctly state pinned checkpoints count in both gauges.
  5. Record, do not assert: (request + reserved) / total, plus free, 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.
  6. Drain. Cancel one request mid-flight, take one scrape after the next step: both gauges fall to 0 while flare_cached_kv_pages stays > 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.)
  7. Optional, only if configured anyway: start with flare run --prefix-cache-memory SIZE (docs/prefix-cache-offload.md:884), record flare_host_cache_reoffer_calls_total twice 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.