Review of #332 — Report unresolved kernel argument address candidates during export
Lens: architecture and scope — does this change belong in the repository, and is the approach right — judged against the charter, AGENTS.md, docs/design-review.md and docs/runtime-core-design.md, with every finding verified in the code at head 1ac7073.
Key findings
- Scope verdict: in scope, right layer, right shape. #266 contains an explicit request for export-time detection, the maintainer prioritising #266 accepts "export-time detection where pointer provenance can be established without misclassifying numeric kernel parameters", and the change is confined to the Heliopause export scan with no wire, core-format, flag, env-var or recipe-setting surface. Retention semantics are unchanged (inactive ranges and gaps still do not retain storage). Nothing here is scope expansion or a layer violation.
- The three blockers from my 2026-11-25 review are fixed at head (alignment filter, single classification rule, straddling-window tests, report wording, docs/TODO). I do not repeat them as findings.
- Should fix — the report still cannot point an operator at a stale pointer.
unresolved_reportprints the first ten distinct addresses in encounter order (reachability.rs:247-249); on the author's own rerun that is 10 of 762 (rank 0) and 10 of 832 (rank 1) distinct addresses, with… 752 more distinct addresses (14776 occurrences) not shown. #266's stale arguments are aligned and would now be collected, but they sit behind hundreds of constants in graph/node order. - Should fix (evidence) — the diagnostic's separation of stale pointers from constants is still unmeasured. The single export is MXFP4/A8, no printed example is identified as a W4A8 MoE value or as a stale pointer, and the description says so plainly. Charter line 11 ("Bring real evidence") and the maintainer's qualifier are only partly met; the residual work is at least booked in docs/TODO.txt:350-354, which softens this from a gate to a tracked follow-up.
- Nits: raw
eprintln!outside theStartupProgresschannel (capture.rs:3219-3223), and small new retained state insideReachability. - Clean surface, checked: no protobuf/core-format change, no flag, setting, environment variable, callback or per-model branch; nothing persisted; design-review.md principles 10, 13 and 15 and AGENTS.md:176-180 boundaries are untouched.
Why the change belongs here, and where it belongs
AGENTS.md:165-166 — "Every contribution must address an explicit maintainer request, a demonstrated defect, a measured performance or memory problem, or inaccurate documentation." #266 supplies the demonstrated defect and the request (comment 2026-11-11: "let Heliopause reject this class of package at export time"), and the maintainer's 2026-11-13 reply narrows the acceptable form to detection "where pointer provenance can be established without misclassifying numeric kernel parameters". The charter's "What gets merged" line covers "a reproducible bug" and "a maintainer request". Both are satisfied.
Placement is also right. heliopause/src/export/reachability.rs is the only code that sees the recorded argument bytes alongside the recorded allocation table, so the check cannot live in Ignition or the runtime without duplicating capture-time state (charter/design-review.md:16-21 (not opened), "keep Helios as simple as possible"; AGENTS.md "solve the right problem in the right place"). Two design choices are correct and should be preserved:
- Non-retention.
candidate(reachability.rs:156-170) returnstrueonly for a live recorded interval; inactive ranges and gaps returnfalsewithout touchingreference, so reporting an inactive-range candidate does not resurrect the freed allocation.freed_interval_boundaries_report_kernel_candidates_without_retaining_storage(reachability.rs:1072-1133) asserts both retention and reporting. - No new reporting surface. Nothing lands in the core,
ModelIndexor protobufs; previously exported cores keep loading with no re-export. The rawrequest.inactivedecision (capture.rs:3164, per the author's 2026-11-28 reply item 5) is defensible: trimminginactiveinward would let pointers into freed sub-granule blocks retain a segment and silently drop out of the report, which would weaken the lifetime contract.
Should fix — the ten printed examples are first-encountered addresses, so the report still cannot single out a stale pointer
File/lines: heliopause/src/export/reachability.rs:247-249 (sort by entry.order, take(UNRESOLVED_EXAMPLES), constant at :76), examples rendered at :249-263, hidden line at :264-279; printed at heliopause/src/export/capture.rs:3219-3223.
What is wrong. The alignment fix landed (reachability.rs:294-303: reporting push gated on (base + offset).is_multiple_of(8) while retention keeps scanning every byte), and the counts fell by roughly 8x. But the selection policy is unchanged: candidates are ordered by first appearance across graphs and nodes, and the first ten win. From the author's verbatim stderr (PR comment 2026-11-28):
- rank 0:
22,618 occurrences / 762 distinct, printed examples are mHC and DenseGemm kernels with values like0xfff00000fff(1395 occurrences),0xfff000003ff(1440),0x3fff000003ff(860),0x200000000020(559) — value patterns that read as packed constants, not pointers — then… 752 more distinct addresses (14776 occurrences) not shown; - rank 1:
19,417 / 832, same shape,… 822 more distinct addresses (13614 occurrences) not shown.
The omitted line also reveals how thin the sample is: on rank 0 only ~10 addresses hold ~7,842 of the 22,618 occurrences; the remaining 752 distinct addresses hold the other 14,776.
Why it matters for this lens. #266's stale arguments are an argument at offset 256 of a 384-byte parameter and argument 1 at offset 0. Both are 8-byte aligned, so the filter no longer excludes them — but they are ordinary entries in a set of 700-800, and the operator sees only ten chosen by graph order. A diagnostic whose printed evidence is systematically drawn from whichever kernel happens to appear first in the first graph is not a check an operator can act on in the export it is meant to protect; it will be read once, seen to be full of mHC constants, and ignored afterwards. Charter line 11 and docs/design-review.md's "report evidence honestly" standard apply: the submitted evidence shows volume reduction, not separation.
The maintainer already named the cheap remedy in the 2026-11-20 review ("If thousands remain, one example per kernel symbol would show which kernels produce them"), and the author explicitly offers it in the 2026-11-28 comment ("let me know if you also want one example per kernel symbol rather than first-encountered order across kernels").
Fix. In unresolved_report, group by Site.function (the retained UnresolvedEntry already carries it, reachability.rs:200-210) plus argument, and print one line per (symbol, argument) with its distinct-address and occurrence totals, keeping the per-address detail behind the cap. The symbols and modules are already resolvable through the functions slice (:252-258), so this is local to one function and needs no new state. Then the printed output names the ~3 kernels producing the noise instead of the first node in prefill4096, and a cuBLASLt split-K symbol from #266 would be visible next to them.
What would settle it. Only the export rerun can show whether per-symbol grouping makes the report legible; a unit test can show that two addresses sharing a symbol collapse to one line and that ordering is by symbol rather than by order.
Should fix — the evidence still does not establish that the report can identify a stale pointer
Where: PR description and 2026-11-28 comment (single SM120 two-GPU export of local-inference-lab/DeepSeek-V4-Flash-Vision-Exp-lossless-CSF); docs/TODO.txt:350-354.
The body states the run "does not establish W4A8 MoE kernel behavior or identify stale pointers", that it does not reproduce #266's four-GPU failure, and that the author has only three RTX PRO 6000 GPUs. The maintainer's 2026-11-19 question — whether any example is not a W4A8 MoE constant — is therefore still unanswered in substance: the one export is load_mxfp4_experts (A8), and no printed example is classified either as a constant with evidence or as a pointer with provenance.
This is a real gap against AGENTS.md:165-166 and the charter's evidence line, but it is mitigated on two counts, and I would not make it blocking on its own:
- the change is explicitly a non-blocking diagnostic, not the rejection #266 asked for, so nothing in the serving path or the core depends on it being right yet;
- the outstanding measurement is now recorded as a tracked item — docs/TODO.txt:350-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 both exports have run ... and the counts establish whether per-kernel example grouping is needed"), which also names the per-symbol grouping this report asks for.
Fix. Nothing in the code; the PR description should say explicitly what the aligned counts do and do not demonstrate (that the 762/832 distinct addresses are dominated by packed constants from mHC/DenseGemm kernels is a reasonable inference from the printed values, but it is not stated), so that a future reader does not mistake the presence of the diagnostic for verified detection.
Nits
heliopause/src/export/capture.rs:3219-3223— raweprintln!outside the progress layer. The same function buildsStartupProgressat capture.rs:2864-2868 (stderr_rows()for rank 0,silent()for peers), which is the repository's single reporting mechanism for preparation (helios_core::startup::StartupProgress,is_enabled,Phase::detail,StartupObservationconsumed by the controller/UI). The per-rank report is written as bare stderr: a caller cannot silence it, it never reachesStartupObservation, and it cannot be exercised through the layer. Two mitigating facts keep this at nit level: the behaviour is now documented (docs/runtime-core-design.md:337-342, "Each rank also writes a bounded stderr summary when kernel-argument reachability scanning finds aligned unresolved address candidates"), and there is an existing precedent for raw export stderr in the same file. It also does not corrupt the animated progress rows —stderr_rows()never setsOutput::startedandOutput::redrawreturns early whenstartedis unset — so interleaving is safe. Fix if touched: gate onprogress.is_enabled()or return the lines and letignitionprint them.heliopause/src/export/reachability.rs:172-194and :197-210 — small new retained state.blobbuilds a(data.to_vec(), numeric.to_vec())key, and on a cache hit clones the cached miss vector (misses.clone());unresolvedholds a graph-nameStringper distinct address (~800 per rank). Negligible in absolute terms, but this is new retained state in a function whose surrounding comments are explicit about bounding memory; returning&[(usize, u64)]and storing a graph index rather than an owned name would keep the memory story obvious.
Checked and deliberately not reported
- Alignment filter is correct and does not weaken retention.
scanstill slidesdata.windows(8)one byte at a time (reachability.rs:294) and only the reporting push is filtered (:296-303), sounaligned_pointer_across_chunks_retains_targetsemantics are preserved. - One classification rule.
candidate(:156-170) is now the single place that decides live vs inactive vs gap, andscanno longer recomputesin_free_block; the duplication the maintainer asked about is gone. - Symbol lookup is sound.
Site.functionisnode.function as usizeindexingoutput.index.ranks[0].functions; both vectors are built in the same order over the same kernel list, so symbol/module are correct. Symbols are truncated to_0-style suffixes in the printout, which is cosmetic. - Report arithmetic is correct at head. :264-279 computes hidden distinct addresses as
len - UNRESOLVED_EXAMPLESand sums their occurrences separately, so the maintainer's "14 where 4 occurrences are hidden" nit is fixed; the line is omitted entirely at or below ten distinct addresses. - No compatibility or configuration surface. Nothing persisted, no protobuf field, no flag/env var/setting/config key, no per-model branch, no captured-graph operation change;
AGENTS.md:176-180and design-review.md principles 10, 13, 15 are unaffected. - Graph-name plumbing (capture.rs passing
&graph.name) matches names already validated non-empty and unique during capture.
Open questions / what could not be settled
- Whether per-symbol grouping actually makes the report legible, and what the residual per-rank noise is on a large export, needs an export rerun; a unit test can only prove the grouping and ordering.
- Whether the aligned candidates on the reported export are dominated by packed constants (the values suggest so) can only be confirmed by checking the kernels' parameter types or by the W4A8 measurement.
- #266's reproducer (
deepseek-ai/DeepSeek-V4.1-Flash-1017, four GPUs) has not been run against this build by anyone with the hardware; that verification, plus an eight-GPU W4A8 MoE export, is the outstanding item in docs/TODO.txt:350-354.
Verdict
In scope, right layer, right shape; the earlier blockers are resolved at 1ac7073. What remains is one presentation should-fix (per-kernel grouping, which the maintainer already suggested and the author has offered to do) and one evidence limitation that is now tracked in docs/TODO.txt. Neither prevents the diagnostic from being useful later, but merging it as-is ships an always-on, operator-facing report whose ten printed examples are chosen by graph order rather than by kernel — which is the difference between a check an operator uses and one they scroll past.