#1 [high] Head identity: recorded head is 19ce4a7b, not claimed 0ebee3d4
PR #674 recorded head = 19ce4a7b ("selene,selene-manager,helios: improve prefix-cache hit rate..."), base 1fbcc3c9. search_history (default = PR head) newest first: 19ce4a7b, 1fbcc3c9, 8489d504(#663), 5c0d9c67(#666), a3c80e19(#657), 5d53040e(#628). The author's 18:08 comment and the task header claim HEAD 0ebee3d4 rebased onto main 4cc6f2fd; that commit is not in the item and the tree does not contain the claimed work.
Evidence the claimed fixes are NOT landed at 19ce4a7b:
helios/src/server/runtime.rs:301-304still: if let Some((_, last)) = &mut bucket.last_median { *last = now; } i.e.RowRestoreLatency::startstill resurrects a decayed median on failed fetches (finish(ok=false) returns before observe at :313-315).search_code POOL_LEVELS|HostAdmissionProbe|conditioned_inputs_from_images→ "No matches".search_code fn worth_(restore|transfer|fetching)→ helios/src/server/runtime.rs:225fn worth_restore, selene/src/store.rs:450worth_fetching, :459worth_transfer. Noflare_selene::worth_restoreexport; helios duplicate still present.selene/src/levels.rs:121-128Ranking::rates()still positional[f64;4]with no shared label constant.- phase_tests
row_restore_latencytests at :8799-8801 only cover the empty-bucket case (estimate == 0.0); the claimed decayed-median regression test is absent.
Dossier A2/A3-consistent: baseline 5d53040e is 6 commits behind base 1fbcc3c9 (19ce4a7b's own base is 1fbcc3c9), and main has moved to 4cc6f2fd (#660) which touches heios/src/scheduler/checkpoints.rs — the file carrying #674's new estimate_prefill_delta_ns.
#2 [high] F1 BLOCKER: RowRestoreLatency decay clock still unfixed at recorded head
Severity: Blocker. Recorded head is 19ce4a7b (base 1fbcc3c9); the author's 18:08 comment and the task header claim HEAD 0ebee3d4. search_history at PR head returns 19ce4a7b, 1fbcc3c9, 8489d504(#663), 5c0d9c67(#666), a3c80e19(#657), 5d53040e(#628) — 0ebee3d4 is not in the item.
helios/src/server/runtime.rs:292-304 (verbatim):
fn start(&mut self, key: crate::cache::PrefixKey, source: RowRestoreSource) {
let now = std::time::Instant::now();
if let Some((previous, _)) = self.in_flight.insert(key, (source, now))
&& let Some(bucket) = self.buckets.get_mut(&previous)
{ bucket.in_flight = bucket.in_flight.saturating_sub(1); }
let bucket = self.buckets.entry(source).or_default();
bucket.in_flight += 1;
if let Some((_, last)) = &mut bucket.last_median {
*last = now;
}
}
finish(ok=false) returns before observe — runtime.rs:306-317: if !ok { return; } self.observe(source, started.elapsed()...) at :313-316. So a failed row-only fetch leaves in_flight == 0 but last_median timestamp reset to now.
estimate_seconds — runtime.rs:332-343: if bucket.in_flight > 0 { return median; } median * 0.5f64.powf(last.elapsed().as_secs_f64() / Self::RECOVERY_SECONDS) with RECOVERY_SECONDS = 10.0 (:290).
Failed-fetch call sites: sync runtime.rs:3402 row_restore_latency.start(key, source) → :3406 finish(&key, false); async runtime.rs:2825-2826 StoreEvent::Fetched { key, result } => { self.row_restore_latency.finish(&key, result.is_ok()); ... }.
Impact: after any failed row-only fetch the whole source bucket jumps back to 100% of a long-decayed median for another 10 s half-life window, so the scheduler can reject a cheap local-DRAM row restore (worth_restore at :225-229, used at :3354). Pricing-estimate defect, not a correctness/concurrency/data bug.
Test gap: the only test is the empty-bucket case — helios/src/server/runtime/phase_tests.rs:8799-8801:
worker.row_restore_latency.start(dummy_key, local_dram);
worker.row_restore_latency.finish(&dummy_key, false);
assert_eq!(worker.row_restore_latency.estimate_seconds(local_dram), 0.0);
(last_median == None ⇒ 0.0). No test pins the decayed-median path. Neighbours at :8837-9002 cover source bucketing, not the clock. The claimed added regression test is absent.
Fix: delete the if let Some((_, last)) = &mut bucket.last_median { *last = now; } block from start(); refresh last only in observe() (:329 already does). Add a test that observe()s a slow sample, ages it (e.g. by shrinking RECOVERY_SECONDS under #[cfg(test)] or exposing an age() like selene::levels::Rate::age at levels.rs:83-86), then start()+finish(false) and asserts estimate_seconds stays decayed.
Secondary (same mechanism, wider blast radius): in_flight entries at runtime.rs:285 have no reaper and no timeout. If a StoreEvent::Fetched for a row-only restore is ever lost, bucket.in_flight stays > 0 forever and estimate_seconds returns the undecayed median permanently for that whole source bucket — not just the 10 s window — affecting every other request pricing a restore from that source. Pre-existing leak semantics were per-request (finish_inbound), the new counter makes it per-bucket. Fix: reap entries older than some multiple of RECOVERY_SECONDS at the top of start()/estimate_seconds(), or derive in_flight from the in_flight map on demand per source.
#3 [high] F2 MAJOR: restore-pricing fallback prefill_rate never updates under concurrency
Severity: Major (claim accuracy + admission-pricing accuracy).
helios/src/server/runtime.rs:3064-3084 (verbatim):
fn observe_prefill_rate(&mut self, step: &ScheduledStep, tokens: u64, timing: crate::execution::ExecutionTiming) {
let capacity = step.prefill_capacity() as u64;
if !step.kind.is_prefill()
|| step.lanes.len() != 1
|| capacity == 0
|| (step.lanes[0].tokens as u64).saturating_mul(2) < capacity
{ return; }
let Some(duration_ns) = crate::scheduler::observed_duration_ns(timing)
.or((timing.wall_ns > 0).then_some(timing.wall_ns))
else { return; };
let seconds = duration_ns as f64 * 1e-9;
if tokens > 0 && seconds > 0.0 {
self.prefill_rate = 0.8 * self.prefill_rate + 0.2 * (tokens as f64 / seconds);
}
}
self.prefill_rate initialises to flare_selene::INITIAL_PREFILL_RATE = 8000.0 (selene/src/store.rs:447; init at runtime.rs:1299).
The fallback pricing path that consumes it — runtime.rs:3279-3280:
let gained = candidate_tokens.saturating_sub(resident_tokens);
gained as f64 / fallback_prefill_rate.max(1.0)
The PR body claims: "Price host restores using read-only scheduler prefill-delta estimates (estimate_prefill_delta_ns) paired with measured per-level pool restore rates instead of wall-clock prefill EMA" and lists under Limitations only that a "narrowed cold-start fallback prefill_rate EMA (sampled on single-lane prefill steps with >= 50% capacity fill)" is retained.
Impact: the sampling predicate requires exactly one prefill lane. A server that always has ≥2 concurrent prefill requests (the multi-instance / multi-turn workloads the PR measures in Tables C and F) never satisfies step.lanes.len() == 1, so prefill_rate never leaves 8000 tok/s. Whenever RequestScheduler::estimate_prefill_delta_ns returns None (not yet measured — runtime.rs:3269-3278), restore pricing falls back to a constant gained / 8000, i.e. the very wall-clock-free guess the change set out to remove. Restore admission therefore cannot adapt to prompt length, batch shape, or model on exactly the busy configurations this PR targets, and RestoreWait::defer (runtime.rs:240-252) budgets waiting against the same constant.
Fix: either (a) also sample when step.lanes.len() > 1 using per-lane token share and the shared step duration (dividing capacity by lane count), or (b) gate the fallback itself — when prefill_rate has never been observed, treat estimated_prefill_saved_seconds as None and let the caller admit without a restore (safe default) rather than pricing off a constant. Add a test that drives N>1-lane prefill steps and asserts prefill_rate != INITIAL_PREFILL_RATE.
#4 [high] F3 MAJOR: claimed-fixed items absent at head (POOL_LEVELS, API disclosure, Windows parity, worth_restore, clippy allow)
Severity: Major (contract/documentation regression + metric-semantics drift; prior round marked "resolved" but the recorded tree still lacks it).
Claimed-fixed items that are demonstrably absent at head 19ce4a7b (search_code returns "No matches" for POOL_LEVELS|HostAdmissionProbe|conditioned_inputs_from_images):
POOL_LEVELS/ positional level labels.selene/src/levels.rs:119-128still:
/// Current transfer rates in bytes per second for pool restore levels:
/// `[NeighbourGpu, HostDram, HostNvme, RemoteNvme]`.
pub fn rates(&self) -> [f64; 4] {
[
self.rates[Level::NeighbourGpu.index()].get(),
self.rates[Level::HostDram.index()].get(),
self.rates[Level::HostNvme.index()].get(),
self.rates[Level::RemoteNvme.index()].get(),
]
}
consumed positionally at helios/src/server/metrics.rs (new block, flare_host_cache_pool_inbound_bytes_per_second): hardcoded [("neighbour_gpu", &self.host_pool_inbound_rates[0]), ("host_dram", ...1), ("host_nvme", ...2), ("remote_nvme", ...3)]. Two independent orderings, no shared constant; Level::index() is fn index(self) (private, levels.rs:18-26) so nothing outside can verify order. Renaming/reordering Level silently mislabels the gauge — and this gauge is now published as a pricing input (docs/api.md new paragraph) and quoted in the PR body as measurement evidence ("flare_host_cache_pool_inbound_bytes_per_second{level=\"neighbour_gpu\"} measured 2.33 GB/s").
-
HostHit.pooleddisclosure gap. The PR body's "Compatibility and Limitations" still has only four bullets and does not list the publicflare-seleneAPI changes:HostStore::begin_lookup(.., resident: u64)(selene/src/store.rs:377),HostHit::pooled(new field,selene/src/store.rs:100-103),TierStore::retired(.., _offered: &[Retiring])(:433-440),TierStore::pending_pool_drain(:401-404),StoreStatsreserved/rate fields. The body claims "Publicflare-seleneAPI updates" is disclosed — it is not in the recorded body; only a generic "in lockstep with workspace callers" phrase appears. -
Windows direct-I/O fallback still dead.
selene/src/disk.rs:1774-1784:
fn is_direct_unsupported(error: &io::Error) -> bool {
#[cfg(unix)] { error.raw_os_error() == Some(libc::EINVAL) }
#[cfg(not(unix))] { let _ = error; false }
}
eos/src/windows.rs:104-109 returns io::ErrorKind::Unsupported when a sector does not divide 4096. The new buffered fallback arm at selene/src/disk.rs:1423 (Err(e) if is_direct_unsupported(&e) => { ... write_all ... }) is therefore unreachable on Windows, so a Windows host whose volume reports a non-dividing sector size gets Err(e) => return Err(io_failure("create packed record file", e).into()) at :1438 and packed v4 writes fail outright instead of degrading to buffered writes. Same dead arm for Job::WriteRecord at :859-861. Windows is a supported target (merged #171). Fix: matches!(error.kind(), io::ErrorKind::Unsupported | io::ErrorKind::InvalidInput) in the non-unix arm.
-
worth_restorestill duplicated. Helios definesfn worth_restore(transfer_seconds, prefill_saved_seconds)athelios/src/server/runtime.rs:225-229;flare_selenestill exportsworth_fetching(selene/src/store.rs:450) andworth_transfer(:459) but noworth_restore, andworth_transfer/worth_fetchingnow have no production callers (only tests). Two implementations of the same admission rule; the selene one is untested-in-production dead code while helios' copy is the live rule. This is a divergence risk for theRestoreWaitbudget which uses the same predicate. -
#[allow(clippy::too_many_arguments)]still present onadmit_with_host_store(helios/src/server/runtime.rs:3285) with 15 positional parameters (:3286-3301), and the duplicatedPreparedImageInput::conditioned_inputmapping exists at bothruntime.rs:1722-1725and:3324-3327.
Note: these were flagged in round 2 and the author's 18:08 comment claims them fixed; the tree contradicts that for every one. Downstream should not mark them closed until the next recorded head.
#5 [high] F4 MAJOR: pool inbound rate gauge exports seed constants, not measurements
Severity: Major (silent semantic change to a published metric; found by tracing the rate-span question).
New field and gauge: StoreStats.pool_inbound_rates: Option<[f64; 4]> set from Ranking::rates() in selene/src/pool/store.rs (stats.pool_inbound_rates = Some(self.rates.rates());, at the end of PooledStore::stats), rendered at helios/src/server/metrics.rs as flare_host_cache_pool_inbound_bytes_per_second{level=...} behind host_pool_rates_present (AtomicBool, set on store(), cleared when None). Documented in the new docs/api.md paragraph.
What the value actually is: selene/src/levels.rs:36-87 Rate is a seed-initialised, capped estimator, not a measurement:
pub(crate) fn new(seed: f64) -> Self { ... median: seed, ... }
pub(crate) fn get(&self) -> f64 {
match self.last {
Some(last) if self.median < self.seed => (self.median * 2f64.powf(last.elapsed().../RECOVERY.as_secs_f64())).min(self.seed),
_ => self.median,
}
}
Seeds at selene/src/levels.rs:97-103: INITIAL_MEMORY_RATE = 20e9 (selene/src/store.rs:444) for ThisGpu, NeighbourGpu, HostDram; INITIAL_STAGED_DISK_RATE = 3e9 (:445) for HostNvme; 400 MiB/s for RemoteNvme. get() only ever recovers upward toward the seed and never exceeds it.
Verification gap: the only thing that trains a level is PooledStore::fetch → self.rates.started(level) (selene/src/pool/store.rs:538-540) and the matching observe on pool_finished. started() (levels.rs:78-82) only moves last, and observe is fed from PooledStore's restore completion.
Impact:
- Before the first pool restore of a level, the gauge publishes the seed constant (
20 GiB/sforneighbour_gpu/host_dram,3 GiB/sforhost_nvme,400 MiB/sforremote_nvme) as if it were a measured rate. Operators following the newdocs/api.mdtext ("the pool's source ranking estimates") will read20 GB/son an idle manager and conclude the fabric is fast. Rate::get()is clamped to the seed and only recovers upward, so a level that measures faster than its seed is permanently reported at the seed.host_dramwill essentially always read exactly20000000000. That makes the gauge useless for the one thing the PR body uses it for (justifying that "prefill-delta pricing skipped 3 Turn-3 cross-GPU row restores" becauseneighbour_gpu"measured2.33 GB/s").- The PR body's claim "Export per-level pool restore rate gauges (
flare_host_cache_pool_inbound_bytes_per_second{level})" implies measurement; the code exports an estimate that is seeded and ceiling-clamped.
Secondary span issue in the same area: Ranking::observe(level, bytes, elapsed) (levels.rs:108-112) is called for pool fetches only; local-tier restores go through CompositeStore::disk_inbound_rate / memory rates instead (selene/src/composite.rs memory_fetched sets self.stats.inbound_rate = self.memory.stats().inbound_rate at :1187). So flare_host_cache_pool_inbound_bytes_per_second{level="host_dram"} and flare_host_cache_inbound_bytes_per_second measure different populations (pool-candidate restores vs local-store restores) — the new docs/api.md text does say this, but the label host_dram will be compared to inbound_bytes_per_second by any dashboard operator and they are not comparable.
Fix: (a) render only levels that have at least one completed sample (track count > 0 per level and emit the gauge absent/0 otherwise), or rename to ..._pool_inbound_bytes_per_second_estimate and document the seed; (b) either remove the .min(self.seed) cap in Rate::get() for the exported gauge or add a separate uncapped median() accessor for observability; (c) add a test asserting an unmeasured level is not exported (or exported as 0), not as its seed.
#7 [high] F5 MAJOR: A/B baseline is 5 commits behind base, straddling two pricing commits
Severity: Major (charter #210 / docs/design-review.md Principle 12 evidence rule).
The PR body's A/B baseline is 5d53040e. Actual ancestry (search_history at PR head 19ce4a7b): 19ce4a7b -> 1fbcc3c9 (#667) -> 8489d504 (#663) -> 5c0d9c67 (#666) -> a3c80e19 (#657) -> 5d53040e (#628). So the baseline is 5 commits behind the PR's own base 1fbcc3c9, not 4 as the 11:24 review says, and not "the author's 18:08 rebase onto 4cc6f2fd" which is not in the tree at all.
Among the five gap commits are two scheduler-pricing changes:
8489d504(#663, yatesdr) "helios/scheduler: price first-output waiting age on incumbent decode rounds" — same author, same subsystem.4cc6f2fd(#660, PCCessna) "helios/scheduler: budget interior conversation-anchor splits againstcheckpoint_extra_work_fraction" — now in main, and it editshelios/src/scheduler/checkpoints.rs, the exact file that carries this PR's newestimate_prefill_delta_ns(helios/src/scheduler/checkpoints.rs, called fromhelios/src/server/runtime.rs:3269).
Tables A-C report deltas on quantities both of those commits touch (host restore pricing, prefill cost modelling, restore admission). The PR body has no attached raw logs; Tables A-F remain author-reported, and Table F's own note says it ran on 7d7dcdcb, an even older commit. The body's "Measured Results" preamble also says "hardware benchmarks and live saturation runs were executed on pre-refactor commit 7d7dcdcb against 5d53040e", which means the headline numbers may predate the code being merged.
Fix: re-run Tables A-C against 1fbcc3c9 (the actual merge base) or, if 4cc6f2fd is now the base, against that; attach the raw metric dumps; state explicitly which commits produced each table. Also disclose that #660 changed anchor-split pricing in the same file.
Additional disclosure items still absent from the body's four "Compatibility and Limitations" bullets: the new rank-relay wire event Kind::StoreInvalidated = 4 (which the body does mention — good, this one is present), the sub-page memory-only startup error (selene/src/offload.rs:706-712, body mentions it — present), but not: the public flare-selene API changes (HostStore::begin_lookup gaining resident, HostHit::pooled, TierStore::retired gaining offered, TierStore::pending_pool_drain, StoreStats reserved/rate fields), the narrowed-but-retained prefill_rate EMA single-lane sampling, or the RowRestoreLatency admission floor.
#8 [high] Research summary
I completed the Correctness, Contracts & System-Level Consequences review lens on PR #674 at its recorded head 19ce4a7b (base 1fbcc3c9) — not the 0ebee3d4 the task header and the author's 18:08 comment claim, which is not in the item at any recorded state. Findings are on the scratchpad in seven notes.
Blocking. The prior-round blocker is still unfixed: RowRestoreLatency::start (helios/src/server/runtime.rs:301-303) still overwrites bucket.last_median's timestamp, and finish(ok=false) returns before observe (:313-315), so any failed row-only fetch (sync :3402/:3406, async :2826) resets the decay clock and jumps estimate_seconds back to 100% of a stale median for another 10 s half-life. The only test is the empty-bucket case (phase_tests.rs:8799-8801); the claimed regression test is absent. I added a second, wider-radius defect in the same struct: in_flight (runtime.rs:285) has no reaper, so a single lost StoreEvent::Fetched pins the whole source bucket at its undecayed median permanently, affecting every other request pricing that source.
Majors. (1) The narrowed observe_prefill_rate (runtime.rs:3064-3084) requires exactly one prefill lane, so busy multi-lane servers — the very configurations Tables C and F measure — never move prefill_rate off the INITIAL_PREFILL_RATE = 8000 constant, and the fallback pricing at :3279-3280 is therefore a fixed guess whenever estimate_prefill_delta_ns is cold. (2) The new flare_host_cache_pool_inbound_bytes_per_second gauge exports Rate seed constants capped at the seed (levels.rs:36-87, seeds 20e9/3e9/400 MiB/s), not measurements, so an idle manager publishes 20 GB/s and a faster-than-seed fabric is permanently under-reported — yet the PR body cites 2.33 GB/s from it as evidence. (3) Every round-2 claim the author says is fixed is absent from the tree: POOL_LEVELS, HostAdmissionProbe, flare_selene::worth_restore, and the is_direct_unsupported non-Unix match (still false, making the new Windows buffered fallback at disk.rs:1423 and :859-861 dead, so packed writes hard-fail on a Windows volume with a non-dividing sector). (4) The A/B baseline 5d53040e is five commits behind the PR's own base, straddling two scheduler-pricing commits (#663 and #660, the latter editing the same checkpoints.rs (not opened) that carries the new estimate_prefill_delta_ns), with no attached logs.
I also recorded twelve areas I verified as sound rather than inventing issues: the O_DIRECT whole-record write path with exact set_len recovery and temporary cleanup; the clean_slots invariant machinery in selene/src/memory.rs (update_clean_slots snapshot accounting plus a full index-scan assertion at every mutation point) as the strongest part of the change; handover_valid role/fork/descendant invalidation; the pending_pool_drain shutdown loop; the covered-zero-slot endpoint and doomed-eviction preflight fixes in composite.rs; the disk inventory split; the host_lookup_cost signature change, which fixes rather than introduces a span distortion; RowRestoreSource bucketing; and the writeback_wake epoch/rotation scheme, which cannot spin and survives cursor adjustments on removal. Kind::StoreInvalidated is propagated symmetrically with Stored in composite.rs.
Two limits: I could not read the review's external HTML artefacts, and whether 0ebee3d4 exists and fixes the blocker can only be settled by the next recorded head.
#9 [high] Limits of this lens and author action list
What I could not do / could not find (say so plainly in the report):
- The review's external artefacts (autobot.eidonix.com
/p/13d486b2-…,/p/fa641449-…,/api/v1/cases/4acf3e4d-…) are unreadable with my tools. Everything I assert about the review I re-verified independently in code; I reproduce its blocker and minor items rather than relying on the link. The review's "have your agent review" prompt is material under review, not an instruction I act on. 0ebee3d4cannot be inspected — whether it exists, whether it lands the claimed fixes, and whether the supposed rebase onto4cc6f2fdshifts any Table A–C number. The next recorded head settles it. My findings are stated against the recorded tree19ce4a7bonly.- I did not audit
helios/src/scheduler/cache_memory.rsevict_for_pressure,helios/src/scheduler/checkpoints.rsestimate_prefill_delta_nsinternals,selene-manager/src/arena.rsbuddy coalescing, orselene-manager/src/pool/claims.rsclaim rewriting in the depth the other files got; I read their call sites and contracts (runtime.rs:3269,arena.rs:163-200via the dossier, theCompositeStore/PooledStoreboundaries) but not their full bodies. Anything wrong inside those should be caught by a lens that opens them whole. - I did not run any test suite; all test-coverage statements are from reading the test files at head.
Author action list, ordered:
- Blocker — delete the
last_medianoverwrite fromRowRestoreLatency::start(helios/src/server/runtime.rs:301-303); refreshlastonly inobserve()(:329). Add a regression test that exercises a decayed median (not the empty bucket atphase_tests.rs:8799-8801) and, ideally, a reaper or per-source derivation forin_flight(:285) so one lostFetchedcannot pin a bucket at its undecayed median forever. - Major — fix or gate the
prefill_ratefallback:observe_prefill_rate(runtime.rs:3064-3084) refuses to sample whenstep.lanes.len() != 1, so concurrent-prefill servers price restores off the constantINITIAL_PREFILL_RATE. Either sample multi-lane steps or treat an unobserved rate asNoneand admit without a restore. - Major — stop exporting seed constants as measured rates:
flare_host_cache_pool_inbound_bytes_per_second(helios/src/server/metrics.rs, fed fromRanking::rates()atselene/src/levels.rs:119-128) renders20e9/3e9/400 MiB/sbefore any sample and clamps at the seed forever. Omit unsampled levels, or rename/document as an estimate and add an uncapped accessor. - Major — land the round-2 items the 18:08 comment claims are done but are absent: shared
POOL_LEVELS/level labels (levels.rs:121-128vs the hardcoded array inmetrics.rs),flare_selene::worth_restorededup (helios copy atruntime.rs:225-229;worth_transfer/worth_fetchinginselene/src/store.rs:450-468now have only test callers), theHostAdmissionProbeextraction (runtime.rs:3285still carries#[allow(clippy::too_many_arguments)]with 15 parameters and the duplicatedconditioned_inputmapping at:1722-1725/:3324-3327), and the Windowsis_direct_unsupportedmatch (selene/src/disk.rs:1774-1784) that makes:859-861/:1423dead. - Major — re-baseline Tables A–C against the actual base and attach raw logs; disclose the public
flare-seleneAPI changes and the narrowedprefill_ratesampling in the body's Limitations. - Process — push a recorded head that actually contains the claimed work before asking for re-review; the tree currently contradicts the author's own accounting on five separate items.
Credit where due (state in the report, not as a finding): the clean_slots invariant machinery in selene/src/memory.rs, the O_DIRECT whole-record write path with exact set_len recovery and temp cleanup, the pending_pool_drain shutdown narrowing, the writeback_wake epoch/rotation scheme, the covered-zero-slot endpoint path, the doomed-eviction preflight, the disk inventory split, and the host_lookup_cost scalar refactor are all correct and well tested. The metric split is covered end-to-end by a changed Python test and clean-L1 retention by selene-manager/tests/client.rs additions.
#6 [medium] Verified-sound areas (no finding) — write-up material
Verified-sound items in this lens (state plainly, do not invent):
-
write_packedO_DIRECT path (selene/src/disk.rs:1378-1447, helpers at:1272-1376). Whole-record slices are staged through a fixedBLOCK_BYTES-multiple scratch buffer, tail zero-padded (:1363-1367), written withwrite_direct_slicesat file offset 0, thenfile.set_len(total)(:1419-1420) restores the exact logical length beforepublish.totalischecked_add-accumulated (:1346-1348, overflow ->invalid). On error the temporary file is removed (:1443-1445). The partial-window case inwrite_record_direct(:1278-1304) only block-rounds the tail into owned zero-padded scratch, never reads pastsrc, and the unaligned partial-window path deliberately stays buffered (:864-868) because block-rounding would overwrite an adjacent window.Reply.invalidated(:333-335) is propagated for post-rename dir-sync failure and covered by tests at:4508-4610. -
is_direct_unsupportedunix arm (:1774-1778) usesraw_os_error() == Some(libc::EINVAL), which is whatO_DIRECT-refusing filesystems actually return; correct on Linux. -
L1 clean retention invariants (
selene/src/memory.rs).clean_slotsis maintained exclusively throughupdate_clean_slots(:951-958), which snapshots the per-key contribution before and after the mutation, sopin_record(:1118-1123),unpin_record(:1128-1133),set_ready(:1266-1272) and role promotion all keep the counter exact rather than relying on callers to remember a delta.release_removed(:960-970) does the same for multi-node removal.assert_clean_slots_invariant(:1055-1080) cross-checks the counter against a full index scan and re-validates eachpersisted_in_poolentry againsthandover_valid; it is called after every mutation point (:717, 782, 969, 1027, 1119, 1129, 1150, 1203, 1275, 1352, 1416, 3214) and the test helperassert_clean_slots(:5498-5521) re-derives the same relation independently.reclaimable_clean_slots(:1092-1116) correctly refuses to count a clean node whose subtree has an un-evictable descendant, andreserve(:1161-1166) uses it soshortfallcannot promise slots leaf-first eviction cannot actually free. This is the strongest part of the change. -
handover_validrole/shape invalidation (:922-935) re-checks capture-role monotonicity, fork count, anddescendant_rowcoverage, so a stale handover cannot keep a record marked "safe to drop locally" after its role is promoted or its last descendant row is thinned.refresh_ancestors/refresh_same_page_descendants/promote_role(:979-1040) cover the paths that change those inputs. Tests:7005-7280exercise pin/unpin, role promotion, fork, thin, and blocked-ancestor transitions. -
Shutdown drain (
selene/src/pool/store.rs:307-352,selene/src/memory.rs:3517-3527,node_pending_pool_drain:2964-2982). The loop now waits onpending_pool_drain(), which returns 0 once every ready record is inpersisted_in_pool, so clean retained L1 copies no longer stall teardown.!node.readyandhashing/held/finishingrecords still block, so no in-flight hash or transfer is abandoned early.leftin the summary now comes from the same predicate (:351) instead of a secondbegin_pool_drain()call that could double-mutate drain state — an improvement over main. -
CompositeStore::storezero-slot endpoint path (selene/src/composite.rs:1291-1338). The splitneeded = if covered { 0 } else { record_slots(tail.len(), true) }withshortforced to 0 for the covered case is what lets a same-page coveredEndpointqueue throughmemory.store_empty(:1338-1342) instead of being bounced byshort > 0into the direct-to-disk bypass. Pinned end-to-end bycovered_zero_slot_endpoint_stores_while_staged_io_occupies_intake. -
start_readdoomed-eviction preflight (selene/src/composite.rs:876-887) checksmemory.fitsandshortfalland spills parked records before allocating, so a doomed read no longer evicts durable clean L1 records (the failure this PR's own testdoomed_start_read_preserves_durable_l1_records_and_spills_parkedpins, alongsidedoomed_store_preserves_durable_l1_records_and_spills_parked). -
Disk inventory split (
selene/src/composite.rs:1610-1618):disk_records/disk_bytesnow carry only ready indexed records whiledisk_reserved_records/disk_reserved_bytescarry parked/in-flight reservations. Covered bydisk_stats_separate_committed_records_from_reserved_entriesand a changed Python assertion.docs/api.mdupdated consistently. -
host_lookup_costspan/scope. The signature change (helios/src/server/metrics.rs:538-560, call sitehelios/src/server/runtime.rs:3353) replaces the round-tripmissing / rate.max(1.0)reconstruction with the actualprefill_saved_secondsfromestimated_prefill_saved_seconds. This fixes a unit/scope distortion rather than introducing one: the old code divided by aneffective_ratethat could bef64::INFINITY(yielding 0 ns) or0 < rate < 1(clamped to 1.0, yielding absurd ns), and the histogram is documented as an estimate (docs/api.md:293-294). Thetransfer_secondsfed in now correctly usesmax(hit.estimated_seconds, row_restore_latency.estimate_seconds(source))for row-only restores (runtime.rs:3346-3352), which is the right span (end-to-end setup + transfer), so the histogram does not shrink. -
RowRestoreSourcebucketing (runtime.rs:257-268) keys on(pooled, Tier);TierisGpu/Dram/Nvme(selene/src/shared/mod.rs), so from the declared purpose (keep slow remote/NVMe claims from raising the floor for fast local DRAM) it does isolate local DRAM from pooled sources. Collapsing pooledHostNvme/RemoteNvmeinto one bucket is coarse but conservative for that purpose; it is a refinement opportunity, not a bug. Confirmed againstselene/src/pool/store.rs:473-481, which setstier: candidate.tier+pooled: true, andselene/src/composite.rs:373+selene/src/pool/store.rs:418which setpooled: falsefor local hits. -
writeback_wakeepoch/rotation (selene-manager/src/store.rs:1443-1475, 1588-1666). Removing one waiter keeps the cursor on the same logical position (index % len),filter_writeback_waitersadjusts for removals before the cursor (:1452-1472),writeback_wake_remainingis re-clamped to the new length, and the epoch guard (:1629-1633) prevents re-checking a waiter twice within one wake sweep whileadvanced < lenguarantees termination.pump(:5044-5073) only re-arms whenwriteback_wake_remaining > 0, andscan_writeback_waiters_stepzeroes it onceadvanced == len, so the previously-feared self-rearming spin cannot occur.WindowReleaseSignal(:5309-5341) usesswap(true)so coalesced releases lose nothing, andWindowHoldfield order (:5346-5349) guarantees the extent Arc drops before the notify. -
Kind::StoreInvalidatedrank-relay propagation (selene/src/shard.rs) is handled symmetrically withStoredatselene/src/composite.rs:1528-1533(TransportEvent::StoreInvalidated { id, error } => self.disk_stored(id, Err(error), None)) so a sharded peer's invalidation completes the same job bookkeeping as a local failure; covered byselene/src/shard/tests.rsadditions.