#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.
#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.)
#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.