Case file — PR #647 "Fix externalized core signing, stream-0 weight race, export I/O, and multi-host tuning"
Key findings
- It is a regression repair for #618, merged one day earlier by the same author. #618 (merged 2026-11-29, lukealonso, +4784/−399) introduced
ExternalBody/flare.body.<sha256>tensors,EnvelopeBuilder::sign_envelopeand the 128 MiBMAX_ENVELOPEbut leftcore/conversion.rs::inject_dependency_descriptorsandconversion/edit.rsdecoding inline bodies and callingbuilder.sign(key). #647 extractsprotection::sign_rewritten_envelopeand fixes both call sites. Socombine/promoteof >128 MiB cores has been broken only since #618 (≈24 h). - Undeclared scope in
capture.rs: the numeric skip set widens from "reused weight spans only" to "all numeric ranges".capture.rs:3420-3425—skip_numeric = if cache_scan { merge_ranges(request.numeric.clone()) } else { numeric_ranges(...) };numeric_ranges()returns empty unless--reuse-weights(weight_reuse.rs). The description says it "skipsrequest.numericD2H in Pass 1 whencache_scanis true"; it does not say the skip applies to plain cached exports without--reuse-weights, nor thatdata_spansstops recording weight bytes for cached exports. No test in the PR coverscapture.rs(diff is +8/−4, no test). transfer.rsstops SHA-256-verifying cached payload transfers, and the wiresha256field now carries aPayloadId.transfer.rs:609(sha256: hex.clone()),transfer.rs:1011(info.payload.is_none().then(Sha256::new)),transfer.rs:1036-1040. I verified the claimed compensating control exists:install_payload_object(transfer.rs:747-769) →Root::adopt_companion/store_slice(helios/src/core/cache.rs:1926-1935 verifies the declared identity viaslice.digest(); cache.rs:1969-1986 links only byte-identical wrappers and mismatched identity is an error — test at cache.rs:5839). So integrity is preserved where a payload id is present, but any other consumer of thesha256wire field is now misled.- The
kv_codec_gpu.cu64-bit widening is only partial, contradicting the description. The description says it "widens plan accumulators and*low_base_ptroffsets touint64_t". At PR headchunk_pkt_offs,lane_byte_offsandlow_base_outremainU *(32-bit) —kv_build_packet_plan_gpuat kv_codec_gpu.cu:1558-1562, 1575, 1581, 1586 (*low_base_out = … ? (U)low_base : 0u), andkv_compact_packet_gpustill takesconst U *low_base_ptr(kv_codec_gpu.cu:1617). Onlytotal_pkt/total_pkt_arr/pkt_out_offs/total_batch_bytes_outare 64-bit. Per-chunk and lane-table offsets inside the packet plan can still wrap at ≥4 GiB. - Correcting the orientation-packet lead: the host-side launcher for those kernels is in-tree and is not in this PR's 27 files —
helios/src/offload/transfer/gpu_codec.rs:297-318resolveskv_build_packet_plan_gpu/…_batch_gpu/kv_compact_packet_gpu, and:1438-1488launches the batch kernels. The new caller-supplied arrays map onto existingu64slotsBATCH_OFF_PKT_LENS/BATCH_OFF_PKT_OFFSind_batch_meta(gpu_codec.rs:71-75, 1434-1436) and the argument counts match (9 args both sides), so the rewrite is launch-compatible — but the only evidence it works isnvcccompilation with zero global/constant ELF symbols plustests/test_kv_codec.py(not opened) 4/4; no kernel execution ran (all 16 GPUs occupied). - CI is red on head
e029dc8, zero reviews, zero comments, no labels, and the description's test evidence was gathered onorigin/main(8da73911), not the PR head — an explicit mismatch in the description itself. - #631 is the only linked issue and only part is addressed:
share_selectionsbefore sharded tuning andreconcile_selectionsafter it are implemented; #631's request to "fail fast on first divergence" is not. - No documentation changed at all, despite touching artifacts documented by #618 (
docs/core-format-design.md(not opened)), a cross-language JSON contract (host_extent) and a changed Rust signature (RankSupervisor::finish_shutdown(&mut self)→&self).
The change
Size and shape. 27 files, +1379/−303, opened 2026-11-30 by lukealonso (COLLABORATOR), head e029dc8, base main. Breakdown: heliopause/src 10 files +834/−163 (allocator.rs, processes.rs, python.rs, export/{binding,capture,core,io,transfer,weight_payload,weight_reuse}.rs); helios/src 3 files +218/−44 (core/conversion.rs +157/−31, core/conversion/edit.rs +9/−13, core/protection.rs +52); ignition/preparation 8 files +141/−85 (aot.py, compilation.py, core_storage.py, kv_codec.py, kv_codec_gpu.cu, peer_storage.py, runtime_core.py, tuning.py); tests/preparation 5 files +181/−7; eos/src/ioring.rs +5/−4. No docs, no RFC, no new flags or config.
Five independent defect families in one PR, only one of them carrying an issue link (#631):
- Externalized signed envelopes — new
protection::sign_rewritten_envelope/sign_rewritten_envelope_with_limitrefreshbody_digest = sha256(body), read rank bodies throughread_rank_body(rank, body_store)(so spilled bodies are re-read), and sign withsign_envelope(key).conversion.rsadditionally indexes rank bodies in aBTreeMap<u32, Vec<RankBody>>, skipsreader::EXTERNAL_BODY_PREFIXtensors when copying the container, re-addssigned.manifestand eachsigned.external_bodiesentry asreader::external_body_tensor(&sha256), anddrop(metadata)beforefs::rename(Windows open-file rename). New testinject_dependency_descriptors_and_promote_handle_externalized_bodies(end of conversion.rs, ~9607-9701) uses a limit of 1 to force spilling. - Stream-ordered zeroing —
core_storage.py:617-635replacescuMemsetD8_v2on legacy stream 0 withcuMemsetD8Async(addr, 0, size, torch.cuda.current_stream(device).cuda_stream);DeviceRegionalso adoptshost_extentfrom the allocator snapshot (core_storage.py:103). - Heliopause export pipeline —
capture.rsskip (above);io.rsoneDirectRing/IoUringper scan/write worker instead of per 4 MiB chunk, plus alibc::pread/pwritetransfer_single_directpath for single jobs;transfer.rsbatches reads to 8 MiB (io::BLOCK) while sending 4 MiB frames, and drops the double hashing;weight_payload.rs::merge_runscoalesces partial overlaps,Claimedbecomes aBTreeMap<u64,u64>(was sort-per-insert, O(V² log V));core.rs::convert_prepareduses aHashMap<&str,&WeightPayloadView>instead of two linear scans per tensor;binding.rs::NativeExportStagededupes leases byPayloadId(BTreeMap,entry().or_insert) and drops the directory mutex before the detachedtry_exists;processes.rsputs the join handle behind its ownMutexsofinish_shutdowntakes&self;python.rs::NativeRankSupervisortakespy: Pythonand detaches the GIL soabortno longer queues behindfinish_shutdown. - Multi-host prep / AOT lowering (#631) —
aot.py::ForwardCache._prepare_ranksexchanges cache-root-relative POSIX paths and_share_artifacts(..., root=self.root)bounds them per host;tuning.pycallsshare_selectionswhenspans_hostsregardless of_shardedand runsreconcile_selectionswithconfigure_tuning_shard(0, (0,)), restoring the real shard in afinally;compilation.py::_storage_regionsgroups raw overlaps before per-group alignment, clamps tostorage.nbytes(), and re-merges newly overlapping groups to a fixed point;_lower_storageslices a multi-dtypeuint8base beforeaten.view.dtype;_reads_across_mutationsclears onlypending & mutations[node]. - ABI / device selection / 32-bit bounds —
peer_storage._Access.flagsc_uint64→c_uint32(12-byteCUmemAccessDesc);runtime_core.pypassesdevice=storage.devicetocompile_gpu_codec_cubin(was device 0);kv_codec_gpu.cugf2_pow[30][32]→[64][32], 64-bit plan accumulators, caller-supplied batch arrays replacing fixed__shared__[64];binding.rsresolves and validates optionalPersistentWorker.metrics(fits u32,count*8bytes, 8-byte-aligned offset);allocator.rscomputeswindow_host_layout(base, extent, world, granule, virtual_address_bits(device))instead of a fixed 12 TiBHOST_BASEand publisheshost_extentinflare_core_snapshot;eos::ReadRing::flushupdatesqueued/in_flightbeforecheck(status)?so accepted DMA is still drained byDropafter a partial-submit error.
What it does that the description does not say. (a) the capture.rs skip widening of finding 2; (b) the sha256 wire-field semantics change of finding 3; (c) a new cross-language JSON key host_extent consumed by Python (allocator.rs ↔ core_storage.py:103) with no doc; (d) binding.rs re-establishes PersistentWorker.metrics, which #430 ("Add Execution.persistent_workers green-context lifecycle", original-el8) had removed (metrics_buffer/metrics_offset) — the proto still declares them (helios/proto/runtime_core.proto:839-841), so this revives a field the original author retired; (e) RankSupervisor::finish_shutdown signature change (&mut self → &self) and NativeRankSupervisor::abort gaining py: Python — call sites in ignition/preparation/rank_group.py:246-263, 341-357 are unchanged and still order begin/finish/abort; (f) ReadRing::flush now clamps submitted to queued rather than erroring when the kernel reports more completions than queued.
What the description says that the code does less of. The low_base_ptr 64-bit claim (finding 4), and the general framing that payload hashing is "redundant" — true for content-addressed objects, but the rank-source sha256 field is dual-purposed, so "removes a redundant pass" also removes a digest check from the non-payload path only, and repurposes the field for the payload path.
The why
- #631 (open issue, pfn, 2026-11-30, labels area:preparation, bug, performance, priority:P2, triage:investigate): 2× DGX Spark GB10,
ignition export --ranks 2, fails after ~2h15m autotune with "2042/2078/2078 kernel selections differ from rank zero's" on three attempts including warm caches;--autotune-effort offsucceeds in minutes. Its diagnosis (rank 1 re-races everything, only consults the shared record atagree_selections, wantsshare_selectionspre-seeding) is exactly whattuning.pynow does. Not implemented from the issue: fail-fast on first divergence. - The other four areas have no linked report. The externalized-core failure exists only because of #618, i.e. it is a self-inflicted regression, not a user-filed bug. The stream-0 race, the >4 GiB KV codec bounds and the WDDM address-space issues are theoretical/latent (all evidenced by unit tests or compilation, not by field reports).
- Nothing in the PR indicates how long any of these have been wanted; the only duration evidence is that #631 is one day old (#631 opened 2026-11-30, same day as the PR).
Related work
- #618 (merged 2026-11-29, lukealonso): source of the external-body format and of the combine/promote regression this PR repairs; also touched
heliopause/src/export/{capture,core,weight_reuse}.rsandignition/preparation/aot.py, so the same code is being re-cleared within 24 h. #618's evidence claimed a "3-rank ~138 MiB core" round-trip, but only throughprotection, not throughcombine/promote— precisely the gap #647 closes. - #593 (merged 2026-11-29, lukealonso) "Fix silent export corruption in AOT lowering, zero-init downloads, and drafter scope": already rewrote
_reads_across_mutationsand_lower_storageincompilation.pyand claimed "target-only--no-mtpexports … continue to reuse target weights from draft-bearing caches". #647 edits the same functions again (second pass over day-old logic), and the--no-mtpreuse claim overlaps a capability #593 says already worked. Cross-check the two test sets (tests/cli/test_planning.py (not opened) vs the new ~200-linemap_groups_skips_omitted_draft_weights_and_clips_coalesced_initializers). - #588 (closed, FujitsuPolycom) "Accelerate multi-host rank export transfer…": earlier owner of the same transfer path; voipmonitor reviewed
weight_reuse.rs--no-mtpdraft-byte accounting there. - #430 (merged, original-el8): removed
PersistentWorker.metrics_buffer/metrics_offset; #647 reintroduces metric resolution under field 4/5. - #504 / #525 (merged, yatesdr): authored
kv_codec_gpu.cu(pure-CUDA KV codec; parallelized GPU rANS setup). #647 restructures that author's fresh kernels. #525 is four days older than this PR. - #620 (merged 2026-11-29, lukealonso) removed copy/history drafts while keeping legacy cores loadable — same file neighbourhood (
conversion.rs,kv_codec); #586 (merged, PCCessna) parallelized Engram plane assembly in core export and touchedheliopause/src. - Open siblings by the same author, same day: #643 (RoCE ring proxy opcodes), #645 (prefill scheduling overhaul), #646 (Orbit rank cache/NVML/flare-agent). #647 is one of four same-day PRs.
- Nothing found that this PR reverts or is superseded by.
Recent activity
Non-author recent changes inside the files this PR touches: yatesdr (kv_codec_gpu.cu, #504/#525, 2026-11-25), Garret Buell (export/io.rs Windows direct-writer flags, #294, 2026-11-14), FujitsuPolycom (skip digest and fsync on disposable export spans, f1bd4210, 2026-11-28), PCCessna (#586 Engram plane assembly, e0290571, 2026-11-29), Martin Vit (#566 engram prefetch), original-el8 (conversion.rs via #427). The PR builds on #618/#593 rather than conflicting with them; it rewrites parts of #504/#525. No revert detected.
People
- lukealonso — COLLABORATOR, one of three named priority contributors in the charter (lines 15 and 58). 27 merged PRs in 180 days, 0 closed, 3 open. Dominant committer in every touched area in 180 days: helios/src 230 (next: Martin Vit 52, yatesdr 47), heliopause/src 60 (Martin Vit 11, Jason Cook 5), ignition/preparation 158 (Martin Vit 52, Eugene Rakhmatulin 36), tests/preparation 206, eos/src 4. Effectively self-reviewing most of the diff. Discord given in the PR body: lukealonso.
- Not engaged but materially affected: yatesdr (author of the KV codec kernels being rewritten), original-el8 (persistent-worker/metrics fields;
conversion.rs), voipmonitor (prior--no-mtpweight-reuse review), FujitsuPolycom and Garret Buell (export transfer /io.rs), PFCessna, Martin Vit, Eugene Rakhmatulin, R4yHarris (Windows #159/#294).
Community
Zero comments, zero reviews, zero reactions (pr_comments → "No comments"). No reviewers requested, no labels. The only cross-item signal is #631's "referred to by" naming this PR as its fix. Interest so far: none measurable.
Project fit
- Lines up: the description uses the charter's prescribed why/what/result/evidence structure inside 60 days of the change, with per-crate test counts; multi-host serving and cross-node export are charter goals, so #631 and the multi-host prep fixes are in scope.
- Tension — benchmarks (#210): the performance half (skip full-weight PCIe D2H, one IoUring, no double SHA-256, HashMap view lookup, BTreeMap
Claimed, FD dedupe) is exactly what the charter says needs a measured speedup, and the description states "not benchmarked end-to-end on GPUs here". - Tension — root cause (#397):
transfer.rsremoves a verification step and repurposes its field rather than eliminating a duplication. - Tension — compatibility matrix: no statement on whether caches written by #618-era tools, previously published external-body cores, or cached KV codec cubins still work. The
capture.rsskip widening changes what cached exports store; the container rewrite strips/regeneratesflare.body.*;kv_codec.py's_CACHEkey is(capability, cache_dir)witharch/source_hashonly in the file name (kv_codec.py:18, 55, 64) — worth checking if a source change invalidates a stale cubin against the changed kernel ABI. - Tension — Windows outside the named matrix: WDDM
HOST_BASEandeos::ReadRingWindows work serve a platform (from #159/#294) that the charter's supported matrix (SM103/SM120/SM121, DGX Spark) does not name. - Charter note on kernels: CUDA kernel changes should report concrete defects; the
gf2_pow30→64 and__shared__[64]changes are concrete, but only partly complete (finding 4). - Roadmap: none of the roadmap items (in-process SDK #6, Engram tables #267, FlashInfer pinning #215) is served.
- The PR adds no per-model branches or flags; it removes the
--reuse-weights --no-mtprejection, relaxing a constraint.
Claims and evidence
| Claim | What backs it | Gap |
|---|---|---|
Externalized envelopes succeed through inject_dependency_descriptors/promote |
New test inject_dependency_descriptors_and_promote_handle_externalized_bodies; helios core:: 514 passed |
Evidence run on main 8da73911, not head e029dc8 |
DeviceRegion.grow issues stream-ordered cuMemsetD8Async |
Code at core_storage.py:617-635; tests/preparation/test_persistent.py FakeCuda records the call, asserts 4 args |
Test replaces the CUDA call with synchronous C.memset; ordering is never asserted semantically, only arity |
_Access matches the 12-byte ABI |
c_uint32 change + test_peer_storage_groups.py |
ctypes size check only |
PersistentWorker.metrics resolved/validated |
New Rust test with null/zero/unaligned failure cases; proto fields exist | No runtime/Python consumer test; contradicts #430's removal |
map_groups handles --no-mtp |
~200-line test | Overlaps #593's claim that this already worked |
merge_runs/Claimed/window_host_layout correct |
Unit tests at weight_payload.rs:1229-1250, allocator.rs:1431 (40-bit = 1 TiB WDDM cases) | Windows runtime path unexercised on Linux |
| Multi-host sharded autotune shares and reconciles (#631) | test_sharded_multihost_tune_shares_cache_and_reconciles_divergent_selections with a monkeypatched coordinator asserting call order [(1,(0,1)),(0,(0,)),(1,(0,1))] |
No live multi-host run; fail-fast not implemented |
kv_codec_gpu.cu correct |
nvcc compiles, no global/constant ELF symbols, tests/test_kv_codec.py (not opened) 4/4 |
No kernel execution (GPUs full); the 64-bit widening is partial (finding 4); host launcher in helios unchanged and only compile-compatible |
| Perf improvements | Reasoning in the description only | Explicitly "not benchmarked end-to-end"; #210 unmet |
ReadRing no longer frees live DMA |
queued/in_flight ordering fix, eos 2 tests |
Windows-only path; clamping hides over-reporting |
Reported test totals (all on main 8da73911): eos 2; selene 549; selene-manager 426 (+1 ignored); helios core:: 514 and 1,658 non-frontend passing with 46 ignored; heliopause lib 220 (+6 CUDA-ignored); flare 237 + 8; flare-cli 227; targeted Python 427 (+1 skipped); full pytest tests/cli tests/preparation 1,282 passed / 74 skipped with 3 disclosed unrelated failures. Live VRAM/WDDM/multi-host checks could not run (GPU OOM; template test blocked by an HTTP 403 on a gated repo).
Reach
- Who is affected: multi-host
ignition export --ranks Noperators (#631), cached-export users, anyone runningflare combine/promoteon >128 MiB cores (today hard-failing, fixed here),--no-mtpweight-reuse users, Windows/WDDM users, GPU KV codec users, persistent-worker users. - Behaviour changes without docs or flags: cached exports skip all numeric ranges in Pass 1 (
capture.rs:3420-3425);--reuse-weights --no-mtpno longer rejected; snapshot JSON gainshost_extentconsumed bycore_storage.py:103; the rank-source transfersha256becomes a payload id (transfer.rs:609,1011). - Compatibility: #618-era external-body cores become rewritable/combine/promote-able; old inline cores unaffected; container rewrite regenerates
flare.body.*; the.cukernel ABI changed with an unchanged Rust launcher, so a stale cached cubin is the main risk;RankSupervisor::finish_shutdown/NativeRankSupervisor::abortsignatures changed (Python call sites unchanged). - Dependencies: none added;
io_uringalready used;libc::pread/pwriteis new for single-job Linux I/O; Windows path unchanged. - Documentation: no
docs/change at all, though #618 documented the external-body format and other similar PRs (#618, #593) did update docs.
Process
Ready for review (not a draft), opened and last updated 2026-11-30, age 0 days. Head e029dc8; CI failed on head. No reviewers assigned, no reviews, no labels, no comments. Test evidence was collected locally against origin/main 8da73911, which the description itself flags, so the head commit's own state is not independently attested. Author is a charter priority contributor: per charter lines 15/58 the PR should not be set aside but reviewed with specific, spelled-out asks.
Open questions / not verified
- Does the widened
capture.rsskip change the meaning ofdata_spansfor consumers downstream of cached export? No test covers the new branch. - Will
helios/src/offload/transfer/gpu_codec.rs(unchanged) behave correctly with the new batch kernels at >4 GiB, givenlow_base_out,chunk_pkt_offs,lane_byte_offsstay 32-bit, and withblock = MAX_PAGE_BATCHnow that the shared cap is gone? - Does anything other than
install_payload_objectread the rank-sourcesha256field as a content digest? - Does the runtime actually consume
PersistentWorker.metrics, and did #430's removal reflect a deliberate decision? - Does
kv_codec.py::_CACHE(keyed(capability, cache_dir)) invalidate a cached cubin after this source/ABI change? - Is
sorted(buf.nbytes) == [1, 4]in the new_storage_regionstest consistent with real Inductor behaviour, given the test file's reference oracle was edited in the same commit as the implementation? - Whether an operator with
--reuse-weightsalready relies on the pre-PR pass-1 numeric D2H for pointer-scan reachability.