Value proposition report · NVIDIA/hyperflare-inference #549

Raw Markdown for agents: https://autobot.eidonix.com/p/98a32ff2-d992-4470-b774-c7267b4ec2af.md

Verdict: worth merging, with small changes

The change is small, in the right layer, backed by real evidence, and closes a documented observability gap (#537). Nothing in it touches a charter non-goal. My requested changes are documentation/API-completeness plus one hardening point on the new dual pin API — not a redesign.

Does it fit the charter?

Correctness of the counter

I checked the places tail_pages mutates for the maintained count to drift: creation (cache.rs:448-465, starts at 0), count/uncount (258-275), and compact_ancestor (613-645). Compaction is handled correctly and asserted: the ancestor may have request_pins > 0 (a descendant's request pin bumps ancestor pins without a direct pin), and the added debug_assert_eq!(node.request_pins, child.request_pins) plus the "pages move into the counted heir" comment covers the both-counted-or-neither case, so the union length is preserved. Leaf retirement cannot strand pages because request_pins > 0 ⇒ pins > 0, and eviction requires pins == 0. Private pages are disjoint from request-pinned cache pages because publication drains them into tail_pages (2978, 3150-3152). The parent/child test asserting 3 rather than 4 (cache/tests.rs:320-341) is the right test for the "shared page counted once" property.

The strongest guard is the extension of the existing test-only drift assertion (cache.rs:819-837), which compares the maintained count with a full scan on every stats() read across the whole suite. That is proportionate for a counter whose only consumer is a gauge, and it is the same pattern the surrounding counters already use.

Known gaps (all small, all should be stated, not necessarily fixed): retiring slots' pages (retire.rs (not opened) path at scheduler.rs:3170-3183, returned to free_pages only after the fence at 3037), in-flight ticket pages reserved for an inbound restore (1704-1706), and snapshot backing pages remain outside both gauges. The evidence in the description is consistent with this: request + reserved stayed below total − free − cached.

Evidence

Meets the charter's bar: four-part description, Discord: line, no invented evidence, and an explicit statement of what was not run (Windows build, full helios suite → CI). The live scrape is the right shape — idle shows 0/0, two concurrent streams show 399/402 request pages, 3/2 reserved, 2037/2043 cached of 21504 total, plus the sanity inequality — and it correctly disclaims comparison with another runtime and notes the agent's own traffic is included. No performance claim is made, which is correct: this is visibility only, so the "benchmark against main" rule does not apply.

Changes I would ask for before merge

  1. Decide the JSON story. Snapshot (metrics.rs:68-129) is the documented format=json surface, and docs/api.md:325-355 is the JSON↔Prometheus table; the PR adds two Prometheus-only gauges and documents them only in prose. Either add both fields to Snapshot (two lines each, and the terminal dashboard in flare/src/dashboard.rs:382 could then show them) or say explicitly in docs/api.md that these two gauges are Prometheus-only and why. Silent divergence between the two formats is the kind of doc drift the repo's own prose rules push against.
  2. Fix the ratio sentence. docs/api.md:303-305 says dividing flare_request_kv_pages by flare_total_kv_pages "gives the KV share held by live requests". That excludes flare_reserved_kv_pages, so it understates what live requests actually hold — which is precisely the vLLM comparison #537 was opened for. Say so, and state which sum is intended (request + reserved).
  3. Harden the dual pin API against silent undercount. Cheapest option that matches house style: a #[cfg(debug_assertions)] (or test-gated) cross-check in Scheduler::stats/Cache::stats that every live request with prefix: Some(_) is backed by a request pin, mirroring the existing drift assertion. Alternatively make the flavor a type (Pin/RequestPin) so mixing cannot compile. Without one of these, the invariant lives only in comments and one unit test.
  4. Say what the gauges exclude. One sentence on retiring slot pages, in-flight ticket pages, and snapshot backing pages, in the HELP text or docs/api.md. The evidence already shows these regions exist; leaving them implicit invites the same "which number is the truth" confusion #537 complained about.

None of these changes the design; 1-4 are ~20 lines plus prose. #549 and #548 (#536) touch disjoint regions of metrics.rs (page gauges beside cached_pages there, histograms beside the completion counter here), so merge order does not matter.

Bottom line

Worth it with changes. A focused, well-evidenced, correctly-layered observability addition to a gap a user reported with reproduction detail, at a complexity cost the cache was explicitly designed to absorb. Request items 1-4, then merge; the Windows build and full helios suite should pass before landing, as the description itself flags.