Full report — PR #332 "Report unresolved kernel argument address candidates during export"
Head reviewed: c3cc87e · Base: main · Diff: +434/−30 across 2 files (heliopause/src/export/reachability.rs +428/−29, heliopause/src/export/capture.rs +6/−1) · Refs #266 · Author: mark-yong (CONTRIBUTOR, branch fix/reject-unrecorded-graph-args) · Third round of review, status CHANGES_REQUESTED (reviewer yatesdr, 2026-11-18 / 11-19 / 11-20) · No CI checks on the head commit.
Key findings
- Scope and layer are right; the instrument is not. #266 asked for export-time detection (2026-11-11) and the maintainer accepted it "where pointer provenance can be established without misclassifying numeric kernel parameters" (2026-11-13). The change is confined to the Heliopause export scan: no protobuf field, core/artifact format, CLI flag, environment variable or recipe setting, nothing persisted, no per-model branch. Retention semantics are correct and unchanged.
- Blocker 1 — the report counts and prints byte windows, not argument values.
scanstepsdata.windows(8)one byte at a time (reachability.rs:259) and pushes every in-envelope value at:269with no alignment filter. The PR's own first example is a straddling window (argument 0, offset 4: 0x100000000800), and the ten first-seen example slots fill before a real stale pointer can appear. This is the maintainer's still-open 2026-11-20 blocking item. - Blocker 2 — raw inactive ranges vs granule-trimmed live intervals.
Reachability::newreceives rawrequest.inactive(capture.rs:3074) whileintervalscome from allocations already trimmed inward bylive_pieces(capture.rs:1196-1240, applied:1408-1423, called viaprepare_allocationsat:2786). Bytes in the retained edge are therefore reported, and the printed summary then says they are "outside every live recorded allocation" (reachability.rs:211-214) — which is false for them. - Blocker 3 — no regression test for the straddling window, which is what would keep Blocker 1 fixed.
- Six should-fix items (duplicate rule, two misstated printed quantities, evidence scoping and a self-undermining W4A8 sentence, missing docs, missing TODO entry) and eight nits follow.
- Verified and cleared: retention semantics, allocation-content scan isolation, argument-relative offsets, deterministic report order, and the symbol-index mapping (
capture.rs:3034-3049builds the rank'sfunctionsfrom the same list pushed once per kernel in kernel order).
Blockers
B1. The report counts and prints byte windows, not argument values
Finding. heliopause/src/export/reachability.rs:259-271:
for (offset, bytes) in data.windows(8).enumerate() {
let pointer = u64::from_le_bytes(bytes.try_into().unwrap());
if pointer >= floor && pointer < ceiling {
...
misses.push((base + offset, pointer));
}
}
data is the encoded argument blob, one entry per parameter (encode_kernel). windows(8) yields a value at every byte offset, so a single 8-byte pointer parameter is also read at its seven misaligned offsets. CUDA places a pointer at an 8-byte-aligned offset inside its parameter, so a value at offset 4 spans two fields and cannot be a pointer. The PR's own first example is exactly that case: prefill4096, node 34, MHCPostPrePartialKernel, argument 0, offset 4, 0x100000000800 (PR description; author comment 2026-11-19), and all ten printed examples per rank are the same kernel at that offset. The reported totals — 175,329 occurrences / 2,646 distinct addresses on rank 0, 170,544 / 2,637 on rank 1 — therefore measure straddling windows. Independent corroboration that this is an artifact of the technique: an out-of-tree check on a healthy, already-fixed package found "864 unaligned byte-window matches and one aligned match per rank" (FujitsuPolycom, PR #331, 2026-11-19).
Request. Apply (base + offset) % 8 == 0 to the reporting push only (reachability.rs:267-270). Do not narrow the scan loop: unaligned_pointer_across_chunks_retains_target (reachability.rs:480-489) writes a pointer at byte offset 5 of a 19-byte buffer split across two contents() chunks and asserts reach.reached.contains("target"), so retention depends on scanning every byte offset plus the tail/boundary reassembly. Then rerun the same export and post before/after occurrence and distinct-address counts per rank; if thousands remain, print one example per kernel symbol so an operator can see which kernels produce the noise. Also check kernel_argument_candidate_offset_counts_from_the_argument_start (:772-790), which asserts a candidate at offset 16 for data whose composition implies a straddling window at offset 4 — confirm or adjust it against the filter so the suite does not fail confusingly. This is the maintainer's 2026-11-20 item 1.
Why. The diagnostic does not fail an export, so its entire value is whether its numbers and examples point at #266's stale arguments. As printed, the occurrence count can be inflated up to ~8× per parameter and the ten first-seen slots (UNRESOLVED_EXAMPLES = 10, :75; first-insert order, :222-224) are exhausted before a real stale pointer can appear. #266's actual cases sit at offset 256 of a 384-byte parameter and at offset 0 of argument 1 — both aligned, so the filter keeps them, which is worth stating in the description as the acceptance criterion. Without this, the check trains operators to scroll past it.
B2. Raw inactive ranges vs granule-trimmed live intervals: the report can state something false
Finding. Reachability::new is given the raw request.inactive (capture.rs:3074; merged unchanged at reachability.rs:107), while intervals come from allocations — which reached capture_rank through prepare_allocations (capture.rs:2786, :1337-1428), where live_pieces (:1196-1240) rounds each hole edge inward to the allocation granule:
let start = start.max(begin).div_ceil(granule) * granule;
let stop = stop.min(end) / granule * granule;
So [hole_start, aligned_start) and [aligned_stop, hole_stop) stay inside a retained live piece. A kernel-argument value in such an edge is inside a live recorded allocation, but candidate returns early on the raw inactive hit without referencing (reachability.rs:131-135), scan recomputes the same raw predicate as in_free_block (:262-265), and the miss is recorded at :266-270 — after which the summary line asserts the value is "outside every live recorded allocation" (:211-214). Misaligned hole edges arise from partially-live preparation-pool blocks, whose range starts at block.address + block.requested_size (ignition/preparation/core_storage.py:303-318), while the granule is MiB-class (core_storage.py:93, :497-499).
Both existing inactive tests are blind to it: freed_interval_boundaries_report_kernel_candidates_without_retaining_storage (reachability.rs:928-966) uses a hole 1024..3072 inside a 4096-byte allocation with alignment: 256, and kernel_argument_inactive_ranges_are_reported_but_numeric_ranges_stay_lenient (:902-916) uses a hole 0x3000..0x3100 — both granule-aligned, so trimmed == raw.
Request. Pass the geometry live_pieces actually trimmed out (or the granule) into Reachability::new and derive the report predicate from it, so candidacy is decided once over the same geometry as intervals. Add a test with a non-granule-aligned inactive range asserting that a value in the retained edge is not reported and a value in the trimmed hole is.
Why. This is the same failure mode the PR exists to surface elsewhere: one lifetime-adjacent rule stated in two places that disagree. It is gated rather than deferred because it is the same edit as maintainer item 2 (one classifier over one geometry), so the incremental cost is near zero — and if it is left in, Blocker 1's rerun still posts counts containing false "no live owner" claims. I am not attaching a magnitude: how many misaligned hole edges exist in recorded core allocations is unmeasured; the defect stands on its own.
B3. No regression test for the straddling window
Finding. Nothing asserts that an unaligned window is not reported. The nearest tests only assert what is reported: unresolved_examples_are_capped_while_occurrences_are_counted (:750-770) builds back-to-back 8-byte values and expects 12 candidates at offsets 0, 8, 16, …, and kernel_argument_candidate_offset_counts_from_the_argument_start (:772-790) expects a hit at offset 16.
Request (maintainer's 2026-11-20 item 3). One test: an 8-byte pointer to a live allocation followed by a small integer in the same argument; assert the straddling window is not reported and that a stale pointer at an aligned offset is.
Why. Without it, Blocker 1 has no guard and the byte-window census returns the next time the loop is touched. It should land with the alignment fix, not after it.
Should fix
S1. State the inactive rule once (maintainer item 2)
Finding. candidate (:131-145) returns a bare bool, and scan re-derives the identical partition_point as in_free_block (:262-266) purely to recover which case it was. The composite !self.candidate(pointer)? || in_free_block means "in an inactive range, or in a gap".
Request. Have one classifier return the classification once — Retained / Inactive / Unallocated — with reference called only for Retained, reporting for Inactive | Unallocated, and Blocker 2's geometry behind it. That deletes in_free_block and the second binary search.
Why. Two copies of a lifetime-adjacent rule drift silently, and this is the maintainer's open 2026-11-20 item 2. Caution: the second lookup is not dead code — candidate returns Ok(true) for an inactive value and does not record it, so deleting in_free_block alone while keeping !self.candidate(...) silently stops inactive-range reporting. kernel_argument_inactive_ranges_are_reported_but_numeric_ranges_stay_lenient (:902-916) pins that behaviour and is the reason the classification must be returned rather than inferred.
S2. The printed summary line misstates which candidates it reports
Finding. reachability.rs:211-214 prints "… fall inside the recorded address envelope but outside every live recorded allocation, so each may be a stale pointer or a numeric constant". That is wrong for one of the two classes the code reports: free-block values inside a recorded segment are reported too (scan, :262-270). The PR description's own Change section states the correct rule. The struct doc at :45-48 has the same contradiction in miniature ("resolves to no live recorded allocation, including a value in an inactive range" — an inactive range is inside a recorded allocation).
Request. Name both conditions in the summary line and in the struct doc; update the pinned literals in unresolved_report_names_the_kernel_and_its_symbol (:830-841) and unresolved_report_bounds_examples_and_counts_hidden_occurrences (:860-865).
Why. The maintainer raised exactly this wording problem for the commit message in the 2026-11-19 review (item 4); the commit message was corrected, but the string an operator actually sees was not. A reader told "outside every allocation" will not think to look at a free block of a live segment — which is the #266 case.
S3. "… N more occurrences not shown" reports a number it does not compute
Finding. reachability.rs:238: let hidden = occurrences - examples.len().min(UNRESOLVED_EXAMPLES);. occurrences is the sum of per-address occurrence counts (:190-195); examples.len() is the number of distinct addresses. The subtraction mixes units. In the PR's own test (:844-870): 12 addresses scanned in two graphs = 24 occurrences; 10 examples print, each with occurrences == 2, so 20 occurrences are shown and 4 are hidden — the code computes 14 and :869 asserts " … 14 more occurrences not shown", locking the wrong number into the suite. In the other direction, 5 addresses × 2 occurrences prints a non-zero hidden count when nothing is hidden.
Request. Sum the occurrences of the examples actually printed (examples.iter().take(UNRESOLVED_EXAMPLES).map(|(_, e)| e.occurrences).sum()), or print omitted distinct addresses instead; make the description and the test say whichever is printed.
Why. It is the only quantitative handle a reader has for "did I see everything?", and it quietly weakens the round-2 concern that ten early constants fill every slot — the compensating number is inflated or deflated depending on how many sites each address has.
S4. The posted evidence is not scoped to the code that produced it, and the W4A8 contrast is self-undermining
Finding. The Validation section quotes the offset-4 example and the pre-fix totals without saying the run predates the restriction the reviewer requires (AGENTS.md:98-107). Further, "The recipe configures its MXFP4 experts with A8 activations (load_mxfp4_experts), but the printed diagnostic does not identify any W4A8 MoE kernel among its examples" asserts the A8 configuration and then reports the absence of the kernels that configuration produces — load_mxfp4_experts calls load_fp4_experts(..., format="mxfp4", activation_mode="a8") (ignition/components/weights.py:1574-1588) and the CSF branch defaults to a8 (:1593-1597). The later Limitations paragraph half-retracts the sentence.
Request. State which scan rule produced the posted numbers, or rerun after Blocker 1 and post the new counts; drop or repair the W4A8 contrast (or name the kernels the recipe's experts actually compiled to); confirm the commit message and description agree on MXFP4/A8 coverage (maintainer 2026-11-20 item 4).
Why. Evidence has to be connected to the behaviour tested and the limits of the conclusion; two paragraphs that disagree on what the run showed is what AGENTS.md:101-102 asks authors to reconcile. Charter line 11 ("Bring real evidence") applies.
S5. The new per-rank export message is undocumented
Finding. capture.rs:3137-3141 prints export: rank N: kernel argument scan: … on every rank of every export. docs/runtime-core-design.md:310-313 enumerates what native capture reports on stderr ("storage clearing, graph inspection and serialization, module/global capture, storage scans, weight materialization, and frontend assets") and omits it; docs/model-preparation.md:1471-1487 documents the comparable unconditional per-rank VRAM inventory.
Request. One short paragraph: the line exists, it does not fail the export, and where the scan is blind — reuse the Limitations wording already in the PR description.
Why. AGENTS.md:47-55 treats repository documents as present-state specifications; as written a reader of model-preparation.md cannot learn the line exists.
S6. The pending verification lives only in the discussion
Finding. The four-GPU deepseek-ai/DeepSeek-V4.1-Flash-1017 export and the unverified W4A8 path appear only in PR comments; this PR adds no docs/TODO.txt entry (search of docs/TODO.txt for 266 / W4A8 / kernel argument: no matches).
Request. Add the pending measurement to docs/TODO.txt.
Why. AGENTS.md:53 directs unresolved defects and pending measurements there.
Nits
capture.rs:3137repeats the callee's contract.unresolved_reportalready returns an emptyVecat zero occurrences (reachability.rs:206-210, pinned by:872-876), soif reach.unresolved_count() > 0cannot change behaviour. Drop theif;unresolved_countthen has one in-module caller andpub(crate)at:190can become private. Two copies of one rule drift apart — the same class the maintainer rejected in item 2.reachability.rs:147-169— the cache clones its key and cached miss list.data.to_vec()/numeric.to_vec()rebuild the key on every call (:148), andmisses.clone()runs on both the hit (:150) and store (:166) paths, at ~2,646 distinct addresses per rank. Return a slice from the hit branch, or fill the cache in place.reachability.rs:170-186— a full site is retained per distinct address while ten print. Each entry stores anUnresolvedCandidatewith an ownedgraph: String(:176-182), i.e. ~2.6k heap-backed site records per rank written and never read. Fillfirstonly whileself.unresolved.len() < UNRESOLVED_EXAMPLES(compute the count before theentrycall soself.unresolvedis not borrowed twice).reachability.rs:455-461—with_countis new machinery where the repo inlines the suffix.flare-cli/src/cache_commands.rs:307 (not opened), :309, :600, :602, :612, :617, :691, :697all writeif n == 1 { "" } else { "s" }inline; no pluralizer helper exists anywhere else (fn plural|pluralize: no matches). Inline it, or use "occurrence(s)" / "address(es)".- Duplicate tests and two lookup idioms.
shared_argument_bytes_record_one_example_per_address(:792-807) repeats:751-770plus the graph-name assertion already made by:844-870— the same overlap the maintainer flagged under its old name in the 2026-11-18 review item 6.unresolved_report_is_empty_without_candidates(:872-876) asserts a path production cannot reach whilecapture.rs:3137keeps its own guard: keep one of the two.first()(:728-730) versus directreach.unresolved[&address](:767,:805) are two idioms for one lookup, andunresolved_unique_addresses(:197-199) exists to be asserted four times alongside.len(). The singular form of the hidden-count line is untested (only the plural at:869). reachability.rs:232-233— unreachablekernel unknown (unknown).graphrejects an out-of-range function index (:290-292) andfunctionsis built one-per-kernel in kernel order (capture.rs:2986-2992), sofunctions.get()always succeeds; the placeholder (pinned at:866) is indistinguishable from a kernel literally namedunknown. Replace with a one-line comment that the two lists must stay in the same order, or say the recorded index was out of range.capture.rs:3137-3141— raweprintln!bypassesStartupProgress. Rank 0 buildsstderr_rows()and other rankssilent()(:2774-2778), yet the report prints on every rank with a bareeprintln!, so it cannot be gated byis_enabledand never reachesStartupObservation. The maintainer accepted the author's resolution (2026-11-19 item 2) andcapture.rs:3993sets the same precedent, so keep it — noting that raw stderr does not corrupt the animated rows, becausestderr_rows()never setsOutput::started. If ever revisited, emit through the progress object and gate onis_enabled().- Re-measure before keeping the surrounding machinery. If aligned candidates collapse to a handful after Blocker 1, the cap/order/example/symbol/cache layers may no longer earn their ~300 lines (charter: "Bring real evidence", "Reject unsupported abstractions and churn").
Verified correct (no finding)
- Retention semantics are untouched.
candidatereturns exactly what the oldpointer()did: inactive hit → no reference,Ok(true); interval hit →reference(name),Ok(true); otherwiseOk(false)(:131-145). The report is additive; it is consulted after all graphs (capture.rs:3137), never as an error path. - Allocation-content scans cannot produce false reports.
scan_spanspassesmisses: None(:370-378), so only kernel-argument blobs report;allocation_contents_still_tolerate_gap_candidates(:918-926) covers it. - The
blobscache change is correct. Misses depend only on(data, numeric), so replaying the first site's miss list per site is sound, and numeric exclusions are still subtracted before scanning (:152-165). - Offsets are argument-relative.
baseis the chunk start within the blob (:159-164), sobase + offsetis an offset from the argument start even when numeric ranges split the slice. - The symbol plumbing is right.
capture.rs:3034-3049buildsindex.ranks[0].functionsfrom the same localVec<wire::Function>pushed once per kernel in kernel order (:2911-2991), andgraphvalidatesnode.functionagainstkernels(:290-292), soSite.functionindexes the right list. The only coupling is that the two lists must stay in the same order — worth the one-line comment in nit 6, not a defect. The maintainer's 2026-11-19 item 4 (store the index, dropkernel_symbols) is implemented as asked;kernel_symbolsno longer exists. - Graph name is passed safely.
capture.rs:3102passes&graph.name, already validated non-empty and unique. - Report order is deterministic (
order= map length at first insert, sorted at:222-223). - No compatibility, wire or configuration surface. No protobuf change, no core/artifact format change, no flag/environment variable/setting, no per-model branch —
docs/design-review.mdprinciples 10, 13, 15 and the charter's "No per-model special cases or flags" are unaffected. Printing on every rank is safe (rank-labelled stderr; no JSON-framed stdout on this path). - No attempt to direct the reviewer was found in the PR text or comments;
flare-autobotposted only a case-file link (2026-11-25).
Open questions / could not be settled
- Commit message body (maintainer item 4, second half). It is not readable with the available tools; whoever merges should confirm it agrees with the description on MXFP4/A8 coverage.
- Tests and clippy were not run in this environment; every line reference was read at head
c3cc87e, and the export counts quoted come from the author's description and 2026-11-19 comment, not from an independent measurement. - A real export rerun is required to know whether alignment plus trimmed-hole geometry leaves a usable signal; a unit test can prove the straddle is skipped but not the residual candidate count. Same for the "one example per kernel symbol" fallback.
- The true size of Blocker 2 is unmeasured — it depends on how many partially-live pool blocks appear in recorded core allocations; the defect (reported bytes lie inside a retained live piece, and the printed line asserts the opposite) is asserted without a magnitude.
- Whether #266's own package would be caught has not been tested by anyone (the author lacks the hardware). Its arguments sit at offset 256 and offset 0, both aligned, so the Blocker 1 fix keeps them — worth stating as the acceptance criterion.