Review of PR #589 — Architecture and scope lens
Verdict: should-fix issues only. No blocking defect in the changed code paths I could verify. The two code-level findings are a weakened-error-handling regression and a now-false unsafe fn contract; the rest are scope, evidence and documentation-consistency findings judged against AGENTS.md and docs/design-review.md.
Note: the orientation packet records this PR as merged (merge commit ba3afb13, 2026-11-28). The findings below are therefore written as follow-ups, not merge gates.
Key findings
- Should fix —
cuda.rs:535-537:is_host_numa_unsupportedtreats genericCUDA_ERROR_INVALID_VALUE(1) as "platform unsupported" at four call sites, silently substituting a different allocation strategy for genuine argument errors. This is exactly the "silently substitute execution paths" patternAGENTS.md:182-186rejects. - Should fix —
cuda.rs:781-790: thecopy_batchdoc contract still says every address is a device address and that raw CPU addresses of registrations are not passed; the new fallback (824-833) exists precisely because callers pass those pointers. A stale# Safetycontract on anunsafe fn. - Should fix (scope) — PR as a whole: four independent outcomes in one PR, two of which extend support to Jetson Orin GA10B / 8–32 GiB SoCs that the charter names nowhere, without the maintainer sign-off the charter requires (
AGENTS.md:171-175, charter Non-Goals). - Should fix (evidence) — release claim: the headline claim ("
flare-linux-arm64.tgzcan start on stock JetPack 6") is supported by an x86_64-only build; the native aarch64 build and theubuntu-24.04-armjob are listed by the author as unrun (docs/design-review.md:247-251). - Should fix (docs) —
docs/release.md:30-31,docs/multi-host.md:50: state JetPack 6 as qualified while the only evidence is the amd64 artifact (AGENTS.md:52-60requires "present qualification"). - Verified, no defect:
eos/src/unix.rs::map_hostTHP ordering change, and the Selene/helios budget arithmetic round trip. - Nits: dead
host_pool_budget_with_reserve, theOption<u64>budget-wrapper stack, the x86_64 RoCE load-time-check behaviour change unstated in the description, and a stale CUDA symbol list indocs/prefix-cache-offload.md.
Should fix
1. CUDA_ERROR_INVALID_VALUE is mapped to "platform unsupported", turning real errors into a silent path substitution
helios/src/cuda.rs:532-537
/// `CUDA_ERROR_INVALID_VALUE` (1) or `CUDA_ERROR_NOT_SUPPORTED` (801), returned by
/// CUDA drivers on platforms without `CU_MEM_LOCATION_TYPE_HOST_NUMA` VMM support
/// (such as Windows WDDM and integrated Tegra/GA10B GPUs).
fn is_host_numa_unsupported(status: c_int) -> bool { matches!(status, 1 | 801) }
Consumed at four sites in try_map_device_host_parts: 579 (cuDeviceGetAttribute), 587 (cuMemGetAllocationGranularity), 642 (cuMemCreate), 658 (cuMemSetAccess); each returns Ok(None), which makes selene/src/offload.rs silently replace the HOST_NUMA split pool with an anonymous SlabPool::sized + cuMemHostRegister_v2 mapping.
Why it matters: status 1 is the generic CUDA_ERROR_INVALID_VALUE, which CUDA also returns for genuine argument errors — bad granularity rounding, wrong handle or flags, a resident-context mistake in the newly added cuMemSetAccess path. Mapping it to "platform unsupported" means a real bug in map_device_host_parts degrades into a different allocation strategy with different properties (CPU-addressable mapping, whole-mapping registration cost, a different device_parts() path) instead of failing. AGENTS.md:182-186 — "Do not remove validation, suppress errors, silently substitute execution paths" — covers this directly, and AGENTS.md:194-199 ("tests must exercise the affected behavior") is relevant because the new fallback tests establish the substitution works but not that it is only reached on real platform absence. The change is also internally inconsistent: cuMemMap and cuMemAddressReserve failures still hard-error, so a platform without HOST_NUMA can return Err as well as Ok(None) depending on which call reports first.
Fix: narrow the predicate to CUDA_ERROR_NOT_SUPPORTED (801), or probe support explicitly before reserving (host-NUMA attribute presence, or cuMemGetAllocationGranularity for CU_MEM_LOCATION_TYPE_HOST_NUMA). If status 1 must be accepted for one documented driver/platform pair, constrain it to that single call and cite the driver behaviour in the comment. Settling this beyond the code needs a GA10B/WDDM run showing which status each of the four calls actually returns.
2. The copy_batch safety contract contradicts the fallback the PR introduces
helios/src/cuda.rs:781-790 versus 824-833
The doc comment still reads: "Every address is a device address, including the device alias of registered host memory. CPU addresses of registrations are not necessarily GPU-accessible." The # Safety section promises only lifetime. The new fallback comment says the opposite of the first sentence — cuMemcpyAsync "accepts device addresses, registered host aliases, and raw cuMemHostAlloc(..., flags=0) pointers" — and the PR description names helios/src/execution/transport.rs (not opened) frame.input.address() (allocated with flags = 0) and helios/src/offload/transfer.rs as the callers that pass exactly the pointers the contract excludes.
Why it matters: the contract other code is written against is now wrong, and the fix is justified by the very case the docstring rules out. A stale contract on a pub(crate) unsafe fn is a correctness hazard for future callers, and AGENTS.md:43-65 (prose review; state actual behaviour) applies to docstrings explicitly.
Fix: rewrite the contract to distinguish the two paths — cuMemcpyBatchAsync_v2 requires device addresses including registered aliases; the CUDA < 13 fallback via cuMemcpyAsync additionally accepts UVA-reachable pinned host pointers without the mapped flag. While there, note that cuMemcpyAsync is now a hard-required entry point: Driver::load resolves it with symbol!("cuMemcpyAsync") at cuda.rs:303, and symbol! (cuda.rs:239-248) returns Err when absent, so driver load fails up front rather than the copy failing later.
3. Scope: four independent outcomes in one PR, two of them extending support to hardware the charter does not name
PR as a whole, against AGENTS.md:165-199 and the charter.
AGENTS.md:198-199 states "Keep each PR focused on one coherent outcome." This PR carries four: (1) the CUDA 12 discrete-GPU copy fallback in helios/src/cuda.rs; (2) a release-engineering portability change — .github/workflows/release.yml (not opened) plus a 236-line vendored helios/native/roce_proxy_dlopen.c and the helios/build.rs switch to it; (3) a Selene/helios host-budgeting rework across selene/src/offload.rs, selene/src/slab.rs, selene/src/registrar.rs, helios/src/runtime_core/{memory,model}.rs, helios/src/offload/{mod,registrar}.rs; (4) an eos/src/unix.rs THP ordering tweak. Each is individually "reproducible bug"-class (AGENTS.md:165-166), but they have no shared failure mode, and a regression in one cannot be bisected from the others.
The larger scope problem is the supported matrix. The charter's Goals name "SM103, SM120, and SM121" and DGX Spark; Non-Goals include "Broad production coverage across arbitrary models, GPUs, or deployment setups", "require an explicit maintainer sign-off before starting work", and "Stay focused … not interested in piling on extra model aliases, random switches, or broad hardware support". Items (2) and the SoC half of (3) explicitly target stock JetPack 6 / Ubuntu 22.04 arm64 hosts, Jetson Orin 8–32 GiB SoCs, and GA10B — none of which appear as a target anywhere in the charter or the roadmap. The PR description cites no maintainer request or sign-off for that target, and AGENTS.md:201-206 says a feature request or passing tests do not waive the requirement.
Related, same principle: the new native TU is a new indirection layer in vendored native code — roce_proxy_dlopen.c #includes the unmodified roce_proxy.c and redefines 17 ibv_* names as static trampolines. AGENTS.md:188-193 rejects "fallback layers … without a concrete requirement"; here the requirement is concrete and stated (arm64 release must run without libibverbs1), so the approach is defensible — but it should be justified for the target that needs it, not applied blanket to every build (see nit 7).
Recommendation: record which of the four outcomes was the maintainer-requested one, and either obtain the sign-off for Orin/GA10B or split the SoC-specific budgeting and arm64 packaging changes out of the CUDA 12 fix.
4. The check that the release fix targets was not run
.github/workflows/release.yml:37-53 (not opened) and the PR's own evidence section.
The workflow's linux matrix already contains an arm64 leg (os: ubuntu-24.04-arm, with build-packages: libibverbs-dev) and runs the ELF/GLIBC_ verification and the ubuntu:22.04/ubuntu:24.04 clean-container smoke checks per leg (release.yml:58-121). The author lists as unrun: "Native aarch64 build and ubuntu-24.04-arm CI run". docs/design-review.md:247-251 is explicit: "Disclosure does not excuse skipping runnable CPU checks … noting it as a limitation does not make the omission acceptable." The headline claim of this PR — flare-linux-arm64.tgz starts on stock JetPack 6 — is exactly the leg that was not executed, and it is runnable on the runner the repository already uses. docs/design-review.md:106-115 likewise requires "disclose unrun checks and material limitations", which was done, but disclosure is not a substitute for a runnable check.
Fix: run the linux arm64 job (workflow_dispatch is enough) or at minimum a native cargo build --release --features roce on arm64 with the ELF checks applied, and attach the output before treating the portability claim as established.
5. Docs state arm64 JetPack 6 support as present qualification on unrun evidence
docs/release.md:30-31, docs/multi-host.md:48-50.
docs/release.md:30-31: "The Linux executables are built in Ubuntu 22.04 and require glibc 2.35 or later (covering Ubuntu 22.04+, JetPack 6, and Ubuntu 24.04+)." docs/multi-host.md:50: "Both builds load libibverbs.so.1 lazily at run time only when opening a …". AGENTS.md:52-60 requires documents to "State support as present qualification: what is implemented, the hardware and configurations on which it is qualified, and what is not qualified", and to record unrun checks in docs/TODO.txt, not in design documents.
The only evidence offered for JetPack 6 is (a) an x86_64 build inside ubuntu:22.04 and (b) a readelf/GLIBC_ read on the amd64 artifact. Nothing establishes the arm64 archive's glibc ceiling, its absence of a libibverbs.so DT_NEEDED entry, or that it starts on JetPack 6. The claim in the prose is therefore ahead of the evidence.
Fix: run finding 4's job and keep the wording, or qualify these two passages to arm64 as "built, not yet qualified on JetPack 6" and move the unrun check to docs/TODO.txt.
Verified, no defect
eos/src/unix.rs:85-119map_host—MAP_POPULATEremoved,madvise(MADV_HUGEPAGE)before faulting, thenmadvise(MADV_POPULATE_WRITE)with a page-stridewrite_volatilefallback. On kernels older than 5.14 themadvisereturnsEINVAL,populatedstays false, and the byte loop runs — correct. A partialMADV_POPULATE_WRITEfailure likewise falls into the loop, which writes into the mapping — also correct. The discarded return value means nothing distinguishes a THP-backed prefault from a 4 KiB loop, which is worth a comment only. The manual fallback runs synchronously over the whole mapping, butMAP_POPULATEdid the same work insidemmap, so no new cost. No concrete defect; do not raise.- Host-budget arithmetic —
selene/src/offload.rs:806-838(host_service_headroom_bytes,host_reserve_bytes,host_pool_budget_from) is now the single definition, consumed byhelios/src/runtime_core/memory.rs:183-190; the previous duplicate constants inmemory.rsare gone, which is the right layer.integrated_offload_host_budget(memory.rs:195-221) dropping both reserves under an explicit--memory-limitmatchesbudget()'s existingexplicit_limitrule and the updated prose atdocs/prefix-cache-offload.md:1142-1143("64 MiBat or below16 GiBtotal RAM,min(2 GiB, total / 32)above16 GiBplus five percent"), which agrees withhost_service_headroom_bytes. Theplanned_offload_host→prepare_with_inputs_budget→headroom_with_inputs_for_budgetround trip (memory.rs:1102-1112,model.rs:967,selene/src/offload.rs:603-619) is sound becausemax_activeand the layout are identical on both sides, sointake_slots(...).min(budget/record)reproduces the same intake. helios/src/execution/roce.rs:191-195—roce_ensure_libibverbsis called after the ABI/layout/topology preflight (125-190) and beforeroce_create(199-216); thewrite_bytesat198is after the check, so a missing library leaves the region untouched. Correct placement.
Nits
- Dead public API added alongside a live one —
selene/src/offload.rs:856-885host_pool_budget_with_reserve:host_pool_budgetcalls it withtrue(851-853) and nothing in production calls it withfalse; theapply_reserveplumbing is exercised only from tests (selene/src/offload/tests.rs:720-723). This is the "unsupported abstractions and churn" case inAGENTS.md:188-193. Fix: inlinehost_pool_budget_from(available, total, future, true)intohost_pool_budgetand drop the wrapper. Related shape nit:prepare_with_inputs_budget(selene/src/offload.rs:522-533,helios/src/offload/mod.rs:105-129) is a 9/10-argument function on a#[allow(clippy::too_many_arguments)]path behind anOption<u64>plus a parallelheadroom_with_inputs/headroom_with_inputs_for_budgetpair (selene/src/offload.rs:117-206); only one production caller (helios/src/runtime_core/model.rs:967) passesSome, allNonecallers are tests. A single requiredhost_budget: u64resolved once at the entry point would remove three wrappers. - x86_64 behaviour change unstated in the description —
helios/build.rs:67-77gates the dlopen shim only on#[cfg(feature = "roce")], with notarget_archgate: any--features rocex86_64 build now goes throughdlopen, so an RDMA host that previously failed at process start now starts and fails only when opening multi-host RoCE. The description frames the dlopen work as an arm64/JetPack 6 fix. Not a code defect (it matches the newdocs/multi-host.mdwording), but the description understates it. - Stale CUDA symbol list in prose —
docs/prefix-cache-offload.md:645-655lists whathelios/src/cuda.rsbinds and now says the batch path falls back to per-entrycuMemcpyAsync, but does not saycuMemcpyAsyncbecame a required entry point (cuda.rs:303via thesymbol!macro at239-248), i.e. a driver missing it fails at load, not at copy time. Add it to the list, and updatecopy_batch's contract per finding 2.
Open questions
- Which of the four bundled outcomes is the maintainer-requested one, and is there sign-off for Jetson Orin GA10B / 8–32 GiB SoC support (charter Non-Goals,
AGENTS.md:171-175)? Neither is stated in the description; this is the one question that changes the disposition from "should fix" to "reject" or "fine". - What status does each of the four host-NUMA calls actually return on GA10B and on Windows WDDM? Only a live run distinguishes "platform unsupported" from a genuine
INVALID_VALUEand would justify or refuteis_host_numa_unsupported's status-1 arm. - Whether the arm64 archive's glibc ceiling and
DT_NEEDEDset equal the amd64 artifact's — only the unrunubuntu-24.04-armleg can show it, which is finding 4.