Explore scratchpad · NVIDIA/hyperflare-inference #667

Raw Markdown for agents: https://autobot.eidonix.com/p/db5ce7e7-afcd-4344-aed2-43b0ff87460e.md

#1 [high] Change: scope and file map of PR #667

PR #667 (open, ready for review, opened 2026-12-01, head 7908ac3, base main, 25 files +1588/-352, no labels, no reviews, CI passed).

Five defect bundles:

  1. Orbit payload integrity: flare-cli/src/orbit/grant.rs (+26), controller.rs (+299/-37), agent.rs (+679/-69); cli.rs (+55), launch.rs (+6).
  2. Page-cache release: eos/src/unix.rs (+13), windows.rs (+1), helios/src/lib.rs (+1/-1), helios/src/runtime_core/model.rs (+3), protection.rs (+6/-2), flare-cli/src/distribution.rs (+27/-10), core_cache.rs (+3), orbit/agent.rs.
  3. Unix flock explicit LOCK_UN: helios/src/core/cache.rs (+37/-1), conversion.rs (+8), flare/src/file_lock.rs (new +168), lib.rs (+1), hub.rs (+8/-99), download_cache.rs (+19/-88), trust.rs (+2/-17).
  4. Multi-host peer export caching: heliopause/src/export/{mod (+5), capture (+115/-22), transfer (+94/-3)}.rs; ignition/preparation/{core_snapshot (+3/-1), host_ranks (+8/-2), runtime_core (+1)}.py.

Key new API surface added:

Note: description says "Single-host describe() appends the first 8 bytes (16 hex chars) of authorized.envelope_digest() to export" — confirmed in diff. Note: export format is model-<16 hex> — this changes cache directory naming for ALL single-host payload cores (not only colliding ones), i.e. every existing single-host payload core cache entry becomes a cache miss after upgrade.

#2 [high] Change: Orbit envelope binding and TP forwarding in detail (#667)

#3 [high] Why: issue #630 and what #667 does/does not cover of it

#630 "GB10 unified memory: KV budget and cuCtxCreate respond to page-cache-polluted MemFree, not MemAvailable" — open, labels area:memory, bug, performance, priority:P2, triage:investigate; opened 2026-11-30 by pfn (not the author).

Sources: issue #630 body + its 2026-12-01 comment.

#4 [high] Change: page-cache release sites (#667, #630)

Page-cache half of #667 (#630):

#5 [high] Change: Unix flock LOCK_UN on drop (#667)

#6 [high] Change: multi-host peer export caching (#667)

#7 [high] Related work: stacked and overlapping PRs

#9 [high] Project fit: charter mapping and stale docs

Charter (read_charter) points that bear on #667:

#10 [high] Change: undeclared behaviour and open questions

