Explore scratchpad · NVIDIA/hyperflare-inference #646

Raw Markdown for agents: https://autobot.eidonix.com/p/1261e32e-e0a1-4d5e-bf7f-1d0fdf211c07.md

#1 [high] Change: PR #646 scope and size

PR #646 "Unify Orbit rank cache, fix GB10 page-cache KV sizing, consolidate NVML, and harden flare-agent", author lukealonso (COLLABORATOR, priority contributor per charter), opened 2026-11-30, base main, head ec1df84, open + ready for review, CI passed on head, no reviews, no comments (pr_comments returned "No comments"). Discord: lukealonso.

Files (29, +2597/-1217) by area:

Bundles FOUR independent changes with unrelated risk profiles: (1) Orbit rank cache unification/CLI, (2) GB10 page-cache + KV sizing, (3) flare-agent security/process lifecycle, (4) NVML FFI consolidation + ordinal bug. Also touches 5 crates (flare-cli, helios, flare, heliopause, selene) with no Cargo.toml/Cargo.lock changes.

#2 [high] Why: linked issues #119/#361/#629/#630 and the asks #646 does and does not cover

#119 (open, bug, P1, area:caching+orbit, by nero-, opened 2026-10-28): orbit agent's evict of ~/.cache/flare/packages (or cores/) deleted a completed 490 GiB flare download store on a DGX Spark rank-0 host; log lines "removed superseded .../{blobs,locks,models,origins,refs,sources,staging}". Refetch took 2 hours. Two proposed directions: separate default dirs, or restrict cache::evict to agent units. #646 says "closes #119".

#361 (open, enhancement, by yatesdr, COLLABORATOR, 2026-11-18): "Store Orbit rank files in the shared model cache" — documents that #147's skip list copies names other modules own and already missed transport; cites docs/core-format-design.md "One Rust-owned model cache" end state (Ignition export, Flare acquisition, Orbit rank distribution all through helios/src/core/cache.rs). Acceptance: agent push into a cache with downloaded models + in-progress download leaves both intact; pinned rank entries survive; old cores//packages/ agent caches handled by a stated rule. Carries a long flare-autobot verification comment (2026-11-30 11:41) enumerating divergences at main c146d7be: Agent::cores lists model-cache internals one level deep; Agent::run passes --core-cache <agent.cache> instead of resolved root (#629); hello/status report free_bytes of agent.cache; core_cache.rs:479-505 puts digest-named legacy companions in an uncollected ~/.cache/flare/blobs/; distribution.rs:735-798 peer bootstrap only looks up sources/<sha256("{export}-rank{rank}")> and misses prestaged orbit push rank dirs. The autobot proposed a ranks/<id> namespace with lock hierarchy — #646 instead commits ranks into models/<model>/<entry>/. That is a DIFFERENT design from the one proposed in #361's comment; worth flagging.

#629 (open, bug, P2, by pfn, 2026-11-30): orbit run staged the full peer rank-1 core (101 files, 167.5 GiB) under default ~/.cache/flare/cores on the controller host even with explicit --core-cache and agents' [paths].core_cache; disk fell 350→14 GiB; "Distribute rank cores over CX7" 247.2s vs 2.3–6.1s when peer already held the core. #646 says it "fixes" the shared-Root/Core-cache propagation half (mentions, not closes — the packet says "this mentions").

#630 (open, bug, P2, area:memory, by pfn, 2026-11-30): GB10 unified memory — page cache from flare's own distribution re-hash pollutes MemFree; KV budget 13.75–14.44 GiB / 2.08–2.19M tokens vs 22.20 GiB / 3.43M tokens on a clean baseline; also cuCtxCreate_v2 failed (2, CUDA_ERROR_OUT_OF_MEMORY) at MemFree 0.8–1.5 GiB while MemAvailable ≈116 GiB. Asks: reap page cache before KV planning, warn when page cache limits the budget, print MemFree/MemAvailable/Cached on failure. Related to #73 (export-time vm.min_free_kbytes cousin). #646 "closes #630" — but PR description does NOT claim ask #2 (warning log) or #3 (diagnostics print), only the release_page_cache no-op fix. This is a partial fix relative to the issue's asks.

#3 [high] Related work: open PR #147 fixes #119 via a skip list and is superseded by #646

#147 (open PR, efegokdemir, opened 2026-10-30, head 130e6ba, +90/-12, 4 files: docs/core-format-design.md, docs/orbit.md, flare-cli/src/core_cache.rs, flare-cli/src/orbit/agent.rs): adds is_model_cache_directory skip list (blobs, models, refs, sources, origins, staging, locks — later +transport) in flare-cli/src/core_cache.rs so evict no longer deletes the prepared-model cache. Says "Fixes #119". Cited fixes +3.

