Review of #332 — Report unresolved kernel argument address candidates during export
Lens: architecture and scope (does this belong in the repository, and is the approach right), judged against the charter, AGENTS.md / CONTRIBUTING, docs/design-review.md and docs/runtime-core-design.md, with every finding verified in the code at head c3cc87e.
Key findings
- Scope verdict: in scope and in the right layer. #266 explicitly asks for export-time detection, the maintainer prioritising it accepts detection "where pointer provenance can be established without misclassifying numeric kernel parameters", and this change is confined to the Heliopause export scan with no wire, core-format, flag or setting surface. The problem is not that it is a diagnostic instead of a rejection; it is that the diagnostic as built cannot separate a stale pointer from constants.
- Blocking — the report cannot pick out a stale pointer. heliopause/src/export/reachability.rs:259 scans every byte offset of every argument, so values that span two fields are reported as candidates. The PR's own first example is such a value (
argument 0, offset 4: 0x100000000800), and the measured density on a healthy, correct export is 175,329 occurrences / 2,646 distinct addresses on rank 0 and 170,544 / 2,637 on rank 1. The maintainer's 2026-11-20 blocking request — report only argument-relative offsets divisible by 8, then rerun the counts — is unimplemented at head. - Should fix — one lifetime rule stated twice.
candidate(reachability.rs:131-145) already treats an inactive range as a hit, andscan(:262-266) repeats the identicalpartition_pointasin_free_blockto decide reporting. The reviewer asked for this to be stated once (2026-11-20, item 2); it is still duplicated, and the two copies can diverge. - Nits: the report is written with raw
eprintln!outside theStartupProgresschannel (capture.rs:3137-3141), and the change adds two small pieces of retained state inside capture. - Clean surface, checked: no protobuf fields, core/artifact format, CLI flag, environment variable or recipe setting is added; nothing is persisted; inactive allocations are still not retained (
candidatestill returns a hit for them), so design-review.md principle 13 ("Preserve model core compatibility") and the charter's "no per-model special cases or flags" are untouched.
In scope, right layer, right shape
The charter's "What gets merged" line ("PRs that address a maintainer request, a roadmap item, a reproducible bug, a measured performance/memory issue, or bad docs") and AGENTS.md's requirement that a contribution "address an explicit maintainer request, a demonstrated defect..." are both satisfied: #266 contains the request ("let Heliopause reject this class of package at export time", comment 2026-11-11) and the maintainer prioritising #266 accepted export-time detection subject to provenance. The scan is the only place in the system that sees the recorded argument bytes next to the recorded allocation table, so putting the check in heliopause/src/export/reachability.rs rather than in Ignition or the runtime also satisfies "solve the right problem in the right place" and "keep layers in their roles": no model-specific branch, no new captured-graph operation, no runtime behaviour change on the serving path.
Two design choices in the change are correct and should be kept as-is:
- Non-retention.
candidatestill returnsOk(true)for a value inside an inactive range (reachability.rs:131-135), so reporting an inactive-range candidate does not resurrect the freed allocation —freed_interval_boundaries(reachability.rs:930-965) asserts both retention and reporting. That is the lifetime contract the change had to avoid weakening. - No new reporting surface. The output goes to the existing native stderr stream; nothing lands in the core, ModelIndex or protobufs, so previously exported cores keep loading with no re-export (design-review.md principle 13, charter "Supported matrix & compatibility").
Blocking: the report cannot identify a stale pointer, so it will be ignored in the export it exists to protect
File/lines: heliopause/src/export/reachability.rs:259-272 (scan, data.windows(8) stepping one byte) and :205-246 (unresolved_report, examples taken in first-seen order, capped at UNRESOLVED_EXAMPLES); printing at capture.rs:3137-3141.
What is wrong. The scan slides an 8-byte window one byte at a time over each argument's bytes:
for (offset, bytes) in data.windows(8).enumerate() {
so a value assembled from two adjacent fields is recorded as a candidate at a half-pointer offset. The PR's own first printed example is exactly such a value: prefill4096, node 34, MHCPostPrePartialKernel, argument 0, offset 4, 0x100000000800 (PR description and the 2026-11-19 comment). The expanded test at reachability.rs:775-790 shows the same behaviour deliberately asserted: an argument holding 0x3008 (excluded as numeric), eight zero bytes and 0x3010 yields a candidate at offset 16.
The measured consequence is in the PR itself: 175,329 occurrences / 2,646 distinct addresses on rank 0 and 170,544 / 2,637 on rank 1, on an export that completed normally, with all ten printed examples per rank coming from b12x mHC Cutlass kernels and the author stating they "do not establish ... whether the mHC values are constants or stale pointers."
Why it matters for this lens. The artifact that would merge is a permanent, always-on diagnostic whose only consumer is an operator reading rank-wide stderr. With ~2.6k distinct candidates ahead of them in first-seen graph/node order, a real stale argument — #266's sit at offset 256 of a 384-byte parameter and at offset 0 of argument 1 — would be buried in the … N more occurrences not shown line (reachability.rs:238-244). The charter's "Bring real evidence" standard and design-review.md principle 12 ("Validate the real path and report evidence honestly ... disclose unrun checks") are what this fails on: the submitted evidence demonstrates volume, not separation between a stale pointer and a constant, and the maintainer's own 2026-11-20 review called the remaining item "One change before this can merge."
This is therefore not a "nice to have" narrowing; it is the difference between a check #266's requester can act on and one that trains operators to scroll past it.
Fix. Restrict reporting to argument-relative offsets divisible by 8 (CUDA places a pointer at an 8-byte-aligned offset within its parameter), keeping retention and the gap/inactive classification unchanged, and rerun the same export to post before/after occurrence and distinct-address counts per rank — plus, if thousands remain, one example per kernel symbol rather than the first ten sites, so an operator can see which kernels produce the noise.
What would settle it. A unit test as the reviewer specified (2026-11-20, item 3): put an 8-byte pointer to a live allocation followed by a small integer in one argument, assert the straddling window is not reported and that a stale pointer at an aligned offset is. Note this test cannot pass against c3cc87e: reachability.rs:783-799 asserts that a window at offset 16 is reported for data whose real content is a numeric field followed by a value, i.e. the current tests encode the unaligned behaviour. The residual noise level can only be settled by the export rerun.
Should fix: the inactive-range lifetime rule is computed in two places
File/lines: heliopause/src/export/reachability.rs:131-145 (candidate returns Ok(true) when the value is inside an inactive range) and :262-266 (scan recomputes the same lookup as in_free_block to decide whether to report).
What is wrong. One rule — "is this value inside a recorded segment that is currently inactive?" — is expressed twice, with the second expression existing only so scan can report a value that candidate has already declared a hit:
let in_free_block = inactive > 0 && pointer < self.inactive[inactive - 1].1;
if (!self.candidate(pointer)? || in_free_block) && let Some(misses) = ... { misses.push(...) }
Why it matters. The maintainer asked for exactly this to be state once (2026-11-20, item 2: "One rule, one place ... State that rule once"). Beyond tidiness, this is a lifetime-adjacent rule: candidate's inactive branch decides retention (a hit means the allocation is not referenced) while scan's copy decides reporting. If the two ever diverge — a plausible future change when inactive ranges gain a richer classification, or when a merged interval is added — the diagnostic and the reachability result can disagree silently, which is precisely the class of bug this PR is trying to surface elsewhere.
Fix. Have candidate return a small classification (Live / Inactive / Gap) instead of bool, and let scan decide "retain, and report if Inactive or Gap" from that single value. The freed_interval_boundaries test (reachability.rs:930-965) already covers the behaviour and will keep covering it after the refactor.
Nits
- capture.rs:3137-3141 — raw
eprintln!sits outside the progress channel. The function buildsStartupProgress::stderr_rows()for rank 0 andStartupProgress::silent()for every other rank (capture.rs:2774-2778), yet the report is written with a bareeprintln!on every rank; it cannot be suppressed by a caller, does not honouris_enabled, and never reachesStartupObservation(consumed by flare/src/controller.rs:1698, 2093), which docs/runtime-core-design.md:310-313 describes as the rank-zero capture reporting surface. I am deliberately rating this a nit rather than a should-fix because the maintainer reviewed the point (2026-11-18, item 2) and explicitly accepted the author's resolution — "The kernel symbol, the rank label ... are fixed" (2026-11-19) — and because capture.rs:3993 already prints weight-materialization diagnostics with the same raweprintln!. If it is ever revisited, the fix is to emit through the progress object (or return the lines and letignitionprint them) and gate onprogress.is_enabled(). Note also that raw stderr here does not corrupt the animated progress rows:stderr_rows()never setsOutput::started, andOutput::redrawreturns early whenstartedis unset, so the lines interleave as plain sequential writes. - reachability.rs:149-169 and :205-246 — small retained state inside capture.
blobsnow cachesVec<(offset, address)>and clones it on every cache hit, andunresolvedkeeps one graph-nameStringper distinct address (2,646 per rank in the reported export). Both are negligible in absolute terms, but they are new retained state in a function whose surrounding comments are explicit about bounding memory, andunresolved_reportclones and sorts the whole map once per rank. A&[(usize, u64)]return orRc-shared slice, and storing a graph index instead of aString, would keep the memory story obvious.
Checked and not reported
- Symbol lookup is correct.
Site.functionisnode.function as usize, indexingoutput.index.ranks[0].functions; both vectors are filled in the same order over the same kernel list (capture.rs:2911-2993,node.functionset at capture.rs:889), so the printed symbol/module are the right ones. The maintainer's bookkeeping request (2026-11-19, item 4: store the index, dropkernel_symbols) is implemented as asked. - Graph-name plumbing is sound. capture.rs:3102 passes
&graph.name, already validated non-empty and unique (capture.rs:2723-2750). - No compatibility, wire or configuration surface. Nothing persisted, no protobuf change, no new flag/environment variable/setting, no per-model branch — design-review.md principles 10, 13 and 15 and the charter's "No per-model special cases or flags" are unaffected.
- The output cannot corrupt the terminal UI (see nit 1 for the mechanism).
Open questions / what could not be settled
- Whether an aligned-only report actually separates signal from noise on a real export needs the export rerun; a unit test can prove the straddling window is skipped but not the residual candidate count. Same for the maintainer's suggestion of one example per kernel symbol.
- #266's own reproducer (
deepseek-ai/DeepSeek-V4.1-Flash-1017, four GPUs) has not been run against this build by anyone, and the author lacks the hardware; the maintainer's "any example that is not a W4A8 MoE constant" question (2026-11-19, item 1) is still unanswered in substance, because the single export reported is MXFP4/A8 and produced no W4A8 MoE example.