Prose review — PR #549 "Report KV pages held by active requests"
Key findings
Verdict at head bca7358: nits only. No blocking and no should-fix prose defect remains. Every claim in the description's "What changed", "Claimed result" and "Evidence", and every new code comment and metric help string, was checked against the code at the head commit and is accurate.
Two nits survive in the single documentation hunk (docs/api.md:298-310):
- The paragraph never says the two new gauges are absent from the
?format=jsonsnapshot, even though the PR description states it outright ("They are not added to the JSON snapshot"), the adjacent paragraph atdocs/api.md:292-296explicitly routes text-only metric families, and the JSON field table atdocs/api.md:330-360has no row for either gauge. One sentence fixes it. - The paragraph calls the ratio "the share comparable to vLLM's
kv_cache_usage_perc" without qualification, while the description explicitly disclaims any cross-runtime comparison. Either mark it as the vLLM definition being modelled, or note that no side-by-side vLLM run was made.
Both defects that my earlier pass raised against the description at head 9cca87a are now fixed in bca7358: the missing helios/src/server/runtime.rs bullet and the "counts once for every request" sentence.
Scope and rules applied
Scope at head bca7358 (pr_diff): 8 files, +202/−34. The only documentation change is one hunk inserting docs/api.md:298-310 (13 lines) between the metrics preamble (docs/api.md:281-296) and the JSON/Accept paragraph (docs/api.md:312-319). Everything else is code, tests, and the description itself. The sole commit subject is "Fix KV-page docs ratio and fold duplicated page tests" (bca7358c, Wynn Drahorad); the parent is "Keep page gauges out of the copy-out retry key" (9cca87ac), and the original is "Report KV pages held by active requests" (5ed7af86).
Rules judged against (read in full):
AGENTS.md:43-65"Required prose review": the prose skill applies to documentation, code comments, and PR titles and descriptions;AGENTS.md:52-60requires documents to specify architecture or instruct agents, to state support as present qualification ("what is implemented, the hardware and configurations on which it is qualified, and what is not qualified"), and to keep unrun checks out of design documents;AGENTS.md:62-65requires reviewing the published text, including PR descriptions, against the skill.AGENTS.md:72-113"Required PR descriptions": four questions in order — why, what exactly changed, what benefit is claimed, what evidence supports it — withAGENTS.md:95-102demanding that expectation be distinguished from measurement, andAGENTS.md:103-112demanding each claim be tied to its check and its limits stated.AGENTS.md:114-140: hierarchy, resolved references, no process assurances, and "Do not publish it if the rationale, exact change, claimed benefit, supporting evidence, or material limitations must be guessed."AGENTS.md:142-153: the Discord line comes after the technical explanation with no leading@. PR #549 ends withDiscord: oystersmiles— compliant.docs/design-review.md:137-152(not opened) (principle 16, "Write without hidden context"): reject prose that leaves the four answers implicit or presents them out of order..agents/skills/repo-prose/SKILL.md:35-46(not opened) (evidence as conditions → measurement → result → conclusion) and:56-59(quote the passage, name the missing context, supply a rewrite).- Charter line 35 (what gets merged) and line 44 (GPU kernel scope, not engaged by this PR).
The PR satisfies the required four-part description structure and labels its single measurement ("Live scrape on the local two-GPU DeepSeek-V4.1-Flash setup"), discloses what was not run ("Not run here: any GPU workload beyond the scrape above, an exported core, the Windows build, and the full helios suite"), and disclaims cross-runtime comparison. The findings are about specific sentences inside those sections, not the scheme.
Findings
Nit 1 — docs/api.md:298-310: the paragraph does not say both gauges are Prometheus-text only
The new paragraph is:
"
flare_request_kv_pagescounts the distinct KV pages that requests owning a model slot reference: their private pages plus the tail pages of the prefix checkpoints they pin, each page counted once even when several requests reference it. It is not disjoint fromflare_cached_kv_pages: a pinned checkpoint stays published, so its tail pages count in both gauges. Neither gauge counts pages draining after a request retires, or a restore ticket's in-flight pages.flare_reserved_kv_pagescounts pages reserved for those requests' growth that are neither free, cached, nor written yet. The worker publishes both when a scheduler pass makes progress, and again at startup and after the shutdown drain; a scrape reads the last published values.(flare_request_kv_pages + flare_reserved_kv_pages)overflare_total_kv_pagesis the share comparable to vLLM'skv_cache_usage_perc; idle cached prefixes and snapshot backing pages are outside it."
Nothing in it says the two gauges are absent from the JSON object, yet:
- the description states it: "They are not added to the JSON snapshot";
- the neighbouring paragraph at
docs/api.md:292-296already establishes the convention of telling readers which families are text-only: "Beyond the JSON fields below, the text includes speculative and proposal counters by batch, width, or depth, graph launches by kind, embedding row-cache counters, HTTP admission gauges, and uptime." The two new gauges are another such text-only family and are not enumerated there; - the JSON field table at
docs/api.md:330-360has norequest_pages/reserved_pagesrow, and in codeMetricsgains the two atomics (helios/src/server/metrics.rs:265-266, stored at:517-518) whileSnapshot(helios/src/server/metrics.rs:70, page fields at:106and:108) gains nothing — I confirmedrequest_pages/reserved_pagesappear inmetrics.rsonly inMetrics, its store call, the two help strings, and a test fixture.
Why it matters: AGENTS.md:52-60 requires support to be stated as present qualification, and SKILL.md:35-46 (not opened) requires stating the limit where it matters. A dashboard author who has read this paragraph using ?format=json (documented at docs/api.md:312-319) will read the fields as zero, since Snapshot "deserializes the object, reading absent fields as zero" (docs/api.md:317-318), and conclude no request holds KV pages. The description already carries the fact, so the doc is the only place it is missing.
Fix: one sentence inside the paragraph, e.g. "Neither gauge appears in the ?format=json snapshot."
Nit 2 — docs/api.md:308-310: unqualified vLLM comparability
"
(flare_request_kv_pages + flare_reserved_kv_pages)overflare_total_kv_pagesis the share comparable to vLLM'skv_cache_usage_perc; idle cached prefixes and snapshot backing pages are outside it."
Against the description: "No comparison with another runtime is claimed; the measurements describe this two-GPU instance only." and, for the scrape, "The request gauge over the total measured 0.0186 and 0.0187; the share the documentation defines, (request + reserved) / total, is 0.0187 and 0.0188 by arithmetic on the same counts."
Why it matters: AGENTS.md:55-57 requires support stated as present qualification, and AGENTS.md:95-102 requires distinguishing expectation from measurement. The mapping here is definitional (vLLM counts blocks held by running requests over total blocks), so it is defensible as a definition, but as written the docs assert a cross-runtime equivalence the PR itself declines to claim and never tested. A reader comparing the two stacks side by side is entitled to know that no such run was made.
Fix: reword to "matches the definition of vLLM's kv_cache_usage_perc", or add one clause stating no side-by-side vLLM run was made. If the author did run one, the Evidence section should say so.
Consistency point (not counted as a nit) — three different names for the same set
docs/api.md:298-299: "requests owning a model slot"helios/src/scheduler.rs:130: "Distinct KV pages active requests reference: private pages plus their pinned prefix-checkpoint pages."helios/src/server/metrics.rs:1311: "Distinct KV pages referenced by active requests: private pages plus pinned prefix-checkpoint pages, each counted once."
All three describe the same computation, self.slots.iter().filter_map(|slot| slot.request.as_ref()) at helios/src/scheduler.rs:1205, which includes Inbound waiters (helios/src/scheduler.rs:137-138 notes they "count as active"). The docs wording is the exact one; adopting it in the two code sites would remove a reader's question about whether a restore waiter's pages are included.
What was verified as sound at head bca7358
Description accuracy against the code:
- The
helios/src/cache.rsbullet:pin_with/unpin_withtake arequestflag; the 0→1 add and 1→0 subtract of the checkpoint's tail pages are athelios/src/cache.rs:536-541and:561-566;unpin_requestrejects a release when the checkpoint holds no request pin athelios/src/cache.rs:547-549; the compaction assertion is at:636with the heir's page move at:638-641; the description now says "there is no rule that a checkpoint leavesnodesonly at zero pins", which the compaction path confirms. - The
helios/src/scheduler.rsbullet: the retirement release runs before the slot is emptied (helios/src/scheduler.rs:3142-3149beforerequest.take()at:3150); ticket-parent pins that belong to host-store admission keep the plain API (:1864,:1900). - The
helios/src/server/runtime.rsbullet: zeroingrequest_pagesandreserved_pagesin the deferred copy-out retry key matcheshelios/src/server/runtime.rs:2441-2449. - The
helios/src/server/metrics.rsbullet: both values are stored fromSchedulerStats(:517-518) and rendered as gauges (:1309-1318);Snapshotgains nothing. - The new
docs/api.mdclaim that the worker "publishes both when a scheduler pass makes progress, and again at startup and after the shutdown drain" matcheshelios/src/server/runtime.rs:1148-1153(store only whenprogress),:722(before ready) and:743-746(aftershutdown.drained). - The docs claim that retired draining pages and a restore ticket's in-flight pages are in neither gauge: ticket pages are popped from free at
helios/src/scheduler.rs:1686-1688and only pinned at:1882. - The docs claim that a pinned checkpoint overlaps
flare_cached_kv_pagesand that idle cached prefixes and snapshot backing are outside the ratio: consistent withhelios/src/scheduler.rs:1216-1229and thesnapshot_backing_pageshelp string athelios/src/server/metrics.rs:1295-1297. - The "Why" paragraph is a causal argument, not a task list:
Cache::statsmust not scannodes(helios/src/cache.rs:816-837scans only under#[cfg(test)]; the shipped counters are maintained at:258-275and:551-580), which is exactly why the count is maintained on pins instead. - Cost claims are stated as read from the code, not measured, and are accurate in kind: one chain walk (
helios/src/cache.rs:519-570), twou64fields per checkpoint (:81-86), oneusizeon the cache (:219-224), one extra pass over live slots (helios/src/scheduler.rs:1200-1221). - New code comments (
helios/src/cache.rs:81-86,:188,:219-224,:580-582,:635-636;helios/src/scheduler.rs:130-133,:2018,:3142-3143;helios/src/server/runtime.rs:2441-2449) state invariants and reasons rather than narrating change history — whatSKILL.md:38(not opened) asks for. - Evidence limits are visible, as
AGENTS.md:103-112requires: the single-instance scrape is labelled, the failing test is named with its cause (FLARE_TEST_TEMPLATE_DIRfromtests/frontend/prepare_templates.py(not opened)), the test count (809 passed, 1 failed) is tied to a filter, and unrun checks are listed.
Fixes already landed at bca7358 against my previous pass at 9cca87a:
- The description gained the
helios/src/server/runtime.rsbullet for the copy-out retry key. - The description's shared-ancestor sentence now reads "counts once, however many requests reference it", matching
helios/src/cache.rs:536-541and the test athelios/src/cache/tests.rs:331-334. - The compaction sentence no longer asserts a zero-pin rule for leaving
nodes. docs/api.mddropped the#[cfg(test)]drift-assertion sentence, replaced "Dividing either gauge" with the explicit(request + reserved) / totalshare, and now describes the publish conditions correctly.
Open questions and what could not be checked
- Commit message bodies.
search_historyreturns only subjects, so I reviewed the PR description, not the full body of5ed7af86/9cca87ac/bca7358c.AGENTS.md:38-41and:46-48apply the same prose standard to commit messages; if a body repeats a sentence since corrected in the description, the repair applies there too. Reading the bodies would settle it. - Whether a vLLM comparison was actually run. The description says none was; if the claim at
docs/api.md:309rests on an unstated measurement, that meas`urement should appear in Evidence, not only in the docs. - The live-scrape numbers themselves. I cannot re-measure them (no GPUs here) and did not try; the arithmetic is internally consistent —
request + reserved ≤ total − freeholds for both scrapes (402 vs 5922, 404 vs 6104) and(request + reserved) / totalgives the stated 0.0187/0.0188. The description's own caveat that the instance served this agent session's traffic is appropriately disclosed. - The Windows build and full helios suite are disclosed as unrun;
AGENTS.md:57-58asks that unrun checks be recorded indocs/TODO.txtrather than design documents, and the PR puts them in the description instead, whichAGENTS.md:105-106explicitly permits for a PR description ("State what remains untested or inconclusive").