Status: yatesdr CHANGES_REQUESTED 2026-11-18 (blocking: take reserved names from owning modules, rewrite description) and flare-autobot "Changes Requested" 2026-11-26 (same blockers; also asks to add publishers/, remove the kind parameter, cut ~33 of +90 lines). original-el8 explained that eviction also removes Hub transport/ (resumable download resumes) because its cache_dir is cleared for Orbit DOWNLOAD. Head has not moved since 2026-11-13.

OVERLAP with #646: #646 implements the #361 end-state design (#147's "larger, maintainer decision" alternative) and additionally keeps a skip list as "defense-in-depth" in core_cache::evict. So #646 overlaps #147's entire change and would make it redundant, but #646 does NOT mention #147 in its list of closed issues — it only lists #119, #361, #629, #147 as issues it closes (the PR body says "closes #119, #361, #629, #147"). So #646 does claim to close #147. Nobody has said so on #147 yet, and #147's reviewers are still waiting for revisions. Whoever decides #646 should know that merging it strands #147 (and that #147's reviewer yatesdr is the author of #361).

#4 [high] Related work: merged #497 built the intake cap that #646 widens

#497 (MERGED 2026-11-29, author FujitsuPolycom CONTRIBUTOR, +1809/-360, 16 files incl. selene/src/offload.rs, helios/src/runtime_core/memory.rs, docs/prefix-cache-offload.md): "Reduce disk offload restore latency and integrated-memory intake overhead". Introduced target_intake_slots/sized_concurrency and bounded integrated GPU disk-only intake to intake_slots(layout, 1). Had 3 autobot review rounds + 1 human (FujitsuPolycom self) iteration; final autobot recommendation "Ready To Merge".

#646 BUILDS ON #497: extends the same target_intake_slots/sized_concurrency bound from memory_bytes == 0 && disk_enabled() to ALL integrated-GPU local offload tiers including memory_bytes > 0 (selene/src/offload.rs +7/-13 in #646), and updates docs/prefix-cache-offload.md (the same doc #497 edited: #497 +51/-15, #646 +2/-2). It is a modification of code #497 landed two days earlier — same function, opposite direction of generality (wider cap). The person who wrote that logic (FujitsuPolycom) has not been pinged; #646 has no comments at all.

Also #646's helios/src/runtime_core/memory.rs planned_host_future change touches the same function #497 edited (integrated_offload_host_budget / host budget in memory.rs), and the test name integrated_offload_host_budget_matches_small_soc_scaling_and_explicit_limits is reused from #497's test suite (per #497 evidence list).

#5 [high] Claims and evidence: #630 partially addressed; NVML defects have no issue

