#1 [high] F1 Blocker/Major: host VMM window placement failure aborts allocator init for ALL exports, incl. models with no MappedHost
heliopause/src/allocator.rs:511-561 (new code):
let host_vmm = host::use_host_vmm(cfg!(windows), host_register != 0, can_use_host_pointer != 0);
let (host_base, host_extent) = if !cfg!(windows) && host_vmm {
if let Some((_, host_granularity)) = host::host_numa_properties(&driver, device)? {
...
vmm_host_window(base, extent, world, host_granule, min_host_base, default_host_base, default_host_extent, |addr, bytes| {...})?
The trailing ? at allocator.rs:555 propagates "no reservable CUDA VMM address range for mapped host storage" (allocator.rs:415-417) out of flare_core_initialize_window, which fails CoreStorage.__init__ (ignition/preparation/core_storage.py:96-97) for EVERY export on that device, including models with no host mailboxes at all.
Before this PR the same device initialized fine (window_host_layout with bits == None on Linux returns HOST_BASE, 1 TiB: allocator.rs:299-318, and address_space.rs:104-106 returns None on non-Windows), and exported; only the serve/export of a MappedHost core failed later.
Condition that triggers it: host_vmm is true on any Linux device lacking attribute 99 or 91, so the probe path runs at init on every such device; a narrow aperture + multi-rank (host span = 8 GiB * world, allocator.rs:393-394) or a device whose 40..48 GiB region is occupied makes init fail.
Impact: a new total-export-outage mode on hardware where export used to work for non-mailbox models.
Fix: don't decide/validate the host VMM window at init. Either (a) store host_vmm + aperture and place/probe the window lazily in the first host_allocate-equivalent call (i.e. when a MappedHost allocation is actually requested), or (b) on probe failure keep (default_host_base, default_host_extent) and let the MappedHost path fail with a precise error.
#2 [high] F2 Major: host VMM address is probed then freed and never held — TOCTOU collision with driver/pool VA on the same narrow aperture
heliopause/src/allocator.rs:539-554 (probe closure): cuMemAddressReserve then driver.check("cuMemAddressFree(host probe)", (driver.release_address)(probe, len))?; Ok(probe == addr) — the range is released immediately; nothing is held between init and first host allocation.
On the new Linux narrow-aperture path the chosen window (e.g. 40..48 GiB, allocator.rs:399-404) lies INSIDE the device VMM aperture (0x18_23c0_0000 = 96.56 GiB per the PR body). Only device-window spans (48..96 GiB) are reserved at init (allocator.rs:562-579) and only below EXTERNAL_FLOOR is sealed (_reserve_low_window/seal_low_window, ignition/preparation/core_storage.py:109-110, 163-190, floor 12 GiB on SM87 at core_storage.py:69). 40..48 GiB is therefore unprotected: context/cuBLAS/non-pool CUDA allocations can land there before host_allocate runs (which is deep into model preparation, e.g. ignition/preparation/collectives.py:76-77, helios/tests/engram_core_fixture.py:133).
The later reservation is ignition/preparation/core_storage.py:513-518:
cuda.call("cuMemAddressReserve", C.byref(pointer), C.c_size_t(self.extent),
C.c_size_t(granularity.value), C.c_uint64(address), C.c_uint64(0))
...
if pointer.value != address:
raise RuntimeError(f"cannot reserve mapped host CUDA address {address:#x}")
So a stolen address is an intermittent hard export failure (not even the documented "range exhausted" path), and ownership of the probed range is not transferred to anyone.
Impact: flaky/irreproducible Orin export failures that depend on where the driver happened to put other allocations; also defeats the GiB-alignment reasoning that motivated window_align (allocator.rs:390-392).
Fix: have the native side actually reserve the selected host span at init and register it with the returned layout (e.g. return it as a reservation in the snapshot and let HostVmmRegion map inside a pre-reserved range), or extend seal_low_window to include the selected host window up to the device base.
#7 [high] Research summary
Reviewed PR #669 (host-backed CUDA VMM fallback on Linux) across all 7 changed files plus their direct callers: heliopause/src/allocator.rs init/snapshot/probe path, helios/src/runtime_core/{host,mod,driver}.rs (MappedHost allocate/teardown branches, NativeResources::initialize), ignition/preparation/core_storage.py (region dispatch, HostVmmRegion, low-window sealing), docs/runtime-core-design.md, and the new tests, plus callers ignition/preparation/collectives.py, peer_storage.py, runtime_core.py, helios/tests/fixed_core_fixture.py, heliopause/src/export/capture.rs, and helios/src/cuda.rs.
Six findings saved to scratchpad (1 high-severity total-outage risk, 2 high, 3 medium): (1) the new vmm_host_window probe result is propagated with ? out of flare_core_initialize_window, so a narrow/occupied aperture now fails every export on such a device, including models with no MappedHost; (2) that probe reserves and immediately frees the chosen host range, so nothing holds it until HostVmmRegion re-reserves it much later — a TOCTOU hazard on exactly the narrow apertures this PR targets; (3) new unconditional cuDeviceGetAttribute(99/91) queries are fatal on drivers that don't know them; (4) two disagreeing capability gates mean host_vmm: true can be reported for a device with HOST_NUMA_VMM == 0, producing a misleading Python-layer error; (5) the probe flattens every driver status into "no reservable range" with no cause; plus verified-sound notes on the MappedHost branch gating. Charter/contract concerns: hardcoded 8 GiB / 1 GiB / 12 GiB constants with no config surface, hard-indexed layout["host_vmm"] with no ABI handshake, and the WindowsHostRegion → HostVmmRegion rename with no alias. Also confirmed the collision with open PR #658 on core_storage.py:66-71 and that merged #589's documentation/code claims (helios/src/cuda.rs:552-557, selene/src/offload.rs:693-695, docs/prefix-cache-offload.md:588-590) now contradict this PR and were not updated.
#4 [medium] F3 Major: attribute 99/91 queries are fatal on unknown attributes and run unconditionally at every init
helios/src/runtime_core/mod.rs:364-381 (new):
let mut host_register_supported = 1;
driver.check(
"cuDeviceGetAttribute(HOST_REGISTER_SUPPORTED)",
(driver.device_attribute)(&mut host_register_supported, driver::CU_DEVICE_ATTRIBUTE_HOST_REGISTER_SUPPORTED, device),
)?;
and heliopause/src/allocator.rs:465-480 do the same with driver.check(...)?. Driver::check turns any nonzero status into an error, so a driver that does not recognize attribute 99/91 fails core load / allocator init outright. Previously helios never queried 99/91 at all and heliopause never did either (pre-PR code queried only 18 and 116: pr diff hunk at allocator.rs:456-488 old (driver.device_attribute)(&mut integrated, 18, device) / 116).
Both new queries are unconditional on every platform and every load — a new hard dependency on the running driver knowing CUDA 10 attributes, for a feature only needed when a MappedHost allocation exists. Also host_numa_properties (host.rs:57-98) is called at allocator init on every Linux host_vmm device (allocator.rs:519), so cuMemGetAllocationGranularity on a HOST_NUMA properties struct runs even for export of models with no mailboxes.
Impact: narrow, but it converts "unknown attribute" into a load failure; and it is new cost on the export/load path for every non-identity-addressing Linux device.
Fix: treat a failing attribute query as 0/unknown (if driver.device_attribute(...) != 0 { value stays default }), which is what the 1/1 defaults are clearly trying to express, and only query when a MappedHost allocation is present.
#5 [medium] F4 Major: host_vmm snapshot is true on 99/91==0 + 141==0 devices; Python then fails naming 141 that the allocator already knew was absent
heliopause/src/allocator.rs:511-522 sets host_vmm = use_host_vmm(...) from attributes 99/91 only, and the snapshot exports it (allocator.rs:863). If the same device also reports HOST_NUMA_VMM (141) == 0, host_numa_properties returns Ok(None) (host.rs:68-70) and the allocator falls back to the ordinary 1 TiB default window (allocator.rs:556-558) while still reporting host_vmm: true. Ignition then selects HostVmmRegion (ignition/preparation/core_storage.py:356) and hard-fails at core_storage.py:499-502:
supported = C.c_int()
cuda.call("cuDeviceGetAttribute", C.byref(supported), C.c_int(141), C.c_int(device))
if not supported.value:
raise RuntimeError("mapped core storage requires host-backed CUDA VMM")
Helios mirrors it at helios/src/runtime_core/host.rs:115-116.
Two native subsystems disagree about the meaning of host_vmm (99/91 vs 141), and the error surfaces in the Python layer, never mentioning attribute 141, on a device where the C++/Rust side had already silently decided to use the default window. The 8 GiB window (allocator.rs:393) is also then moot.
Fix: make attribute 141 part of the exported decision (e.g. report host_vmm = use_host_vmm(...) && host_numa_vmm != 0, or a separate host_vmm_supported), so the failure is raised once, by the native side, naming 141 and the device — the charter's #397 rule against unexplained errors.
#6 [medium] F6 Minor-Major: VMM probe discards every cuMemAddressReserve status, so real driver errors read as "no reservable range"
heliopause/src/allocator.rs:539-554:
let status = (driver.reserve)(&mut probe, len, host_align, addr, 0);
if status == 0 { driver.check(...)?; Ok(probe == addr) } else { Ok(false) }
Every nonzero cuMemAddressReserve status — including CUDA_ERROR_OUT_OF_MEMORY (2), CUDA_ERROR_INVALID_CONTEXT/DEINITIALIZED (3/4), CUDA_ERROR_NOT_SUPPORTED (801) — is flattened to "not reservable", and the caller then reports only:
Err(invalid("no reservable CUDA VMM address range for mapped host storage")) // allocator.rs:415-417
During the first branch the default span is world * 1 TiB (EXTENT, allocator.rs:31), i.e. up to 16 TiB of VA requested per probe on a 16-rank layout; a refusal there is exactly the case where the driver status matters (aperture too small vs OOM vs a broken context). The PR's own validation shows the Orin ceiling is only discoverable by trying.
Fix: keep the first failing status and include code/operation in the final error (no reservable CUDA VMM address range ...; last status 801 at 0xc0000000000+0x10000000000). This also makes the removed/remaining alternatives visible to the operator.
#8 [medium] F7 Major: granule.is_power_of_two() tightened for ALL platforms; also new unconditional attr queries change init contract
heliopause/src/allocator.rs:494-502 (diff hunk r/n -402,7):
let granule = granularity as u64;
let two_granules = granule
.checked_mul(2)
.filter(|_| granule.is_power_of_two())
.ok_or_else(|| {
invalid(format!(
"invalid CUDA allocation granularity {granule:#x}"
))
})?;
Pre-PR this was .filter(|_| granule != 0). This is a device-granularity acceptance change on every platform (Windows, all Linux GPUs), not just the new VMM path, and is not mentioned in the PR description. In practice CUDA granularities are powers of two, so the risk is theoretical, but it is an undeclared behavioral narrowing of the initialization contract and it is the same PR that relies on power-of-two arithmetic (& !(align - 1)) elsewhere.
Second, related contract change: NativeResources::initialize (helios/src/runtime_core/mod.rs:364-386) and flare_core_initialize_window (allocator.rs:465-480) now perform three extra cuDeviceGetAttribute calls before any resource work, each through driver.check(...)?. Driver::check maps any nonzero return to an error, so an older/limited driver turns core load and allocator init into hard failures (pre-PR only attributes 18 and 116 were queried: allocation diff at allocator.rs:456-488).
Concrete fix for both: accept granule != 0 for the device path (keep is_power_of_two only for the new host granularity, host.rs:91-95), and make the two new attribute reads non-fatal (let mut v = 0; if (driver.device_attribute)(&mut v, ATTR, device) != 0 { v = 1 } style, keeping the existing 1/1 defaults meaningful).
#9 [medium] F8 Major: Deployment ABI coupling — layout["host_vmm"] hard-indexed, HostVmmRegion rename without alias, and stale artifacts
ignition/preparation/core_storage.py:103:
self._host_vmm = bool(layout["host_vmm"])
layout comes from flare_core_snapshot() (core_storage.py:192-199 → heliopause/src/allocator.rs:861-869). The key is new in this PR ("host_vmm": a.host_vmm, allocator.rs:863). A stale/prebuilt flare_heliopause (a wheel not rebuilt with ignition, or a cached extension) therefore raises a bare KeyError: 'host_vmm' from the middle of CoreStorage.__init__, after the native allocator is already initialized — not a version/ABI error the operator can act on. Note the neighbouring keys use .get(...) defensively (self.HOST_RESERVATION_BYTES = layout.get("host_extent", ...), core_storage.py:105), so the hard index is inconsistent with the file's own convention.
Same coupling for the class rename: WindowsHostRegion → HostVmmRegion (core_storage.py:492, was line 492 pre-PR) with no alias, and the dispatch changed from os.name == "nt" to self._host_vmm (core_storage.py:356). In-repo the only reference is that dispatch site (verified by search: no other WindowsHostRegion in tree). Out-of-repo importers would break at import time.
Also: tests/preparation/test_core_storage.py:83-127 constructs CoreStorage.__new__(CoreStorage) and sets storage._host_vmm by hand, so it cannot catch the missing-key path.
Fix: layout.get("host_vmm") with an explicit error naming the required flare_heliopause rebuild (or a snapshot version field compared against a Python constant), and keep WindowsHostRegion = HostVmmRegion as a deprecated alias for one release.
#3 [low] Verified OK: MappedHost branch gating and zero-fill in helios (no gap)
helios/src/runtime_core/host.rs:101-116 + mod.rs:564:
unsafe fn allocate_host(&mut self, core: &super::Core) -> Result<()> {
...
if !core.allocations.iter().any(|a| matches!(a.memory, Memory::MappedHost)) { return Ok(()); }
Called from mod.rs:563-566 unconditionally whenever self.host_vmm is true. But NativeResources also builds cores that contain NO MappedHost allocations on a host_vmm device; then allocate_host returns Ok(()) early, i.e. fine.
The real asymmetry: host_vmm is decided from device attributes only (host.rs:12-18) and defaults host_register_supported = 1, can_use_host_pointer = 1 (mod.rs:364, 373; allocator.rs:455). A failure to query attribute 99/91 is a hard error at load (driver.check(...)?), so a driver/version that doesn't know attribute 99 (older CUDA < 10-ish) now fails core load where it previously worked — see F5.
Correctness of the branch gating itself verified: mod.rs:645, 711, 1610 are guarded by cfg(unix) and !self.host_vmm, and the Memory::MappedHost zero-fill at mod.rs:729-731 writes to address as a CPU pointer for BOTH modes (fine for VMM, since the CPU maps the same VA), so no missing branch there.