Pre-Test Report — PR #332 "Report unresolved kernel argument address candidates during export"
Author: mark-yong (CONTRIBUTOR) · Branch: fix/reject-unrecorded-graph-args → main · Head: c3cc87e (unchanged since 2026-11-20) · Size: 2 files, +434/−30 (heliopause/src/export/reachability.rs +428/−29, heliopause/src/export/capture.rs +6/−1) · Refs: #266 (open), #331 (merged)
Recommendation: DO NOT REFER TO HARDWARE TEST
Send back to the author. Three pre-test blockers, none of which a test engineer can resolve, and every one of which invalidates the measurements a hardware run would produce:
- The maintainer's blocking item is unimplemented at head. yatesdr's 2026-11-20 review closed with "One change before this can merge": report only argument-relative offsets divisible by 8, then repost the counts from the same export.
heliopause/src/export/reachability.rs:259still readsfor (offset, bytes) in data.windows(8).enumerate()with no% 8filter anywhere in the file. The PR's own headline example (argument 0, offset 4: 0x100000000800) is exactly the straddling window the maintainer said cannot be a pointer. Status is still CHANGES_REQUESTED after three rounds. - Two user-visible outputs are wrong and must be rewritten (details below): the summary line misstates which values it reports, and the "N more occurrences not shown" line prints a number that is not omitted occurrences.
- The branch will not merge cleanly, and the conflicts are in the code under test.
mainnow hasReachability::execution()(main:heliopause/src/export/reachability.rs:87) andgraph(&mut self, nodes, kernels); this branch hasgraph(&mut self, name, nodes, kernels)and still inlines the execution-buffer reference loop atcapture.rs:3075-3086wheremaincallsreach.execution(&execution)(main:heliopause/src/export/capture.rs:3159). Merged #431/#507/#498 rewrote precisely these functions. Rebasing changes the exact lines any test would exercise.
Expected value of a hardware test right now: near zero. Even with the blockers fixed, hardware cannot settle the two questions this PR exists to answer (see "Why hardware cannot settle this" — the decisive measurement was already taken on GB10 hardware by a third party, and #266's reproducer is unrunnable on the available fleet).
Cost avoided: the author's export takes ~73 minutes (#266, 2026-11-11 comment) and produces ~170k-report-per-rank runs; re-running it twice (before/after an alignment fix that will land) is pure waste.
What the change does
A non-blocking, always-on diagnostic in the Heliopause export scan. pointer() becomes candidate() (reachability.rs:131-145) returning whether a value resolved to a live allocation; scan (:248-274) optionally collects address-shaped values that fall in gaps between recorded allocations or in inactive parts of recorded segments; blob (:147-188) charges each miss to an address→entry map keeping first site (graph, node, function index, argument, offset), an insertion order, and an occurrence count; unresolved_report (:205-246) renders a summary line, ≤10 examples, and a hidden-count line; capture_rank prints them per rank via eprintln! (capture.rs:3137-3141). No wire, core-format, CLI, env-var or recipe surface is added; nothing is persisted; retention behaviour is unchanged.
Verified sound — do not ask the author to change these
- Retention is untouched.
candidatereturnsOk(true)for an inactive value before reachingreference()(:132-135), andreference()is called only on a live-interval hit (:139-142). Tests:928-966pin both reporting and non-retention. This was the one lifetime contract the change had to avoid weakening, and it holds. - Allocation-content scans cannot produce reports.
scan_spanspassesmisses: None(:370-378), socontents/opaque_contentsare report-free;:918-926covers it. - Offsets are genuinely argument-relative.
baseis the chunk start within the blob passing throughsubtract_ranges(:159-164). - Symbol lookup is correct.
Site.function = node.function as usizeindexeskernels(bounds-checked at:290-292), andcapture.rs:2911-2991pushes onewire::Functionper kernel in kernel order, sofunctions[candidate.function]is the right symbol/module. The maintainer's round-2 bookkeeping request (dropkernel_symbols, store the index) is implemented as asked. - Right layer, right scope. The scan is the only place that sees recorded argument bytes beside the recorded allocation table. No per-model branch, no new flag, nothing in core/ModelIndex/protobufs, so previously exported cores keep loading. Charter-compliant on "solve the right problem in the right place" and "no per-model special cases or flags."
- The problem is real and worth detecting. #331 fixed the cause in
main, but #395 (CUDAGraph.reset()freeing a workspace other graphs share) is a live second path, and #331's own limitations note that cores exported before it keep the stale address. A cheap non-fatal report is a defensible residual net.
Blocking issues (must be fixed before any hardware time is spent)
B1. No 8-byte alignment filter — the report cannot pick out a stale pointer (reachability.rs:259)
scan slides an 8-byte window one byte at a time, so a value spanning two CUDA parameters is recorded as a candidate at a half-pointer offset. 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, all ten printed examples per rank being b12x mHC Cutlass MHCPostPrePartialKernel at offset 4, with the author stating they "do not establish … whether the mHC values are constants or stale pointers."
Why this blocks testing rather than merely needing polish: with ~2.6k distinct candidates ahead of them in first-seen order, #266's real stale arguments (offset 256 of a 384-byte parameter; offset 0 of argument 1 — both aligned, so an alignment fix preserves them) would be buried in the … N more occurrences not shown line. The artifact that would merge is a permanent diagnostic whose only consumer is an operator reading rank-wide stderr; a diagnostic that trains operators to scroll past it is worse than none.
Fix: report only when (base + offset) % 8 == 0, leaving retention and the inactive/gap classification unchanged. Then rerun the export and post before/after distinct-address counts per rank. The maintainer also offered: if thousands remain, one example per kernel symbol.
B2. The summary line misstates what is reported (reachability.rs:211-214)
The shipped string says candidates "fall inside the recorded address envelope but outside every live recorded allocation". But scan:266 pushes when !self.candidate(pointer)? || in_free_block, so a value in the free block of a segment that is a recorded allocation is reported too — which is why the duplicate in_free_block term exists at all. The PR description states the correct rule ("gaps between recorded allocations and in inactive parts of recorded segments"); the string an operator actually reads does not. The UnresolvedCandidate doc comment (:45-46) has the same defect in miniature ("resolves to no live recorded allocation, including a value in an inactive range" — an inactive range is inside a recorded allocation).
B3. "… N more occurrences not shown" prints a number it does not compute (reachability.rs:238)
let hidden = occurrences - examples.len().min(UNRESOLVED_EXAMPLES);
occurrences is a sum of per-address occurrence counts; examples.len() is a count of distinct addresses. The subtraction mixes units. The PR's own test pins the wrong number: :869 asserts " … 14 more occurrences not shown" where each of the 10 printed examples has occurrences == 2, so 20 of 24 occurrences are shown and only 4 are unshown. At scale (2,646 distinct / 175,329 occurrences) the line reads "175,319 more occurrences not shown" when what is actually omitted is 2,636 distinct addresses. Fix: sum the occurrences of examples actually printed, or print omitted distinct addresses and say so.
B4. A second, independent false-positive source: raw inactive ranges vs granule-trimmed live intervals (correctness, verified)
Reachability::new takes raw request.inactive (capture.rs:3074, stored at reachability.rs:107), but allocations were already rebuilt by live_pieces (capture.rs:1410-1423), which rounds each hole inward to allocation.alignment (capture.rs:1211-1212). The retained live piece therefore still covers [raw_start, aligned_start) and [aligned_stop, raw_stop). A kernel-argument value sitting in that edge is inside a live recorded allocation, but candidate checks the raw inactive list first (:131-135) and returns early, and scan recomputes in_free_block from the same raw list (:262-265), so it is reported with the false claim that no live allocation covers it. Granule is MiB-class (cuMemGetAllocationGranularity), so each hole can contribute up to a granule of live-but-reported addresses per side, for every graph argument.
No existing test reaches this: every test uses granule-aligned holes — :908 (hole 0x3000..0x3100), :943 (hole 1024..3072 in a 4096-byte allocation), and capture.rs:4545 (holes 0x1080/0x1380 with granule 0x100). A non-granule-aligned hole test is missing.
B5. The duplicated lifetime rule (reachability.rs:131-135 vs :262-266) — the maintainer's open item 2
candidate already treats an inactive range as a hit, and scan repeats the identical partition_point as in_free_block. Since candidate cannot mutate inactive, !candidate(pointer)? || in_free_block always equals !candidate(pointer)? — the second copy changes no result, yet it is paid on every 8-byte window of every argument and every byte of every scanned allocation segment (the misses: None path at :370-378 pays it too, because the predicate is evaluated before the && let short-circuit). It is also the mechanism that produced B4: two copies of one lifetime rule that already disagree.
Caution for whoever fixes it: deleting in_free_block alone and keeping !self.candidate(...) would silently stop reporting inactive-range values, because candidate returns true for them and does not record them. The fix must return a classification (Live/Inactive/Gap), and B4 should be fixed in the same edit by deriving candidacy from the same geometry as self.intervals. Test :902-916 pins the reporting half and must keep passing.
B6. Missing tests the maintainer asked for (reachability.rs:248-274, capture.rs:3137-3141)
- Item 3, unaddressed: "Put an 8-byte pointer to a live allocation, then a small integer, in one argument. Assert the straddling window is not reported, and that a stale pointer at an aligned offset is." The nearest existing tests (
:750-770,:772-790) assert only what is reported. Note this test cannot pass atc3cc87e::783-799deliberately asserts that a window at offset 16 of0x3008 | 8 zero bytes | 0x3010is reported — i.e. the current suite encodes the unaligned behaviour B1 removes. - The print path is untested.
capture.rs:3137-3141needs a CUDA context, so nothing exercises the rank prefix or the three-way index wiring (wire::Kernel.function→kernels→functions) end to end. A two-kernel graph throughReachability::graph+unresolved_reportwith a two-elementfunctionslist would pin it on CPU.
Should-fix and nits (not test gates, but they will move the output)
capture.rs:3137: theunresolved_count() > 0guard duplicatesunresolved_report's ownoccurrences == 0early return (:207-210) and forcespub(crate)onunresolved_count. One rule, one place.reachability.rs:147-169: theblobscache clones its key up to three times per argument and clones the miss vector on every cache hit;unresolved_reportclones and sorts the whole map once per rank; one graph-nameStringper distinct address is retained for 2,646 addresses while only 10 are printed. Bounded, but new retained state inside a function whose comments stress limited memory.reachability.rs:455-461:with_countis a new pluralisation helper with no repo precedent (flare-cli inlines the suffix).reachability.rs:232-233:function.map_or("unknown", …)renders an unreachable state —graphrejects an out-of-range function index at:290-292, andcapture.rs:2911-2991keeps the lists in one order. Either drop the fallback or say the index was out of range.- Docs: the new per-rank stderr line is unmentioned in
docs/runtime-core-design.md:310-313(which enumerates rank-zero capture's stderr reports), and the pending four-GPU/W4A8 verification has nodocs/TODO.txtentry, which AGENTS.md:53 (not opened) requires (I searcheddocs/TODO.txtfor W4A8/266/kernel-argument: no matches). capture.rs:3139uses raweprintln!outsideStartupProgress/is_enabled, so the line never reachesStartupObservation. The maintainer explicitly accepted the author's resolution here (2026-11-18 item 2 → 2026-11-19), andcapture.rs:3993andtransfer.rs(not opened) already print raw rank-labelled stderr, so this is a nit, not a gate. Do not reopen it.
Semantic caution for any future test: "occurrences" is not a severity figure
blob caches the miss list keyed by (data, numeric) and replays it for every site sharing those bytes (:147-188). So an "occurrence" is (misses in one unique blob) × (number of nodes/arguments with identical bytes) — rank 0's 175,329 occurrences over 2,646 addresses is ~66 replays per distinct address. Anyone reading the counts as "how many bad arguments" would be misled by an order of magnitude. Any future test must assert distinct-address counts, never occurrence counts. Similarly, examples are chosen in first-seen order with no ranking by rarity, so a rare true positive is structurally invisible behind thousands of benign constants; a regression test should assert a rare candidate is reachable in the output (e.g. per-symbol grouping), not merely that ten lines print.
Why hardware cannot settle this PR's questions — and what is already measured
| Question | Can our hardware answer it? | Status |
|---|---|---|
| Do aligned-only candidates separate signal from noise? | No | Already answered on GB10 hardware. FujitsuPolycom's independent 4×GB10 TP4 export posted in #331 (2026-11-19 04:57): "864 unaligned byte-window matches and one aligned match per rank." ~863 of 864 candidates are the exact artifact B1 removes. That is the before/after the maintainer wanted, from a third party, on hardware equivalent to ours. |
| Does the diagnostic catch #266's real stale pointers? | No | #266's reproducer is deepseek-ai/DeepSeek-V4.1-Flash-1017 at TP4 on 4× GB10. cn7 has 1× GB10 — cannot form TP4. cn5 has 4× RTX PRO 6000 but none of its models is DeepSeek-V4.1, and no archived known-bad package exists. |
| False-positive volume on a 4×RTX PRO 6000 export | Technically yes (GLM-5.3 or Qwen3.8 export on cn5) | Not comparable to the author's Vision-Exp numbers, so it would not answer the maintainer's "post the counts from the same export again." |
| Does an export still complete with the diagnostic enabled? | Yes, but pointless | The author already ran a full SM120 two-GPU export that completed. The code path will change again (B1/B4/B5). |
Two further resource facts: an export runs ~73 minutes (#266) and a job on cn5 gets only 16 GiB scratch — GLM-5.3-Flash NVFP4/DeepSeek-class exports are large. Spending that on a branch that will be rewritten is a poor trade.
Testability note: the PR is CPU-testable today. Everything except the capture.rs:3137-3141 print site runs without a GPU or a model (cargo test --manifest-path heliopause/Cargo.toml (not opened) --lib, which the author reports as 205 passed / 4 ignored, and the maintainer independently reproduced at an earlier head as 206 passed / 4 ignored). Note heliopause is not in CI at all — .github/workflows/native-serving.yml (not opened) covers eos, selene, selene-manager, helios, flare-cli and flare only — so the suite is author/maintainer-run by hand. That is a real gap, but it argues for adding heliopause to CI, not for buying a GPU.
What to tell the author (minimal path back to a test)
- Filter reporting to
(base + offset) % 8 == 0; keep retention and the gap/inactive classification untouched (B1). - Fix the summary string and the
UnresolvedCandidatedoc to name both conditions — gap between live allocations, or inactive range inside a recorded segment (B2). - Fix the hidden-count line to subtract printed occurrences, or print omitted distinct addresses (B3).
- Replace the duplicated inactive lookup with one classifier (
Live/Inactive/Gap), and derive candidacy from the same granule-trimmed geometry asself.intervals, so the granule-edge false positives go away with the same edit (B4+B5). Add the unaligned-hole boundary test. - Add the straddling-window test the maintainer specified, fixing the existing
:783-799expectation that encodes unaligned reporting (B6); add a two-kernel symbol-mapping test for the print path. - Rebase onto
main(#431/#507/#498) and show the branch builds and the heliopause suite passes — including a conflict-freecapture.rsaroundreach.execution(). - Rerun the same Vision-Exp export and post before/after distinct-address counts per rank, plus (if thousands remain) one example per kernel symbol — the maintainer's own fallback offer.
- Add the
docs/runtime-core-design.md:310-313sentence and thedocs/TODO.txtentry for the unrun four-GPU/W4A8 verification.
Deferred test plan — for the next round only, NOT authorized now
If the above lands and the maintainer lifts CHANGES_REQUESTED, a single-purpose test should validate the diagnostic's specificity, since that is the only thing hardware adds. I would keep it to one job:
- One export on cn5 (4× RTX PRO 6000) of
nvidia/GLM-5.3-Flash-NVFP4at TP4, which is on the box and exercises the same SM120 capture path as the author's run. Assert: export completes (non-blocking diagnostic), ≥1 rank prints the summary, and the reported distinct-address count is small and attributable per kernel symbol. Compare against a same-commit run with reporting disabled only to confirm the diagnostic changes no export artifact (core/manifest byte-identical) — this is the non-retention and non-blocking guarantee, and it is the highest-value assertion available. - A/B for regressions, not throughput: export wall-clock and peak RSS with the scan on vs. off, on the same model and pin. The
blobscache (:147-188) is new per-node copying in the hottest export loop and is the only plausible performance risk; throughput on the serving path cannot regress because nothing on it changes. Expect parity; a measurable slowdown is a finding. - Explicitly out of scope: a true-positive test (unrunnable on this fleet), any DeepSeek-V4.1 export, and single-GPU GB10 runs on cn7 (the diagnostic is rank-agnostic and a 4-rank run already covers the rank-label path). Do not spend a second job re-deriving counts the author's SM120 run and FujitsuPolycom's 4×GB10 run already establish.
That is at most one cn5 job (~2 GPU-hours) and it should only be authorized after the code stops moving.
Security / integrity check
I read the PR description, all five discussion entries, and #266 in full. Nothing instruction-shaped: no prompt injection, no requests to alter tooling/CI/review process, no data-exfiltration instructions. #266 contains a genuine torch._C._cuda_clearCublasWorkspaces() suggestion aimed at the capture path (fixed by #331), and an offer to "share the script" — informational only. Discord: myong_acct is ordinary author attribution. This matches the intake screen's all-clear. The author's Limitations section is candid about what was not run, which is to their credit and is reflected above rather than treated as a defect.