Opened by a workflow run, Nov 30, 2026 1:44 PM EST. decide malicious: all_clear (100%): No malicious content found
explore
Author: lukealonso (COLLABORATOR; charter-named priority contributor; Discord: lukealonso) Motivation: Five separate defects are being fixed at once, four of them latent or newly self-inflicted and one reported by a user: large signed cores (>128 MiB) can no longer be combined or promoted because #618's externalized bodies are still decoded as inline bytes; newly mapped GPU memory is zeroed on legacy stream 0 and can overwrite weights being copied on other streams; cached export does redundant copies, hashing and file-descriptor work; multi-host autotune lets ranks pick divergent kernels (#631); and several native helpers have wrong ABI, device-selection or 32-bit bounds. Scale: +1,379 / −303 lines in 27 files Proposal:
- New
protection::sign_rewritten_envelopere-reads externalized rank/deployment bodies and signs withsign_envelope, fixingcombine/promoteof oversized cores (regression from #618). cuMemsetD8Asyncon the current PyTorch stream replaces legacy stream-0cuMemsetD8_v2;peer_storage._Access.flagsnarrowed toc_uint32; KV codec compiled for the rank's device.- Cached export skips the Pass-1 numeric D2H entirely, reuses one
IoUringper worker, drops payload SHA-256 passes, usesBTreeMap/HashMaplookups, and dedupes payload leases across ranks. - Multi-host
ForwardCacheexchanges cache-root-relative paths; sharded autotune shares and reconciles selections (#631); storage-region lowering clamps and clears only mutated dependencies. window_host_layoutrespectsvirtual_address_bits(device)for narrow WDDM VA spaces and publisheshost_extent, which Python now consumes. Touches:heliopause/src/export/*(capture, transfer, binding) — export correctness and data-integrity pathshelios/src/core/{conversion,protection}.rs— signed core container rewriteignition/preparation/*— tuning, AOT lowering, storage, CUDA KV codec Related items:- #618 core,hub,heliopause,ignition: decouple signed bodies… (merged): introduced external bodies and the combine/promote bug this repairs, one day earlier, same author.
- #593 Fix silent export corruption in AOT lowering… (merged): already rewrote the same
compilation.pyfunctions and claimed--no-mtpreuse works. - #631 Multi-host autotune: rank selection divergence recurs on every retry (open): the only linked issue; partly addressed, fail-fast not implemented.
- #430 Add Execution.persistent_workers green-context lifecycle (merged): had removed the
metrics_*fields this PR re-resolves. - #504/#525 KV codec (merged, yatesdr): authored the kernels this PR rewrites.
Link: https://github.com/NVIDIA/hyperflare-inference/pull/647
Autobot comments: Undeclared scope:
capture.rsnow skips all numeric ranges in cached exports, not just reused weight spans, and no test covers it.transfer.rsstops SHA-256-verifying cached payload transfers and repurposes the wiresha256field to carry aPayloadId(the claimed compensating re-hash does exist incache.rs::store_slice/adopt_companion). The description's claim of widening*low_base_ptrto 64-bit is only partly true:low_base_ptr,chunk_pkt_offsandlane_byte_offsremain 32-bit inkv_codec_gpu.cu. The in-tree launcherhelios/src/offload/transfer/gpu_codec.rsis unchanged and only compile-compatible with the rewritten kernels, which were never executed (GPUs full). All perf gains are explicitly unbenchmarked, against charter #210. No docs changed, despite a newhost_extentJSON contract and changed Rust signatures. CI is red on heade029dc8, there are no reviews or comments, and test evidence was gathered onmain8da73911, not the head.
Value Proposition
Value Proposition — PR #647
Charter alignment. Mixed but salvageable. It fixes reproducible bugs and a filed issue, which the charter names as mergeable ("a reproducible bug"). #631 (bug, priority:P2) is a real 2× DGX Spark ignition export --ranks 2 failure, and multi-host prep/export is a charter goal; the signing fix repairs combine/promote on >128 MiB cores, charter artifacts created by #618. It adds no model aliases, flags, or per-model branches — it even removes the --reuse-weights --no-mtp rejection. Against that: the performance half (skip full-weight PCIe D2H, one IoUring, no double SHA-256) is explicitly "not benchmarked end-to-end on GPUs," failing the #210 evidence bar; transfer.rs drops a verification pass and repurposes the sha256 wire field (tension with #397); and the WDDM/HOST_BASE work targets a platform the supported matrix does not name. No roadmap item (#6, #267, #215) is served.
Novelty & status. Genuinely additive — nothing supersedes it, nothing on main is already fixed. It is, though, largely self-repair: the signing defect exists only because #618 (merged the previous day, same author) shipped sign_envelope without updating inject_dependency_descriptors/conversion/edit.rs; compilation.py was rewritten by #593 a day earlier; PersistentWorker.metrics re-establishes a field #430 deliberately removed; kv_codec_gpu.cu restructures kernels from #504/#525, four days old. That is debt re-paid within 24 h, not new capability.
Value vs maintenance cost. Real beneficiaries: multi-host export operators (#631), anyone running combine/promote on spilled cores, and latent-defect fixes (CUmemAccessDesc ABI, ReadRing freeing live DMA, gf2_pow bounds). But five unrelated defect families across 27 files (+1379/−303) is far from the charter's "smallest footprint," and several behaviours change silently: the capture.rs skip widens from reused-weight spans to all numeric ranges (capture.rs:3420-3425, untested); a new host_extent JSON key crosses into Python (core_storage.py:103); and the claimed 64-bit widening is partial — chunk_pkt_offs, lane_byte_offs, low_base_out stay 32-bit (kv_codec_gpu.cu:1558-1586). Documentation is untouched despite #618 documenting the format. CI is red on head e029dc8, and all evidence was gathered on main 8da73911.
Verdict: Worth it with changes. lukealonso is a charter priority contributor and must not be closed as low value. Before merge: (1) re-run evidence on the PR head and get CI green; (2) document and test the widened capture.rs skip, the host_extent key, and sha256-as-PayloadId; (3) complete the kernel 64-bit widening or correct the claim; (4) confirm kv_codec.py::_CACHE invalidates stale cubins against the changed kernel ABI; (5) split the unbenchmarked export-pipeline performance work out with #210 measurements. The signing, ABI, ReadRing, and #631 fixes should land promptly.
Full report Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.
Classify intake
Selected: triage:review, priority:P2, bug, performance, area:preparation
Threshold: 65%
Triage
- [✓]
triage:review: 99.8% -
triage:design-review: 0.1% -
triage:partial: 0.0% -
triage:validation: 0.0% -
triage:investigate: 0.0% -
none: 0.0% -
triage:integration: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0%
Priority
- [✓]
priority:P2: 90.4% -
priority:P1: 6.5% -
none: 3.1%
Type
- [✓]
bug: 94.0% - [✓]
performance: 93.2% -
community: 26.9% -
duplicate: 14.8% -
enhancement: 6.8% -
documentation: 0.1%
Area
- [✓]
area:preparation: 95.3% -
area:kernels: 46.9% -
area:memory: 24.5% -
area:caching: 22.3% -
area:packaging: 8.5% -
area:rocenante: 8.5% -
area:selene: 8.5% -
area:api: 4.2% -
area:scheduling: 2.9% -
area:engram: 1.8% -
area:orbit: 1.4%
Model
-
model:kimi-k3.1: 0.3% -
model:qwen3.8-flash-next: 0.3% -
model:inkling-small: 0.2% -
model:deepseek-v4.1: 0.1% -
model:qwen3.8-27b: 0.1% -
model:deepseek-v4: 0.1% -
model:nemotron-3.5-bolt: 0.1% -
model:glm-5.3: 0.1% -
model:gemma4: 0.0% -
model:muse-glimmer: 0.0% -
model:mimo-v2.6: 0.0%
Apply Labels (Intake)
Applied: +triage:review, +priority:P2, +bug, +performance, +area:preparation
Correctness and contracts
Correctness / Contracts / System-Level review — PR #647 (e029dc8)
I read every changed hunk in eos/src/ioring.rs, heliopause/src/{allocator,processes,python}.rs, all nine heliopause/src/export/* files, helios/src/core/{conversion,conversion/edit,protection,reader}.rs, the eight ignition/preparation files, the touched tests, plus direct callers/contracts (helios/manifest.md, helios/proto/runtime_core.proto (not opened), helios/src/core/{cache,reader,export,synthesis}.rs, helios/src/offload via search, ignition/preparation/model_core.py (not opened), host_ranks.py (not opened), tests/preparation/test_export_transfer.py (not opened)). Eight findings, three of them material; the core-signing repair itself is sound.
1. compilation.py "clamp to storage.nbytes()" is a no-op — Major
ignition/preparation/compilation.py:184-199 (diff hunk @@ -179,18 +180,37 @@)
end = begin + span * value.element_size()
ranges.setdefault(key, []).append((begin, end, node))
storage_nbytes = int(value.untyped_storage().nbytes())
limits[key] = max(limits.get(key, 0), storage_nbytes, end)
...
a_end = min(storage_nbytes, (end + alignment - 1) // alignment * alignment)
The clamp bound is max(observed storage nbytes, end), so whenever a view's computed end already exceeds the storage (exactly the over-estimate case the PR is fixing, since span = 1 + sum((size-1)*stride) deliberately includes holes), the bound is raised to end and min() is a no-op. The description claims "_storage_regions … could extend past storage.nbytes(), while … _lower_storage slices clamped multi-dtype uint8 bases"; the multi-dtype slice in _lower_storage is likewise applied only if len(dtypes[key_for(node)]) > 1 and region_bytes % value.element_size() != 0, so a single-dtype region still passes an over-long base to aten.view.dtype. Impact: the out-of-bounds view.dtype/slice lowering that motivated the change can still be emitted. Fix: keep the true untyped_storage().nbytes() per key and clamp with min(true_storage_nbytes, …); if a real traced view legitimately exceeds it, fail loudly rather than widening the clamp.
2. kv_codec_gpu.cu 64-bit widening is partial and truncates silently — Major
ignition/preparation/kv_codec_gpu.cu hunk @@ -1565,41 +1565,41 @@ (~1576/1582/1587) and @@ -1632,15 @@ (~1635)
chunk_pkt_offs[i] = (U)pos;
...
lane_byte_offs[i] = (U)low_bytes;
...
*low_base_out = (total_pkt < (uint64_t)orig_bytes) ? (U)low_base : 0u;
...
B *dst = d_pkt + (size_t)(*low_base_ptr) + (size_t)lane_byte_offs[lane_id];
pos, low_bytes and low_base are now uint64_t, but they are immediately narrowed back to U (32-bit) in the two arrays and in low_base_out, and the compact kernel still takes const U *low_base_ptr. Per-chunk and lane offsets inside a packet plan therefore wrap at 4 GiB; because total_pkt < orig_bytes may still hold, the guard does not catch it, so lanes are written to wrapped destinations — silent corruption rather than a clean failure. The PR text claims it "widens plan accumulators and *low_base_ptr offsets to uint64_t". Impact: the concrete defect the change claims to fix is only partly fixed, and the remaining truncation is unobservable (no kernel execution ran; evidence is nvcc compile + ELF-symbol check only). Fix: widen chunk_pkt_offs/lane_byte_offs/low_base_out/low_base_ptr end-to-end (and the matching u64 slots in helios/src/offload/transfer/gpu_codec.rs (not opened)), or reject plans whose offsets exceed u32::MAX explicitly.
3. Cached-export Pass-1 skip widens from "reused weight spans" to "all numeric ranges" — Major (undeclared, untested)
heliopause/src/export/capture.rs:3419-3426
let cache_scan = request.weight_payload.is_some() && request.options.cache.is_some();
let skip_numeric = if cache_scan {
merge_ranges(request.numeric.clone())
} else {
super::weight_reuse::numeric_ranges(request, &allocations)?
};
numeric_ranges returns Ok(Vec::new()) unless request.options.reuse_weights.is_some() (weight_reuse.rs:218-220), so the previous skip set was empty for cached exports without --reuse-weights. Now every cached export skips all of request.numeric — both the D2H copy and, via the skip_numeric argument threaded into the pointer scan, pointer scanning of any numeric-classified buffers (which include 64-bit integer buffers). data_spans for cached exports no longer records those bytes. The description only says "skips request.numeric D2H in Pass 1 when cache_scan is true while still pointer-scanning non-numeric bytes"; the widening, the data_spans change, and the loss of numeric-range pointer scanning are not stated, and pr_files shows no test file covering capture.rs (tests changed: forward_artifact_sharing, peer_storage_groups, persistent, storage_lifetimes, tuning_shards). Fix: keep numeric_ranges(request, …)'s reuse-only semantics for the skip set, or state the new invariant in the description and add a capture-level test asserting data_spans for a plain cached export.
4. Payload transfer loses both sender- and receiver-side integrity checks — Major
heliopause/src/export/transfer.rs:600-620 and :1008-1040
let file = super::io::open_read(path)?;
let before = super::io::Identity::of(&file)?;
files.insert(path.clone(), Source {
size: before.size,
sha256: hex.clone(),
let mut digest = info.payload.is_none().then(Sha256::new);
...
if let Some(digest) = digest
&& format!("{:x}", digest.finalize()) != info.sha256
{
return Err(invalid("rank payload digest mismatch"));
}
Two removals, not one: (a) the pre-transfer scan is gone together with the post-scan Identity::of(&file) != before re-check that guarded against the object being replaced/mutated between the identity snapshot and the send (the remaining before is used only for size); (b) for every payload entry the receiver now computes no digest at all and no longer checks the declared sha256, so the wire field's meaning changes from "bytes you are receiving" to "the id you should look up later". The compensating check at install (install_payload_object → cache adopt_companion/store_slice) exists, so no silent corruption lands in the cache, but a corrupted/truncated in-flight payload now costs a full transfer before failing, and any other consumer of info.sha256 is reading a different contract. Fix: keep a cheap post-open Identity::of re-check on the sender (or drop before entirely so the unused snapshot is not mistaken for a guard), and in receive_rank verify the received object against info.payload at install time explicitly rather than relying on a distant call site.
5. DirectRing forces synchronous single-job I/O on the contended path — Minor
heliopause/src/export/io.rs:828-830, with :236-245
if jobs.len() == 1 {
return transfer_single_direct(file, jobs[0], write);
}
let count = ((source.length - offset).div_ceil(BLOCK as u64) as usize)
.min(self.depth)
.min(32);
while buffers.len() < count {
match self.try_buffer()? {
Some(buffer) => buffers.push(buffer),
None => break,
IoBudget buffers are shared (self.pool under a mutex, latency .. try_buffer returns None when allocated == depth), so when the budget is contended — multi-rank export — buffers collapses to one and every batch takes the new blocking libc::pread/pwrite path instead of the ring. The scan reader thread then cannot overlap I/O with the consumer, which is the opposite of the intent on exactly the busy path; the uncontended fast path is unaffected. Fix: reserve the synchronous path for a genuine one-shot (e.g. IoBudget::depth == 1 or an explicit single flag) rather than for jobs.len() == 1.
6. retain_sources return value silently changes scope — Minor
heliopause/src/export/binding.rs:819-855
let already_held: std::collections::BTreeSet<helios_core::core::PayloadId> = self
.leases
.lock()…
…
let count = retained.len();
…
self.retain_payload_leases(crate::export::PayloadLeases(retained))
…
Ok(count)
retained now excludes ids already leased, so the returned number is "newly leased this call", not "payloads leased for this rank". Callers ignition/preparation/model_core.py:67 (not opened) and host_ranks.py:496 (not opened) receive a value that drops to 0 for every rank after the first that shares payloads (which is the normal multi-rank case the dedupe targets); tests/preparation/test_export_transfer.py:244 (not opened) only pins the empty case. Any caller using the count as an "did this rank have weight payloads" signal inverts. Fix: return the post-insert self.leases.lock().len() (or document the new semantics and update callers).
7. ReadRing::flush now clamps kernel over-reporting instead of rejecting it — Minor
eos/src/ioring.rs:152-160
// Account for every entry the kernel accepted before propagating a
// submission error so Drop drains in-flight DMA before freeing buffers.
let submitted = (submitted as usize).min(self.queued);
self.queued -= submitted;
self.in_flight += submitted;
check(status)?;
The lifetime ordering fix itself is correct: accounting happens before check(status)?, so Drop/cancel_and_drain drains anything the kernel accepted. But the .min(self.queued) clamp converts a driver/duration mismatch (kernel claims more entries submitted than were queued) into a silent short-accounting: queued becomes 0, in_flight is short by the excess, and the subsequent if self.queued != 0 "incomplete submission" error cannot fire. Previously the same condition surfaced as an underflow/panic. Windows-only path, unexercised on Linux. Fix: return io::ErrorKind::InvalidData when submitted as usize > self.queued after adding the accepted entries to in_flight.
8. map_groups accepts any dropped view, not just omitted draft weights — Minor
heliopause/src/export/weight_reuse.rs:576-595
for old in &prior.views {
if current_names.contains(old.name.as_str()) || old.nbytes == 0 {
continue;
}
…
.push((old.offset, end));
The exclusion set is keyed on name absence, not on draft/speculative role, so a view that disappears for any other reason (recipe rename, engram plan change, a genuinely partial capture) is now subtracted from the cached initializers instead of tripping "is not covered by one declared weight group; export with weights". That check was the last guard that a --reuse-weights reuse is byte-complete for every retained view. The new test (map_groups_skips_omitted_draft_weights_and_clips_coalesced_initializers) only exercises the draft case. Fix: scope the omission to views whose prior group/dtype marks them as draft/speculative (or compare against the declared --no-mtp drop set) and keep the coverage error for everything else.
Verified sound (no finding)
- Core signing repair.
protection::sign_rewritten_envelope[_with_limit](protection.rs:1506-1554) refreshesbody_digestfrom the encoded bodies, re-reads every rank body viaread_rank_body(rank, body_store)(so spilled bodies resolve), and signs withsign_envelope;conversion.rs:2190-2317indexes ranks per deployment once, skipsflare.body.*andflare.manifestwhen copying the container, re-emitssigned.external_bodiesviareader::external_body_tensor, anddrop(metadata)beforefs::rename(correct on Windows).edit.rs:182-190routes through the same helper. External bodies keepMemoryBodyStore/Containersha256+length checks (protection.rs:451-499,reader.rs:38-54), so the rewrite cannot launder a body. ReadRingin-flight bookkeeping on the happy/partial-submit paths,NativeExportStagelock order (directory→leases in bothretain_payload_leasesandclose),RankSupervisorjoin handle isolation,Claimed::claim's complement arithmetic (I walked the merged/remove/insert sequence by hand),convert_prepared'sHashMapfirst-wins equivalence with the previous.find(), andwindow_host_layout's narrow-WDDM placement/overflow rejection (including the0x80_0000_0000full-address-space rejection test).PersistentWorker.metricsis documented (helios/manifest.md:106-112,runtime_core.proto:839-841(not opened)) and consumed (runtime_core/serving.rs:130(not opened),runtime_core/mod.rs:1272(not opened)), sobinding.rs's new resolution makes the exporter consistent with the ABI rather than inventing a field; the new both-or-neither hard error is the correct shape but is a new export failure mode for inputs that set only one of the pair.
Evidence/claim accuracy notes
- All reported test totals were gathered on
origin/main8da73911, not on heade029dc8; the description itself flags this, so the head commit has no independent attestation, and CI is failing on head. - No end-to-end benchmark backs the performance half (
capture.rsskip,DirectRingreuse, hashing removal,Claimedcomplexity), which the charter (#210) requires for a performance claim; live GPU/WDDM/multi-host paths were not run at all. --reuse-weights --no-mtpacceptance and thehost_extentsnapshot key (allocator.rs↔core_storage.py:103) are new cross-language behaviour changes with no documentation update indocs/.
Subtraction and simplicity
PR #647's diff is largely lean — python.rs (−22 lines) drops an outer Mutex, core.rs replaces two linear scans per tensor with a HashMap, processes.rs gives the join handle its own Mutex — but five changes are worth simplifying, three by deleting code.
-
High:
weight_payload.rs:574-583 fn merge_runsis now the same algorithm as the existingreachability.rs:12-24 fn merge_ranges, which the same crate already calls at weight_reuse.rs:249/:567/:594. Replace weight_payload.rs:561-562 (runs.sort_unstable(); return Ok(merge_runs(runs));) withsuper::reachability::merge_ranges(runs), delete the helper and its test at :1230-1236. -
High:
Claimed::claim(weight_payload.rs:647-685) hand-rolls interval subtraction thatreachability.rs:26-43 fn subtract_rangesalready does; keep only the merged_start/merged_end/to_remove bookkeeping. Removes ~18 lines from the function the PR rewrote for simplicity. -
Medium-high:
io.rs:914-921 transfer_batchrepeats thejobs.len() == 1 => transfer_single_directdispatch already at io.rs:828-830 inDirectRing::transfer; its only Linux callers (io.rs:648-657, :679) pass one-element slices, so theIoUring::newat :919 is unreachable — the very per-call allocation this PR aimed to remove. Delete it, calltransfer_single_directdirectly. -
Medium:
allocator.rs:269-272 window_host_baseis now test-only (production useswindow_host_layoutat :424-425); andallocator.rs:353-360check_fits(...)?cannot succeed — the same check already failed at :312-314, and success would fall through to theErrat :361-363. Delete both. -
Medium:
binding.rs:355-386and:415-455resolvestop_flagandmetricswith the same five steps; oneresolve_reference(obj, field, nbytes, align)helper removes ~40 of the 68 added lines and collapses the four-arm match at :401-415.
Minor: transfer.rs:25 BLOCK_BYTES (4 MiB) vs new io::BLOCK (8 MiB) at :650 with frames still 4 MiB — state the relation once; capture.rs:3421-3425 ternary leaves numeric_ranges unused on the cached path; tuning.py finally adds a third nested import torch.distributed and re-derives a rank already known at :448.
No AGENTS.md structural violation: no new flags, config keys, env toggles, fallbacks or model branches.
Not verified: exhaustive transfer_batch caller enumeration (one grep settles it); the two *_with_limit test seams' exact line numbers.
Final review
Recommendation: Changes Requested
Most of the core fixes in this PR are technically solid—the externalized core-signing rewrite (protection.rs/conversion.rs/conversion/edit.rs), stream-ordered granule zeroing (core_storage.py), CUmemAccessDesc ABI fix (peer_storage.py), multi-host ForwardCache relative paths (aot.py), sharded autotune reconciliation (#631, tuning.py), AOT storage region clamping and multi-storage mutation tracking (compilation.py), RankSupervisor lock decoupling (processes.rs/python.rs), and eos::ReadRing::flush lifetime accounting all hold up under direct inspection. However, verification uncovered two concrete blockers—a silent weight-corruption bug in weight_reuse.rs::map_groups whenever an omitted view shares bytes with a retained view (such as tied embed_tokens/lm_head weights under --reuse-weights --no-mtp), and an unmocked torch.cuda.current_stream call in DeviceRegion.grow that breaks the 12 CPU-mocked tests in tests/preparation/test_persistent.py on GPU-less runners (alongside red CI on head e029dc8 and test evidence reported only on origin/main 8da73911).
Merge Risk
Level: Medium
- Silent weight corruption on
--reuse-weights --no-mtpwith shared/tied weights:heliopause/src/export/weight_reuse.rs:576-620subtracts all byte ranges ofprior.views \ current.viewsfrom prior initializers without protecting overlappingcurrent.viewsranges, which can silently drop initializers for retained target weights and leave them zero-initialized at runtime. - Broad multi-subsystem blast radius (27 files across
helios,heliopause,eos, andignition): Touches core signing, cached export capture/I/O/transfer, weight reuse, multi-host tuning/AOT sharing, CUDA VMM zeroing, and GPU KV codec kernels in one PR with red CI on heade029dc8and no live GPU/WDDM/multi-host execution evidence. - Unbenchmarked hot-path export I/O changes: Pass-1 numeric skip (
capture.rs),DirectRingreuse (io.rs), 8 MiB read batching and payload SHA-256 elision (transfer.rs) modify the export pipeline without end-to-end GPU measurements on the PR head.
Walkthrough
- Externalized signed-envelope rewriting (
helios/src/core/{protection.rs,conversion.rs,conversion/edit.rs}): Extractssign_rewritten_envelope[_with_limit]to refresh deploymentbody_digests, read rank bodies throughbody_store, and sign viasign_envelope; updatesinject_dependency_descriptorsandconversion/edit.rsto rewriteflare.body.*external bodies and dropmetadatabeforefs::rename. - Stream-ordered VMM zeroing, ctypes ABI, and GPU KV codec (
ignition/preparation/{core_storage.py,peer_storage.py,kv_codec.py,runtime_core.py,kv_codec_gpu.cu}): SwitchesDeviceRegion.growtocuMemsetD8Asyncontorch.cuda.current_stream(device).cuda_stream, adoptshost_extentfromflare_core_snapshot, fixes_Access.flagstoc_uint32(12-byteCUmemAccessDesc), compiles KV codec cubins forstorage.device, widensgf2_powto[64][32]and 64-bit packet-plan accumulators, and removes the__shared__[64]batch cap. - Heliopause export pipeline, allocator, supervisor, and
eos::ReadRing(heliopause/src/{allocator.rs,processes.rs,python.rs},heliopause/src/export/{binding,capture,core,io,transfer,weight_payload,weight_reuse}.rs,eos/src/ioring.rs): Skipsrequest.numericD2H in Pass 1 whencache_scanis active; reuses oneDirectRingper scan/write worker and uses directpread/pwritefor single jobs; removes redundant payload container hashing and batches transfer reads to 8 MiB; switchesClaimedtoBTreeMapandconvert_preparedtoHashMap; deduplicatesNativeExportStagepayload leases; isolatesRankSupervisor's join handle and detaches the GIL; resolves/validatesPersistentWorker.metrics; relaxesmap_groupsfor omitted views; computes WDDM-awarewindow_host_layout; and updatesReadRing::flushto accountsubmittedbefore returning errors. - Multi-host preparation and AOT lowering (
ignition/preparation/{aot.py,tuning.py,compilation.py},tests/preparation/*.py): Exchanges cache-root-relative POSIX paths inForwardCache._prepare_rankswith path-traversal guards in_resolve_shared_path; runsshare_selectionsandreconcile_selections(with temporary(0, (0,))shard override) for sharded multi-host tuning (#631); groups raw overlaps before per-group clamped alignment in_storage_regions, slices multi-dtype bases beforeaten.view.dtype, and clears onlypending & mutations[node]in_reads_across_mutations.
Pre-merge Checks
- [PASS] Security / malicious screen: No backdoors, credential leaks, or unsafe path traversals;
_resolve_shared_path(aot.py:772-778) rejects absolute paths and.., external bodies retain SHA-256 verification, andtransfer.rsretains per-frame HMAC-SHA256 plusinstall_payload_objectPayloadIddigest verification. - [WARN] Charter & value fit: Correctness fixes (externalized signing, #631 multi-host tuning, stream-0 race,
CUmemAccessDescABI,ReadRingDMA lifetime) align well with charter goals; however, the bundled export-pipeline performance changes lack end-to-end GPU benchmarks required by charter #210 /docs/design-review.mdPrinciple 12. - [PASS] Related / duplicate / conflict check: Cleanly builds on #618 and #593 without reverting or conflicting with
main; addresses #631's core multi-host sharded autotune divergence. - [WARN] Tests & verification evidence: CI is failing on head
e029dc8, all reported test totals were collected onorigin/main(8da73911) rather than the PR head,test_persistent.pybreaks on GPU-less runners due to unmockedtorch.cuda.current_stream, andcapture.rs's widenedcache_scanbranch has no unit test.
Blockers
- Silent weight omission when an omitted view shares bytes with a retained view (
heliopause/src/export/weight_reuse.rs:576-620).map_groupsbuildsomitted_by_allocationfrom everyoldinprior.viewswhose name is absent fromcurrent.views, then subtracts those ranges directly from every prior weight initializer (subtract_ranges(old_start, old_end, excluded)at line 617) without excluding ranges covered by retained views (prior.views ∩ current.views).- Whenever an omitted view aliases or overlaps a retained view's bytes—for example, tied
embed_tokensorlm_headweights shared between target and MTP draft layers under--reuse-weights --no-mtp, or interleaved strided views sharing an allocation—the retained target bytes are silently subtracted out. Ifretained_piecesbecomes empty (line 618), the initializer is skipped altogether; neithermap_groupsnorresolve_weight_payloadchecks that every non-empty span incatalog.groupsis covered byresult, so those retained target weights are silently left zeroed in the exported core. - Fix: Collect
retained_by_allocation(merged intervals ofold in &prior.viewswherecurrent_names.contains(old.name.as_str()) && old.nbytes > 0) and subtractretained_by_allocationfromomitted_by_allocationbefore clippingprevious.initializers. Add a regression test inweight_reuse.rswhere an omitted draft view aliases a retained target view's offset/range, asserting the retained target initializer is preserved intact.
- Unmocked
torch.cuda.current_streaminDeviceRegion.growbreaks CPU-only test suite (ignition/preparation/core_storage.py:619-621,tests/preparation/test_persistent.py:40-72).DeviceRegion.grownow unconditionally executesstream = torch.cuda.current_stream(device).cuda_stream. Thepacked_storagefixture intests/preparation/test_persistent.py:48-72(used by 12 unit tests designed to run on CPU with a fakeMemorydriver stub) does not monkeypatchtorch.cuda.current_stream, so on any GPU-less CI runnertorch.cuda.current_stream(0)fails immediately beforecuMemsetD8Asyncis reached. Additionally,Memory.call(test_persistent.py:40-42) only assertslen(args) == 4without verifying that the stream pointer was actually passed through.- Fix: In
packed_storage(tests/preparation/test_persistent.py:48-72), monkeypatchtorch.cuda.current_streamto return a sentinelSimpleNamespace(cuda_stream=0x1234)(asserting the passeddevice == storage.device), and assertargs[3].value == 0x1234inMemory.call. Re-run the test suite and confirm CI passes on the updated PR head.
Should Fix
- Re-run verification on PR head and satisfy charter #210 evidence for the performance changes (
heliopause/src/export/{capture.rs,io.rs,transfer.rs}).- The PR description reports test runs gathered on
origin/main(8da73911) rather than the PR head (e029dc8), and explicitly notes that the export-pipeline performance changes (capture.rsPass-1 numeric skip,io.rsDirectRingreuse,transfer.rs8 MiB batching and payload hashing skip) were not benchmarked end-to-end on GPUs. In addition,capture.rs:3420-3425has no unit test covering thecache_scanbranch (request.weight_payload.is_some() && request.options.cache.is_some()without--reuse-weights). - Fix: Either (a) add a unit/integration test for the
cache_scanPass-1 skip path and provide before/after export timing measurements on the PR head, or (b) split the unbenchmarked export-pipeline performance work into a follow-up PR with measurements so the urgent correctness fixes (sign_rewritten_envelope, stream-0 zeroing, #631 multi-host tuning/AOT,CUmemAccessDescABI,ReadRing::flush,compilation.py) can land promptly.
- The PR description reports test runs gathered on
Subtract / Simplify
- Delete duplicate
merge_runsinheliopause/src/export/weight_payload.rs:560-583, 1230-1235: With partial-overlap merging (start <= last.1),merge_runsis identical toheliopause/src/export/reachability.rs:12-24(merge_ranges, which also sorts and drops empty spans). Replace lines 561–562 (runs.sort_unstable(); return Ok(merge_runs(runs));) withreturn Ok(super::reachability::merge_ranges(runs));and deletemerge_runsand its redundant test. - Delete dead Linux
transfer_batchinheliopause/src/export/io.rs:914-921: Every remaining Linux caller oftransfer_batch(read_bouncedatio.rs:648andread_atatio.rs:679) passes a 1-element slice, makingIoUring::new+transfer_batch_on_ringatio.rs:919-920unreachable on Linux. Call a single-job helper (transfer_single_directon Linux,transfer_batchon Windows) from those two sites and remove Linuxtransfer_batch. - Deduplicate
stop_flagandmetricsresolution inheliopause/src/export/binding.rs:355-455: Both blocks repeat the same object extraction, non-emptyallocationvalidation, default-0offsetparsing,resolve_mapped_host, alignment check, and JSON re-insertion. Extracting one helper (resolve_host_ref) eliminates ~35 lines. - Delete test-only
window_host_basewrapper inheliopause/src/allocator.rs:269-272: It has zero production callers (only tests atallocator.rs:1414-1433); point those assertions directly atwindow_host_layout(..., 1, None).
Nits
heliopause/src/export/binding.rs:819-855:NativeExportStage::retain_sourcesnow returns the count of newly acquired leases rather than total leases forpaths. Neither production caller uses the return value (ignition/preparation/model_core.py:67,ignition/preparation/host_ranks.py:496), so clarify the docstring (or returnself.leases.lock().len()).eos/src/ioring.rs:154-159: Clamping(submitted as usize).min(self.queued)prevents underflow on driver errors, but on a hypotheticalstatus == 0withsubmitted > self.queuedit would suppress the error; explicitly returningio::ErrorKind::InvalidDatawhensubmitted as usize > self.queued(after updatingin_flight) is cleaner.ignition/preparation/tuning.py:448, 517: Capturerank = dist.get_rank()once at line 448 and reuse it in thefinallyblock instead of re-importingtorch.distributed as distand callingdist.get_rank()again.heliopause/src/export/transfer.rs:25, 650, 665: ExpressBLOCK_BYTESin terms ofsuper::io::BLOCK(e.g.,super::io::BLOCK / 2) or add a one-line comment noting the 8 MiB read batch vs. 4 MiB wire frame split.- PR description wording:
kv_codec_gpu.cu:1635widens the*low_base_ptr + lane_byte_offs[lane_id]offset expression tosize_trather than changing*low_base_ptr's parameter type (which staysconst U *becauseorig_bytesisuint32_t).
Dropped on verification
- Correctness Lens #1 (
compilation.py:185-204"a_endclamp is a no-op"): False. For real PyTorch views,end <= storage.nbytes()already (max(..., end)only protects against 0-byte fake/meta storages); the bug was rounding(end + alignment - 1) // alignment * alignmentpaststorage.nbytes()(e.g., 5 bytes rounded to 8), whichmin(storage_nbytes, ...)genuinely clamps back to 5. Single-dtype regions already have aligned extents and are cast directly at line 535, so the multi-dtype slice guard at line 691 is exact. - Correctness Lens #2 & Dossier #4 (
kv_codec_gpu.cu"partial 64-bit widening truncateschunk_pkt_offs/lane_byte_offs/low_base_out" and "kernel ABI changed / stale cubin risk"): False.orig_bytesisuint32_t(matching the 32-bit GKV1 packet header), so whenevertotal_pkt < orig_bytes, every intermediate offset (pos,low_base,low_bytes) is strictly< orig_bytes <= u32::MAXand cannot wrap; whentotal_pkt >= orig_bytes(the actual 32-bit overflow case on incompressible packets),*low_base_outis set to0uand compact kernels skip or fall back to literal. No__global__parameter types changed,helios/src/offload/transfer/gpu_codec.rsis ABI-compatible, andkv_codec.py:79-81hashessource_bytesinto the cubin filename so stale on-disk cubins auto-invalidate. - Correctness Lens #3 & Dossier #2 (
capture.rs:3420-3425"dropsdata_spansbytes and loses pointer scanning of numeric ranges"): False.write_allocation(capture.rs:1930, 1965) initializesstoredwithreused(retained ∩ skip_numeric) and merges it intodata_spans;Reachability::contents(reachability.rs:241, 289-300) already skipsself.numericviasubtract_ranges, so numeric ranges were never pointer-scanned; and whencache_scanis true, Pass 1 setspersist = falsewhile Pass 2 (WeightDownload+for_each_group_block) downloads directly from GPU memory viasnapshot_spansand applies 64 KiB zero-block elision. - Correctness Lens #4 (
transfer.rs:600-620, 1008-1040"lost senderIdentityre-check and receiver integrity"): False on the sender check and overstated on the receiver.beforeis still stored inidentities(transfer.rs:614) and re-checked both before and after every read batch (transfer.rs:654-661). On the receiver, every fabric frame is authenticated by per-frame HMAC-SHA256,install_payload_object(transfer.rs:747-769) verifies the companion payload slice againstPayloadIdviaadopt_companion/store_slice, andSourceis a private wire struct internal totransfer.rswhosesha256field is only used on non-payload paths (925-948, 1011-1069). - Correctness Lens #5 (
io.rs:828-830"DirectRingforces synchronous single-job I/O on contended path, preventing overlap"): False. Bothtransfer_single_directandtransfer_batch_on_ring(io.rs:952-978) wait for all jobs in the batch before returning; reader/consumer overlap comes from the worker thread andmpsc::sync_channel(self.depth). Forjobs.len() == 1,pread/pwriteavoidsio_uring_enteroverhead without reducing concurrency. - Correctness Lens #8 (
weight_reuse.rs:576-595"accepts renamed/changed views"): Overstated as framed—map_groups(517-552) rejects any renamed or modified view incurrent.views, anddeployment()(367) validatescompatible_for_weight_reuseupfront. Superseded by verified Blocker #1 on the same lines (omitted views aliasing retained views). - Subtraction Lens #2 (
weight_payload.rs:647-685"rewriteClaimed::claimviasubtract_ranges(..., &self.ranges(allocation))"): Dropped because callingself.ranges(allocation)allocates and copies the entireBTreeMapinto aVecon everyclaim(), re-introducing the exact O(V²) regression this PR fixed. - Subtraction Lens #4b (
allocator.rs:353-360"unreachablecheck_fitstail"): Dropped because re-runningaddress_space::check_fitsinsideif let Some(bits)deliberately surfaces the specific GPU VA-width error message instead of the generic fallback error at line 361. - Dossier claim ("
PersistentWorker.metricsrevives a field removed by #430"): Dropped—PersistentWorker.metricsandmetrics_countare active fields inruntime_core.proto(not opened),helios/manifest.md(not opened), andheliosserving code, so resolving/validating them inbinding.rsaligns the exporter with the runtime ABI.
Classify triage
Selected: triage:review
Threshold: 65%
Triage
- [✓]
triage:review: 99.0% -
triage:validation: 0.7% -
triage:design-review: 0.2% -
triage:partial: 0.1% -
triage:integration: 0.0% -
triage:investigate: 0.0% -
none: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0%
Apply labels
No label changes Decision to Test: no (99%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.