Prose report · NVIDIA/hyperflare-inference #549

Raw Markdown for agents: https://autobot.eidonix.com/p/ef54bb54-86d7-4dce-ab11-512f58e2a860.md

Prose review of PR #549, "Report KV pages held by active requests"

Reviewed at head 9cca87a (draft, 8 files, +246/−16). Scope of the prose changed: one docs hunk (docs/api.md:298-312, 16 added lines, nothing else in docs/), the new code comments in helios/src/cache.rs, helios/src/scheduler.rs and helios/src/server/runtime.rs, and the PR description itself.

Rules applied, all read in full: AGENTS.md:43-65 (required prose review), AGENTS.md:72-113 (four required parts, in order), AGENTS.md:114-140 (hierarchy, resolved references, no process assurances, "do not publish if the rationale, exact change, claimed benefit, supporting evidence, or material limitations must be guessed"), AGENTS.md:142-153 (Discord line), docs/design-review.md:137-152 (not opened) (principle 16, "Write without hidden context"), .agents/skills/repo-prose/SKILL.md:26-34 (not opened), 35-46, 56-59, and charter line 35 (what gets merged) / line 44 (kernel scope, not engaged here).

Key findings

No blocking prose defect. The description answers the four required questions in order, labels its measurement as one two-GPU instance, states what it did not run, and ends with a compliant Discord: oystersmiles. Two should-fix accuracy defects remain in the description, and five nits sit in the new docs/api.md paragraph and in one description sentence.

Should fix

1. "What changed" omits the head commit's behavioural change in runtime.rs

helios/src/server/runtime.rs:2441-2456:

let resources = CopyoutResources {
    completed: self.scheduler.completed(),
    // Decode moves request and reserved page counts without moving cache
    // resources; zeroing them keeps deferred host copy-outs keyed on the
    // cache state they actually depend on.
    scheduler: crate::scheduler::SchedulerStats {
        request_pages: 0,
        reserved_pages: 0,
        ..self.scheduler.stats()
    },
    ...
};
let retry_copyouts = retry || progress || self.copyout_resources != Some(resources);

Commit 9cca87ac ("Keep page gauges out of the copy-out retry key") makes the deferred host copy-out retry condition depend on a SchedulerStats with the two new counters zeroed. That is a behavioural change: which deferred copy-outs are re-offered now differs from what the full stats comparison would produce.

The description's "What changed" lists only helios/src/cache.rs, helios/src/scheduler.rs, helios/src/server/metrics.rs and docs/api.md. It never names runtime.rs, never says the two fields are zeroed when building the copy-out key, and gives no reason. A reviewer finishes the description believing the change is gauges-only, while the same PR also changes what the worker treats as a resource change — which also makes the "Claimed result" line "No allocation, eviction, or scheduling decision changes" read as covering copy-out offering, when the head commit changes precisely that.

Why it matters against the rules: AGENTS.md:88-94 requires the description to name the affected components and make the before/after explicit ("what is replaced, removed, or added, and how the resulting path works", and to "identify material numerical, compatibility, and resource-lifetime changes"); AGENTS.md:135-137 forbids publishing a description whose exact change must be guessed; docs/design-review.md:137-152 (not opened) rejects text that leaves the change implicit or non-explicit about before/after.

Fix: add a helios/src/server/runtime.rs bullet to "What changed" — the deferred host copy-out key embeds SchedulerStats whole, and now zeroes request_pages/reserved_pages because decode moves those counts without moving cache resources. Add a matching clause under "Evidence" if the blocked-host-cache tests exercise the re-offer path; otherwise say the re-offer path was not separately measured (AGENTS.md:103-112, SKILL.md:35-46).

2. The description's shared-ancestor sentence contradicts the code and the PR's own test

PR description, cache.rs bullet: "A page shared through a pinned ancestor therefore counts once for every request that references it."

The code counts each such page once in total, not once per request. helios/src/cache.rs:551-563:

