#1 [high] Blocking: 434-line diagnostic whose only measured run reported 2,646 misaligned non-pointers per rank and no true positive
Size: heliopause/src/export/reachability.rs +428/-29, heliopause/src/export/capture.rs +6/-1 (434/-30 total; ~215 of the added lines are tests, ~150 are the new report/scan machinery).
Why it is unnecessary at this size:
- #266's root cause is fixed in merged #331 ("Isolate cuBLAS warmup workspaces from CUDA graph capture", merged 2026-11-20). Reviewer original-el8 in #266 (2026-11-13) narrowed the residual ask to "export-time detection where pointer provenance can be established without misclassifying numeric kernel parameters". This PR explicitly cannot establish provenance: its description says the result is "a non-blocking diagnostic for possible stale arguments, not proof";
reachability.rs:212-214prints "may be a stale pointer or a numeric constant". - The only export measured (PR description Validation; comment 2026-11-19) prints 175,329 occurrences / 2,646 distinct addresses on rank 0 and 170,544 / 2,637 on rank 1, and all ten printed examples per rank are
MHCPostPrePartialKernel, "not W4A8 MoE kernels"; the author states they "do not establish ... whether the mHC values are constants or stale pointers". No true positive was ever identified. - Independent evidence that the population is a scan artifact: FujitsuPolycom's #331 validation (2026-11-19 04:57) reports "864 unaligned byte-window matches and one aligned match per rank".
- The author's own examples are all
argument 0, offset 4— i.e. values produced byscan's byte-slidingdata.windows(8)(reachability.rs:259), which steps one byte at a time, so every aligned 8-byte field is also read at all seven other sub-offsets. Reviewer yatesdr's blocking item 1 (2026-11-20) is exactly this and is still unaddressed at head c3cc87e.
Smallest footprint: nothing at all (serving is protected by #331; flare inspect --memory-map plus the #266 reporter's package-decoding script already produce the actionable answer — it found exactly the 10 split-K arguments on the faulting package and "only the W4A8 constants" on the 4096 package). If a diagnostic is kept, the enumerator must be data.chunks_exact(8) (or offsets filtered by base % 8 == 0) instead of data.windows(8), which is a one-line change that removes most of the population the pipeline exists to count; only then is a report with occurrence/distinct counts, a 10-example cap, an ordering key and symbol lookup justified. As submitted, the machinery reports ~2,600 entries per rank that its own validation describes as uninterpretable.
Charter citations: "Look for the smallest footprint in shared code, or a way to solve it without new code at all"; "Bring real evidence ... 'An agent suggested it,' linter warnings, or hypothetical users aren't enough to justify a change"; "Reject unsupported abstractions and churn ... Do not add frameworks, extension points, speculative compatibility, fallback layers".
#2 [high] Should fix: candidate/scan state the inactive-range rule twice (10-16 lines)
heliopause/src/export/reachability.rs:131-145 (candidate) and 259-271 (scan).
candidate returns Ok(true) for a value in an inactive range (131-135) and for a live interval (136-143); scan then repeats the identical partition_point to recover which case it was:
// reachability.rs:262-270
let inactive = self.inactive.partition_point(|&(start, _)| start <= pointer);
let in_free_block = inactive > 0 && pointer < self.inactive[inactive - 1].1;
if (!self.candidate(pointer)? || in_free_block) && let Some(misses) = misses.as_deref_mut() {
misses.push((base + offset, pointer));
}
The pair means "report iff no live allocation covers the value", so the boolean can carry that directly and the duplicate lookup disappears:
/// Retains the allocation covering `value`; reports whether it is a live pointer.
fn candidate(&mut self, value: u64) -> ExportResult<bool> {
let index = self.intervals.partition_point(|&(start, _, _)| start <= value);
if index == 0 || value >= self.intervals[index - 1].1 {
return Ok(false); // a gap between recorded allocations
}
let free = self.inactive.partition_point(|&(start, _)| start <= value);
if free > 0 && value < self.inactive[free - 1].1 {
return Ok(false); // an inactive block of a recorded segment
}
let name = self.intervals[index - 1].2.clone();
self.reference(&name)?;
Ok(true)
}
and in scan:
for (offset, bytes) in data.windows(8).enumerate() {
let pointer = u64::from_le_bytes(bytes.try_into().unwrap());
if pointer >= floor && pointer < ceiling && !self.candidate(pointer)?
&& let Some(misses) = misses.as_deref_mut()
{
misses.push((base + offset, pointer));
}
}
Saves the 3-line duplicate plus the 3-line in_free_block computation (~5 lines net), removes the misleading name, and closes reviewer yatesdr's open item 2 from the 2026-11-20 review ("One rule, one place ... scan repeats the inactive lookup ... State that rule once"). Behaviour is unchanged: inactive ranges are still reported and never retained (test freed_interval_boundaries_report_kernel_candidates_without_retaining_storage, reachability.rs:929-966).
Related dead weight: the half of kernel_argument_inactive_ranges_are_reported_but_numeric_ranges_stay_lenient (reachability.rs:902-916) that re-proves inactive reporting is covered by that same test; the numeric half is covered by numeric_argument_holes_are_conservative (568-575) and kernel_argument_candidate_offset_counts_from_the_argument_start (772-790).
#8 [high] Research summary
Reviewed PR #332 (2 files, +434/−30) through the subtraction lens; notes are in the scratchpad (entries 1–7).
Blocking (whole-change size). The 434-line diagnostic should not merge at this size. Issue #266's root cause is already fixed by merged #331, and #266's own follow-up asked for export-time detection only "where pointer provenance can be established without misclassifying numeric kernel parameters" — which this change states it cannot do ("may be a stale pointer or a numeric constant"). Its single measured export reports 2,646 distinct addresses per rank with all ten examples from MHCPostPrePartialKernel and no identified true positive, and all of them sit at offset 4, i.e. they are artifacts of data.windows(8) stepping one byte at a time. With chunks_exact(8) (reviewer yatesdr's still-open blocking item) most of the population this pipeline enumerates, orders, caps, caches and counts disappears — and so does the need for most of the machinery.
Should fix, by lines saved:
- ~55 test lines prove what sibling tests already prove (three overlapping tests; the
capture.rs:3137guard duplicates the report's own empty check). - ~30 production lines:
UnresolvedCandidate/Site/UnresolvedEntrycarry the same four site fields three times; theorderfield exists only to re-sort aHashMapback into insertion order;unresolved_unique_addressesis a one-line accessor used once; a 7-linewith_countpluralizer. - ~16–20 lines of prose: 13 lines of doc comment for 110 lines of code (three restating the code), a 4-line pumped summary sentence duplicated verbatim in two test strings.
- ~10 lines: the blob miss cache changed from
HashSetto a map ofVecpairs cloned twice per key although theunresolvedmap already deduplicates by address; anOption<&mut Vec>sink threaded throughscanhas one real caller. - ~5 lines: state the inactive-range rule once instead of
candidate+in_free_blockdoing the same lookup twice — closes reviewer item 2 from 2026-11-20 with a shown replacement.
Total removable on the current design: roughly 110–130 of the 434 added lines, and nearer 300 if the blocking enumeration fix lands first. Nothing the change supersedes is left dead elsewhere in the repository.
#9 [high] Report-ready summary: ranked findings with line savings and the smaller enumeration
Change size (from the diff): heliopause/src/export/reachability.rs +428/−29; heliopause/src/export/capture.rs +6/−1. Total +434/−30. Of the added lines, ~215 are in mod tests (reachability.rs:698-966 plus the edits at 573/625/634/676/687/952), ~150 are the new scan/report machinery (reachability.rs:45-75, 147-274, 455-461), ~13 are doc comment, and 6 are capture.rs.
Ranked findings (report in this order):
-
BLOCKING — whole change, 434 lines. See entry 1. Evidence: #331 merged fixes #266's cause; #266 follow-up asks for detection only where provenance can be established; this PR's own export found 2,646 meaningless addresses per rank with no true positive; FujitsuPolycom's #331 run saw 864 unaligned byte-window matches per rank. Smaller version: nothing, or one line —
for (offset, bytes) in data.chunks_exact(8).enumerate()replacingdata.windows(8).enumerate()at reachability.rs:259 (and the same forscan_spans' inherited behaviour), which is reviewer yatesdr's open blocking item 1 from 2026-11-20. Only with that fix do the counts, cap, ordering key, symbol lookup and cache earn their lines. -
SHOULD FIX — ~55 test lines. entry 4. Drop
shared_argument_bytes_record_one_example_per_address(reachability.rs:792-807), the inactive and numeric halves ofkernel_argument_inactive_ranges_are_reported_but_numeric_ranges_stay_lenient(902-916), the secondwire::Functionin 823-828, and either theoccurrences == 0early return (207-210) or thecapture.rs:3137guard — not both. KEEPallocation_contents_still_tolerate_gap_candidates(918-926) andfreed_interval_boundaries_report_kernel_candidates_without_retaining_storage(928-966). -
SHOULD FIX — ~30 production lines. entry 3: collapse
UnresolvedCandidate+Site+UnresolvedEntry(49-61, 66-71) to one site type withgraph,node,function,argument,offset,occurrences; droporder(59, 171, 183, 223) and thesort_unstable_by_key(223) by keeping insert order in a Vec; inlineunresolved_unique_addresses(197-199); replacewith_count(455-461) with "occurrence(s)"/"address(es)"/"more occurrences". -
SHOULD FIX — ~10 lines. entry 5: drop the miss-list cache or keep
HashSet(blobs, 84, 147-169,misses.clone()at 150 and 166) since theunresolvedmap already dedups by address; makescan(248-274) return its misses instead of takingOption<&mut Vec>(three call sites, two passNone: 370-374, 378). -
SHOULD FIX — ~16-20 prose lines. entry 6: trim the four doc blocks (45-48, 63-65, 73-74, 201-204) from 13 to ~4 lines; shorten the summary format string (211-221) and its two verbatim copies in tests (832-836, 861-865).
-
SHOULD FIX — ~5 lines. entry 2: one rule, one place —
candidate(131-145) returns whether the value is a live pointer directly,scandropsin_free_block(262-265) and the duplicatepartition_point. Closes reviewer item 2 from 2026-11-20; includes the ready code. -
Nit —
capture.rs:3138-3139stacks two prefixes ("export: rank N: kernel argument scan: ..."); keep one. 0 lines.
Totals to quote: with the design as submitted, ~110-130 of the 434 added lines are removable (55 tests + 30 structs/helpers + 16-20 prose + 10 cache/sink + 5 duplicate rule). With finding 1's one-line enumeration fix first, the counts/cap/order/symbol/cache machinery loses most of its justification, i.e. ~300 of the 434 lines.
Candidates I checked and DROPPED (do not report):
graph()'s newnameparameter, thepointer→candidaterename,blobsfield type: no stale callers anywhere outside capture.rs (entry 7), so not a subtraction.wire::Function.modulein the report ("kernel sym (module)"): used nowhere else in heliopause/src/export except capture.rs:2987 where it is written; but it is index metadata helios may read, so not shown removable — did not verify a dead read path. Leave out.UNRESOLVED_EXAMPLES = 10as a configurable: it is a const with one value, which is the correct form; nothing to remove.- The
… N more occurrences not shownline: it is the only thing that reconciles the capped examples with the total, so it stays. - Repo-wide duplicate helpers for pluralizing: none exist (
fn plural|pluralize: no matches), sowith_countis new, not a duplicate — its cost is the singular forms, not the function's existence.
#11 [high] Re-review at head 1ac7073d: what changed since c3cc87e, and what it costs now
Head 1ac7073d (2026-11-26), base main c9935887. pr_files: docs/TODO.txt +6/-0, docs/runtime-core-design.md +8/-2, heliopause/src/export/capture.rs +6/-1, heliopause/src/export/reachability.rs +579/-34. Total +599/-37.
Split of the 599 added lines (computed from main's copy vs head):
- reachability.rs tests: main's test module is ~371 lines (main reachability.rs totals 707 lines, tests start ~336); head tests run 496-1252 = 756 lines → ~385 added test lines.
- reachability.rs production: ~194 added, 34 removed → net ~160.
- capture.rs 6, docs 14.
Addressed since my c3cc87e review:
- Alignment filter added in
scan(reachability.rs:294-303): report push requires(base + offset).is_multiple_of(8); retention loop stays byte-sliding. Counts at the author's re-run fell 175,329/2,646 → 22,618/762 (rank 0) and 170,544/2,637 → 19,417/832 (rank 1). - My earlier finding "candidate/scan state the inactive rule twice" is FIXED:
candidate(153-170) now returns false for both inactive ranges and gaps,scanreports on!candidatewith no secondin_free_blockpartition_point. Do not re-raise. kernel_symbols/CUfunction handle path is gone; symbol comes fromoutput.index.ranks[0].functionsvia the recorded node.function index (capture.rs:3220).- Docs added (runtime-core-design.md:154-157 and :336-339) and the pending 4-GPU/W4A8 measurement is now docs/TODO.txt:349-354.
Still open / unchanged at head: blobs miss-list cache with two clones per key (85, 172-213), Option<&mut Vec> sink (283-288, callers 185-189/402-406/410), duplicate site structs (45-72), order field + re-sort (60, 196, 208, 248), unresolved_unique_addresses (222-224), with_count (487-493), capture.rs guard (3219-3223), and ~385 lines of new tests of which ~95 provably re-prove sibling tests.
#12 [high] Blocking: 599-line change whose own measurement identifies no stale pointer and whose target is fixed by merged #331
Charter (read via read_charter, lines 11/35): "Bring real evidence ... Bug fixes need to address the root cause"; "Look for the smallest footprint in shared code, or a way to solve it without new code at all".
Evidence at head:
- The PR adds docs/TODO.txt:349-354 ("Measure the unresolved kernel-argument diagnostic on a four-GPU DeepSeek V4.1 export (issue #266) and an eight-GPU W4A8 MoE export ... Close when ... the counts establish whether per-kernel example grouping is needed"). So the change merges with its own validation requirement still open — the reviewer's blocking item ("Measure the noise", yatesdr 2026-11-18 item 4 / 2026-11-19 item 1) is now recorded as future work rather than met.
- #266's root cause is fixed and independently verified by merged #331 ("Isolate cuBLAS warmup workspaces from CUDA graph capture", merged 2026-11-20). FujitsuPolycom on #331 (2026-11-19 04:57): four GB10s TP4 export, "all 120 cuBLAS split-K workspace arguments identified in #266 resolved to the same recorded allocation on each rank", serving 7,014/7,900-token prompts, no new Xid. FujitsuPolycom also reported "864 unaligned byte-window matches and one aligned match per rank in a CUTLASS parameter of the vision1152 graph".
- At head the diagnostic's aligned population is still noise by its own examples (mark-yong comment 2026-11-28 19:09): distinct addresses 762/832 per rank, and every printed example is a CUTLASS template constant, e.g.
0xfff00000fff,0x3fff000003ff,0x200000000020,0x100000001000; all from mHC/dense-GEMM kernels, none a stale pointer, none from a W4A8 MoE kernel. - The PR body itself says the result is "a non-blocking diagnostic for possible stale arguments, not proof that every graph argument has a live owner".
Smallest footprint that still answers the maintainer's asks (occurrence/distinct counts, up to 10 aligned examples with graph/node/symbol/module/argument/offset, hidden count, one rule, tests, doc line): ~155 production + ~90 test lines instead of ~194 production + ~385 test lines, i.e. about 450 of the 599 added lines go. Concretely: one site struct, no order field, no miss-list cache, no Option sink, unresolved_count/unresolved_unique_addresses/with_count inlined or dropped, 4 report-format tests collapsed to 1, 6 of the 12 new behaviour tests merged or deleted, one doc paragraph.
#13 [high] Should fix: ~75 production lines condense — duplicate site structs, the cloned miss-list, single-use counter, pluralizer, duplicate empty guard
reachability.rs:45-76 structs, 172-213 blob, 215-224 counters, 226-281 unresolved_report, 487-493 with_count, capture.rs:3219-3223. Smaller version, verified against head:
/// A kernel argument value that resolves to no live recorded allocation, in a gap
/// between allocations or an inactive block. It may be a stale pointer or a numeric
/// constant, so export reports it without failing.
#[derive(Clone)]
struct Site<'a> { graph: &'a str, node: usize, function: usize, argument: usize }
struct Unresolved {
graph: String, node: usize, function: usize, argument: usize, offset: usize, occurrences: usize,
}
/// Distinct addresses shown per rank.
const UNRESOLVED_EXAMPLES: usize = 10;
vs today's 32 lines (two structs + doc triads + const): -19.
fn blob(&mut self, data: &[u8], numeric: &[(usize, usize)], site: &Site) -> ExportResult<()> {
let key = (data.to_vec(), numeric.to_vec());
if !self.blobs.contains_key(&key) {
let excluded = merge_ranges(numeric.iter().map(|&(s, e)| (s as u64, e as u64)).collect());
let mut misses = Vec::new();
for (start, end) in subtract_ranges(0, data.len() as u64, &excluded) {
self.scan(&data[start as usize..end as usize], start as usize, Some(&mut misses))?;
}
self.blobs.insert(key.clone(), misses);
}
for &(offset, address) in &self.blobs[&key] {
self.unresolved.entry(address).and_modify(|e| e.occurrences += 1).or_insert(Unresolved {
graph: site.graph.to_owned(), node: site.node, function: site.function,
argument: site.argument, offset, occurrences: 1,
});
}
Ok(())
}
24 lines vs 42: removes misses.clone() at 175 and 191 (the temporary is moved into the map, then read by disjoint field borrow) and folds first: away: -18.
Counters: unresolved_unique_addresses (222-224) is self.unresolved.len() used at 242 and in four asserts whose meaning survives as .len(): -3.
/// Summary, up to ten examples with occurrence counts, and the omitted total.
pub(crate) fn unresolved_report(&self, functions: &[wire::Function]) -> Vec<String> {
let occurrences: usize = self.unresolved.values().map(|e| e.occurrences).sum();
if occurrences == 0 { return Vec::new(); }
let mut examples: Vec<_> = self.unresolved.iter().collect();
examples.sort_unstable_by_key(|&(_, e)| std::cmp::Reverse(e.order)); // or keep the map order field
let mut lines = vec![format!(
"kernel argument scan: {occurrences} occurrence(s), {} address(es) outside every live allocation",
examples.len())];
for &(address, e) in examples.iter().take(UNRESOLVED_EXAMPLES) {
let function = functions.get(e.function);
lines.push(format!(
" graph {:?} node {} kernel {} ({}), argument {}, offset {}: {address:#x} ({} occurrence(s))",
e.graph, e.node, function.map_or("unknown", |f| f.symbol.as_str()),
function.map_or("unknown", |f| f.module.as_str()), e.argument, e.offset, e.occurrences));
}
if let Some(hidden) = examples.get(UNRESOLVED_EXAMPLES..) {
lines.push(format!(" … {} more address(es) ({} occurrence(s)) not shown", hidden.len(),
hidden.iter().map(|(_, e)| e.occurrences).sum::<usize>()));
}
lines
}
~26 lines + no with_count (7 lines deleted) vs today's 56+7: -35. with_count is new machinery with no other user (search_code 'fn plural|pluralize' → no matches); "occurrence(s)"/"address(es)" is fine on stderr.
capture.rs:3219-3223 → for line in reach.unresolved_report(..) { eprintln!(...) }: the guard duplicates unresolved_report's occurrences == 0 early return: -3.
Total production/doc: 19+18+3+35+3 = 78, call it -75. Note: I dropped the order-field removal from this bucket because sorting by address instead of first encounter changes which ten examples print; keep order.
#14 [high] Should fix: ~120 of the ~374 added test lines re-prove sibling tests
Test module at head runs reachability.rs:495-1252 (758 lines) versus main's 324-707 (384): ~374 net added, essentially the whole 579-line growth. Twelve new #[test]s plus helpers kernel_graph (730-751), SITE (753-758), first (760-762). Verified redundancies, with the sibling test that already proves each fact:
unresolved_report_hidden_line_sums_omitted_address_occurrences(944-987, 44 lines) — its whole claim is that the omitted line sums hidden occurrences rather than counting hidden addresses;unresolved_report_bounds_examples_and_counts_hidden_occurrences(876-905) asserts" … 2 more distinct addresses (4 occurrences) not shown"where 4 ≠ 2, so an implementation printing the address count fails there. Same shape (12 distinct, 2 hidden), different numbers. -44.shared_argument_bytes_record_one_example_per_address(824-839, 16) — dedup by address across graphs and first-site retention are asserted by 876-905 (lines[1].contains("graph \"graph-a\" ...")with 12 addresses across graph-a/graph-b). -16.kernel_argument_inactive_ranges_are_reported_but_numeric_ranges_stay_lenient(1019-1033, 15) — inactive-range reporting without retention is asserted byfreed_interval_boundaries_report_kernel_candidates_without_retaining_storage(1071-1133, third argument is the inactive list), and the numeric half by main'snumeric_argument_holes_are_conservative(600-607). -15.kernel_argument_boundaries_and_external_values_follow_the_recorded_contract(995-1017, 23) — the live/gap boundaries are the same values 1071-1133 checks; the out-of-envelope cases exercisepointer >= floor && pointer < ceiling, unchanged from main (main reachability.rs:157-159). -20.unresolved_report_omits_hidden_line_when_all_distinct_addresses_are_shown(907-942, 36) — the one-address half (907-926) restatesunresolved_report_names_the_kernel_and_its_symbol(841-874, two lines) andunresolved_report_is_empty_without_candidates(989-993); only the exactly-ten boundary is new and needs ~6 lines. -30.kernel_argument_candidate_offset_counts_from_the_argument_start(804-822, 19) — offset-from-argument-start is new but needs ~8 lines; its numeric-hole half repeats 600-607. -10.allocation_contents_still_tolerate_gap_candidates(1035-1043, 9) — a real distinct fact (contents() never reports) in 3 lines. -6.unresolved_report_is_empty_without_candidates(989-993, 5) — asserts an early return that capture.rs:3219's guard makes unreachable; with the guard deleted (production finding) the function must still print nothing for zero candidates, but the assertion is aVec::is_empty()on trivially no work. -5.
Sum 146; conservative claim ~120 lines of behaviour-preserving test removal. Nothing here is "a test that proves no behaviour" beyond 8; the rest are duplicates of a sibling's claim, which reviewer yatesdr already flagged once (repeated_argument_bytes_report_every_call_site, 2026-11-18 item 6).
Also: docs/runtime-core-design.md:154-157 and :339-341 state the same rule twice (event-relative detail and the stderr-row list); one sentence in each suffices, -3 (nit, and the second is where the reviewer asked for it).
Grand total removable at head: ~75 production + ~120 test + ~3 docs ≈ 200 of the 599 added lines, with no behaviour lost beyond which ten examples print (unchanged) and plural forms ("occurrence(s)").
#15 [high] Report-ready summary at head 1ac7073d
Ranked by lines saved. Change at head 1ac7073d: +599/-37 (reachability.rs +579/-34, capture.rs +6/-1, docs/TODO.txt +6, docs/runtime-core-design.md +8/-2). Verified against main (reachability.rs 707 lines) and head (1252 lines).
-
Blocking — the change should not merge at this size. 599 added lines for a non-blocking stderr diagnostic whose own run identifies no stale pointer: the aligned counts are 22,618/762 and 19,417/832 per rank and every printed example is a CUTLASS template constant (
0xfff00000fff,0x3fff000003ff,0x200000000020,0x100000001000); #266's root cause is fixed and verified by merged #331 (FujitsuPolycom: all 120 split-K arguments resolve on four GB10s, no Xid); and the required four-GPU measurement now lives in docs/TODO.txt:350-354, i.e. it merges unmet. Smaller version that still answers every maintainer ask: ~155 production + ~90 test lines. Savings ≈ 350-450 lines. -
Should fix — ~75 production lines (entry 13): duplicate
Site/UnresolvedCandidatestructs (-19),misses.clone()twice per key inblob(-18),unresolved_unique_addresses(-3), 4-line summary +with_count→ one-lineoccurrence(s)/address(es)(-35), capture.rs guard duplicating the report's empty check (-3). -
Should fix — ~120 of the ~374 added test lines (entry 14): 8 tests whose claim a sibling already asserts, led by
unresolved_report_hidden_line_sums_omitted_address_occurrences(44 lines, same claim as the 4≠2 assertion at 876-905) andshared_argument_bytes_record_one_example_per_address(16 lines, subsumed by the same test). -
Nit — 3 doc lines: docs/runtime-core-design.md:154-157 and 339-341 state the same reporting rule twice.
Total removable ≈ 200 of 599 (dense version), ≈ 450 (minimal version). Dropped candidates: the inactive-rule duplication and the Order-style re-sort were fixed/kept; the Option<&mut Vec> sink is a 3-line wash; sorting examples by address instead of first encounter would change printed examples, so order stays.
Already fixed at head, do not re-raise: alignment filter in scan (294-303), candidate as the single rule (153-170), symbol lookup through the recorded function index (capture.rs:3220), docs and TODO entries present.
#16 [high] Research summary
Reviewed PR #332 at head 1ac7073d (+599/−37 across 4 files) through the subtraction lens; findings are scratchpad entries 11–15, with #15 as the ranked report.
Verdict: should not merge at this size. The whole 599-line apparatus (≈194 production lines in reachability.rs, ≈374 test lines, 14 doc lines) exists to print a non-blocking stderr diagnostic, and its own measurement at head still shows only noise: 22,618/762 and 19,417/832 occurrences/distinct per rank, every example a CUTLASS template constant, none a stale pointer, none from a W4A8 MoE kernel. #266's root cause is already fixed and independently verified by merged #331, and the four-GPU measurement the maintainer required is now recorded as future work in docs/TODO.txt:350-354 — so the change merges with its own validation open.
Concrete subtractions, ranked: ≈350–450 lines if the report is brought down to what the maintainer actually asked for (counts, ten aligned examples, hidden total, one rule, tests, a doc line); ≈200 lines with no behaviour lost at all — duplicate Site/UnresolvedCandidate structs (−19), the miss-list Vec cloned twice per key in blob (−18), unresolved_unique_addresses (−3), the four-line summary plus with_count pluralizer replaced by "occurrence(s)"/"address(es)" (−35), the capture.rs guard that duplicates the report's own empty check (−3), eight tests whose claim a sibling test already asserts (−120 of ~374), and one duplicated doc sentence (−3).
Two of my earlier findings are now fixed and should not be re-raised: the alignment filter in scan (:294–303) and candidate as the single live/inactive/gap rule (:153–170). I also dropped the Option<&mut Vec> sink (3-line wash) and kept the order field, since removing it would change which ten examples print.
#3 [medium] Should fix: duplicate site structs, re-sort of a HashMap, single-use accessors, pluralizer (~30 lines)
heliopause/src/export/reachability.rs:45-75, 170-186, 224-236, 238, 455-461.
UnresolvedCandidate(49-55) +Site<'a>(66-71) +UnresolvedEntry(57-61) carry the same four fields (graph/node/function/argument) twice.Siteexists only to be copied field-by-field into the ownedUnresolvedCandidateat 176-182:
struct UnresolvedEntry { graph: String, node: usize, function: usize, argument: usize, offset: usize, occurrences: u64 }
and blob(&mut self, data: &[u8], numeric: &[(usize, usize)], graph: &str, node: usize, function: usize, argument: usize) — or keep one borrowed Site and have blob own the copy only on first insert (or_insert_with(|| Site { graph: graph.to_owned(), ..site })). Removes ~12 lines between the two structs plus 4 lines of Site in the two module-level docs. unresolved_count (190-195) then becomes sum::<u64> over .occurrences — or is deleted entirely (see below).
-
unresolved_unique_addresses(197-199) isself.unresolved.len()in a function body used once (line 217); inline it. -4 lines. -
order(59, 171, 183, 223) exists to re-sort aHashMapback into insertion order:let order = self.unresolved.len();andexamples.sort_unstable_by_key(|(_, e)| e.order). AVecof entries plus an address→indexHashMap(or a plainVec<UnresolvedEntry>scanned linearly for 2,646 entries) keeps insertion order for free and deletes the field, its initializer and the sort. -4 lines.orderis only ever asserted in tests (reach.unresolved[&address].order, line 767). -
with_count(455-461, 7 lines + 2 call sites) exists because the summary has one plural and the hidden line has another ("more occurrence(s)"). Dropping the singular form ("occurrence(s)", "address(es)", "more occurrences") deletes the helper and both call-site expansions: -12 lines including the test string. The repository has no general pluralizer (search_code 'fn plural|pluralize': no matches), and this diagnostic's only consumers are operators reading stderr.
Total here: ~30 lines of production code with no behaviour change.
#4 [medium] Should fix: ~55 test lines prove what sibling tests already prove; capture.rs guard duplicates the report's empty check
heliopause/src/export/reachability.rs:698-966 (tests) and capture.rs:3137-3141.
Tests: the change adds 10 tests (kernel_graph helper 698-719, SITE 721-726, first 728-730, then 732-966). Roughly half the added test lines prove facts one existing or sibling test already proves:
shared_argument_bytes_record_one_example_per_address(792-807): "a repeated blob counts twice under one address".unresolved_examples_are_capped_while_occurrences_are_counted(750-770) already drives dedup through the sameblobscache — it inserts 12 addresses in one graph — andunresolved_report_bounds_examples_and_counts_hidden_occurrences(844-870) asserts exactly 24 occurrences over 12 distinct addresses across two graphs, which is the same claim with the graph name attached. Reviewer yatesdr flagged this overlap earlier ("repeats what ... already proves, except the graph name"). -16 lines.kernel_argument_inactive_ranges_are_reported_but_numeric_ranges_stay_lenient(902-916): second half (numeric exclusion suppresses the report) duplicatesnumeric_argument_holes_are_conservative(568-575) +kernel_argument_candidate_offset_counts_from_the_argument_start(772-790), which already exercisenumericexclusion throughgraph. First half duplicates the inactive case offreed_interval_boundaries_report_kernel_candidates_without_retaining_storage(928-966). -15 lines.unresolved_report_is_empty_without_candidates(872-876): asserts an earlyreturn lineson line 208-210 that thecapture.rsguard already makes unreachable — capture.rs:3137 callsunresolved_reportonly whenreach.unresolved_count() > 0. Delete the guard inunresolved_report(3 lines) or the test (5 lines), not both. Preferred: delete the guard incapture.rs:3137and keep the early return inside the function, so one place decides whether anything prints. -4 lines either way.kernel_argument_boundaries_and_external_values_follow_the_recorded_contract(878-900) re-checks allocated/gap boundaries already covered byfreed_interval_boundaries_..., plus out-of-envelope suppression, which is unchanged code (pointer >= floor && pointer < ceilingexisted on main).- The
functionfield ofSITE/Siteis only used to look up a symbol in the report;kernel_graph(698-719) builds aKernelwhosefunction: 1never matches, so the "recorded function index" path is asserted only inunresolved_report_names_the_kernel_and_its_symbol(809-842) — which is fine, but the secondwire::Function("wrong-module"/"wrong-symbol", 823-828) exists only to provefunctions.get(index)picks index 0; that is std library behaviour.
Total tests: ~55-60 removable lines of the ~215 added.
capture.rs: if reach.unresolved_count() > 0 { for line in reach.unresolved_report(..) } (3137-3141) is a 5-line block whose guard duplicates the occurrences == 0 early return inside unresolved_report (207-210). One place suffices: for line in reach.unresolved_report(&output.index.ranks[0].functions) { eprintln!(...) }. -2 lines.
#5 [medium] Should fix: miss-list cache clones Vec pairs twice per key and the Option sink in scan has one real caller (~10 lines)
heliopause/src/export/reachability.rs:147-169 (blob) and 248-274 (scan).
blob now stores Vec<(usize, u64)> of every miss per distinct (data, numeric) key and then lists them:
// reachability.rs:84
blobs: HashMap<(Vec<u8>, Vec<(usize, usize)>), Vec<(usize, u64)>>,
Two costs worth naming:
misses.clone()twice per new key (150, 166). With the export's measured population (2,646 distinct addresses on rank 0 alone, each a (usize, u64) pair) the cache holds tens of thousands of pairs per rank for the whole scan, and it grew fromHashSet(main, reachability.rs:52) to a map of vectors. The cache exists only to skip re-scanning identical blobs; keepingHashSetand re-listing the misses on each repeat would drop the payload (the map isHashSet<(Vec<u8>, Vec<(usize,usize)>)>plusfor (offset, address) in missesrecomputed... ) — simplest subtraction: do not cache the miss list at all, since theunresolvedmap already deduplicates by address and incrementsoccurrencesfor repeats; the cache's only job is CPU, and it buys it with memory that outlives the scan. -6 lines (let misses = match ...,misses.clone()x2) if the cache is dropped andblobscans and records inline. No behaviour change: repeated addresses are already merged by.entry(address).and_modify(|e| e.occurrences += 1).misses: Option<&mut Vec<(usize, u64)>>is threaded throughscanfor three callers, two of which passNone(370-374, 378).scanis only called from two places:blob(with a sink) andscan_spans(without). A separatescan_missesthat returnsVec<(usize, u64)>, or makingscantake&mut Vecand havingscan_spanspass a throwawayVec, removes theOptionand theas_deref_mut()dance (3 lines plus the twoNonearguments). Better:scanreturningExportResult<Vec<(usize,u64)>>needs no parameter at all.
Together: ~10 lines and the largest retained structure in the diagnostic.
Note the pre-existing windows(8)-byte-sliding is not introduced here (main has it at reachability.rs:155) but the report now materializes its output; yatesdr's blocking item 1 (chunks_exact(8)) is the fix that makes this cache and the whole enumeration small.
#6 [medium] Nit-to-should-fix: doc comments restate the code and the 4-line summary sentence is duplicated in two test strings (~16-20 lines)
Docs/comments in the diff and what they cost:
-
reachability.rs:45-48 (UnresolvedCandidate doc, 4 lines), 63-65 (Site doc, 3 lines), 73-74 (UNRESOLVED_EXAMPLES doc, 2 lines), 201-204 (unresolved_report doc, 4 lines): 13 lines of doc comment for ~110 lines of code, and three of the four restate the code.
UNRESOLVED_EXAMPLESdoc says "The examples retain the first call site for each address in graph and node order" — that sentence is exactly whatorder+sort_unstable_by_keyimplement, and the ordering requirement came from review; if the field goes (see entry 3) the comment is wrong. Also the repo-prose skill requires comments to state invariants, not to narrate (SKILL.md:38-39). One line per item suffices: -8 lines. -
The summary sentence in the report (211-221) is a 4-line format string that spells out in prose what the counts say: "N occurrences and M distinct addresses fall inside the recorded address envelope but outside every live recorded allocation, so each may be a stale pointer or a numeric constant". Reviewers asked (yatesdr 2026-11-20 item 1) for the counts, not a paragraph, and the same string is duplicated verbatim in two tests (832-836, 861-865) where it consumes 8 of those tests' lines.
"kernel argument scan: {occurrences} occurrence(s), {addresses} address(es) outside every live allocation"cuts the format string to one line and both test strings to one each: -8 lines. Nothing lost: the "may be stale pointer or numeric constant" caveat is a description sentence (PR "Change" section) and repeats in the doc comment at 45-48. -
capture.rs:3137-3141 prints
"export: rank {}: {line}"per rank, andreachability.rsalready builds the prefix meaning ("kernel argument scan:") — two prefixes in one line. Pick one. -0 lines but a simpler contract:unresolved_reportreturns the summary line already prefixed, the caller loops. (Nit; ranked last.) -
Nothing in docs/ needs updating:
docs/runtime-core-design.md:118-156describes retention, numeric spans, and "This can retain false positives and retains complete backing segments" — the diagnostic does not change any documented behaviour, so no doc addition is required either. (Recorded so the final report can say the change leaves no dead documentation behind.)
#17 [medium] Rules and reviewer citations used by the report
Citations the report may lean on, with their exact provenance so nothing is overstated.
Charter (quoted lines came from the orientation packet's charter excerpt, which reproduces the project's Autobot charter; I did not re-fetch it with read_charter this turn):
- line 11: "* Bring real evidence. Performance PRs need benchmarks ... Bug fixes need to address the root cause; don't just swallow, skip, or retry an unexplained error (#397). 'An agent suggested it,' linter warnings, or hypothetical users aren't enough to justify a change" — used against a diagnostic whose one measurement identifies no stale pointer.
- line 35: "What gets merged: PRs that address a maintainer request, a roadmap item, a reproducible bug, a measured performance/memory issue, or bad docs."
- line 44: "GPU kernel code: ... report concrete defects only—do not propose designs for it." (Only relevant to confirm the scan loop is not kernel code; no design proposal made.)
Reviewer history (PR #332 comments, all read via read_item 332):
- yatesdr, 2026-11-18 CHANGES_REQUESTED, items 1-7: print the symbol not the CUfunction handle; label the rank; one example per unique address; "Measure the noise" (run a W4A8 export and post counts); Sign-off; test dedup ("repeated_argument_bytes_report_every_call_site repeats what unresolved_examples_are_capped_while_occurrences_are_counted already proves, except the graph name").
- yatesdr, 2026-11-19 15:56: noise measurement still blocking; item 4 asks for "one map from address to its first site and occurrence count" instead of miss lists + example list + counts.
- yatesdr, 2026-11-20 04:34: blocking item 1 = report only argument-relative offsets divisible by 8 and repost counts; item 2 = "One rule, one place" (candidate vs in_free_block); item 3 = straddling-window test; item 4 = commit message.
- flare-autobot, 2026-11-26 00:06: repeats alignment, inactive-trimming, summary wording, docs/TODO.
- mark-yong, 2026-11-28 19:09: alignment filter landed; counts fell to 22,618/762 and 19,417/832; test run 221 passed on Linux x86_64 without CUDA.
Consequence for the report: of the maintainer's asks, only "measure the noise" remains unmet, and the PR now files it as docs/TODO.txt:350-354. Every other ask (symbol, rank label, one example per address, single rule, alignment, straddling test, docs) is satisfied — which is why the remaining criticism is size, not correctness.
#7 [low] Note: nothing dead left behind outside the two changed files
Checked for things the change supersedes or leaves behind:
Reachability::pointerwas renamed tocandidate(reachability.rs:131). No other caller exists (search_code '\.pointer\(': only self). Nothing dead left behind.blobs: HashSet->HashMap: main's reachability.rs:52. No external user of the field (private). No dead code.graph()gained aname: &strfirst parameter. Sole caller is capture.rs:3102 (production) and tests. No other crate callsReachability(search_code 'reachability::': capture.rs:23 imports merge_ranges/subtract_ranges only, weight_reuse.rs:226,521 uses merge_ranges). No stale callers.kernel_symbolsand theCUfunction-handle map that reviewer yatesdr asked to remove in the earlier round are already gone from the head —wire::Function.symbolis looked up throughnode.function(capture.rs:889, reachability.rs:314). Nothing left over.- The pre-existing
scan_spans/scan_contentsallocation-content path is untouched in behaviour: it passesNone(370-374, 378) and stays lenient, asserted byallocation_contents_still_tolerate_gap_candidates(918-926). Good — but that test's assertionreach.unresolved.is_empty()is the only place proving allocation scanning does not report, so keep it. - docs/runtime-core-design.md:118-156 needs no edit (see entry 6).
- AGENTS.md:176-181 and the PR-description rules: description already has why/what/benefit/evidence and the Limitations section. No prose debt to remove in the repo.
Conclusion of the sweep: no orphaned flags, config, docs or callers. The subtraction surface is entirely inside the two changed files.