Undeclared / under-declared behaviour changes a reader could not learn from the description:

  1. Controller skips its own cache pre-check when the source is the target node. flare-cli/src/orbit/controller.rs:2031 if source.public_key != node.public_key { ...have/check_space/print... }. Previously the loop always ran; now intra-node transfers get no check_space free-space guard and no "fetching N from X" line. Not mentioned anywhere in the description.
  2. Every existing single-host Payload core cache entry becomes a miss. The export name changes from model to model-<16 hex> for all single-host payload cores (controller.rs:2434-2457), so Grant.cache_directory()/complete_directory() (grant.rs:150-157) produce new directory names on the agent. Combined with "unverified staging hits are refused when an envelope is bound" (agent.rs:1581-1586) this forces a re-transfer of previously cached single-host payload cores once, and leaves the old <export>-<len> entries behind (docs/orbit.md:518-520 notes legacy flat dirs "are not migrated automatically"). The description frames the change as only preventing collisions.
  3. agent::run now re-opens and re-verifies the sealed core before every launch when an envelope is bound (verify_envelope_on_run, only true via Agent::new; agent.rs:2177-2194). That is an extra VerifiedCore::open (header/index metadata parse) per rank launch on the production path; with_fakes agents don't do it, so tests other than the new ones don't exercise it.
  4. --verify-weights regression risk for controller-present cores. controller.rs:1165 sets run_args.serving.verify_weights = verify_weights only on the CoreReference::Local branch, and verify() → trust::load(...) → RuntimeCore::open(..., None) for Payload cores before describe() can learn tensor_parallel (controller.rs:2382-2396 vs 2423). So an orbit run --verify-weights of a multi-deployment Payload core can still fail/exclude deployments at the controller even though the numeric TP is only recovered afterwards; the PR rests on the user having passed --tensor-parallel so load_with supplies it (trust.rs:41-49). Also this flag is written into ServingOptions after rank_options() may already have been derived elsewhere.
  5. tensor_parallel is Some(n) for every Payload core, including plain TP1. describe() sets it whenever identity.tensor_parallel > 0 (controller.rs:2423); that makes strip_tp true in agent::run (agent.rs:2229) and grant.core.tensor_parallel.is_some() route open_verified_core to VerifiedCore::open_tensor_parallel(..., tp, rank_id) for cores that previously used plain VerifiedCore::open (agent.rs:496-506). Behaviourally equivalent only if open_tensor_parallel matches open for a single-deployment core.
  6. tensor_parallel is sent as a joined list. ServingOptions::rank_options emits --tensor-parallel 1,2 when several are configured (cli.rs:1167-1177), while agent::run emits a single scalar from the grant; agent::run strips any --tensor-parallel from serving only when grant.core.tensor_parallel.is_some(), which is always for real cores.
  7. New failure mode replaces an old silent one. Where a colliding cache previously launched stale weights, a launch can now fail with "signed envelope differs from the grant" / "staged core signed envelope differs from the grant" — correct, but a hard stop for anyone whose staged bytes don't match (e.g. a core re-exported in place).
  8. Page-cache release drops the kernel's readahead benefit for everything read through these paths, not only GB10: sha256_file, every serve_source range, every verified payload, every stored blob. Declared as intended, but the cost (re-reads from disk/network on any later pass, e.g. hash-then-transfer of the same file) is not discussed.
  9. agent::fetch now sleeps nowhere but releases the page cache of ranges it just sent — on a peer that serves the same ranges repeatedly (#93-style warm restart), it will re-fault them from disk each time.
  10. flare-cli/src/launch.rs:144-149 adds the envelope/TP to --hosts grants via core.identity().ok() — an error -> None swallow on the path the rest of the PR is hardening; the export is still injected into the grant so it is at least authenticated there.

#11 [high] Claims and evidence: what is backed, what is not

Claims in the description vs what backs them:

#17 [high] Research summary

Case file gathered across all nine angles; 16 scratchpad notes hold the details with file:line and PR/issue citations.

What the PR is. #667 is a single squashed commit (7908ac3, on main at a3c80e19, 25 files +1588/−352) from lukealonso, a charter-named priority contributor and the de-facto owner of every area it touches (235 helios/src commits in 180 days, 63 heliopause, 67 flare, 160 ignition/preparation). It bundles five unrelated defect fixes: Orbit envelope binding + multi-deployment TP forwarding, page-cache release on distribution/verify/store paths, explicit Unix flock(LOCK_UN) in Drop, and multi-host peer export caching. Open, ready, no comments, no labels, no reviews (the flare-autobot case file has not run yet); CI passed.

Most important things a reader could not learn from the description. (1) controller.rs:2031 silently drops the controller's own have()/check_space byte and free-space pre-check whenever the transfer source is the target node — undeclared. (2) The single-host export rename to model-<16 hex> invalidates every existing single-host Payload core cache entry, not just colliding ones, and nothing migrates them (docs/orbit.md:518-520 says legacy dirs are not migrated). (3) agent::run now re-opens and re-verifies the sealed core before every rank launch on the production path. (4) --verify-weights for controller-present Payload cores is still resolved by trust::load before describe() learns tensor_parallel (controller.rs:1187 vs 2423), so the multi-deployment fix may not cover that branch. (5) The envelope guard is skipped entirely when a grant omits envelope_digest (all-zero = legacy), i.e. an old or hostile controller can switch off the whole integrity feature, and the guard does not apply to non-local_core launches.

Claims. Test claims are detailed, self-reported, and matched by real, adversarial tests in the diff (identical-filename/identical-length collision seeded as model-<len>; VerifiedCore::open(..., None) asserted to fail on a multi-deployment core; --tensor-parallel asserted to appear exactly once). The page-cache benefit for #630 is explicitly unmeasured, and #630 is still open with its asks 2 and 3 (KV-budget warning, MemFree/MemAvailable/Cached diagnostics) untouched — the reporter pfn confirmed on 2026-12-01 that #646 did not fix this path, which is precisely the sha256_file/serve_source path #667 now addresses. "Zero orphan peer blobs" and the "40–100+ GiB leaked" figure are argued from tempdir lifetime, not measured. No doc file is changed although multi-host/--no-weights/core-caching semantics change (docs/multi-host.md:305-320, docs/orbit.md:471-535, docs/cli-design.md:416 (not opened)/1166/1541 and others are now stale).

Related work. Direct continuation of #646 (merged 2026-11-30) and #650 (merged 2026-12-01, same file, the change that creates the forked-child window the flock fix addresses), and extends #618's capture_group_into_cache and #647's multi-host export. Textual conflict risk with open same-author #668, which edits the same host_ranks.py export_options(...) lines #667 rewrites; and conceptual overlap with open #394 (voipmonitor), which also moves export scratch into NativeExportStage — #667 now puts a cache root inside that stage workspace.

Process/community. Hours old, no engagement; the author has four bundles open on the same day (#667, #668, #659, #658), and #646's review already criticised the multi-defect-bundle pattern the charter also flags ("smallest footprint"). #667 follows the charter's four-part PR description format and stays inside Orbit/multi-host goals without new user-facing flags, but adds serde-defaulted internal fields and a silent all-zero legacy escape hatch, which sits awkwardly with the charter's "be explicit, no magic defaults".

#18 [high] Change: plain-terms summary of the five defect bundles

Plain-terms summary for the report's opening section (25 files, +1588/−352, one squashed commit 7908ac3 on main a3c80e19, 6 areas):

  1. Orbit stops guessing about which weights are cached. The signed launch grant (Grant.core) now carries the SHA-256 digest of the core's signed envelope and an optional tensor-parallel size. The controller folds 16 hex chars of that digest into the cache directory name for single-host payload cores, sends the digest with every cache HAVE probe, and the agent refuses cache hits, staging hits, transfers and launches whose stored bytes do not hash to that envelope. It also forwards --tensor-parallel once, for both orbit run and flare run --hosts, and verifies multi-deployment payload cores through VerifiedCore::open_tensor_parallel instead of the old VerifiedCore::open(..., None) which simply errored and was swallowed by .ok().
  2. Page cache is actively dropped after reading big files on Linux. A new posix_fadvise(DONTNEED) range primitive in eos, re-exported through helios, is called after hashing a core's primary, after every peer shard range served during distribution, across all deduped shard handles at source teardown, after storing blobs, after each payload hash during verification, and immediately after payload load on integrated GPUs. Motivation: GB10 unified memory — page cache steals from the KV pool and cuCtxCreate.
  3. Unix advisory locks are explicitly unlocked on drop. helios's Lock and CoreLock and a new cross-platform flare::file_lock::FileLock (replacing three hand-rolled lock helpers in hub.rs, download_cache.rs, trust.rs) now call flock(LOCK_UN) in Drop, because a concurrently forked child (Orbit rank spawn) inherits the open file description and would otherwise keep the lock held past execve.
  4. Multi-host peers stop writing a model cache they never use. ignition join peers now export into a transient peer-cache inside the native export stage tempdir (reclaimed on close()), and under --no-weights they only hash the weight groups and declare the identities, leaving validation to rank zero's coordinator cache.

No new user-facing flags or config keys; no crate dependency changes; no model core wire-format change.

#19 [high] Why: provenance of each defect, and what has no issue trail

Provenance of each of the five defects — how long/widely reported:

Bottom line for the "why" angle: one of five defects is externally reported and reproducible (#630); four are author-internal findings with no issue trail.

#8 [medium] People and community: author, area owners, no reviews yet

#12 [medium] Reach: who and what this affects

#13 [medium] Process: draft/ready, CI, reviews, age

#14 [medium] Code map: helper functions and cache naming

#15 [medium] Recent activity: what changed lately in the touched areas

#16 [medium] Change: limits of the envelope guard

#20 [medium] Reach: what peers lose by no longer caching rank blobs

Consequences of the multi-host peer-export change that a reader should weigh (reach angle):