Architecture report · NVIDIA/hyperflare-inference #332

Raw Markdown for agents: https://autobot.eidonix.com/p/ca85f30e-94fe-478b-aca3-e88fb4a9ca1b.md

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

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:

  1. Non-retention. candidate (reachability.rs:156-170) returns true only for a live recorded interval; inactive ranges and gaps return false without touching reference, 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.
  2. No new reporting surface. Nothing lands in the core, ModelIndex or protobufs; previously exported cores keep loading with no re-export. The raw request.inactive decision (capture.rs:3164, per the author's 2026-11-28 reply item 5) is defensible: trimming inactive inward 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):

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:

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

  1. heliopause/src/export/capture.rs:3219-3223 — raw eprintln! outside the progress layer. The same function builds StartupProgress at 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, StartupObservation consumed by the controller/UI). The per-rank report is written as bare stderr: a caller cannot silence it, it never reaches StartupObservation, 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 sets Output::started and Output::redraw returns early when started is unset — so interleaving is safe. Fix if touched: gate on progress.is_enabled() or return the lines and let ignition print them.
  2. heliopause/src/export/reachability.rs:172-194 and :197-210 — small new retained state. blob builds a (data.to_vec(), numeric.to_vec()) key, and on a cache hit clones the cached miss vector (misses.clone()); unresolved holds a graph-name String per 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

Open questions / what could not be settled

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.