#1 [high] PR #332 lens findings — correctness/contracts/system consequences
Head 38805ba. Files: reachability.rs (+738/−27), capture.rs (+4/−1), docs/runtime-core-design.md, docs/TODO.txt.
VERIFIED SOUND (state plainly):
- Retention behavior is unchanged.
candidate()(reachability.rs:156-169) ispointer()(main:118-131) returning bool;scan(317-340) uses the bool only for reporting. No allocation enters/leavesreacheddifferently than on main → no core-compatibility or missing-segment risk. - No wire/proto change.
unsolved_report(&output.index.ranks[0].functions)at capture.rs:3294 is valid becausefunctions.push(capture.rs:3151) andkernels.push(3060) happen in the same loop, andnode.functionisindices→kernelsindex (capture.rs:889, 824-827).functions[site.function]resolves correctly. - No locks/threads added: single-threaded per rank;
unresolved/blobsare per-Reachabilityand dropped with it. No hot-path or serving interaction (export-only). - Alignment offsets are stable across
blobscache hits: key is(data, numeric)(reachability.rs:197), and span bases derive fromnumericonly (202-215), so replayed(offset, address)pairs are argument-relative-identical. - Terminal/progress interleaving is safe:
Phase's worker is joined inDrop(helios/src/startup.rs:336-354) and finished rows emit a newline (Output::write, startup.rs:473-481), soeprintln!at capture.rs:3295 does not corrupt the row.
FINDING A (Major) — alignment filter's domain is the packed blob offset, not the CUDA parameter offset. encode_kernel discards the per-parameter offset returned by function_layout and concatenates by size only (capture.rs:829-841: |(&(_, size), argument)| ... cursor = end;). scan's filter (base + offset).is_multiple_of(8) (reachability.rs:334) therefore assumes each parameter starts at an 8-byte boundary in the concatenated blob, which holds only if every preceding parameter size is a multiple of 8. A int/float/odd-sized struct parameter before a pointer parameter shifts the pointer to a non-multiple-of-8 blob offset and the candidate is silently dropped — the exact false negative the PR exists to prevent. cuFuncGetParamInfo offsets are fetched (capture.rs:437-460) then thrown away. No test covers it: every new test uses 8-byte parameters — kernel_graph (reachability.rs:764-785) builds one Argument and the two-argument test (706-762) uses size 8 twice. Fix: report on the ABI parameter offset (carry layouts[index] offsets into the Site/scan base) or drop the alignment filter for parameters whose preceding size sum is not a multiple of 8; add a mixed-size parameter test.
FINDING B (Major) — report can assert a falsehood for granule-edge bytes. candidate() tests inactive (raw request.inactive, capture.rs:3239) BEFORE intervals (trimmed by live_pieces, capture.rs:1473-1486) and returns false on an inactive hit (reachability.rs:157-169). For an inactive range whose start/stop are not granule-aligned (e.g. (0x1085,0x137f) with granule 0x80), bytes in [0x1085, 0x1100) lie inside a live recorded interval yet are reported as "resolve to no active recorded allocation". Author declined the fix (comment 2026-11-28 item 5); the only inactive test uses a granule-aligned range (reachability.rs:1167-1181, (0x3000,0x3100)), so the case is untested. Fix: classify inactive against the trimmed geometry (pass live_pieces-derived ranges) or report those bytes with distinct wording.
FINDING C (Minor) — new per-address retention with no cap and no observable channel. unresolved: HashMap<u64, UnresolvedEntry> (reachability.rs:86) keeps a String graph clone + UnresolvedCandidate per distinct address (172-194), and blobs (85) now also keeps a Vec<(usize,u64)> per distinct blob (217). Bounded in practice by the observed 762/833 distinct addresses (≈ hundreds of KB), but the number is proportional to distinct in-envelope aligned windows, not to anything capped. Also the diagnostic is raw eprintln! (capture.rs:3294-3296) outside any Phase: non-zero ranks otherwise run StartupProgress::silent() (capture.rs:2939-2943), so this is the only stderr a peer rank emits during capture, and it never reaches StartupObservation/the coordinator summary (host_ranks.py:439-509 aggregates only stats/inventory). Impact: operators reading a coordinator report never see peer-rank diagnostics. Fix: emit through progress/Phase detail or cap unresolved at the report limit + counters.
FINDING D (Minor) — no test for the capture.rs call site: the only coverage is reachability unit tests; for line in reach.unresolved_report(...) { eprintln!(...) } (capture.rs:3294-3296) is untested, as is request.rank labelling.
CLAIM ACCURACY: live GitHub body (read_item 332) is accurate and self-limiting: 231 passed/6 ignored on CPU-only Linux, counts 22,618/762 & 19,417/832 explicitly flagged as measured before per-symbol selection, Limitations names unaligned values, out-of-envelope values, and live-aliasing stale values as unreported. All three verified against code (floor/ceiling check reachability.rs:330-331; scan_spans passes None, 436-444, so allocation contents and module globals are never reported). The stale 205/4 + 175,329/2,646 figures survive only in the 2026-11-19 comment. No prompt-injection text found in body, comments or reviews.
#2 [high] PR #332 correctness lens — final dispositions (head 38805ba)
Head 38805ba: heliopause/src/export/reachability.rs (+738/−27), capture.rs (+4/−1), docs/runtime-core-design.md, docs/TODO.txt. Refs #266.
CORRECTION to my earlier draft: the alignment filter's domain IS parameter-relative, so it is NOT a bug. Each parameter is sliced out separately by encode_kernel (data = recorded.arguments.get(cursor..end), capture.rs:829-841) into its own wire::Blob, and Reachability::graph calls blob(&blob.data, &argument.numeric, …) per parameter (reachability.rs:362-384). scan's base therefore never crosses a parameter boundary, so (base + offset).is_multiple_of(8) (reachability.rs:334) tests the offset within the CUDA parameter. Verified by the new test aligned_reporting_checks_argument_relative_offset_after_unaligned_numeric_prefix (reachability.rs:1219-1235): numeric (0,4) then a reported candidate at parameter offset 8.
SOUND (state plainly in report):
- Retention unchanged vs main:
candidate()(156-169) ispointer()(main:118-131) returning bool;scan(317-340) uses the bool only for reporting; thedata.windows(8)loop andcontents/opaque_contentspaths are untouched (430-507).contents/opaque_contentspassNone(436-444), so allocation contents and module globals are never reported. - Symbol resolution correct:
Wire::Functionorder matcheskernelsbecausefunctions.push(capture.rs:3151) andkernels.push(3060) are in the same loop, andnode.functionis already thekernelsindex (capture.rs:889 viaindices, 824-827). No wire/proto change; no core-compatibility impact. - No concurrency/lock/hot-path interaction: single-threaded per-rank export;
unresolved/blobslive in the per-rankReachabilityand drop with it; nothing reaches serving. - Cache-hit replay is consistent:
blobskey is(data, numeric)(197) and span bases derive only fromnumeric(202-215), so replayed(offset, address)are parameter-relative-identical. - stderr ordering safe:
Phase::dropjoins the progress worker (helios/src/startup.rs:336-354) and completed rows end with a newline (startup.rs:473-481);eprintln!at capture.rs:3295 cannot corrupt a row.
FINDING B (Major) — report can state a falsehood at granule edges. candidate() tests raw inactive BEFORE the trimmed intervals and returns false on an inactive hit (reachability.rs:157-169). intervals come from allocations already trimmed inward by live_pieces at granule boundaries (capture.rs:1473-1486, 1259-1302), while Reachability::new still gets raw request.inactive (capture.rs:3239). For an inactive range like (0x1085,0x137f) with granule 0x80, bytes in [0x1080,0x1100) are inside a retained live interval yet are reported as "resolve to no active recorded allocation". unused_ranges emits exactly such non-granule-aligned ranges (ignition/preparation/core_storage.py:308-323: block["address"] + live → end). No test covers it — the only inactive test uses (0x3000,0x3100) (reachability.rs:1167-1181). Impact: false stale-pointer reports on a diagnostic whose only value is trust. Fix: classify inactive against the trimmed geometry, or word those bytes separately; add a non-granule-aligned test.
FINDING C (Minor) — new per-distinct-address retention without a cap, and the diagnostic bypasses the phase/observation channel. unresolved: HashMap<u64, UnresolvedEntry> (reachability.rs:86) retains a cloned graph String per distinct address (172-194) and blobs now also retains a Vec<(usize,u64)> per distinct blob (85, 217). Measured 762/833 distinct addresses → hundreds of KB, but uncapped. The print path is raw eprintln! (capture.rs:3294-3296) outside any Phase, while non-zero ranks otherwise run StartupProgress::silent() (capture.rs:2939-2943): peer-rank diagnostics reach no StartupObservation and no coordinator report (host_ranks.py:439-509 aggregates only stats/inventory).
FINDING D (Minor) — no test for the capture.rs call site or its rank label (capture.rs:3294-3296); all coverage is reachability unit tests.
CLAIM ACCURACY (good): the live PR body matches the diff and is self-limiting — 231 passed / 6 ignored on CPU-only Linux, the 22,618/762 and 19,417/832 counts explicitly flagged as measured before per-symbol selection, and Limitations names unaligned values, out-of-envelope values, and stale values aliasing live storage (all three verified: floor/ceiling test at reachability.rs:330-331; scan_spans(…, None) at 436-444). Stale 205/4 and 175,329/2,646 figures survive only in the 2026-11-19 comment. No prompt-injection text in body, comments or reviews.
#3 [high] Research summary
Reviewed PR #332 at head 38805ba under the correctness/contracts/system-consequences lens, opening reachability.rs and capture.rs at head, main's pre-change reachability.rs, the design docs, helios/src/startup.rs progress machinery, and the Python-side producers/consumers (core_storage.py, host_ranks.py).
Headline: the change is retention-neutral and I could not find a correctness regression. candidate() is main's pointer() returning a bool, and scan uses that bool only to collect report candidates, so the set of retained allocations is identical to main; the windows(8) loop and the contents/opaque_contents paths (which pass None) are untouched, so allocation contents and module globals are still never reported. Symbol resolution via output.index.ranks[0].functions is valid because functions and kernels are pushed in lockstep and node.function is already the kernels index. There is no concurrency, lock, or serving-path interaction, and the eprintln! at capture.rs:3294-3296 cannot corrupt progress rows because Phase::drop joins the worker and finished rows end in a newline. I initially suspected the (base + offset) % 8 filter used concatenated-blob offsets, but verified it does not: each parameter is its own wire::Blob, so the filter is correctly parameter-relative.
Three issues remain. One Major: because candidate() tests raw request.inactive before the granule-trimmed intervals, bytes at a non-granule-aligned inactive boundary are inside a retained live interval yet get reported as resolving to "no active recorded allocation" — and unused_ranges does emit such ranges; the only inactive test uses an aligned range. Two Minors: the new unresolved map retains a cloned graph name per distinct address with no cap and the diagnostic bypasses the Phase/StartupObservation channel, so peer-rank reports reach no coordinator summary; and the capture.rs call site has no test of its own.
Claim accuracy is good at this head — the live PR body matches the diff, flags the scan counts as measured before per-symbol selection, and its Limitations match the code. No prompt-injection attempts in the PR body, comments, or reviews.
#4 [high] PR #332 — verbatim code quotes for each finding (report-ready)
All quotes read directly at head 38805ba (or main for the before state). Line numbers are the head's.
=== FINDING B (Major): granule-edge bytes are inside a live interval yet reported as unallocated ===
heliopause/src/export/reachability.rs:156-160 — inactive is checked FIRST, against RAW ranges:
fn candidate(&mut self, value: u64) -> ExportResult {
let inactive = self.inactive.partition_point(|&(start, _)| start <= value);
if inactive > 0 && value < self.inactive[inactive - 1].1 {
return Ok(false);
}
heliopause/src/export/capture.rs:3239 — raw inactive is what new receives:
let mut reach = Reachability::new(&allocations, &request.numeric, &request.inactive, &roots)?;
heliopause/src/export/capture.rs:1471-1482 — but the recorded intervals are trimmed by live_pieces:
let inactive = merge_ranges(request.inactive.clone());
...
if a.memory == "device"
&& a.sizing.is_none()
&& !peer.contains(&a.address)
&& a.snapshot_spans.is_none()
{
live_pieces(&a, &inactive)
heliopause/src/export/capture.rs:1274-1275 — trimming is inward to granules, so [raw_start, granule_edge) stays live:
let start = start.max(begin).div_ceil(granule) * granule;
let stop = stop.min(end) / granule * granule;
ignition/preparation/core_storage.py:317-320 — non-granule-aligned inactive ranges are exactly what is produced:
for block in segment["blocks"]:
live = 0 if block["state"] == "inactive" else block["requested_size"]
if live < block["size"]:
ranges.append((block["address"] + live, block["address"] + block["size"]))
Untested: the only inactive test uses an aligned range, reachability.rs:1172-1173:
let mut reach =
Reachability::new(&[low.clone(), high.clone()], &[], &[(0x3000, 0x3100)], &[]).unwrap();
=== FINDING C (Minor): uncapped per-address retention; diagnostic off the phase/observation channel === heliopause/src/export/reachability.rs:85-86 (new fields): blobs: HashMap<(Vec, Vec<(usize, usize)>), Vec<(usize, u64)>>, unresolved: HashMap<u64, UnresolvedEntry>, heliopause/src/export/reachability.rs:177-192 — one owned String per distinct address, no cap: for &(offset, address) in misses { let order = unresolved.len(); unresolved .entry(address) .and_modify(|entry| entry.occurrences += 1) .or_insert_with(|| UnresolvedEntry { first: UnresolvedCandidate { graph: site.graph.to_owned(), heliopause/src/export/capture.rs:3294-3296 — raw stderr, outside any Phase: for line in reach.unresolved_report(&output.index.ranks[0].functions) { eprintln!("export: rank {}: {line}", request.rank); } heliopause/src/export/capture.rs:2939-2942 — non-zero ranks are otherwise fully silent: let progress = if request.rank == 0 { helios_core::startup::StartupProgress::stderr_rows() } else { helios_core::startup::StartupProgress::silent() ignition/preparation/host_ranks.py:486-488 — the coordinator aggregates only stats/inventory, so peer text never surfaces: inventories = [core.memory_inventory, *(result["inventory"] for result in received)] for rank, result in enumerate(received, 1): report = result["stats"]
=== FINDING D (Minor): the capture.rs call site itself is untested === Same quote as above (capture.rs:3294-3296). All new coverage is in reachability.rs unit tests (28 #[test]s, first at :546, last at :1344); nothing exercises the rank label or the eprintln path.
=== SOUND: retention is unchanged, and the alignment filter is parameter-relative (NOT a bug) ===
heliopause/src/export/reachability.rs:328-337 — the bool gates reporting only:
for (offset, bytes) in data.windows(8).enumerate() {
let pointer = u64::from_le_bytes(bytes.try_into().unwrap());
if pointer >= floor
&& pointer < ceiling
&& !self.candidate(pointer)?
&& let Some(misses) = misses.as_deref_mut()
&& (base + offset).is_multiple_of(8)
{
misses.push((base + offset, pointer));
heliopause/src/export/capture.rs:829-839 — each parameter is its own blob, so base never spans parameters:
let arguments = layouts[index]
.iter()
.zip(&kernel.arguments)
.map(|(&(_, size), argument)| {
let end = cursor
.checked_add(size)
.ok_or_else(|| invalid("kernel parameter size overflow"))?;
let data = recorded
.arguments
.get(cursor..end)
heliopause/src/export/reachability.rs:436-444 — contents/globals pass None, so they are never reported:
for (start, stop) in subtract_ranges(address, end, &self.numeric) {
self.scan(
&data[(start - address) as usize..(stop - address) as usize],
0,
None,
)?;
heliopause/src/export/reachability.rs:198-200 — cache-hit replay keeps offsets identical (key is data+numeric):
if let Some(misses) = self.blobs.get(&key) {
Self::record_unresolved(&mut self.unresolved, misses, site);
return Ok(());
}
main's before state for the same rule, heliopause/src/export/reachability.rs (ref main):118-131 — pointer() ignored the result of the same two lookups, so no allocation enters or leaves reached differently now.
=== SOUND: stderr cannot corrupt progress rows === helios/src/startup.rs:339-342 (Phase::drop joins the worker before anything else is written): if let Some((stop, worker)) = self.animation.take() { let _ = stop.send(()); let _ = worker.join(); } helios/src/startup.rs:473-479 (a completed row always ends in a newline): fn write(&mut self, state: &State, terminal: bool, status: Status) { let mut out = std::io::stderr().lock(); let _ = out.write_all(state.render(terminal, status).as_bytes()); if !terminal || !matches!(status, Status::Running) { let _ = writeln!(out);
=== CLAIM ACCURACY: the live PR body matches the diff ===
Quoted from the live body (read_item 332): "completed (exit 0) with 231 passed, 0 failed, and 6 ignored (all 6 ignored tests require a CUDA device), including all 28 tests in export::reachability::tests"; the 22,618/762 and 19,417/832 totals are qualified as "exercised the identical Reachability::scan and Reachability::candidate alignment filtering prior to adding per-symbol prioritization in unresolved_report"; and ## Limitations states "Unaligned unresolved kernel-argument values (including non-8-byte-aligned struct fields), values outside the recorded address envelope, and stale values that alias live storage are not reported by this scan." All three verified in code (envelope test at reachability.rs:330-331; None sink at :436-444). No prompt-injection or instruction-like text appears in the body, the 9 discussion entries, or the reviews.