#1 [high] PR #665 subtraction review — verified findings (A: dead write in publish Existing branch)
A. Dead duplicate write, helios/src/cache.rs:466-471 (diff hunk). Verbatim:
if let Some(id) = self.prefixes.get(&prefix).copied() {
let existing = self.nodes.get_mut(&id).unwrap();
existing.accessed = existing.accessed.max(use_epoch);
existing.role = existing.role.max(role);
let ready = existing.ready;
self.touch_hit(id, use_epoch)?;
touch_hit -> touch (cache.rs:377-382) performs exactly node.accessed = node.accessed.max(use_epoch). So line 468 is now a no-op duplicate; the PR added the second writer at :471 without removing the first. Delete existing.accessed = existing.accessed.max(use_epoch);; role/ready still use the &mut borrow so the borrow ends the same way. Net -1 line, one = duplicated mutation path gone.
#2 [high] PR #665 subtraction review — B: new projection-parity test cannot fail from this diff
B. helios/src/cache/tests.rs:1472-1504 reclaimable_if_pinned_matches_evict_with_mixed_protected_and_probationary_nodes (33 lines) is a third copy of a projection/eviction parity check:
- tests.rs:1040-1080
projection_matches_eviction_for_chains_branches_and_compaction(same fixed ids 1..=4 sweep), - cache/lifecycle_tests.rs:640-703
reclaimable_projection_matches_eviction_with_pins(exhaustive fixture sweep over parent/pending/pin,assert!(cases >= 30)). Verbatim core:
let (mut cache, ids) = build();
let projected = cache.reclaimable_if_pinned(ids[idx]).unwrap();
let actual = evicted_after_pin(&mut cache, ids[idx]);
assert_eq!(sorted(projected.pages), sorted(actual.pages));
assert_eq!(sorted(projected.snapshots), sorted(actual.snapshots));
It cannot detect anything this PR changes: the helper evicted_after_pin (tests.rs:1026-1038) evicts with pages: usize::MAX, snapshots: usize::MAX, i.e. evict drains every candidate, so victim order is irrelevant; and reclaimable (cache.rs:785-843) is a pin/child-count fixpoint that never reads reused, is_protected, evicted_pages, or eviction_key. The PR description also claims reclaimable_if_pinned is unchanged — so this is a test for behaviour the diff does not touch. Delete the whole test.
#3 [high] Research summary
Subtraction / simplicity / conventions review — PR #665
I read the full diff, helios/src/cache.rs (all 913 lines), helios/src/cache/tests.rs helpers and neighbouring tests, helios/src/cache/lifecycle_tests.rs (fork/projection/key/action machinery), the two scheduler.rs call sites, AGENTS.md, docs/design-review.md and the stale spec at docs/core-design.md:1536-1583. Bottom line: the production diff is lean and idiomatic — ~68 lines, no flags, knobs, env vars, wrappers, fallback branches, speculative traits or dead fields; every new field is read by the policy and every new counter is incremented on exactly one path. advance_completed(Fence(0)) in the new aging test looks removable but is not (it releases page/snapshot ownership so the next re-publish of the same PageId/SnapshotId passes the ownership check at cache.rs:449-465). Two genuine reductions and one convention item follow.
1. Dead duplicate write — the PR added a second writer for accessed and left the first in place
helios/src/cache.rs:466-471:
if let Some(id) = self.prefixes.get(&prefix).copied() {
let existing = self.nodes.get_mut(&id).unwrap();
existing.accessed = existing.accessed.max(use_epoch);
existing.role = existing.role.max(role);
let ready = existing.ready;
self.touch_hit(id, use_epoch)?;
touch_hit → touch (cache.rs:377-382) is exactly node.accessed = node.accessed.max(use_epoch), so line 468 is now a no-op that runs twice. Delete existing.accessed = existing.accessed.max(use_epoch);; the role/ready reads still end the &mut borrow at the same point. Net −1 line and one duplicated mutation path removed — and it removes the hazard of two writers for the same field drifting apart.
2. New 33-line test that cannot fail because of this diff — delete it
helios/src/cache/tests.rs:1472-1504, reclaimable_if_pinned_matches_evict_with_mixed_protected_and_probationary_nodes:
let (mut cache, ids) = build();
let projected = cache.reclaimable_if_pinned(ids[idx]).unwrap();
let actual = evicted_after_pin(&mut cache, ids[idx]);
assert_eq!(sorted(projected.pages), sorted(actual.pages));
assert_eq!(sorted(projected.snapshots), sorted(actual.snapshots));
Two independent reasons it is inert: (a) evicted_after_pin (tests.rs:1026-1038) evicts with pages: usize::MAX, snapshots: usize::MAX, i.e. evict drains every candidate, so victim order — the only thing eviction_key changes — cannot affect the result; (b) reclaimable (cache.rs:785-843) is a pin/child-count fixpoint that reads none of reused, is_protected, evicted_pages, evicted_checkpoints. The PR description itself lists reclaimable_if_pinned as unchanged. It is also a third copy of the same parity property already covered by projection_matches_eviction_for_chains_branches_and_compaction (tests.rs:1040-1080, same fixed-id sweep) and the exhaustive fixture sweep at cache/lifecycle_tests.rs:640-703 (assert!(cases >= 30)). Removing it takes ~11% of the test additions with zero coverage loss.
3. Convention: the specifier of the changed rule is left contradicting the code
docs/core-design.md:1536-1542 still states victim order "then consumed-token count, then checkpoint identity", i.e. strictly (retention_rank, id), and :1565 says optional captures "reclaim lower-rank victims strictly by demand-recency order" — while cache.rs:363-365 now sorts protection first. AGENTS.md:52-60 requires design documents to specify implemented behaviour and keeps defect notes out of them, so the file must be edited rather than left as a known-stale spec. (Same substance as the docs lens; flagged here only because it is a written repo convention, not a style nit.) No other convention issues: no env vars, no flags, no per-model branch, no unsafe, docs/design-review.md:50 (no model/hardware branch in eviction) respected.
I deliberately make no correctness claims (the is_protected dual-turnover rule, mark_reused's unwrap, and the global aging horizon belong to the correctness lens).
#4 [medium] PR #665 subtraction review — C: docs convention (stale spec) + items checked and cleared
C. Convention: docs/core-design.md:1536-1542 states GPU retention orders by demand epoch, role, consumed tokens, then identity (strict (retention_rank, id)), and :1565 "reclaim lower-rank victims strictly by demand-recency order", while helios/src/cache.rs:363-365 now sorts is_protected first. AGENTS.md:52-60 requires design docs to specify implemented behaviour and keeps defect notes out of docs, so the doc must be edited, not left stale. (Overlaps the docs lens; reported only as a written-convention violation.)
Checked and CLEAN (say so plainly — do not manufacture nitpicks):
- No new flags/knobs/env vars/CLI, no floats, no
unsafe, no per-model branch (satisfiesdocs/design-review.md:50, charter "no per-model special cases"). Integer-only arithmetic. - Every new field is read:
reused/reused_at_evicted_pages/reused_at_evicted_nodes(cache.rs:84-86) read inis_protected(349-361) and written inmark_reused(367-374) / birth (503-505);evicted_pages/evicted_checkpoints(221-222) incremented only inretire_leaf(604-609). No dead code, no speculative trait/wrapper. eviction_key(363-365) is a genuine de-duplication: one sort key used bymin_by_key(732) and by the lifecycle projectionkey()(lifecycle_tests.rs:502) instead of repeating the tuple in two places.- Per-call-site branch at scheduler.rs:1734-1739 (
fresh_admission→ touch_hit/touch) cannot collapse into a plaintouch_hit: preemption re-admissions carrySome(accounting)and must not promote, and host restores go to the!readyearly-return at 1876-1883 before the newtouch_hitat 1886. Splitting the two-call branch into duplicate arms would duplicate?handling for no gain — leave as is. - FALSE POSITIVE rejected: the
cache.advance_completed(Fence(0)).unwrap();calls in the new test (tests.rs:1434, 1451) look removable but are load-bearing — they move retired records out ofself.retirementsoadvance_completedreleasesowned_pages/owned_snapshots(cache.rs:865-876); without them the later re-publish ofPageId(2)/SnapshotId(2)fails the ownership check at cache.rs:449-465. Do not report as redundancy. - Test helper duplication is acceptable: the new tests intentionally hand-roll
publish_with_retention(..).unwrap().id()instead of reusingcreated()(tests.rs:45-54) becausecreatedforcesRetentionRole::Endpoint, epoch 0;proposal/history/sorted/evicted_after_pinhelpers are reused where applicable. - Minor, not worth reporting: double blank line at tests.rs:1313-1314 after the new test block.