Case file — PR #646: Unify Orbit rank cache, fix GB10 page-cache KV sizing, consolidate NVML, and harden flare-agent
Author: lukealonso (COLLABORATOR; Discord: lukealonso). Opened 2026-11-30, base main, head ec1df84, open and ready for review, CI passed on head, 0 comments, 0 reviews, no labels. Size: 29 files, +2597/−1217 across five crates plus two docs. Background: https://github.com/NVIDIA/hyperflare-inference/pull/646
Key findings
- Four independent changesets in one PR, one squashed commit. Orbit rank-cache unification/CLI (flare-cli), GB10 page-cache + KV/host sizing (helios, selene), flare-agent security/process lifecycle (flare-cli/orbit), and NVML FFI consolidation + ordinal fix (helios, flare, heliopause, flare-cli) share no code path and have different risk profiles (filesystem layout change vs. CUDA memory sizing vs. process/security hardening vs. FFI). No
Cargo.toml/Cargo.lockchanges. - "Closes #630" overstates what the code does. #630 asks for three things; #646 implements only a narrow form of the first (reclaim flare's own payload page cache). The requested warning when page cache limits the KV budget, and MemFree/MemAvailable/Cached diagnostics on
cuCtxCreatefailure, are absent. The PR body does not claim them. - It claims to close open PR #147, the competing skip-list fix for #119 that has been
CHANGES_REQUESTEDsince 2026-11-18 and stalled since 2026-11-13. #147's reviewers (yatesdr, flare-autobot) have not been told; yatesdr is also the author of #361. - Two of the four fixes have no issue at all (the ~1,800 FDs/hr NVML leak and the
device.ordinalvisibility bug) — no user report, no triage, resting on the author's own analysis. The leak arithmetic does check out against the 2 s polling interval. - Undeclared behaviour change in
distribution::root: malformed, duplicate-rank and protocol-mismatched rendezvous joins are now logged and skipped instead of failing the launch (flare-cli/src/distribution.rs:196–220). A duplicate-rank cluster misconfiguration now hangs to the rendezvous timeout instead of erroring immediately. The description only mentions "stray LAN probes". - Observable status/placement semantics change: HELLO/STATUS
free_bytesnow reports the core cache rather than~/.cache/flare(flare-cli/src/orbit/agent.rs:917,:2281), which feeds placement and any UI reading storage. Not called out in the description. flare agent installwrites--core-cacheinto the installed systemd unit (flare-cli/src/orbit/agent.rs:2316–2323), so a later reinstall can pin a stale cache path.- It rewrites two-day-old merged work and collides with open work. The selene change reverses the exact condition #497 (merged 11-29, FujitsuPolycom) landed, and it edits the same function region as autobot's open #625 (
selene/src/offload.rs).heliopause/src/export/capture.rs(not opened) is also edited by the author's own open #647. - Design divergence from the issue's own design comment. #361's long flare-autobot comment proposed a
ranks/<id>namespace; #646 instead publishes rank slices intomodels/<model>/<entry>/. #646 does not mention this choice anywhere. - Zero community engagement so far, though the underlying demand is recent and documented (#119 is P1 with 490 GiB data loss; #629/#630 are P2 filed by the same GB10 operator on the morning #646 opened).
The change: what it does, in plain terms
Orbit rank cache unification (flake-cli). flare agent used to ignore --core-cache/[paths].core_cache and keep flat core directories in ~/.cache/flare/cores — the default directory of Helios's managed cache root — then run core_cache::evict() over it, which is how #119 deleted a 490 GiB model store. #646 makes the agent's cache configurable (flare-cli/src/cli.rs:242–245, flag aliases --model-cache/--package-cache; default ~/.cache/flare/cores), stages in-flight PUT/TRANSFER data under <core-cache>/staging/orbit (flare-cli/src/orbit/agent.rs:699–706, :1444), and publishes verified transfers as managed helios::core::cache::Root entries with .verified and .flare-verified.json (not opened) markers and orbit:<dir>, <export>-rank<R>, <export>-complete source refs (agent.rs:713, :818, :438). Spawned flare run peers now get the agent's real cache root (--core-cache at agent.rs:1969, asserted in the test at agent.rs:4405), fixing the #629 double-staging. As defense-in-depth core_cache::evict skips Helios's seven managed directories (flare-cli/src/core_cache.rs:236–251).
GB10 / unified memory. PayloadSource::release_page_cache() is no longer a no-op; it calls crate::os::release_page_cache per deduplicated file (helios/src/runtime_core/protection.rs:1916–1918, dispatch at :538–541, test payload_source_release_page_cache_deduplicates_unique_files at :4534). NativeModel::allocate_caches routes host_future through planned_host_future so input_window is charged once (helios/src/runtime_core/memory.rs:385–388, :883, test :2078). Selene bounds all integrated-GPU local offload tiers to intake_slots(layout, 1) (selene/src/offload.rs:230–240, :606–607). Metadata-only authorizations are no longer loadable (require_loadable at helios/src/runtime_core/protection.rs:225–245, checks at helios/src/runtime_core/mod.rs:207 (not opened), model.rs:300, test authorize_metadata_is_not_loadable at protection.rs:4480).
flare-agent hardening. Grant expiry enforced in grant() rather than only in the run path (agent.rs:940 in grant(), so TRANSFER/FETCH/FETCH_FABRIC/RUN all reject expired grants). Bounded sessions: MAX_SESSIONS = 1024, separate pre-auth cap with slots released on authorization (agent.rs:301, :1109–1180, :1749, :1775). Magic-before-bulk-read and armed timeouts in the handshake. Atomic 0600 secret creation via store::atomic_write_private (flare-cli/src/orbit/store.rs:42, used by identity.rs:51 (not opened), :98, :300). Ranks get their own process group and PR_SET_PDEATHSIG (agent.rs:2055–2063), stop signals -pgid only while an atomic exited flag is clear (agent.rs:2138, :2208–2212), the reaper sets exited right after wait(), bounds the stdio-drain to 2 s and unconditionally calls finished.finish(code) (agent.rs:304, :2138–2161). Controller caps the rank-zero stop drain at 120 s (flare-cli/src/orbit/controller.rs:54).
NVML consolidation. New helios/src/nvml.rs (+378, pub mod nvml; at helios/src/lib.rs:18) loads libnvidia-ml.so.1 / nvml.dll once behind a OnceLock and never calls nvmlShutdown (stated at helios/src/nvml.rs:6–11 — a deliberate process-lifetime tradeoff, not a driver fix). Seven call sites migrated, including large deletions in flare-cli/src/doctor.rs (+123/−259) and flare-cli/src/orbit/gpu.rs (+68/−227) and heliopause/src/export/capture.rs (not opened) (+21/−46). assign_visibility() now matches numeric CUDA_VISIBLE_DEVICES entries against device.ordinal instead of the filtered slice index (flare/src/hardware.rs), with test gpu_inventory_visibility_matches_nvml_ordinal_when_non_cuda_devices_skipped.
Docs. docs/orbit.md core-caching and prestaging sections are rewritten around the new layout. docs/prefix-cache-offload.md changes "disk-only" to "local tiers (memory > 0 or local disk enabled) on an integrated-memory device".
What the description understates or omits
- Rendezvous failure semantics relaxed for genuine misconfiguration (
distribution.rs:196–220). free_bytesmeaning change in HELLO/STATUS (agent.rs:917,:2281) and its effect onStorage/placement reporting (controller.rs:339–347).flare agent installpersisting--core-cacheinto the unit file (agent.rs:2316–2323).--hostspeers now useShape::MeshandGrant.roce_ring/roce_chain;--hostsalso inferstensor_parallel = hosts.len() + 1(flare-cli/src/main.rs:451, mirror inflare-cli/src/trust.rs:41–48; core-path resolution inflare-cli/src/launch.rs:118–160).- The old flat cache module survives (
core_cache::evictis still called forbin/puts;HELIOS_CACHE_DIRSis layer two), so #361's "remove the directory scan and the skip list" end state is only partially met.
The why
- #119 (open, P1, area:caching+orbit, by nero-, DGX Spark TP4 operator, 2026-10-28): an
orbit agenteviction wiped a completed 490 GiBflare downloadstore; refetch took two hours. #646 says "closes #119". - #361 (open, enhancement, by yatesdr, COLLABORATOR, 2026-11-18): "Store Orbit rank files in the shared model cache"; documents the single-cache end state from
docs/core-format-design.md(not opened) and carries a long flare-autobot verification comment (2026-11-30) enumerating divergences at mainc146d7be, including thatAgent::runpasses the wrong root (#629) anddistribution.rs:735–798misses prestagedorbit pushrank dirs. - #629 (open, P2, by pfn, 2026-11-30):
orbit runstaged a 167.5 GiB peer rank core under the default~/.cache/flare/coresdespite--core-cache; controller disk fell 350→14 GiB; distribution took 247.2 s instead of 2.3–6.1 s. #646 mentions rather than closes it. - #630 (open, P2, area:memory, by pfn, 2026-11-30): GB10 page cache polluted
MemFree, cutting KV budget from 22.20 GiB/3.43M tokens to 13.75–14.44 GiB/2.08–2.19M tokens, pluscuCtxCreate_v2 failed (2)at 0.8–1.5 GiB MemFree with ~116 GiB MemAvailable. Three asks; #646 handles only the first, partially, and is unmeasured on GB10. - The NVML leak/ordinal defects have no issue (
search_itemsfor "NVML file descriptor leak" returns only #646; "CUDA_VISIBLE_DEVICES ordinal" returns nothing). The 2 s poll that produces ~1,800 init/shutdown cycles per hour is real:flare/src/hardware_monitor.rs:25–28.
Related work
- #147 (open PR, efegokemir, +90/−12, 4 files): the skip-list fix for #119 (
is_model_cache_directoryinflare-cli/src/core_cache.rs).CHANGES_REQUESTEDby yatesdr on 2026-11-18 (reserved names must come from owning modules; rewrite description) and again by flare-autobot on 2026-11-26 (alsopublishers/, drop thekindparam, cut ~33 lines). original-el8 noted eviction also wipes Hubtransport/, breaking resumable downloads. Head frozen since 2026-11-13. #646 supersedes it and adds its own skip list, yet nobody has commented on #147 to say so. - #497 (merged 2026-11-29, FujitsuPolycom, +1809/−360): introduced
target_intake_slots/sized_concurrencyand the integrated disk-only cap; three autobot rounds plus author iteration, "Ready To Merge". #646 widens the condition it landed (selene/src/offload.rs:230–240) and edits the samememory.rshost-budget function; its new test reuses theintegrated_offload_host_budget_*name. FujitsuPolycom has not been pinged. - #625 (open, autobot-authored, +1621/−109, autobot "Ready To Merge"): adds
PrepareTimings/prepare_with_inputs_budget_with_progressinside the sameprepare_with_inputs_budgetregion (#646 editssized_concurrency/required_intakeatoffload.rs:606–607) — likely textual conflict and clear semantic overlap in the same budget logic. - #323 (closed 2026-11-30 by yatesdr): configurable
--system-headroomfor unified-memory sizing, with DGX Spark measurements (3×121.6 GiB hosts; 6.08 GiB default headroom → 8.17M KV tokens, 2 G → 13.06M, +60%). Closed as covered by--memory-limit=-4G/[memory] reserve = "4G"(landed via #589). A maintainer has already ruled that this class of GB10 KV complaint is answered by configuration, which is context for reading #646's "closes #630". - #589, #598, #618, #620 (all merged, all lukealonso) are the state #646 is stacked on:
helios/src/core/cache.rs,heliopause/src/export/capture.rs(not opened) andhelios/src/runtime_core/protection.rs(#618),orbit/gpu.rs+controller.rsplatform matching (#598). - #643, #645, #647 (open, same author, same day): #647 also edits
heliopause/src/export/capture.rs(not opened) (its D2H path) while #646 migrates NVML calls there — two of the author's own open PRs overlap on one file. #504 (merged) and #554 (open draft) also sit in the offload/Engram file set.
Recent activity in the touched areas
flare-cli/src/orbit/agent.rs: previous edits were 9de65fbd (2026-11-17, lukealonso, "Reuse cached core payloads…") and 70069281 (2026-11-13, Jason Cook, RoCE rails); no other author since 2026-11-09. #646 is effectively a rewrite of the author's own two-week-old code.flare-cli/src/core_cache.rs: unchanged since da037284 (2026-11-22) / fa158284 (2026-11-09) — i.e. #147's skip list never landed, so #646 replaces a fix that was still in review.docs/prefix-cache-offload.mdandselene/src/offload.rs: changed 11-29 (#497, #589, #607, #496), 11-28, 11-25 (#504) — the most contended file set in the repo right now. Six recent PRs touchmemory.rs+offload.rs+offload/tests.rs+ that doc: #323, #497, #589, #504, #625, #628/#621.helios/srcis the busiest crate (#644, #637 merged 11-30; #626, #620, #619, #618 before), overwhelmingly by this author; #646 builds directly on those merges rather than conflicting with them.
People
- Author: lukealonso, COLLABORATOR, one of the three priority contributors named in the charter; 27 merged PRs and 3 open in 180 days; dominant committer in every touched area (helios/src 230 commits/180d, docs 385, flare/src 65, heliopause 60, flare-cli/src 17). He is the area owner of essentially everything this PR touches.
- Issue reporters not engaged: nero- (#119), yatesdr (#361; also #147's blocking reviewer), pfn (#629, #630). original-el8 (priority contributor) wrote the transport-eviction analysis on #147. None were pinged in #646's description; the only channel offered is "Discord: lukealonso".
- Area regulars who could own review but have not appeared: yatesdr (36 commits in selene/src, 47 helios/src), Martin Vit (52 helios/src), Jason Cook (agent.rs, heliopause), eugr (flare-cli), FujitsuPolycom (#497's intake logic).
Community
Nothing on the PR itself: no comments, no reviews, no labels, no reactions; autobot has not opened a case file or review for #646, unlike #147 and #497. Demand signals live on the issues instead: #119 is P1 with real data loss, #629/#630 are P2 from a single DGX Spark operator filed hours before this PR, #361 is collaborator-filed with a long autobot design comment.
Project fit (charter, as facts)
- Aligns: charter line 22 ("Support single-host and cross-node serving, with Orbit handling placement and supervising serving ranks"), line 24 (prefix-cache checkpoints in host memory shared via Selene), line 35 ("PRs that address a maintainer request, a roadmap item, a reproducible bug, a measured performance/memory issue, or bad docs"), line 42 ("Check interactions across every supported model, cache scheme, parallel layout, multi-host setup, and hardware target named in the docs… verify that existing data, artifacts, and exported cores still load"), line 3 (DGX Spark focus).
- Tension: line 10 "Stay focused… not interested in piling on extra model aliases, random switches, or broad hardware support" — #646 bundles four unrelated defect families and one process-wide FFI loader swap, and touches five crates' internals. Line 12 ("keep the runtime small and model-agnostic") is not at risk; this is scheduling/cache plumbing, not per-model branches.
- The charter's priority-contributor weighting is the main reason a self-authored 2.6k-line rewrite of the author's own recent code is procedurally normal here.
Claims and evidence
| Claim | Evidence | Gap |
|---|---|---|
closes #119 |
skip list at core_cache.rs:236–251, staging never evicted agent.rs:1444–1446, test at agent.rs:4430+ (put_and_transfer_preserve_managed_cache_and_enforce_grant_expiry) |
Verified logically on CPU; no test with a real flare download store |
closes #361 |
publishes into Root models/sources, Agent::cores() reports published entries |
Uses models/<model>/<entry>, not the ranks/<id> namespace #361's design comment proposed; old cores/ layout migration rule not stated in the PR |
| mentions #629 | spawned peers get --core-cache <agent.core_cache> (agent.rs:1969, asserted :4405) |
Issue itself not closed; live 4-Spark verification unrun |
closes #630 |
release_page_cache real (protection.rs:1916), input_window once (memory.rs:383–388), integrated cap widened (offload.rs:230–240) |
Asks (b) warning and (c) failure diagnostics missing; no GB10 measurement (declared unrun) |
closes #147 |
same effect achieved inside #646 | PR #147 still open with two blocking reviews, its author not told |
| NVML leak ~1,800 FDs/hr | 2 s poll (hardware_monitor.rs:25–28) × init/shutdown per query → arithmetic matches; OnceLock loader never shuts down |
No issue, no reproduction, no FD count measured before/after |
| ordinal visibility bug | diff: slice index → device.ordinal; new test |
No issue, no user report |
| All suites pass | claimed per-crate counts (eos 2, selene 548+1, helios 504/12 ignored, flare all, flare-cli 208 unit + 26 integration, heliopause 216/6 ignored) | One flake declared (actual_load_core_leases_managed_local_entries_and_releases_on_failure fork-vs-flock race); Windows nvml.dll, GB10 KV tokens, 4-Spark push/run, FLARE_TEST_TEMPLATE_DIR unrun |
Reach
- Operators: default agent cache root is now
~/.cache/flare/cores, configurable via--core-cache/[paths].core_cache;docs/orbit.mdcore-caching and prestaging sections are rewritten;flare orbit coresreports published and staged entries; storage freed byflare models remove/gcrather than by receiving. STATUSfree_bytesnow describes the core cache. - Cluster behaviour:
orbit push-staged rank slices are now reused byorbit run(the #629 win); rank zero is verified after controllerPUT; saved persistent groups no longer get duplicated--roce-ring/--roce-chain;--hostslaunches accept the managed entry dir and infertensor_parallel. - Security/process: expired grants rejected on all four verbs, pre-auth session cap,
FLAREFLTmagic validated before bulk reads,0600+O_EXCL+fsync+rename secret writes, process-group/PDEATHSIG isolation and a bounded reaper drain, 120 s cap on rank-zero stop. - Hardware/memory: GB10 page-cache reclamation and once-only
input_window; all integrated-GPU local offload tiers capped atintake_slots(layout, 1)— a behaviour change for integrated hosts with warm offload memory configured (fewer intake slots than before). - No dependency churn: zero
Cargo.toml/Cargo.lockedits;libloadingalready a helios dep (helios/Cargo.toml:49) and windows-sysWin32_System_LibraryLoaderalready present (:142);flare/src/hardware.rsdrops its direct libloading use. - Compatibility gaps not addressed in the description: what happens to cores already staged under the old flat
~/.cache/flare/cores/<export>…layout (docs no longer mention those paths);agent installbaking--core-cacheinto the unit; and Windows build of the newnvml.dllpath (declared unrun).
Process
Ready for review (not draft), single squashed commit ec1df84, CI green on head, no reviewers assigned, no labels, opened and last updated the same day (2026-11-30), so zero review latency yet. Autobot has not reviewed it. Merge-strategy note: merging #646 strands #147 and will conflict with open #625 (selene/src/offload.rs) and likely #647 (heliopause/src/export/capture.rs (not opened)).
Open questions / could not find
- Whether pre-existing flat
cores/agent caches are migrated, ignored or deleted — #361's acceptance criteria explicitly ask for "a stated rule", and #646's docs rewrite simply stops describing them. - Why
ranks/<id>(the design in #361's autobot comment) was abandoned formodels/<model>/<entry>; no discussion on the PR. - Whether a duplicate-rank rendezvous join timing out instead of erroring is intended (
distribution.rs:211–220). - Effect of the new
free_bytesmeaning onplan::Pool::holds/placement and any dashboard consumer. - Actual FD-count before/after and GB10 KV-token capacity after reclamation: both claimed, neither measured.
- Any intent to notify or close #147/#497's author.