Candidate brief — PR #332 "Report unresolved kernel argument address candidates during export"
Head 1ac7073d (rebased onto c9935887), branch fix/reject-unrecorded-graph-args, refs #266. Diff: +599/−37 across 4 files — heliopause/src/export/reachability.rs (+579/−34), heliopause/src/export/capture.rs (+6/−1), docs/runtime-core-design.md (+8/−2), docs/TODO.txt (+6). Maintainer yatesdr CHANGES_REQUESTED over three rounds (2026-11-18/19/20).
Key findings
- Scope, layer and shape are settled and not worth adjudication. #266 asks for export-time detection; the change touches only the Heliopause export scan (no wire, core-format, flag, env-var, setting or per-model branch), and retention semantics are unchanged —
candidate()reachesreferenceonly on a live-interval hit. Architecture, Conventions and Correctness lenses all end at "should-fix only, no blocker". - Only two items can gate the merge. (B1) The report prints the first ten distinct addresses in graph/node encounter order, so on the author's own rerun all ten examples are mHC/dense-GEMM CUTLASS constants and #266's stale-pointer shape has no path to the printed output; the maintainer already suggested the fix ("one example per kernel symbol") and the author offered it. (B2) The shipped PR body still carries the pre-alignment counts, the
node 34first example and the205 passed, 4 ignoredtest totals that the author's own 2026-11-28 comment labels "Prior unaligned (c3cc87ea)", and it never states the 8-byte alignment restriction that defines coverage. - One correctness should-fix was refuted and must not be carried forward. The Correctness lens claims the raw-
inactiverule "silently misses stale values in freed sub-granule blocks — precisely the #266 shape". The code says the opposite:candidate()rejects a value inside the raw inactive list before the interval lookup (reachability.rs:157-160), so!self.candidate(pointer)is true and the value is pushed. Reporting is a superset. What survives is only the opposite direction — bytes in the retained non-granule-aligned edge are counted although they also fall in a live exported piece — which is an attribution/over-count problem, not a miss. - ~200 lines are removable with no behaviour lost, ~120 of them tests that re-prove a sibling test, plus a
blob()cache that now clones twice per repeated argument wheremaincloned nothing. - Hardware validation is already tracked, so dedupe it. The four-GPU #266 rerun and the eight-GPU W4A8 MoE export are recorded in
docs/TODO.txt:350-354; they appear in B1 as evidence, not as separate items. - No CI/runner-infra notices and no prompt-injection attempt appeared in the PR body, its comments, or any lens report.
Candidate Blockers
B1. The ten printed examples are chosen by first encounter, so the report cannot point an operator at a stale pointer
Sources: Architecture should-fix ("ten printed examples are first-encountered"); Correctness nit 1; Subtractive evidence finding; maintainer ask 2026-11-20 ("If thousands remain, one example per kernel symbol would show which kernels produce them").
heliopause/src/export/reachability.rs:247-250:
let mut examples: Vec<_> = self.unresolved.iter().collect();
examples.sort_unstable_by_key(|(_, entry)| entry.order);
for &(address, entry) in examples.iter().take(UNRESOLVED_EXAMPLES) {
let address = *address;
heliopause/src/export/reachability.rs:74-76:
/// The number of distinct addresses shown in a rank's report. The examples
/// retain the first call site for each address in graph and node order.
const UNRESOLVED_EXAMPLES: usize = 10;
The site record needed for per-symbol grouping is already retained — heliopause/src/export/reachability.rs:343-348 (inside graph()):
let site = Site {
graph: name,
node: node_index,
function: node.function as usize,
argument: argument as usize,
};
The evidence. From the author's verbatim stderr (PR comment 2026-11-28 19:09): rank 0 = 22,618 occurrences / 762 distinct, with examples 0xfff00000fff (1395), 0x3fff000003ff (860), 0x200000000020 (559), 0x100000001000; hidden line … 752 more distinct addresses (14776 occurrences) not shown. Rank 1 = 19,417 / 832, omitted 822 / 13,614. Arithmetic checks out — the ten printed examples sum to 7,842 of 22,618, and 22,618 − 7,842 = 14,776, 762 − 10 = 752. So the counts are right; only the selection is wrong. Every printed example is an mHC or dense-GEMM kernel; none is W4A8 MoE, none is a stale pointer.
Why it matters. #266's stale arguments (offset 256 of a 384-byte parameter; argument 1 at offset 0) are 8-byte aligned, so the alignment filter no longer excludes them — they are now collected, but they sit behind hundreds of constants in graph order and cannot reach the ten slots in practice. Charter line 11 ("Bring real evidence") and the maintainer's qualifier ("export-time detection where pointer provenance can be established without misclassifying numeric kernel parameters") are only partly met.
Adjudication question. Gate, or accept as mitigated by docs/TODO.txt:350-354, which books the measurement and names this exact remedy ("the counts establish whether per-kernel example grouping is needed")? Note that the remedy is local to one function — Site.function and the functions slice are already parameters of unresolved_report, so grouping by (symbol, argument) needs no new state — and the author has already offered to do it.
B2. The shipped PR body posts a superseded build's evidence and never states the alignment restriction
Source: Prose lens blocking item; two defects merged into one item per the prose-dedup rule.
(a) Stale evidence. The body's ## Validation still reads: rank 0 175,329 / 2,646, rank 1 170,544 / 2,637, first example b12x mHC Cutlass kernels, beginning with MHCPostPrePartialKernel in prefill4096, node 34, and "cargo test --locked --manifest-path heliopause/Cargo.toml (not opened) --lib passed on the build host: 205 passed, 4 ignored". The author's own comment labels exactly those figures "Prior unaligned (c3cc87ea)" and posts the aligned run 22,618/762, 19,417/832, node 35, "221 passed, 0 failed, 5 CUDA tests ignored". The posted first example (offset 4, 0x100000000800) is a byte-straddling window that the shipped filter cannot emit — proof the posted run predates the code:
heliopause/src/export/reachability.rs:294-303:
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()
&& (base + offset).is_multiple_of(8)
{
misses.push((base + offset, pointer));
}
}
This also directly contradicts the author's own claim in that comment (item 7) that the description was "reconciled both to match commit 1ac7073d" — the body was not changed. Standards: AGENTS.md:103-112 (not opened) ("Connect each material claim to the relevant checks or measurements … Never invent evidence"; "Explain differences between runs"), charter line 11.
(b) Missing restriction. ## Change says only "The Heliopause export scan reports kernel-argument values in gaps between recorded allocations and in inactive parts of recorded segments", and ## Limitations lists only that values outside the envelope and stale values aliasing live storage are not detected. Neither mentions that reporting is limited to argument-relative 8-byte-aligned offsets, though retention still scans every byte (reachability.rs:294), so an unaligned unresolved value is still silently discarded — exactly the behaviour the PR removes for aligned values. The same PR's docs do state it, and so does the commit subject:
docs/runtime-core-design.md:154-157:
a reachable segment. Argument-relative 8-byte-aligned kernel-argument values
inside the recorded address envelope that resolve to no active recorded
allocation (a gap between allocations or an inactive range) are reported on
stderr per rank as a non-blocking diagnostic without retaining inactive storage.
Standard: AGENTS.md:88-102 (not opened) (make the material change explicit; attach limitations).
Suggested one-line fix. State the run was made at 1ac7073d with the alignment rule in force (22,618/762; 19,417/832; node 35), say retention scans byte-by-byte while reporting keeps aligned offsets, and either drop or explicitly label 175,329/2,646 + 170,544/2,637 and 205/4 as the pre-alignment build.
Candidate Should Fix
S1. Raw inactive drives reporting while granule-trimmed pieces drive retention — totals cannot be attributed (over-count only)
Sources: Correctness should-fix 1 (with its "silently misses" half refuted — do not repeat that claim); Prose should-fix 3 (wording half).
heliopause/src/export/capture.rs:1274-1275 (inside live_pieces):
let start = start.max(begin).div_ceil(granule) * granule;
let stop = stop.min(end) / granule * granule;
Applied at heliopause/src/export/capture.rs:1476-1481 only when a.memory == "device" && a.sizing.is_none() && !peer.contains(&a.address) && a.snapshot_spans.is_none() — while the diagnostic gets the raw list:
heliopause/src/export/capture.rs:3164:
let mut reach = Reachability::new(&allocations, &request.numeric, &request.inactive, &roots)?;
heliopause/src/export/reachability.rs:156-160:
fn candidate(&mut self, value: u64) -> ExportResult<bool> {
let inactive = self.inactive.partition_point(|&(start, _)| start <= value);
if inactive > 0 && value < self.inactive[inactive - 1].1 {
return Ok(false);
}
What is true. Raw hole edges are allocator/tensor-arena alignment slack (ignition/preparation/core_storage.py:308-323 (not opened); persistent.py:135-141 (not opened)) while the granule is cuMemGetAllocationGranularity (MiB-class), so raw ≠ trimmed for essentially every hole. Bytes in the retained non-granule-aligned edge are inside both a live exported piece and the raw inactive range; candidate() returns false on the inactive check before the interval lookup, so they are reported and counted as "resolve to no active recorded allocation" (reachability.rs:237-239), inflating the occurrence and distinct-address totals the PR quotes. What is false. The lens's claim that freed sub-granule blocks are missed: they are rejected by the raw inactive check, hence !candidate is true and they are pushed. Reporting is a superset.
Test gap. reachability.rs:1083-1087 uses edges at storage.address + 1024 / + 3072, both granule-aligned to allocation.alignment, so raw and trimmed geometry coincide and no test covers a non-aligned edge.
Adjudication question. Is this a gate for a non-blocking diagnostic, or a wording + tracked-item fix? The cheap version is to qualify the summary sentence at reachability.rs:236-246 and docs/runtime-core-design.md:154-157 ("…of the granted granularity, or fall in an inactive range inside one") and add one boundary test at an odd offset. The author's reason for keeping raw inactive (2026-11-28 comment item 5: trimming inward would let a freed sub-granule pointer retain a segment) is sound and should be preserved.
S2. The argument-relative alignment arithmetic (base + offset) has no test that would catch a regression to base = 0
Source: Correctness should-fix 2. The filter itself is the line quoted under B2 (reachability.rs:300). base is the chunk's offset within the argument blob, and blob() restarts each numeric-excluded span with start as usize — heliopause/src/export/reachability.rs:184-189:
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),
)?;
}
The two tests that touch alignment never exercise it: unaligned_straddling_window_is_not_reported_while_aligned_stale_pointer_is (reachability.rs:1046-1069) calls kernel_graph(&data, vec![]) (:1060), i.e. no exclusion spans, so base is always 0; kernel_argument_candidate_offset_counts_from_the_argument_start (:805-822) checks offset 16 across one exclusion but contains no unaligned window, so it would pass unchanged with base = 0. Since the headline counts now depend on this filter (175,329→22,618 and 170,544→19,417 between heads), a silent regression changes the diagnostic's numbers with nothing failing.
Fix. Two CPU-only cases: a stale pointer in a second numeric span at an argument offset that is a multiple of 8 but not a multiple of 8 from that span's start; and a straddling window at offset 4/12 in an argument whose fields begin at 8/16.
S3. The print guard repeats the callee's own emptiness contract
Sources: Simplicity S1; Conventions nit 1; Subtractive (e).
heliopause/src/export/capture.rs:3219-3223:
if reach.unresolved_count() > 0 {
for line in reach.unresolved_report(&output.index.ranks[0].functions) {
eprintln!("export: rank {}: {line}", request.rank);
}
}
heliopause/src/export/reachability.rs:231-235:
let mut lines = Vec::new();
let occurrences = self.unresolved_count();
if occurrences == 0 {
return lines;
}
Every entry carries occurrences >= 1 (:195-211), so "sum is zero" and "map is empty" are one condition and the caller can never disagree. The guard is also the only reason unresolved_count is pub(crate) (:215) and the only reason the test unresolved_report_is_empty_without_candidates (:989-993) has a caller shape at all. Fix: iterate the returned lines unconditionally; nothing prints when there is nothing to say (behaviour identical).
Candidate Subtract / Simplify
X1. blob() clones its cache key and the whole miss vector, twice — a regression against main
Sources: Conventions nit 2; Simplicity N5; Subtractive (b) "−18".
heliopause/src/export/reachability.rs:172-194:
fn blob(&mut self, data: &[u8], numeric: &[(usize, usize)], site: &Site) -> ExportResult<()> {
let key = (data.to_vec(), numeric.to_vec());
let misses = match self.blobs.get(&key) {
Some(misses) => misses.clone(),
None => {
let excluded = merge_ranges(
numeric
.iter()
.map(|&(start, end)| (start as u64, end 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, misses.clone());
misses
}
};
main reachability.rs:133-136 (the construct this replaced) was if !self.blobs.insert((data.to_vec(), numeric.to_vec())) { return Ok(()) } — key copied once, nothing cloned. Head rebuilds the key to probe (:173), clones the cached vector on a hit (:175) and clones it again into the map on a miss (:191). Argument blobs repeat heavily across graph nodes, which is the whole reason the cache exists; the author's scan reports 22,618/19,417 occurrences. Fix: insert only on the miss branch and return &[(usize, u64)] (or split the borrow into a small remember helper) so neither clone survives.
X2. Duplicate site structs plus an unknown fallback that cannot fire in production
Sources: Conventions nit 2 (same entry); Simplicity N3; Subtractive (a) "−19".
heliopause/src/export/reachability.rs:50-56 and :67-72 carry the same four fields, differing only in String vs &str for graph; :202 clones one into the other. The report then does:
heliopause/src/export/reachability.rs:252-258:
let function = functions.get(candidate.function);
lines.push(format!(
" graph {:?} node {} kernel {} ({}), argument {}, offset {}: {address:#x} ({})",
candidate.graph,
candidate.node,
function.map_or("unknown", |function| function.symbol.as_str()),
function.map_or("unknown", |function| function.module.as_str()),
The None arm is unreachable from export: graph() rejects an out-of-range index (reachability.rs:322-324, invalid("graph function index is out of bounds")), and capture.rs:3001/:3076 push one wire::Function per kernel into index.ranks[0].functions (:3129), which is the slice passed at :3220. The only thing that pins the placeholder is the test at :890 passing &[] and asserting kernel unknown (unknown) at :898. Fix: one Site/Unresolved pair, direct indexing &functions[candidate.function], module-private structs (both are pub(crate) only for mod tests), and give that test a real wire::Function as :848-861 already does. Prose nit 4 (kernel unknown (unknown) is indistinguishable from a kernel literally named unknown) folds in here.
X3. ~100+ redundant test lines; one test's name claims coverage it does not have
Sources: Conventions nit 3; Simplicity N4; Subtractive §2 (ranked by saving). Treat the line count as approximate; the named duplicates are verified.
The clearest case is the test whose name promises the cap:
heliopause/src/export/reachability.rs:782-802:
fn unresolved_examples_are_capped_while_occurrences_are_counted() {
let low = allocation("low", 0x2000);
let high = allocation("high", 0x4000);
let data: Vec<u8> = (0..12u64)
.flat_map(|index| (0x3000 + 8 * index).to_le_bytes())
.collect();
let (node, kernel) = kernel_graph(&data, vec![]);
let mut reach = Reachability::new(&[low, high], &[], &[], &[]).unwrap();
reach.graph("graph", &[node], &[kernel]).unwrap();
assert_eq!(reach.unresolved_count(), 12);
assert_eq!(reach.unresolved.len(), 12);
assert_eq!(reach.unresolved_unique_addresses(), 12);
It feeds twelve distinct addresses (above the cap of 10) but never calls unresolved_report, so despite its name it asserts nothing about capping; the only real cap coverage is :876-905. Separately, shared_argument_bytes_record_one_example_per_address (:824-839) is subsumed by :876-905, which also feeds graph-a/graph-b and asserts the graph-a first site, 12 distinct addresses and (2 occurrences). Further candidates: :944-987 (its 4≠2 assertion already exists at :901-904), :907-942 (restates :841-874 and :989-993; only the exactly-ten boundary is new, ~6 lines), :995-1017, :1019-1033, :1035-1043, :989-993. The maintainer already flagged this pattern once (2026-11-18 item 6). Fix: rename :782 to what it verifies, keep the cap/hidden-line assertions in one test, and fold the first-site fact into :876-905.
X4. Per-address site retention, a .len() accessor and a pluralizer with no precedent (~35 lines)
Sources: Simplicity N1/N2; Conventions nit 2/nit 4; Subtractive (c)/(d).
heliopause/src/export/reachability.rs:222-224 is self.unresolved.len() behind a name, used once in production (:242) and asserted twice in four tests (e.g. :793 and :794 in the same test). heliopause/src/export/reachability.rs:487-493:
fn with_count(count: usize, one: &str, many: &str) -> String {
if count == 1 {
format!("1 {one}")
} else {
format!("{count} {many}")
}
}
It is module scope with five call sites, all in this file, and has no precedent — the repository inlines if n == 1 { "" } else { "s" } (e.g. flare-cli/src/cache_commands.rs:307 (not opened), :600, helios/src/runtime_core/model.rs:619 (not opened)). The countervailing fact: two call sites need a two-word noun phrase, so this is style, not defect — keep it behind the subtraction judgement, and prefer the flat occurrence(s)/address(es) form from Subtractive (c) if the pluralizer goes. Finally, UnresolvedEntry.first retains a String graph name plus four usize fields for every distinct address (~800/rank) while only ten are printed; making first an Option filled only below the cap shrinks the sort to ≤10 and is output-identical — optional, no behaviour change.
Candidate Nits
N1. One explanation written four times
reachability.rs:45-49 (struct doc), the printed summary at :236-246, docs/runtime-core-design.md:154-157, and again at docs/runtime-core-design.md:339-341 ("Each rank also writes a bounded stderr summary when kernel-argument reachability scanning finds aligned unresolved address candidates"). Keep the printed line (operator-facing contract) and :154-157; cut the struct doc to a one-liner and drop the second docs sentence. Subtractive scores this −3 lines; Prose and Architecture are neutral.
N2. Dead rebind, a stray assertion, and an inverted name
reachability.rs:250 let address = *address; is dead — the pattern at :249 is for &(address, entry), binding by value already. reachability.rs:1130-1131 inside freed_interval_boundaries_report_kernel_candidates_without_retaining_storage:
aligned.reference(&storage.name).unwrap();
assert!(aligned.reached.contains(&storage.name));
asserts that reference stores a name — unrelated to inactive-range boundaries, already covered at :582-583, and run six times by the loop. candidate() returns true when a value did resolve and was retained, yet its only call site reads !self.candidate(pointer) (:298) at the point the value is being pushed as a candidate; renaming to retains removes the double negation. Its doc comment (:153-155) restates its own three lines.
Dropped as noise (not carried downstream)
eprintln!outsideStartupProgress(Architecture nit 1): cleared on in-repo precedent (cross-rank stderr lines intransfer.rs(not opened), progress rows are rank-0 only), and now documented atdocs/runtime-core-design.md:339-341;stderr_rows()never setsOutput::started, so progress rows are not corrupted.Option<&mut Vec>sink throughscanand removing theorderfield/sort: Subtractive's own verdicts are "a wash" and "would change which ten examples print".- Carrying the closed rounds forward: alignment filter landed (
:296-303),in_free_blockgone, straddling test exists (:1046-1069),kernel_symbolsmap gone, hidden-count units fixed (:264-279), docs sentences landed, maintainer items (rank label, one example per address,Signed-off-by, symbol from the recorded index) all closed. - The Correctness "silently misses" half (refuted above) and its nit that
UnresolvedCandidate/Siteexist only formod tests(folded into X2). - Prose's
load_mxfp4_expertsidentifier observation: the Limitations paragraph already concedes the examples do not establish W4A8 MoE behaviour, and the identifier cannot be checked in this tree. - Taste-only items: singular-form coverage of the hidden line, cross-graph ordering assertion, test-lookup idiom mix (
first()vs direct indexing), and "docs omit the new report" (closed by:337-342).
Open questions for the adjudicator
- B1: gate or tracked? The remedy is one function and the author has offered it;
docs/TODO.txt:350-354already books the measurement that would settle whether it is needed. Which wins? - B2: is a stale PR body enough to hold a merge? The code at head cannot produce the posted numbers, and the description is the only artifact asserting the diagnostic is usable rather than drowned in noise — which is the maintainer's open ask.
- S1: wording or geometry? Whether the retained non-granule-aligned edge is reachable in practice only a real export can show; the wording defect is established from the code alone, and a boundary test at an odd offset would pin whichever answer is chosen.
- Evidence value overall: nobody has shown that any aligned candidate on the reported export is a stale pointer; the printed values read as packed constants. Until the four-GPU and eight-GPU runs happen, the diagnostic's output cannot be distinguished from constants — which is the substance of B1 and the reason the hardware asks are tracked separately rather than listed as findings.
- Not settled by any lens: whether per-symbol grouping actually makes the report legible, and #266's reproducer (
deepseek-ai/DeepSeek-V4.1-Flash-1017, four GPUs) has not been run against this build by anyone with the hardware.