Prose scratchpad · NVIDIA/hyperflare-inference #496

Raw Markdown for agents: https://autobot.eidonix.com/p/8e2340b5-fcbd-4b01-95e7-f18a97494c9d.md

#1 [high] should fix: free_slots carries the allocate doc comment

selene/src/disk_store.rs (PR #496 head f9c9191), impl Resources, lines 228-234:

    /// Slots for `pages` page records and, when `row`, all row pieces;
    /// `None` leaves the pool unchanged when it cannot supply all of them.
    fn free_slots(&self) -> usize {
        self.pool.as_ref().map_or(0, SlabPool::free_slots)
    }

    fn allocate(&mut self, pages: usize, row: bool) -> Option<Buffers> {

The existing doc comment for allocate was left above the newly inserted free_slots, because free_slots was inserted after the comment rather than after allocate. On main (ref main, lines 216-218) the comment sits directly above allocate. As published, rustdoc documents free_slots as taking pages/row and returning None, which it does not; allocate is undocumented. Violates AGENTS.md "Required prose review" / repo-prose skill (comments must describe the code as it exists; documentation is a present-state specification). Fix: move the comment back onto allocate and give free_slots its own one-line comment (e.g. "Free slots in the shared pool; zero when this transport has no pool.").

#2 [high] should fix: PR description leaves a Qwen 9/9 vs 7/9 difference unexplained and mixes measured with expected cost

PR #496 description (four-part scheme required by AGENTS.md "Required PR descriptions" and docs/design-review.md principle 16; the four parts why/what/result/evidence are present and in order, Discord line present).

Gap 1 - unexplained correctness difference (AGENTS.md item 4: "Explain differences between runs when passed and skipped cases would otherwise appear contradictory. Keep material failures ... visible"). Evidence paragraph: "recipe-clamped Qwen3.8-27B TP1 matched 9/9 at 30.1K and 8/9 (main) vs 7/9 (this PR) at 61.3K." The change lowers a deterministic temperature = 0 fact-retrieval score from 8/9 to 7/9 at 61.3K and the description neither says whether this is a defect, a context-limit artefact of the recipe clamp, or measurement noise, nor whether it reproduces. A reviewer cannot tell whether the PR broke an answer. Fix: state what the one differing answer was and the conclusion drawn (e.g. reproduced/unreproduced, attributable to the recipe's clamped context rather than to the transport), or move the check to "Not covered" as inconclusive.

Gap 2 - expected costs presented as results (AGENTS.md item 3: "distinguishing an expectation from a measured result"; prose skill: "separate measurements from hypotheses"). Result section, after the measured table: "Existing users pay per-pump demand indexing when free slots exist and at most one extra window split when skip_pages % 64 != 0." These are unmeasured predictions about CPU and window-split cost. Fix: label them as expected and unmeasured, or cite the measurement.

#6 [high] Research summary

Prose review of PR #496 (head f9c9191) is complete. The description has the four required parts in order (why / what / result / evidence) and a Discord line, the commit message follows the repository's imperative style and carries the same four-part body, and the docs addition to docs/prefix-cache-offload.md section 2.4 is a present-state statement that resolves its own references.

Three things should be fixed before merge: a rustdoc comment for Resources::allocate was left sitting above the newly inserted free_slots in selene/src/disk_store.rs (lines 228–234), so the published doc describes the wrong function; the description records a deterministic 9/9 vs 7/9 result at 61.3K on Qwen3.8-27B without saying whether that difference is a defect, a recipe artefact, or noise, which the four-part rules require it to explain; and the "Existing users pay per-pump demand indexing …" sentence presents unmeasured costs as results. Two smaller notes: the benchmark table was measured on a pre-head tree with that disclosure buried in parentheses, and the docs sentence does not say what the 64-page windows are aligned to. The new type, state-machine, pass and test comments were checked against the code and read correctly, with line numbers recorded in the scratchpad.

#7 [high] Findings index for PR 496 prose review (lens E)

PR #496 prose review (lens E), head f9c9191, base main, 2 files (+2808/−914). Rules applied: AGENTS.md "Required prose review" and "Required PR descriptions" (the four-part scheme and its four bullets), docs/design-review.md principle 16 ("Write without hidden context"), .agents/skills/repo-prose/SKILL.md. Nothing here is blocking; two items should be fixed.

  1. SHOULD FIX — selene/src/disk_store.rs:228-236 (impl Resources). The rustdoc for allocate ("Slots for pages page records and, when row, all row pieces; None leaves the pool unchanged when it cannot supply all of them.") now sits directly above the new fn free_slots(&self) -> usize, and allocate is left undocumented. On main the comment is at lines 216-218 directly above allocate. As published, the docs describe free_slots as taking pages/row and returning None, which is false. Fix: move the comment back onto allocate; give free_slots its own line, e.g. "Free slots in the shared pool; zero when this transport has no pool."

  2. SHOULD FIX — PR description, Evidence paragraph. "recipe-clamped Qwen3.8-27B TP1 matched 9/9 at 30.1K and 8/9 (main) vs 7/9 (this PR) at 61.3K" reports a deterministic (temperature 0) score drop with no conclusion attached: defect, recipe context clamp, or unreproduced noise is left to the reviewer. AGENTS.md item 4 requires explaining differences between runs and keeping material failures visible. Fix: name the differing fact and the conclusion (reproduced or not, attributable to the clamped recipe context rather than the transport), or move it to "Not covered" as inconclusive.

  3. SHOULD FIX — PR description, end of "Result". "Existing users pay per-pump demand indexing when free slots exist and at most one extra window split when skip_pages % 64 != 0" states unmeasured costs next to a measured table. AGENTS.md item 3 and the prose skill require distinguishing expectation from measurement. Fix: label as expected and unmeasured, or cite a measurement.

  4. NIT — PR description, "Result" -> "Benchmark setup". The parenthetical "(measured before the linear demand-index and close-count edits covered by the unit tests below)" is the only notice that the table predates the head commit, and it conflicts in emphasis with the "Not covered" bullet that says the SM121 runs were not repeated. AGENTS.md item 4 (identify the tested artifact) and docs/design-review.md principle 16 (disclose material limitations). Fix: say in the benchmark paragraph that the numbers are from an earlier commit of this branch and what the head differs by; keep one consistent statement.

  5. NIT — docs/prefix-cache-offload.md:338-342. "coalesce aligned 64-page windows" does not say aligned to what; the alignment is to absolute file WINDOW_PAGES boundaries (plan_aligned_windows, disk_store.rs:697-738), which is exactly what lets restores with different skip_pages share a window, and section 2.4 names WINDOW_PAGES = 64 only at line 85. Fix: "coalesce the 64-page WINDOW_PAGES windows that begin on the same file page boundary". Optional second part: the shared open/read failure scope (all attached restores fail) and private-failure isolation are stated in the PR body but not in section 2.4 or the section 2.12 invariants; one clause would keep the document self-contained.

Also worth reporting: item 5's paragraph is otherwise correct and present-tense; the module doc (disk_store.rs:14-24), the new type/state comments (1005-1091, 1115-1117), the five pass comments in pump_device_inbound (1815-1844 and Pass 5a-5e), and the new test names/comments all describe the code as it exists; the commit message and Discord line ("Discord: Dooner") comply. See notes 5 (clean items) for line references.

#11 [high] Report of 2026-11-25, run 2 — PR 496 prose re-review at 0c04b1e2

PR #496 prose review, second pass, head 0c04b1e2 (base main), 3 files: selene/src/disk_store.rs, selene/src/shard.rs, docs/prefix-cache-offload.md. Rules applied: AGENTS.md:43-70 ("Required prose review"), AGENTS.md:72-140 ("Required PR descriptions", the four-question order), .agents/skills/repo-prose/SKILL.md (present-state specification; "State evidence as conditions, measurement, result, and conclusion"; "separate measurements from hypotheses"), docs/design-review.md principle 16 (no hidden context).

Verdict: no blocking prose findings. Two nits, both in the PR description (entries #9 and #10 below). All three earlier should-fix items are fixed at this head; the earlier two nits are also fixed.

  1. Misplaced rustdoc (previously entry #1) — FIXED. selene/src/disk_store.rs:236 now carries "Free slots in the shared pool; zero when this transport has no pool." above fn free_slots, and the "Slots for pages page records and, when row, all row pieces; None leaves the pool unchanged when it cannot supply all of them." comment is back directly above fn allocate at :241-243 (read :232-254).

  2. Unexplained 8/9 vs 7/9 (previously entry #2, gap 1) — FIXED. Evidence now reports 5 cold-VRAM restart repeats (seeds 1234..1238, 60,534 tokens, top_logprobs = 5) with identical FP32 top-5 logprobs and token IDs on main and head (6/9, 8/9, 7/9, 9/9, 4/9), explains why temperature = 0 is unavailable (helios/src/model.rs:230-233 rejects it; helios/src/server/request.rs:643-666 clamps a request value into the core's SamplingRange, helios/src/model.rs:154-166), attributes the earlier single-pass difference to positive-temperature sampling, and names the new unit test. Both code claims check out.

  3. Expected costs stated as results (previously entry #2, gap 2) — FIXED. Now "As an expected bound, single-restore callers skip demand indexing (device_inbound.len() <= 1) and pay at most one extra partial window per segment when skip_pages % 64 != 0". The <= 1 short-circuit is real in build_pending_demand; the bound matches plan_windows(align_to_window = true) at selene/src/disk_store.rs:702-724. Satisfies AGENTS.md:95-96.

  4. Benchmark provenance (previously entry #3) — FIXED. Benchmark setup now says "comparing main (c0c4f798) against 0c04b1e2" (the head), and "Not covered" no longer contradicts it.

  5. Docs change (previously entry #4, two nits) — RESOLVED. docs/prefix-cache-offload.md:340-346 now says windows are "aligned to WINDOW_PAGES (64-page) boundaries in the record file" and that caller-owned read_into reads "slice windows relative to each request's starting page and run independently". Shared-error vs private-error scope at :358-362, pin/close invariant at :346-350, both coalescing limits at :354-358, physical-vs-logical accounting at :362-366, repeated in §4 at :1528-1531. The signature list at :337-339 matches Staged::write_from (:1308) and Staged::read_into (:1334) exactly.

  6. Module doc and comments (previously entry #5) — verified accurate at this head: selene/src/disk_store.rs:14-27 (at most WINDOW_PAGES pages per window; WINDOWS_IN_FLIGHT credits per outbound record, host read, or device fetch, matching has_window_credit at :1686; one shared handle per record file; one GPU upload per follower; Fetched-after-close at :2230); WINDOWS_IN_FLIGHT comment at :62; SharedFileState (:1066-1078); SharedSegment::reusable/settled (:1097-1110); SharedWindow release condition (:1125-1129, matching sweep_shared_windows); DeviceSegmentRef (:1160-1164); DeviceInbound (:1166-1167); HeaderIdentity Hash contract (:1001-1050) matching Header's PartialEq field list (selene/src/shared/record.rs:136-152, version excluded on both sides); plan_windows (:679-681); HostInbound (:747-748). Test-support counters are now gated #[cfg(any(test, feature = "test-support"))] (:200-208, :1285-1295) instead of allow(dead_code). shard.rs:718-729 forwards InboundWindowSample on rank 0 and :466-478's unreachable! is guarded by that earlier matches! check; Peer::poll ignores them (:1145-1153). Correct.

Nits recorded separately: entry #9 (which read paths feed inbound_rate is narrower than the description implies) and entry #10 (two Flash-Next "Read Reduction" ratios do not equal the ratio of the tabulated MB means: 3.99x vs 4.01, 3.52x vs 3.54; all four TTFT deltas and both 27B ratios check out).

Nothing is outstanding as unverifiable from prose alone; the earlier open question (whether 7/9 was a regression) is now answered in the description with matched logprobs.

#3 [medium] should fix: benchmark table measured on a pre-head tree; disclosure buried in parentheses

PR #496 description, "Result" paragraph: "Benchmark setup: Single-pass flare run runs on NVIDIA GB10 (SM121) with --prefix-cache-memory 0 --prefix-cache-disk /tmp/selene-disk, comparing main (425ab2d4) against this change (measured before the linear demand-index and close-count edits covered by the unit tests below)."

The measured numbers describe a tree state that is not the head commit, and the parenthesis is the only statement of that fact. The description also does not say whether the demand-index edit changes the measured physical read volume or TTFT. AGENTS.md "Required PR descriptions" item 4 requires connecting each claim to the artifact actually tested, and docs/design-review.md principle 16 requires disclosing material limitations. Fix: in the benchmark paragraph, say plainly that the table was measured at an earlier commit of this branch and that the head commit (f9c9191) differs only by X (demand-index bookkeeping, close accounting), or repeat the run. Related: the "Not covered" bullet already concedes the runs were not repeated, so make the two statements consistent in one place.

#4 [medium] docs change is acceptable; two nits on specificity

docs/prefix-cache-offload.md, section 2.4, Staged bullet (lines 333-343), added by PR #496 (diff +5 -1, insertion at 338-342): "Concurrent fetch jobs reading the same record file share one open file handle and coalesce aligned 64-page windows while staged so one disk read fans out to each attached fetch's GPU upload before its staging slots are released; caller-owned read_into reads run independently."

Judged against the repo-prose skill (present-state specification, no hidden context): it is present tense, states the invariant, and resolves fetch/read_into from the surrounding bullet and from section 2.2. Two residual issues:

  1. "aligned 64-page windows" does not say what they are aligned to. The alignment is to absolute file page boundaries (WINDOW_PAGES boundaries, plan_aligned_windows at selene/src/disk_store.rs:697-738), which is exactly what makes two restores with different skip_pages share windows; the section names WINDOW_PAGES = 64 only at line 85. Fix: "coalesce the 64-page WINDOW_PAGES windows that start on the same file page boundary".
  2. Not documented in the section (and not a prose defect in the changed lines, but materially part of the new behavior): coalescing is a device-fetch behavior only, faults of a shared open/read fail every attached restore, and a private child or upload failure fails one restore. Section 2.12 lists invariants and section 2.5 covers the staged transport; one clause on the shared-error scope belongs there rather than only in the PR body. Optional.

#5 [medium] Clean items: module/type/test comments and commit message pass

Checked and found acceptable in PR #496 (head f9c9191, single commit "Coalesce shared ancestor reads across concurrent Selene disk fetches", body matches the PR description):

#9 [medium] Nit: description's InboundWindowSample claim is scoped wider than the code

PR #496 (head 0c04b1e2), description What bullet, "Physical inbound_rate and logical bytes_in": "Emit one TransportEvent::InboundWindowSample per completed physical window read from disk::Reply.elapsed (forwarded on rank 0 in Sharded, ignored on peer ranks) so DiskStore::inbound_rate prices admission from physical disk bandwidth while StoreStats.bytes_in stays logical."

Code: the only site that pushes TransportEvent::InboundWindowSample is Staged::apply_shared_disk (selene/src/disk_store.rs:1617-1620), i.e. only shared device-fetch staging windows. The caller-owned host path (HostInbound / read_into, selene/src/disk_store.rs:747-993) increments the test-only disk_window_reads counter but never emits a sample, so a DiskStore whose restores run through read_into (composite path, selene/src/composite.rs:830) no longer feeds DiskStore::inbound_rate at all — it is fed only by device fetches. docs/prefix-cache-offload.md:362-366 and :1528-1531 say "physical staging-window disk reads", which is closer but still reads as covering both paths.

Fix: in the What bullet and in docs 2.4/§4, say the sample comes once per shared device-fetch staging window; state what feeds inbound_rate for caller-buffer reads (composite keeps its own disk_inbound_rate, selene/src/composite.rs:1000-1003). Severity: nit — behaviour is defensible; the prose scope is what is off.

#10 [medium] Nit: two read-reduction ratios do not match the MB figures; say how they were computed

PR #496 description, Result table (head 0c04b1e2). "Read Reduction" column vs the MB columns:

Fix: state in the table caption whether "Read Reduction" is a ratio of the tabulated means or the mean of per-trial ratios, and make the two Flash-Next values consistent (4.01x / 3.54x if a ratio of means). Severity: nit.

Also verified as accurate: the "at most one extra partial window per segment when skip_pages % 64 != 0" bound (docs/prefix-cache-offload.md:354-358) matches plan_windows(..., align_to_window = true) (selene/src/disk_store.rs:702-724), and the docs' new signature list write_from(id, header, temporary, path, pages, row, sums) / read_into(id, path, expected, first_page, pages, row) (docs:337-339) matches selene/src/disk_store.rs:1308-1342 exactly.