#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.
#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).