#1 [high] Change: what PR #549 does, size, files
PR #549 "Report KV pages held by active requests", author WynnD (association NONE), open, draft, opened 2026-11-26, head 5ed7af8, base main, 7 files +218/-10, no reviews, no CI checks on head, no comments at all (pr_comments empty).
Files: docs/api.md (+9), helios/src/cache.rs (+60/-1), helios/src/cache/lifecycle_tests.rs (+3), helios/src/cache/tests.rs (+24), helios/src/scheduler.rs (+38/-9), helios/src/scheduler/tests.rs (+66), helios/src/server/metrics.rs (+18).
Substance:
- cache.rs:
Checkpointgainsdirect_request_pinsandrequest_pins(subset of direct_pins/pins);PrefixCheckpointCachegains maintainedrequest_pinned_pagescount (cache.rs:222-224); newpin_request/unpin_request(cache.rs:548-580) that call pin/unpin then increment/decrement request pins along the whole ancestor chain, adding/subtractingnode.tail_pages.len()when a node's request_pins crosses 0/1;unpin_requesterrors whendirect_request_pins == 0;compact_ancestorgetsdebug_assert_eq!(node.request_pins, child.request_pins)(cache.rs:627);CacheStats::request_pinned_pages(cache.rs:188-189) exposed from stats (cache.rs:842); the test-only drift assertion instatsnow includes request_pinned_pages vs a full scan filteringrequest_pins > 0(cache.rs:817-837). - scheduler.rs:
SchedulerStatsgainsrequest_pagesandreserved_pages(scheduler.rs:130-133); computed inRequestScheduler::stats(scheduler.rs:1217-1228) as sum over live slots ofprivate_pages.len()+cache.request_pinned_pages, and sum ofreserved_pages.len(). - scheduler.rs pin call-site swaps: admission pin when
inbound.is_none()→ pin_request (1643-1649) and matching rollout unpins on the two error paths (1657-1691); ticket waiters (1900); boundary publication created (2971/2973) and existing-ready resume path (2991/2992); retirement release (3159). Plain pin retained when inbound.is_some() (ticket parent), and in pin_checkpoint/unpin_checkpoint (scheduler.rs:2038-2044) used by runtime.rs for host-store copy-out/export. - metrics.rs: two AtomicU64 gauges stored in
Metrics::scheduler(metrics.rs:514-518) and rendered asflare_request_kv_pages/flare_reserved_kv_pages(metrics.rs:1306-1318); not added to JSONSnapshot(server/metrics.rs:106cached_pagesfield list unchanged; snapshot() at :355-393 omits them). - docs/api.md:298-305 new prose paragraph defining both gauges and the ratio statement.
Claimed: visibility only, no allocation/eviction/scheduling change. Test evidence: Linux x86_64 release --lib -- cache:: scheduler:: server::metrics: 508 passed. Live scrape on two-GPU DeepSeek-V4.1-Flash with #536, base AzallazA fork 5ffe4d54 (needs engram, upstream #482). Closes #537.
#2 [high] Why: issue #537 (the motivating request) detail
Issue #537 "Metrics: KV cache usage cannot be computed with vLLM semantics (pages held by active requests are not exposed)", by Napuh, opened 2026-11-26 09:07 (same day as PR #549 opened; PR closes it). No comments on the issue.
Content: vLLM vllm:kv_cache_usage_perc = fraction of KV blocks held by running requests; prefix blocks with ref_count 0 count free. Existing Flare gauges total/free/cached/snapshot_backing give only bounds: 1-free/total very high (idle prefix + snapshot backing count as used); 1-(free+cached+snapshot)/total ~0% with active requests (lower bound); 1-(free+snapshot)/total ~16% (upper bound); vLLM same hw/load ~9%.
Root cause cited at v0.3.2 (c0c4f79): scheduler.rs:1697-1703 + Cache::pin cache.rs:499-522 — prefix-hit requests pin the chain and share tail pages in place, so those pages stay in flare_cached_kv_pages while in use; mid-request checkpoint capture moves private prompt pages into cache (scheduler.rs:2887-2911 shared_pages.extend(private_pages.drain(..pages))).
Proposal: (1) flare_request_kv_pages distinct pages referenced by active requests (each once) so ratio vs total_kv_pages matches vLLM; OR (2) split cached into pinned vs idle; optionally a ready-made flare_kv_cache_usage_ratio.
PR #549 implements proposal (1) plus an extra flare_reserved_kv_pages; it does NOT implement (2), the ratio gauge, nor the JSON snapshot field.
Referred to by: PR #541 (Grafana example mentions), #548 (mentions), #549 (closes).
Wanted-ness: single issue, one reporter, no comments, opened the same day the PR was opened — no long-standing demand visible in the local copy.
#3 [high] Change: verification of what the diff does and does not do
Verified against the head (5ed7af8):
pin_request/unpin_request(helios/src/cache.rs:548-580) call existingpin/unpin(cache.rs:519-546), then walkchain(id)(cache.rs:312-321) incrementingrequest_pinson the node and every ancestor, adding/subtractingnode.tail_pages.len()whenrequest_pinscrosses 0/1.unpin_requestrejects whendirect_request_pins == 0(cache.rs:566-568).CacheStats::request_pinned_pages(cache.rs:188) comes from the maintained field (cache.rs:842); the test-only drift assertion now compares it withnodes.values().filter(request_pins > 0).map(tail_pages.len()).sum()(cache.rs:817-837).compact_ancestor(cache.rs:613-646) keeps pages in the heir and gainsdebug_assert_eq!(node.request_pins, child.request_pins)at cache.rs:627 — debug builds only, so the description's "compaction asserts" is a debug assertion, and "a checkpoint leaves nodes only at zero pins" is pre-existing behaviour (eviction_candidatesrequiresdirect_pins == 0, cache.rs:658-663), not new enforcement by this PR.SchedulerStats::request_pages= Σprivate_pages.len()over live slots +cache.request_pinned_pages;reserved_pages= Σreserved_pages.len()(scheduler.rs:1216-1228). Slots hold at most one request (LiveRequestinslot.request), which is what "at most one slot per active request" means.- All request-owned pins verified swapped: admission when
inbound.is_none()and its two error-path unpins (scheduler.rs:1643-1691), ticket waiters (1900), boundary publish Created + parent unpin (2971-2974), Existing-ready resume (2991-2992), retirement (3159). Plain pins kept for the ticket parent (1647, 1662, 1688, 1882, 1918) and forpin_checkpoint/unpin_checkpoint(2038-2044), which runtime.rs uses for host-store copy-out/export (runtime.rs:2360-2489, 2698-2703).request.prefixis only ever set on the four request-pin paths (1902, 2979, 2996), so theunpin_requestat 3159 cannot fire without a matching request pin. No undeclared pin path found. - Gauge plumbing: two
AtomicU64s (metrics.rs:265-266) stored inMetrics::scheduler(metrics.rs:517-518, inside the same loop ascached_pages) and rendered asflare_request_kv_pages/flare_reserved_kv_pagesgauges (metrics.rs:1309-1318). JSONSnapshot(metrics.rs:90-129,snapshot()at :355-393) is untouched — matches the description. Metrics refresh happens on progress in the worker loop (runtime.rs:1148-1153) plus worker start/shutdown (722, 745). - Docs: docs/api.md:298-305 is prose only; the field table at docs/api.md:325-355 (which maps JSON field →
flare_*metric) was NOT given rows for the two new gauges, even though the table is the "one row per field" contract and the gauges are not in JSON. Small documentation inconsistency worth flagging.
#4 [high] Related work: #460 is the direct predecessor of the cache counter approach
PR #460 "Keep checkpoint cache counts instead of scanning for stats" by yatesdr (COLLABORATOR), merged 2026-11-23, +52/-3 in helios/src/cache.rs and cache/lifecycle_tests.rs. Commit 6d6fe0c6 / main history.
It created exactly the machinery #549 extends: kept ready_checkpoints/unready_checkpoints/tail_pages counters updated at publication, advance_completed, retire_leaf, compact_ancestor, plus the #[cfg(test)] assertion in stats comparing them to a full scan. #460's reason: the runtime loop reads stats on every pass (host-store copy-out retry key and the metrics refresh), and the scan was 49-58% of runtime-thread samples on a 4×RTX PRO 6000 GLM-5.3-Flash TP4 box with a Selene cache holding 500-900 checkpoints.
Consequence for #549: the design constraint "stats must not scan nodes" has a measured owner (yatesdr) and a measured justification; #549 honours it for the runtime build (counters only) but pin_request/unpin_request add an O(chain depth) walk per pin, and stats under cfg(test) still scans. This is the same file/area, so yatesdr is the natural reviewer and #549 is a direct follow-on to #460. #460 also references #459.
#5 [high] People: new contributor with two parallel metrics PRs, no engagement yet
WynnD = commit author "Wynn Drahorad" (commit 5ed7af86 "Report KV pages held by active requests"). GitHub association with the repo: NONE. In the last 180 days: 0 merged, 0 closed, 2 open — #548 (latency histograms/process metrics, closes #536) and #549 (this one, closes #537). Both opened 2026-11-26, both drafts, both signed "Discord: oystersmiles", both use the same evidence method (Linux x86_64 release lib tests + live scrape on a local two-GPU DeepSeek-V4.1-Flash llama-swap entry built from the repo Dockerfile on top of AzallazA fork commit 5ffe4d54, which carries the engram encoding from upstream PR #482 — an open PR by another author). Both descriptions explicitly say they and the other "merge in either order" and touch different regions of helios/src/server/metrics.rs. No prior history in this repo, so no standing as a priority contributor (charter names @voipmonitor, @original-el8, @lukealonso). People who own these areas: helios/src commits in last 180d — Luke Alonso (207), Martin Vit (47), yatesdr (47); docs — Luke Alonso (367). cache.rs/metrics.rs page-count work is yatesdr's (#92, #141, #168, #400, #415, #429, #460, #351); scheduler pin/prefix-cache pressure work is voipmonitor's (#298, #299). Engagement on #549 so far: none — no comments, no reviews, no reactions, and unlike #548 and #541 no flare-autobot case-file comment was posted on #549.
#6 [high] Related work: #537's other proposals unimplemented; #541 and #148/#149 connect
- Issue #537 (by Napuh, 2026-11-26 09:07) and issue #536 (metrics latency histograms) were both filed the same day as the two PRs that close them, and by the same external reporter pattern; #537 has zero comments. No evidence in the local copy of a long-standing or widely-requested need — one reporter, one day, one issue.
- #537 offers two alternatives plus an optional convenience: (1)
flare_request_kv_pages[implemented by #549], (2) splitflare_cached_kv_pagesinto pinned/idle [NOT implemented], and "a ready-made ratio gauge with vLLM semantics (e.g.flare_kv_cache_usage_ratio)" [NOT implemented; #549 leaves the ratio to the operator, documented in docs/api.md:303-305]. A reader of #537 might expect any of the three. - Cross-reference with #541 (open Grafana example, jere357): the autobot review there twice tells the author that "request-held pages appear in no gauge (issue #537)" and asks them to reword the KV panel description — i.e. #541's docs/review reasoning is written against the pre-#549 world; merging #549 makes that statement stale.
- #351 (merged, yatesdr) established that free + cached + snapshot_backing = pool for qualification's conservation check, and its qualification clients live under qualify/ at that time (now no
qualify/folder exists at head — only scripts/qualify_worker_failure.py and tests/reference/*). Since #549 does not add a JSON field and does not change free/cached/backing, those checks are unaffected. - Issue #148 (closed, duplicate of #149): cache-aware gateways wanted vLLM/sglang-compatible load gauges (
vllm:kv_cache_usage_perc). Same underlying need (KV pressure visible in a vLLM-compatible way), different proposal (a/v1/loadsroute); #149 is closed and the route is not on main. Not superseded by #549 but adjacent evidence that KV-usage exposure has been asked for before.
#7 [high] Claims and evidence: what the numbers actually show, and the gap that remains
Verified by reading the code (not by running it):
- Definition mismatch. docs/api.md:298-300 defines
flare_request_kv_pagesas "distinct KV pages that active requests reference … each page counted once even when several requests reference it". The scheduler value (scheduler.rs:1216-1222) isΣ request.private_pages.len()(correctly distinct: each page is owned by one slot)+ cache.request_pinned_pages.request_pinned_pagescounts a checkpoint's tail pages once if ANY request has request_pins > 0 on it (cache.rs:558-560), so shared checkpoint pages do dedupe across requests — that part matches. - But
private_pagesfor other requests are not deduped against pinned checkpoint pages, and a request'sshared_pages(the page chain it actually reads) is never used at all in the stat. After a boundary publication the request's own prompt pages move intoshared_pagesviaprivate_pages.drain(..pages)(scheduler.rs:2976-2978) and the new checkpoint is request-pinned, so those pages are counted once through the cache — consistent. Reservations are excluded from request_pages and reported separately, which matches the docs. - The test
request_kv_pages_count_shared_prefix_pages_once(scheduler/tests.rs:971-1032) assertsrequest_pages == shared + first_private + second_private, wheresharedis one request'sshared_pages.len()— i.e. the test bakes in that shared pages are counted once for both requests. It also asserts both become 0 aftercancel()whilecached_pages > 0. Note the test cancels rather than completing, so the terminal-publication path (retire with publish=true) is not the one asserted; retire'sunpin_requestis shared code, so coverage is partial, not absent. - The live numbers in the description are small: request_kv_pages 399/402 with reserved 3/2, against total 21504 and free 15582/15400, cached 2037/2043. Sanity: 21504-15582-2037 = 3885 pages unaccounted by free+cached, far more than 402 — the PR's own evidence shows request_pages does NOT close the gap the issue hoped for. The description acknowledges only that request+reserved stayed below total-free-cached.
- Reported ratio 0.0186/0.0187 == 399/21504 and 402/21504 (≈0.01856/0.01869) — arithmetic checks out.
- The PR's claim "No allocation, eviction, or scheduling decision changes" is consistent with the diff: no decision path reads the new counts; only Metrics and stats do. Caveat verified:
pin_requestadds an O(chain) walk plus an extrachain()call afterpin()(which itself walks the chain), so per-request admission/retirement work grows slightly; nothing reads the counters on the hot path.
#8 [high] Claims and evidence: test suite claimed, CI absent, live run not reproducible
Not executed by me — recorded as claimed, with what backs it:
- "Linux x86_64, release profile,
--lib -- cache:: scheduler:: server::metrics: 508 passed." Backed only by the description; no CI checks on head 5ed7af8 (orientation packet: "CI on the head commit: no checks"). The description itself says the Windows build and the full helios suite were not run and "CI covers" them. Compare #460 (the same machinery) which ran the full helios library: 1,542 passed, plus a revert check. - The drift assertion in
statsis the strongest safety net and it is real: everystats()call undercfg(test)comparesrequest_pinned_pagesto a full scan (cache.rs:818-837), so any cache/scheduler test that reads stats checks the counter. But it only runs in test builds — a release build has no check that pins and pages agree. request_kv_pages_count_shared_prefix_pages_once(scheduler/tests.rs:971) andrequest_pins_count_each_shared_page_once(cache/tests.rs:320-341) exist as described, including the "releasing the parent without a request pin is an error" assertion.counters_expose_fixed_names_without_request_payloads(metrics.rs:1784-1836 area) covers both gauges' types and values as described.- Live scrape evidence: two-GPU DeepSeek-V4.1-Flash, container built from repo Dockerfile together with #548's branch counterpart (#536's PR), swapped into a llama-swap entry, base AzallazA fork 5ffe4d54 (engram only in upstream #482, still open). The description admits the instance also served the agent's own traffic, so the gauges include it; no other runtime was compared. This is a single unreproducible instance run — the numbers cannot be re-derived by a reviewer.
- Untested by design or omission: multi-rank/TP (the gauges are per-worker sums over that worker's slots and its cache; each rank reports its own
total_kv_pages, so "dividing by total" is per-rank), multi-host Selene, and the Inbound/host-restore path's plain-pin branch (covered by the drift assertion only indirectly, since ticket-parent pins deliberately do not count as request pins).
#9 [high] Project fit: charter evidence bar and "smallest footprint" vs the chosen of two issue options
Facts, both where it lines up and where it does not:
- Lines up: charter "What gets merged" includes "bad docs" and PRs addressing a maintainer request; #537 is an issue in this repo, so #549 addresses a filed report. Charter's "PR descriptions: why / what changed / claimed result / evidence" — #549 has all four parts. It adds no per-model branch, no flag, no dependency, no API field, so it does not trip the model-agnostic, "pin everything", or "don't silently ignore API fields" rules. It is observability only.
- Tension: charter "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over
main… 'hypothetical users' aren't enough". #549's evidence is a single local two-GPU scrape on a fork-based container, self-admittedly polluted by the agent's own traffic, with no repeatable script, plus an unrun Windows build. There is no CI on the head commit. A reviewer cannot reproduce either the test run or the scrape. - Tension: charter "Solve the right problem in the right place… Look for the smallest footprint in shared code, or a way to solve it without new code at all." #549 adds two counters, a new pin API pair and a second pin bookkeeping dimension on every checkpoint to answer one metric. The issue itself listed the cheaper alternative (2) — split
flare_cached_kv_pagesinto pinned/idle — which reuses existingpins/direct_pinscounts and needs no per-node subset counters and no new API. The PR picked the more invasive of the two options without saying why. - Neutral / factual: docs/api.md's health-and-metrics section is the documented contract for
/metrics(docs/api.md:281-355). The new gauges are documented in prose (298-305) but the field/metric table (325-355) was not extended, and the JSON snapshot intentionally omits them (documented as "The fields in the table are integers…" at :316-323, and the gauges are not fields). Nothing in the repo's roadmap (SDK #6, Engram #267, FlashInfer #215) covers observability, so this is not a roadmap item. - AGENTS.md:77, :103 ask descriptions to connect each material claim to its evidence; AGENTS.md:64 warns against claiming beyond the stated evidence. #549 is disciplined about scope ("Visibility only… No allocation, eviction, or scheduling decision changes") but its live numbers do not demonstrate the outcome the issue wanted (a usable KV-usage ratio) — see the Claims entry.
#10 [high] Process and reach: draft, no CI, no intake comment, operator-only, no compat break
- Draft, opened and last updated 2026-11-26 (same day), head 5ed7af8, base main; no commits on main since it branched touched its files (orientation packet). 7 files, +218/-10.
- No CI checks on the head commit. No reviews, no comments at all (pr_comments returns nothing) — unlike sibling PRs #548 and #541, which both received flare-autobot case-file comments within ~30 minutes of opening. That absence is itself a fact for a reader: the automated intake has not run on #549 (possibly because the PR is a draft).
- Reach: operators only. Two new Prometheus gauges; JSON snapshot unchanged, so
flare_helios::server::Snapshotconsumers, the terminal dashboard (dashboard.rs), qualification Python clients (tests/server/test_cache_memory.py:34 readsflare_free_kv_pagesfrom text) andscripts/qualify_worker_failure.py:143are all unaffected. Free/cached/total semantics unchanged, so #351's free+cached+backing=pool conservation check still holds. - Compatibility/merge: description states it and #548 "merge in either order" because they touch different regions of helios/src/server/metrics.rs (page gauges beside
cached_pageshere, histograms beside the completion counter there). Verified the regions are distinct (metrics.rs:1309-1318 here vs #548's completion counter), so no textual conflict is likely; both add fields toSchedulerStatsin scheduler.rs — #548 does not (it works in runtime.rs/http.rs/latency.rs), so no conflict there either. - Deployment: no config, no default, no flag, no dependency change. Cost: per-request
pin_request/unpin_requestwalk the ancestor chain an extra time (cache.rs:551-563, 565-580); the metric read itself is O(slots) and safe on the runtime thread, which matters because stats is read on every progress pass (runtime.rs:1148-1153) and #460 was created precisely to keep that read cheap. - Documentation: docs/api.md 298-305 (prose only) and nothing else; docs/prefix-cache-offload.md:747 lists the SchedulerStats host fields but was not updated (it never listed cached_pages either, so not a regression).
#12 [high] Research summary
Case file assembled for PR #549 ("Report KV pages held by active requests", WynnD, draft, 7 files +218/−10, head 5ed7af8, no CI, no comments or reviews). Ten scratchpad entries cover every angle.
Key things a reader cannot get from the description: (1) the live-scrape evidence shows flare_request_kv_pages at 399/402 against 21504 total with 3885 pages still unaccounted by free+cached, so the gauge does not close the gap issue #537 set out to close; (2) #537 offered a cheaper alternative (split cached_kv_pages into pinned/idle, reusing the existing pin counts) that the PR did not take or explain; (3) the "compaction asserts" claim is a debug_assert only and "a checkpoint leaves nodes only at zero pins" is pre-existing behaviour, not new enforcement; (4) the docs prose was added but the JSON-field↔Prometheus table in docs/api.md was not extended; (5) no CI ran on the head commit and no automated intake comment appeared, unlike sibling PRs #548/#541.
The change is a direct successor to merged PR #460 (yatesdr), which created the very counters and drift assertion it extends; that also supplies the measured reason stats must not scan nodes. Related: #548 (same author, same day, different region of metrics.rs, stated to merge in either order), #541 (its review text still tells readers request-held pages appear in no gauge), #537 (the issue), #148/#149 (earlier vLLM-compatible KV-load request, closed unmerged). Project fit: description has all four charter parts and no model branch/flag/dependency, but the charter's evidence bar and "smallest footprint" rule are the tension points. Reach is operator-only: JSON snapshot, terminal dashboard and qualification clients are untouched.
#17 [high] Amendment: new head 9cca87ac "Keep page gauges out of the copy-out retry key" — what changed and what did not
New head since report #16: 9cca87ac "Keep page gauges out of the copy-out retry key" (Wynn Drahorad, 2026-11-26), on top of 5ed7af86. PR now 8 files, +246/−16, still draft, no CI evidence, no review on the new head (last comment is the author's 2026-11-27 04:56 "review the pushed changes"; the autobot review of 2026-11-26 22:38 is against the old head). Cited PR: https://github.com/NVIDIA/hyperflare-inference/pull/549
FIXED:
- Blocker (copy-out retry key) — fixed.
CopyoutResources { scheduler: SchedulerStats { request_pages: 0, reserved_pages: 0, ..self.scheduler.stats() } }(runtime.rs:2441-2453). Key is now byte-equivalent to pre-PR semantics; sound because every movement of request/reserved pages (admission, commit scheduler.rs:2433-2438, retirement) also movesfree_pages/cached_pages/active_requests, which stay in the key.SchedulerStatsPartialEq is used only here (runtime.rs:1053-1059, 2455).- BUT: no test for the fix (phase_tests.rs untouched), the Evidence section still reports the pre-fix 508-test run, and the PR description's "What changed" still lists only cache.rs / scheduler.rs / metrics.rs / docs/api.md — runtime.rs (+8/−1) is undocumented, and "No allocation, eviction, or scheduling decision changes" is still stated without recording that the gauges had briefly perturbed deferred copy-outs.
docs/api.md"gauges read from scheduler state on each scrape" replaced with worker-publishes wording (:302-303). Done.- Ratio paragraph rewritten (:303-312): reserved outside numerator,
request + reserved= comparable figure, request-pinned tail pages in both gauges, excludes retirement-draining and in-flight restore pages. Done. cache.rs:548-550doc comment now states the cache's half only ("a request's own private pages are counted by the scheduler"). Done.- Pin-release-before-take: retirement now releases
unpin_requestat scheduler.rs:3149-3157 beforerequest.take()(:3157), so a failed release leaves the request inspectable. Semantics preserved (record_publicationmoved too, queues an id only).
NOT DONE / NEW PROBLEMS:
- Pin-kind conditional not simplified as asked. Instead of carrying the choice in the
pinnedbinding, the commit addspin_prefix(id, request: bool)/unpin_prefix(scheduler.rs:2025-2040) pluslet request_pin = inbound.is_none()(:1643), used at only one of five request-pin sites (1645, 1656, 1678).cache.pin_request/unpin_requestare still called directly at :1889 (ticket waiters), :2977/:2999 (boundary publication), :3155 (retirement). Net +13 lines, two idioms for one operation, boolean-flag parameter — the opposite of the "carry it once inpinned" ask and against the Subtract aim. - Subtract/Simplify (~90 lines) untouched: scheduler/tests.rs still +66 (the duplicate of
branching_requests_own_distinct_tail_pages_and_terminal_snapshots, tests.rs:971-1034 vs 1037+), cache/tests.rs still +24,pin_request/unpin_requeststill walkchain()twice (cache.rs:551-563, 565-580). - docs/api.md 312: test internals leaked into the operator contract — "the test-only assertion in
Cache::statscompares the maintained request-pinned count with a full scan of every checkpoint on each read". The reviewer asked for the drift assertion as evidence in the PR, not as documented runtime behaviour; it exists only undercfg(test)(cache.rs:818-837). The field↔Prometheus table at docs/api.md:332-362 still has no rows forflare_request_kv_pages/flare_reserved_kv_pages(finding #4 of the report stands). - New prose inaccuracy: "The worker publishes both on every scheduler pass and a scrape reads the last published values" (docs/api.md:302-303). Publishing is gated on
progressand also happens once at worker start and once after shutdown (runtime.rs:722, 745, 1148-1149) — so it is "each pass that made progress", not every pass, and not only scheduler passes. Note #15's progress-gating observation stands. - Minor: "Dividing either gauge by
flare_total_kv_pages…" — dividing the reserved gauge gives no meaningful ratio; only the request (or request+reserved) gauge divides usefully.
#19 [high] Amendment addendum: the copy-out fix sits outside the claimed test filter
Correction/completion of entry #17 (same commit 9cca87ac, PR #549):
The fix's own file is outside the claimed test filter. The commit's only source change is helios/src/server/runtime.rs (+8/−1). The PR's Evidence section still reports cargo test --lib -- cache:: scheduler:: server::metrics, a name filter that does not select server::runtime::*; nothing in the new commit adds a test, and helios/src/server/runtime/phase_tests.rs is untouched by it. So the copy-out-key fix has no claimed coverage at all. Existing tests that could incidentally catch a regression: local_copyout_defers_without_a_pin_until_pending_admission_headroom_returns (phase_tests.rs:6357), local_copyout_rechecks_headroom_after_each_queued_pin (:6408), completed_copyout_retries_capacity_waiters_without_a_new_model_fence (:5890) — they assert copyout_headroom_deferrals counts, but only catch the regression if a page-boundary-crossing decode happens between deferred-copy-out retries, which I did not verify. Recommendation: one test that decodes across a page boundary while a copy-out is deferred and asserts the deferral count does not move.
Pin release moved but the failure mode it protects is now reachable earlier. retire (scheduler.rs:3094) now calls record_publication(prefix) and cache.unpin_request(prefix) at :3149-3156, before self.slots[..].request.take() at :3157. Previously a failed unpin_request lost the request; now it returns Err with the slot intact and retire is retryable (cancel/finish/fail_ticket/release_after_shutdown all re-enter it). record_publication dedups through offered_publications, so a retry cannot double-offer. Semantics equivalent otherwise; the terminal flush of self.publications order changed only in that the prefix id is now queued before the Created-terminal bookkeeping block (:3160-3168) — no reader depends on that order (store pulls the whole list).
Equivalent-quality nit in new prose (docs/api.md:309-310): "Dividing either gauge by flare_total_kv_pages …" — dividing the reserved gauge alone has no meaning; only request, or request+reserved, divides usefully. The sentence lists both because the previous one names request+reserved; a one-word fix ("Dividing that sum or the request gauge …").
#21 [high] Amendment: engagement changed — bot review now exists with Changes Requested
Supersedes report #16's "no autobot intake comment / no engagement" line for PR #549:
- The PR now has two flare-autobot comments: case file opened 2026-11-26 21:35 (case 993b6a3c, intake c610511d) and an Autobot Review at 2026-11-26 22:38, Recommendation: Changes Requested (98f8d847), plus the author's reply at 2026-11-27 04:56 asking for re-review. So the "unlike its sibling PRs, no automated intake comment appeared" observation is stale — it was true when I looked, and the comment has since appeared. No human review, no human comment: engagement is still bot-only.
- The bot review independently reaches five of my findings — docs prose accuracy (scrape vs worker publish; ratio sentence; snapshot-backing residual),
retirereleasing the pin beforerequest.take(), thepin_requestdoc comment claiming private pages, the duplicate scheduler test (+55 removable lines), folding pin_request/unpin_request (~25 lines), andflare_reserved_kv_pagesas unasked-for (~22-25 lines, conditional) — i.e. the same "subtract" tension the charter raises. It recommends "Changes Requested" and explicitly says "Nothing below asks for new code". - It does not mention: the ledger gap (#537's ~3,885 unaccounted pages in the PR's own scrape), that #537's cheaper pinned/idle split of
flare_cached_kv_pageswas neither taken nor explained, thatdocs/api.md's field↔Prometheus table (332-362) still lacks the two gauges, that the compaction claim is adebug_assert, or that the description is now stale about runtime.rs. Those remain my report's distinct findings.
#22 [high] Research summary
Amended the #549 case file for the new event (head 5ed7af86 → 9cca87ac, "Keep page gauges out of the copy-out retry key"). Notes 17–21 hold the detail.
Closes / strike from the old report: the copy-out retry-key blocker is fixed (runtime.rs:2441-2453) and I verified the zeroing is sound, not merely expedient — every transition the key no longer sees moves no cache resource, and SchedulerStats' PartialEq is used only there. Also done: the "read on each scrape" prose, the whole ratio paragraph, the cache.rs:548-550 doc comment, and the retire pin-release reordering before request.take() (retire is now re-enterable, record_publication dedups). The "no automated intake comment" observation is stale: a flare-autobot Changes Requested review exists (2026-11-26 22:38) plus the author's re-review request; still no human engagement.
Stands, with new detail: the subtract item was answered by adding code — pin_prefix/unpin_prefix plus a request_pin boolean at only three of five sites, leaving two idioms and the ~90 removable lines untouched. Two new prose inaccuracies: test internals (cfg(test) drift assertion) leaked into the operator contract, and "publishes on every scheduler pass" is wrong (progress-gated, plus start and shutdown). The ledger gap, the untaken cheaper #537 option, the unextended field↔Prometheus table and the debug_assert claim all stand unchanged.
New finding: the fix lives in helios/src/server/runtime.rs, which the PR's claimed test filter (cache:: scheduler:: server::metrics) does not select, and no test was added — the copy-out fix has no claimed coverage. Series context: the author now has four open drafts in two days (#548, #549, #552, #553) and #553's auto-review was halted on charter-alignment grounds, the same value gate #549 faces, which #549 answers only through the independently filed issue #537.
#23 [high] Amendment block for the report: what to replace, strike and add for #549 after 9cca87ac
Delivered to the reader as amendments to case file run 1349. Detail lives in notes #17 (what changed/what did not), #18 (series), #19 (fix outside the claimed test filter), #20 (zeroing soundness), #21 (engagement). Order to present:
Replace in the Scale/scope section: head 5ed7af86 → 9cca87ac "Keep page gauges out of the copy-out retry key" (Wynn Drahorad, 2026-11-26); 8 files, +246/−16 (was 7 / +218/−10), still draft. New diff file helios/src/server/runtime.rs (+8/−1); docs/api.md +16; scheduler.rs now +51/−14. The description's "What changed" still omits runtime.rs and still asserts "No allocation, eviction, or scheduling decision changes" without noting the gauges had briefly perturbed deferred copy-outs (docs/api.md's own text also still frames the numbers as scrape-time, see below).
Strike (closed by this event):
- Checkpoint-2 blocker "gauges leaked into the copy-out retry key" → fixed at runtime.rs:2441-2453 by zeroing
request_pages/reserved_pagesin the key; soundness verified (note #20;SchedulerStatsPartialEq used only at runtime.rs:2455). - The three prose items and the
cache.rs:548-550doc comment → done (docs/api.md:302-312; cache.rs:548-550). - "retire can fail after
request.take()" → done: release at scheduler.rs:3149-3156 precedes take at :3157; retire is retryable andrecord_publicationdedups viaoffered_publications(scheduler.rs:2001-2011). - Note #13's "no automated intake comment" and note #16's "no engagement" → stale: flare-autobot case file 2026-11-26 21:35 and Autobot Review 22:38, "Changes Requested" (case 993b6a3c, review 98f8d847), plus the author's 2026-11-27 04:56 re-review request. Still no human review or comment. The bot reaches five of my findings independently (prose accuracy ×3, pin-before-take, pin_request doc comment, duplicate scheduler test, folding the pin API,
flare_reserved_kv_pagesunasked-for); it does not reach the four findings below.
Stands, with new detail:
- Subtract/Simplify answered by adding:
pin_prefix/unpin_prefix(scheduler.rs:2025-2040) +request_pin(:1643) cover only :1645/:1656/:1678; directpin_request/unpin_requestremain at :1889, :2977, :2999, :3155 → two idioms, boolean-flag parameter, ~+13 lines; the ~90 removable lines untouched (scheduler/tests.rs still +66, duplicate test at tests.rs:971-1034 vs :1037+; cache/tests.rs +24; doublechain()walk cache.rs:551-563, 565-580). - Two new prose inaccuracies: docs/api.md:311-312 documents the
cfg(test)drift assertion (cache.rs:818-837) as runtime behaviour; docs/api.md:302-303 "publishes both on every scheduler pass" is wrong (progress-gated runtime.rs:1148-1149, plus start :722 and shutdown :745). Minor: docs/api.md:309-310 "Dividing either gauge byflare_total_kv_pages" invites dividing the reserved gauge. - Unchanged: ledger gap (#537's 399/402 vs ~3,885 unaccounted; 21504 − 15582 − 2037), #537's cheaper pinned/idle split neither taken nor explained, field↔Prometheus table docs/api.md:332-362 still lacks both gauges, compaction claim is
debug_assert_eq!only (cache.rs:627).
New finding: the fix's only source change is in helios/src/server/runtime.rs, while the Evidence section still reports --lib -- cache:: scheduler:: server::metrics (does not select server::runtime::*), no test was added, server/runtime/phase_tests.rs is untouched, and the 508-test result predates the fix → the copy-out fix has no claimed coverage. Candidate tests that could catch it only incidentally: phase_tests.rs:5890, 6357, 6408. Ask for one test that decodes across a page boundary with a copy-out deferred and asserts copyout_headroom_deferrals does not move.
Series context: WynnD has four open drafts in two days — #548 (+548/−25, closes #536), #549, #552 (+929/−26, stacked on #548), #553 (+303/−9) — plus issue #551; none merged. #553's auto-review was halted 2026-11-27 05:17: "Review Stopped — It is low value or does not align with the project charter" (value-proposition gate); #549's answer to that gate is the independently filed #537.
#11 [medium] Recent activity: KV-codec page work is the live neighbour; other file-mates do not overlap
- Recent main commits in the touched areas: ba35da3f (#538 cold pure-prefill discovery), c915b5f0 (#532 16-SM green context), c36a6a02 (#527 Latent576 page-split KV codec), 225758fe (#525 rANS parallelism), e685a975 (#529 GB300 PCI id), 3d8640c6 (#523 kv-codec disk conversion), e30d55db (#522 GPU confidence calibration), 716df00f (#504 pure-CUDA KV compression). Of these, only the KV-codec work (#527, #504) touches page semantics: c36a6a02 "add Latent576 page-split KV codec encoding" changes what a "page" is per layer while
total_pages/page_tokensstay the logical quantities the docs describe (docs/api.md:348"including compressed storage", metrics.rs:1405-1408). #549's counters count page IDs, so they inherit whatever the codec does — no conflict, but the ratio the docs recommend (docs/api.md:303-304) is a page ratio, not a byte ratio, which matters more now that pages can hold compressed data (#504, #527). - Immediately relevant recent work: 6d6fe0c6 / #460 (counters + drift assertion, yatesdr, 2026-11-23) — #549 extends it; f646bebc / #507 (persistent worker counter schema, metrics, Luke Alonso, 2026-11-24) — different region of metrics.rs, no overlap; 21a40f05 / #429 (host-cache linking, yatesdr) — touched metrics.rs and scheduler.rs but not the pin paths #549 changes.
- Orientation leads checked and judged not relevant: #542 (TP dispatch/PreparedAllToAll, FujitsuPolycom), #540 (cost-refresh/SAM drafts), #520 (snapshot slot assertions), #505 (FP32 graph inputs), #404 (activation steering), #306 (acceptance estimates), #301 (learned graph costs) — all touch scheduler.rs but in graph/cost/slot regions, not pin accounting or stats. #429/#400/#415/#358/#141/#92 touch metrics.rs for host-cache counters only — same file, different series. #482 (open, engram/EXL3) is only relevant because the PR's live evidence is based on that fork commit.
#13 [medium] Community: no engagement at all on #549, no automated intake comment
- Comments/reviews on #549: none.
pr_commentsreturned "No comments"; orientation packet says "Reviews: none yet". No reactions recorded. - Automated intake: #548 and #541 each received a flare-autobot case-file comment within roughly 30-60 minutes of opening ("A case file has been opened… Future reviews will auto-run 90 minutes after code updates are pushed"). #549, opened the same day by the same author as #548, has none. Recorded as fact only — the plausible explanation is that #549 is a draft and #548/#541 went through the intake at a different moment; I did not verify any gating rule.
- Referred to by (from
related_items/read_item): #536 (issue, open, "metrics latency histograms" — mentioned because #548 closes it and the same author wrote both), #537 (issue, open, closed by this PR), #482 (open PR by another author, engram/EXL3 — mentioned only because the live evidence is built on the AzallazA fork commit 5ffe4d54 that carries its engram encoding). None of these are review engagement on #549. - Interest level: the only external expressions of interest in the underlying problem are #537 (one reporter, Napuh, zero comments), #541 (a Grafana example whose review repeatedly cites #537 as a gap), and the older #148 (closed duplicate of #149, cache-aware gateway load reporting). No maintainer has commented on #537, #548 or #549 in the local copy.
- Note for whoever reads this later: the PR body carries "Discord: oystersmiles", which is the project's convention for contributor contact rather than engagement.
#14 [medium] Claims: reserved_pages is additive by construction; the residual is unattributed
Why flare_reserved_kv_pages is additive rather than overlapping, verified in code: at admission the scheduler pops reserved_count page ids out of self.free_pages into request.reserved_pages (scheduler.rs:1732-1735; also rebound in vision windows at 2183-2197), and only later moves them into private_pages as work is committed (request.private_pages.extend(allocated) at scheduler.rs:2434-2438, and private_pages.extend(reserved_pages) on retirement at 3170). So a reserved page is by construction not free, not in any checkpoint's tail_pages, and not yet in private_pages. That is what makes the docs sentence "neither free, cached, nor written" (docs/api.md:301-302) accurate, and it is why request_pages + reserved_pages can be summed without double counting.
- Unverified/unknown term in the same ledger: the live scrapes in the description do not report
flare_snapshot_backing_pages, so the 3885-page residual (21504 − 15582 − 2037) cannot be attributed from the description alone. Merged PR #351 (yatesdr, +81/−47) established that free + cached + snapshot_backing equals the pool at idle on two recorded real-server samples (25,239 + 31 + 4 = 25,274 and 19,564 + 3,351 + 2,467 = 25,382), which points at snapshot backing as the largest missing term in those scrapes. Also outside the four gauges: ticket pages held for in-flight host restores (allocated from free_pages inadmit_planned, scheduler.rs:1704-1706) and retired pages awaiting a fence (cache.retired_pages, scheduler.rs:843-847). I did not attempt to reconcile the live numbers further; the point recorded is that request_pages is not the term that closes the ledger.
#15 [medium] Reach: how the two gauges behave (per-rank, progress-gated, logical holds)
Facts about how the two gauges behave that bear on any decision, all verified in code:
- Per rank, not per deployment.
total_pagesis "the per-rank KV pool" (metrics.rs:1400-1402, docs/api.md:347) andSchedulerStatsis built per worker (self.metrics.scheduler(self.scheduler.stats())in each worker loop, runtime.rs:1149; also at worker start/shutdown 722, 745). Each rank's/metricstherefore reports that rank's request-held pages over that rank's pool, which is the right pairing for the documented ratio but means the two gauges are not additive across ranks. - Instantaneous gauge, refreshed only when the worker loop made progress (runtime.rs:1148-1153:
if progress { … }). During a fully stalled worker a scrape shows the last stored value. A scrape can also catch a moment between a slot's pages being retired and the cache counters being updated, but both are on the same thread, so no torn read between the two new gauges. - Cancelled/finished-but-undelivered requests: "Finished responses awaiting delivery … occupy no model execution slot or live KV cache" (docs/api.md:278-279), and cancel/preempt retire the slot immediately (
retire(handle, false)at scheduler.rs:3051-3052) even though physical pages are reclaimed later; so request_pages drops at retirement, not at fence completion. That makes the gauge a logical-hold count, not a physical-reclaim count, and reserved_pages drops at the same moment. Worth knowing before someone compares it to GPU memory. - The gauge ignores requests that are waiting but not yet admitted (they hold nothing), and inbound-waiting requests hold only their reservation, not shared pages, until
finish_inboundpins them (scheduler.rs:1898-1909).
#18 [medium] Amendment: author's series widened; first charter-alignment "Review Stopped" on a sibling
New context since report #16 (all WynnD, all 2026-11-26/27, none merged):
- #548 Add request latency histograms and process metrics (open, draft, +548/−25, closes #536) — still open, autobot "Changes Requested" 2026-11-26 22:00.
- #549 this PR (open, draft, +246/−16).
- #552 Report request timings on final responses (open, draft, +929/−26, closes #551) — stacked on #548, "merge #548 first"; states it does not touch #549's code.
- #553 Add vLLM-compatible per-request metrics (open, +303/−9) — its auto-review was Stopped at 2026-11-27 05:17: "Auto-Review halted due to finding: It is low value or does not align with the project charter" (Value Proposition Report at autobot.eidonix.com/p/0b596174-…). This is the first charter-alignment stop in the author's series and the same value-proposition gate that #549 and #548 sit in front of.
- Issue #551 (open, WynnD) the llama-swap timing gap #552 closes. Signal for the report's "project fit" and "people" sections: six items in under two days from a contributor with no merged work; the sibling that made the weakest operator case was stopped on charter grounds, while #549's case is anchored in a filed operator issue (#537), which remains its strongest charter argument. Also #549's own motivation text is now the strongest of the four because #537 exists independently.
#20 [medium] Amendment: the copy-out key fix is sound, not just expedient
Verified the zeroing is semantically right, not just expedient (PR #549 head 9cca87ac, runtime.rs:2441-2453):
- The key still carries
free_pages,cached_pages,active_requests,retiring_slots,free_slots,snapshot_*, all u64 counters,completed,exports,next. Every state change that could enable a deferred copy-out (a page freed, a checkpoint retired/evicted, a slot freed, a fence advancing, a pending admission shrinking) moves one of those. - The movements the fix removes from the key move no cache resource:
committakes pages fromrequest.reserved_pagesintorequest.private_pages(scheduler.rs:2433-2438, 2442), which changesreserved_pages/request_pagessplit but notfree_pages/cached_pages; a ticket waiter'spin_requeston a restore (scheduler.rs:1889) raises the cache's request-pinned count against already-cached pages, freeing nothing. - One residual gap (pre-existing, not introduced):
cached_pagesandfree_pagesdo not distinguish pinned cached pages, so if headroom forpin_checkpointever depended on evictable cache pages rather than on free pages, the key would still miss it.pin_checkpointneeds free pages/snapshots, so in practice the key stays sufficient. Worth one sentence in review, not a blocker.