pub fn pin_request(&mut self, id: CheckpointId) -> Result<()> {
    self.pin(id)?;
    self.nodes.get_mut(&id).unwrap().direct_request_pins += 1;
    let chain = self.chain(id)?;
    for ancestor in chain {
        let node = self.nodes.get_mut(&ancestor).unwrap();
        node.request_pins += 1;
        if node.request_pins == 1 {                    // only on the 0 -> 1 transition
            self.request_pinned_pages += node.tail_pages.len();
        }
    }

helios/src/cache/tests.rs:320-342, request_pins_count_each_shared_page_once, builds a parent with two children over pages 0, 1 and 2, pins both children for requests, and asserts:

// Both requests pin the shared parent, whose page counts once for both.
assert_eq!(cache.stats().request_pinned_pages, 3);

The description's sentence predicts 4. The head commit repaired the matching doc comment (helios/src/cache.rs:548-550: "Request pins also count the tail pages of the pinned checkpoints, each page once; a request's own private pages are counted by the scheduler") and the docs sentence (docs/api.md:298-300: "each page counted once even when several requests reference it"), but left the description unchanged.

Why it matters: AGENTS.md:95-102 requires the effect to be stated precisely, distinguishing expectation from measurement. This is the sentence a dashboard author or reviewer uses to predict the gauge, and as written it makes the PR's own live values (399 and 402 of 21504) look implausibly small — the very numbers the evidence section reports.

Fix: replace with wording lifted from the repaired comment, e.g. "A page in a shared ancestor's tail is counted once in the total, however many requests pin checkpoints below it; per-request totals add each request's private pages."

Nits

  1. docs/api.md:309-310 — "Dividing either gauge by flare_total_kv_pages excludes idle cached prefixes and snapshot backing pages". The exclusions were written for the request share; applying them to "either gauge" is muddled, because reserved pages are by construction neither cached nor snapshot-backed (helios/src/scheduler.rs:1223-1228 sums slots' reserved_pages, disjoint from the cache's cached_pages). Fix: scope it — "Dividing flare_request_kv_pages by flare_total_kv_pages gives the share held by live requests' written and pinned pages, excluding idle cached prefixes and snapshot backing pages."

  2. docs/api.md:311-312 — "and the test-only assertion in Cache::stats compares the maintained request-pinned count with a full scan of every checkpoint on each read." A #[cfg(test)] assertion (helios/src/cache.rs:817-837) is not observable API behaviour, and AGENTS.md:52-60 limits repository documents to architecture specification or contributor instruction, routing unrun checks and process notes to docs/TODO.txt. The PR description's Evidence section already carries this fact. Fix: delete the clause from api.md.

  3. docs/api.md:298-312 never states that neither gauge appears in the ?format=json snapshot, while the description says so ("They are not added to the JSON snapshot") and the JSON section follows immediately at docs/api.md:314-321. .agents/skills/repo-prose/SKILL.md:26-34 (not opened) asks for qualification to be stated where support matters. Fix: one sentence, "Neither gauge appears in the JSON snapshot."

  4. docs/api.md:302-303 — "The worker publishes both on every scheduler pass". The worker stores only on iterations where progress is true (helios/src/server/runtime.rs:1148-1153). The published value stays correct when nothing changed, so this is wording only. Fix: "The worker republishes both whenever a scheduler pass makes progress."

  5. PR description, cache.rs bullet — "Compaction asserts that the removed ancestor and its heir agree on request pins, and a checkpoint leaves nodes only at zero pins." The first clause is right (helios/src/cache.rs:627 asserts node.request_pins == child.request_pins), but the second is false for compaction: compact_ancestor removes the node from nodes at helios/src/cache.rs:614 with its pins (including request pins) still held, because they move into the surviving heir (comment at :615-616, pages moved at :629-631). Fix: "a leaf leaves nodes only at zero pins; a compacted ancestor's pins move to its heir."

Verified sound (not findings)

Open questions and what could not be found