Explore report · NVIDIA/hyperflare-inference #647

Raw Markdown for agents: https://autobot.eidonix.com/p/10f011e8-c8e5-4caf-a0d2-22ebd9c7a639.md

Case file — PR #647 "Fix externalized core signing, stream-0 weight race, export I/O, and multi-host tuning"

Key findings

  1. 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_envelope and the 128 MiB MAX_ENVELOPE but left core/conversion.rs::inject_dependency_descriptors and conversion/edit.rs decoding inline bodies and calling builder.sign(key). #647 extracts protection::sign_rewritten_envelope and fixes both call sites. So combine/promote of >128 MiB cores has been broken only since #618 (≈24 h).
  2. 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 "skips request.numeric D2H in Pass 1 when cache_scan is true"; it does not say the skip applies to plain cached exports without --reuse-weights, nor that data_spans stops recording weight bytes for cached exports. No test in the PR covers capture.rs (diff is +8/−4, no test).
  3. transfer.rs stops SHA-256-verifying cached payload transfers, and the wire sha256 field now carries a PayloadId. 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 via slice.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 the sha256 wire field is now misled.
  4. The kv_codec_gpu.cu 64-bit widening is only partial, contradicting the description. The description says it "widens plan accumulators and *low_base_ptr offsets to uint64_t". At PR head chunk_pkt_offs, lane_byte_offs and low_base_out remain U * (32-bit) — kv_build_packet_plan_gpu at kv_codec_gpu.cu:1558-1562, 1575, 1581, 1586 (*low_base_out = … ? (U)low_base : 0u), and kv_compact_packet_gpu still takes const U *low_base_ptr (kv_codec_gpu.cu:1617). Only total_pkt/total_pkt_arr/pkt_out_offs/total_batch_bytes_out are 64-bit. Per-chunk and lane-table offsets inside the packet plan can still wrap at ≥4 GiB.
  5. 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-318 resolves kv_build_packet_plan_gpu/…_batch_gpu/kv_compact_packet_gpu, and :1438-1488 launches the batch kernels. The new caller-supplied arrays map onto existing u64 slots BATCH_OFF_PKT_LENS/BATCH_OFF_PKT_OFFS in d_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 is nvcc compilation with zero global/constant ELF symbols plus tests/test_kv_codec.py (not opened) 4/4; no kernel execution ran (all 16 GPUs occupied).
  6. CI is red on head e029dc8, zero reviews, zero comments, no labels, and the description's test evidence was gathered on origin/main (8da73911), not the PR head — an explicit mismatch in the description itself.
  7. #631 is the only linked issue and only part is addressed: share_selections before sharded tuning and reconcile_selections after it are implemented; #631's request to "fail fast on first divergence" is not.
  8. 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):

  1. Externalized signed envelopes — new protection::sign_rewritten_envelope / sign_rewritten_envelope_with_limit refresh body_digest = sha256(body), read rank bodies through read_rank_body(rank, body_store) (so spilled bodies are re-read), and sign with sign_envelope(key). conversion.rs additionally indexes rank bodies in a BTreeMap<u32, Vec<RankBody>>, skips reader::EXTERNAL_BODY_PREFIX tensors when copying the container, re-adds signed.manifest and each signed.external_bodies entry as reader::external_body_tensor(&sha256), and drop(metadata) before fs::rename (Windows open-file rename). New test inject_dependency_descriptors_and_promote_handle_externalized_bodies (end of conversion.rs, ~9607-9701) uses a limit of 1 to force spilling.
  2. Stream-ordered zeroing — core_storage.py:617-635 replaces cuMemsetD8_v2 on legacy stream 0 with cuMemsetD8Async(addr, 0, size, torch.cuda.current_stream(device).cuda_stream); DeviceRegion also adopts host_extent from the allocator snapshot (core_storage.py:103).
  3. Heliopause export pipeline — capture.rs skip (above); io.rs one DirectRing/IoUring per scan/write worker instead of per 4 MiB chunk, plus a libc::pread/pwrite transfer_single_direct path for single jobs; transfer.rs batches reads to 8 MiB (io::BLOCK) while sending 4 MiB frames, and drops the double hashing; weight_payload.rs::merge_runs coalesces partial overlaps, Claimed becomes a BTreeMap<u64,u64> (was sort-per-insert, O(V² log V)); core.rs::convert_prepared uses a HashMap<&str,&WeightPayloadView> instead of two linear scans per tensor; binding.rs::NativeExportStage dedupes leases by PayloadId (BTreeMap, entry().or_insert) and drops the directory mutex before the detached try_exists; processes.rs puts the join handle behind its own Mutex so finish_shutdown takes &self; python.rs::NativeRankSupervisor takes py: Python and detaches the GIL so abort no longer queues behind finish_shutdown.
  4. Multi-host prep / AOT lowering (#631) — aot.py::ForwardCache._prepare_ranks exchanges cache-root-relative POSIX paths and _share_artifacts(..., root=self.root) bounds them per host; tuning.py calls share_selections when spans_hosts regardless of _sharded and runs reconcile_selections with configure_tuning_shard(0, (0,)), restoring the real shard in a finally; compilation.py::_storage_regions groups raw overlaps before per-group alignment, clamps to storage.nbytes(), and re-merges newly overlapping groups to a fixed point; _lower_storage slices a multi-dtype uint8 base before aten.view.dtype; _reads_across_mutations clears only pending & mutations[node].
  5. ABI / device selection / 32-bit bounds — peer_storage._Access.flags c_uint64 → c_uint32 (12-byte CUmemAccessDesc); runtime_core.py passes device=storage.device to compile_gpu_codec_cubin (was device 0); kv_codec_gpu.cu gf2_pow[30][32] → [64][32], 64-bit plan accumulators, caller-supplied batch arrays replacing fixed __shared__[64]; binding.rs resolves and validates optional PersistentWorker.metrics (fits u32, count*8 bytes, 8-byte-aligned offset); allocator.rs computes window_host_layout(base, extent, world, granule, virtual_address_bits(device)) instead of a fixed 12 TiB HOST_BASE and publishes host_extent in flare_core_snapshot; eos::ReadRing::flush updates queued/in_flight before check(status)? so accepted DMA is still drained by Drop after 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

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

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

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

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