Claims/evidence cross-check for #646:

  1. GB10 (closes #630): #630 asks for THREE things: (a) reap reclaimable page cache before KV planning or size from MemFree, (b) log a one-line warning when reclaimable page cache limits the KV budget, (c) on the cuCtxCreate failure path print MemFree/MemAvailable/Cached. #646 implements only a narrow version of (a): PayloadSource::release_page_cache() now calls crate::os::release_page_cache (POSIX_FADV_DONTNEED) per deduped Arc (helios/src/runtime_core/protection.rs:1913-1920 in PR head; trait Files::release_page_cache at helios/src/runtime_core/payload.rs:113). It is invoked before CUDA init and again before allocate_caches at helios/src/runtime_core/model.rs:617 and :910 (both pre-existing call sites; the payload impl was the no-op). No budget-accounting change (still MemAvailable-style), no warning log, no diagnostics on cuCtxCreate failure → asks (b) and (c) unmet, and the "plans from MemFree" part is addressed only by freeing flare's own pages. The PR does not claim (b)/(c), but it says "closes #630", which overstates. Also unmeasured on GB10 (declared unrun).

  2. NVML consolidation: no GitHub issue exists for either the ~1,800 FDs/hr leak or the CUDA_VISIBLE_DEVICES ordinal bug (search_items "NVML file descriptor leak" returns only #646; "CUDA_VISIBLE_DEVICES ordinal" returns nothing). So two of the four bundled changesets fix defects with no bug report/triage label and no reproduction from a user — they rest on the author's own analysis. The 2s polling interval is verified: flare/src/hardware_monitor.rs:25-28 Self::start_with(Duration::from_secs(2), || inventory()...). 2s period = 1800 cycles/hr → matches the "~1,800 FDs/hr" figure arithmetically. Ordinal bug verified in diff: flare/src/hardware.rs assign_visibility matched numeric CUDA_VISIBLE_DEVICES entries against the filtered slice index (|ordinal| index == ordinal as usize) and now compares device.ordinal == ordinal; test gpu_inventory_visibility_matches_nvml_ordinal_when_non_cuda_devices_skipped added. New loader: helios/src/nvml.rs (+378), Nvml behind OnceLock, library never unloaded / nvmlShutdown never called (documented at helios/src/nvml.rs:6-11). Disclosure: never shutting NVML down is a deliberate process-lifetime resource tradeoff, not a fix of the underlying driver behavior.

  3. Ride-along changes NOT in the "Why" list (undeclared in the summary bullets, only partly visible in "What changed"):

    • flare-cli/src/doctor.rs +123/-259 (the largest delete in the PR) and flare-cli/src/orbit/gpu.rs +68/-227 — pure migration of duplicated NVML FFI to the shared loader (~486 lines removed).
    • heliopause/src/export/capture.rs +21/-46 — also NVML migration.
    • flare-cli/src/fabric_transport.rs +112/-28 — stray LAN probe tolerance (declared in description body, not in title).
    • distribution::root now ignores (continues past) incompatible/duplicate/protocol-mismatched rendezvous joins instead of failing the launch (flare-cli/src/distribution.rs:196-220). Description says only "drop stray LAN probes without aborting active transfers"; in fact a malformed or duplicate-rank join from a real rank now also just logs and keeps waiting, which changes failure behavior for genuine cluster misconfiguration (a duplicate rank now times out after the rendezvous wait instead of erroring immediately).
    • launch.rs: --hosts manual peers now pass Shape::Mesh to rank_options and rely on Grant.roce_ring/roce_chain; core path resolves a directory to model.safetensors (flare-cli/src/launch.rs:118-160).
    • main.rs load_core: tensor_parallel for --hosts = hosts.len()+1 (flare-cli/src/main.rs:451); trust.rs mirrors it (flare-cli/src/trust.rs:41-48).
    • agent.rs: free_bytes in HELLO/STATUS now reports the core cache (not ~/.cache/flare) — an observable behavior change for placement/UI; Agent::install writes --core-cache into the systemd unit (agent.rs:2316-2323), so reinstall can pin a stale path.
    • agent.rs session: bounded sessions 1024 total / 256 pre-auth (agent.rs:296-303), FETCH/FETCH_FABRIC clear the preauth slot on authorization.
    • HELLO/status now advertise a different free_bytes; cores() reports published entries + unverified staged dirs.
  4. Description says "Agent::grant() enforces grant.current(now()) across TRANSFER, FETCH, FETCH_FABRIC, and RUN" — verified: the check moved from run() into grant() (agent.rs:937-941), so all four paths now reject expired grants; new test covers all four.

#7 [high] People and community: priority contributor, area owner, issue reporters not engaged

People:

#8 [high] Recent activity and related work: stacked on author's own merges, conflicts with open #625 and #647

Six distinct PRs touch helios/src/runtime_core/memory.rs + selene/src/offload.rs + selene/src/offload/tests.rs + docs/prefix-cache-offload.md — the unified-memory budgeting area #646 edits: #323 (closed 2026-11-30 by yatesdr as superseded by c9935887/#589), #497 (merged 11-29), #589 (merged, lukealonso), #504 (merged), #625 (open, autobot-authored, +1621/-109), #628/#621 (open). So #646's selene/offload.rs + memory.rs hunks land in the most-contended file set in the repo right now, and #625 is open with "Ready To Merge" from autobot on the same selene/src/offload.rs prepare_with_inputs_budget region (#625 adds PrepareTimings and prepare_with_inputs_budget_with_progress in that function). #646 changes the same function's sized_concurrency/required_intake lines → textual conflict with #625 likely.

#323 relevance: proposed a configurable --system-headroom for unified-memory sizing, with GB10 measurements (three 121.6 GiB DGX Spark hosts: default 6.08 GiB headroom → 8.17M KV tokens; 2G → 13.06M, +60%). yatesdr closed it 2026-11-30 saying --memory-limit=-4G / [memory] reserve = "4G" now covers it. Same operator-facing problem #630 reports; a maintainer has already ruled that the answer for this class of GB10 KV-capacity complaint is "use --memory-limit / reserve", not new sizing logic — relevant precedent for reading #646's "closes #630".

Recent activity in touched areas (search_history + orientation packet):

Net: #646 is stacked on the author's own recent merges (#497, #589, #598, #618, #620) and collides with his own still-open #647 (heliopause/src/export/capture.rs) and with autobot's open #625 (selene/src/offload.rs). No competing external PR does the same work; #147 is the only overlapping alternative and is strictly narrower.

#6 [medium] Change: verified size, crate spread, no Cargo changes, old flat cache retained for bin/ and staging

Scope/size facts verified from the diff and file list: