#3 [high] Report of 2026-11-28, run 1551 — #549 worth merging, minor changes
Head bca7358 (+202/-34, 8 files). Verified this turn:
- cache.rs:519-589 pin_with/unpin_with single chain walk; counter add/sub only at 0->1 / 1->0 crossings (539, 565); unpin_request rejects when direct_request_pins==0 (547-549). Public pin/unpin unchanged (572-578).
- cache.rs:632-640 compaction: debug_assert node.request_pins == child.request_pins; union tail_pages stay in the counted heir, so request_pinned_pages is unchanged (correct: both were counted before).
- cache.rs:825-846 test-only drift assertion compares request_pinned_pages with a full scan of nodes on every stats() read.
- scheduler.rs:1199-1221 stats(): one pass over live slots adds private_pages + reserved_pages and counts active; request_pages = private + cache.request_pinned_pages.
- scheduler.rs:1636-1671 admission carries request_pin = inbound.is_none() once through pin_prefix/unpin_prefix; ticket parent keeps plain pin (1864, 1900).
- scheduler.rs:1882 (ticket waiters), 2970-2972 and 2990-2991 (boundary publications) use pin_request/unpin_request; 3142-3149 releases the request pin before request.take() at 3150.
- runtime.rs:2441-2454 zeroes request_pages/reserved_pages in the CopyoutResources retry key (struct at 1053-1059 derives PartialEq over SchedulerStats).
- metrics.rs:265-266, 517-518, 1309-1318 render both gauges; Snapshot (metrics.rs:70-129) does NOT contain them and docs/api.md:298-310 does not say so. But docs/api.md:292-296 already frames the table as the JSON subset ("Beyond the JSON fields below, the text includes ..."), so a one-clause addition suffices — no longer a blocker.
- tests: cache/tests.rs:320-373 phases one test over shared-page-once, plain-pin neutrality, error on ancestor unpin, compaction preserving the count; scheduler/tests.rs:970-1032 asserts stats.request_pages == shared + both private sets, reserved sum, and both zero after cancel with cached_pages > 0; metrics.rs:1782-1843 covers gauge names/types/values.
- docs/api.md:298-310 ratio (request+reserved)/total matches #548's mapping row; publishing rule matches runtime.rs:722/1149/745. Verdict: worth merging. Remaining: one clause on the JSON asymmetry, plus optional description prose fixes. Residual non-blocking notes: SchedulerStats doubles as the copy-out key (manual two-field exception, commented); a Debug-only cross-check that every live request with prefix Some carries a request pin would catch future mispairs; retired-page and restore-ticket pages stay outside both gauges (documented).
#5 [high] #549 run 4: re-verified counter invariant at bca7358 (compaction/scalar arithmetic)
PR #549, head bca7358 (+202/-34, 8 files). No new commits since run 1708; new comments only: WynnD live-validation table (2026-11-28 03:26) and a flare-autobot review (03:28, Changes Requested, 0 blockers, 2 should-fix, 4 subtractive ~55 lines, 7 nits; full review URL autobot.eidonix.com not fetchable from this sandbox).
Scalar-vs-scan invariant (my own derivation, not stated in the PR):
- Cache keeps
request_pinned_pagesas a scalar incremented by node.tail_pages.len() on the request_pins 0->1 crossing (cache.rs:536-541) and decremented on 1->0 (562-566); the test-only assertion in stats() compares it with sum of tail_pages over nodes with request_pins>0 (cache.rs:827-846). - Compaction (cache.rs:622-655) removes the ancestor and appends its tail_pages onto the heir, so the sum changes shape but not value; the debug_assert_eq!(node.request_pins, child.request_pins) at 636 guarantees "both counted or neither", because a request pin implies direct_pins>0 and compaction requires direct_pins==0, so the ancestor holds no direct request pin and its request_pins equals the single child's.
- retire_leaf/cancel_publication (cache.rs:603-620, 657-665, eviction_candidates 667-673) only remove nodes with pins==0, hence request_pins==0, so uncount() never has to subtract request pages.
- Addition uses the length at crossing time and subtraction uses the length at release time; any growth in between is only the absorbed ancestor's pages, which were counted when that ancestor crossed. Verified by the cache test (cache/tests.rs:331-360: 3 -> 2 -> 2 across compaction -> 0).
Pin/release pairing, all sites:
- request pins taken: admit_planned when inbound.is_none() (scheduler.rs:1636-1639 via pin_prefix), finish_inbound waiters (1882), publish_boundary Created (2970) and Existing+resumable (2990).
- request pins released only in retire (3144-3148), which now runs before request.take() at 3150; prefix is otherwise never set to None (grep), and no other path clears it.
- plain pins (host copy-out/export, ticket parent at admission when inbound+creating) released with plain unpin at 1864/1900 and via pin_checkpoint/unpin_checkpoint (2038/2042).
- Copy-out retry key: SchedulerStats embedded whole in CopyoutResources (runtime.rs:1053-1059), two fields zeroed at 2441-2450.
- Publish points for the gauges: runtime.rs:722 (startup), 745 (after shutdown drain), 1149 (a pass that made progress).
Verdict unchanged: worth merging; one optional doc clause (Snapshot/format=json does not carry the two gauges, metrics.rs:70-129 vs docs/api.md:292-296). Residual autobot subtractive items are micro-scale (bool-parameter helper shape, direct_request_pins guard) and do not change the verdict.
#6 [high] #549 run 4 final verdict (post live-validation + review comments)
#549, head bca7358, +202/-34, 8 files, open, no new commits. New since last report: WynnD live-validation table (2026-11-28 03:26, image = upstream main + #549 + #548 + #560; 16 concurrent streams 54-80 request pages / 16-22 reserved of 20,480; two-GPU DeepSeek-V4.1-Flash 399-402 / 2-3 of 21,504; 809 tests pass, 1 unrelated template test) and flare-autobot review (03:28, Changes Requested, 0 blockers, 2 should-fix = one API-doc sentence + one restored test assertion, 4 subtractive ~55 of 202 lines, 7 nits).
Verdict: WORTH MERGING (not worth another iteration round).
- Charter: closes #537, a reproducible defect with version/commit and reproduction (v0.3.2 c0c4f79) -> on the charter's merge list ("reproducible bug ... or bad docs"). Right layer (cache owns the counter, scheduler owns live slots, metrics renders); no flag, no per-model branch, no non-goal touched. Aligns with vision (KV pressure on SM120/DGX Spark compact hardware).
- No duplication, no simpler route: #537's alternative (split cached_kv_pages into pinned/idle) needs the same bookkeeping and yields a less usable number; a ratio gauge would hide the reserved term. The counter follows the cache's established no-scan-nodes pattern (cache.rs:257-275 vs 825-861).
- Cost: 2 u64 per Checkpoint, 1 usize, add/sub on a chain already walked, one pass over live slots in stats() that already counted active requests. No GPU work, no allocation, no scheduling change (retry-key zeroing runtime.rs:2441-2450 preserves that).
- Evidence honest and adequate; critique: the measured request-page values (54-80 of 20,480 at 16 streams; 399 of 21,504 on DeepSeek) are small, so the live data proves the gauges move and are consistent but does not reproduce #537's 16%-vs-9% heavy-context gap; Windows build, full helios suite, exported core -> CI (disclosed).
- Remaining cheap follow-ups, none gating: (a) docs/api.md:298-310 should say the two gauges are Prometheus-only (Snapshot, metrics.rs:70-129, does not carry them, while the JSON table starts at docs/api.md:330); (b) the reviewer's two should-fix items (one doc sentence, one restored test assertion) and ~55 deletable lines; (c) SchedulerStats is now also the copy-out retry key, so future fields must be judged for key-worthiness (commented exception is acceptable).
- Correctness re-verified at this head (see note #5): pin pairing complete, compaction arithmetic exact, eviction cannot strand counted pages, retirement releases before slot take, test-only drift assertion compares the scalar with a full scan on every stats() call.