Recommendation: Changes Requested
The core engineering across all five fixes in PR #667 is solid: Orbit envelope binding closes the single-host cache collision, multi-deployment Payload cores route cleanly through open_tensor_parallel and persist --tensor-parallel, Unix flock(LOCK_UN) drops are open-file-description-scoped with matching Windows LockFileEx parity, core_cache page-cache releases run after sync_all(), and peer export capture cleanly avoids orphan blobs. Several upstream candidate alarms proved false on verification (including the alleged intra-node check_space drop, the alleged verify_envelope_on_run test gap, and the suggestion to strip --tensor-parallel from rank_options). Before merging, please fix the remaining .ok() identity swallow in launch.rs, remove the dead contextlib import and add a small Python test for the remote_cache plumbing, update the now-stale peer-cache docs in docs/multi-host.md, and clarify the single-host cache-miss upgrade impact and unmeasured #630 status.
Merge Risk
Level: Medium
- Broad cross-crate surface in one commit (25 files, +1588/−352): touches Orbit transfer/launch (
flare-cli), file locking (flare,helios), Linux page-cache eviction (eos,helios,flare-cli), and multi-host peer export (heliopause,ignition). No wire/Protobuf/captured-graph ABI breaks, and legacy Orbit grants remain deserializable. - Upgrade-time cache invalidation & warm-read behavior: renaming single-host Payload exports from
{stem}to{stem}-{digest_prefix}(controller.rs:2448-2452) triggers a one-time cache miss/re-transfer for every existing single-host Orbit entry; unconditional Linux page-cache eviction on hashing/transfer paths trades warm host-RAM reuse (#93) for GB10 unified-memory headroom (#630, still unmeasured on GB10 hardware). - In-flight branch overlap:
ignition/preparation/host_ranks.py:685-690overlaps textually with open PR #668, so whichever lands second will need a rebase.
Walkthrough
- Orbit envelope binding & multi-deployment TP seams (
flare-cli/src/orbit/{grant,controller,agent}.rs,cli.rs,launch.rs): Added#[serde(default)]envelope_digestandtensor_paralleltoGrant.core, appended an 8-byte envelope digest prefix to single-hostexportnames, enforced envelope matching acrossHAVE/TRANSFER/FETCH/RUN(includingverify_envelope_on_runonAgent::new), dispatched Payload cores toVerifiedCore::open_tensor_parallel, returnedVerifiedCoreMetadirectly fromverify_coretopublish_orbit_entry, and forwarded/deduplicated--tensor-parallelfor saved groups and rank launches. - Linux page-cache eviction (
eos/src/{unix,windows}.rs,helios/src/{lib,runtime_core/{model,protection}}.rs,flare-cli/src/{distribution,core_cache,orbit/agent}.rs): Addedeos::release_page_cache_range(posix_fadvise(..., POSIX_FADV_DONTNEED)on Unix, no-op on Windows) and invoked page-cache releases aftersha256_file,serve_source,Sourceteardown,store_parallel/store_partial(post-sync_all()),agent::fetch,protection.rspayload hashing, and post-load_payloadon integrated GPUs inmodel.rs. - Explicit Unix
flock(LOCK_UN)on drop (flare/src/{file_lock,lib,hub,download_cache,trust}.rs,helios/src/core/{cache,conversion}.rs): Added cross-platform RAIIflare::file_lock::FileLockreplacing ~200 lines of duplicated lock helpers acrosshub.rs,download_cache.rs, andtrust.rs, and implemented#[cfg(unix)] Dropcallinglibc::flock(fd, LOCK_UN)onhelios::core::cache::LockandCoreLock. - Multi-host transient peer cache & coordinator-side
--no-weights(heliopause/src/export/{mod,capture,transfer}.rs,ignition/preparation/{core_snapshot,runtime_core,host_ranks}.py): AddedExportOptions.remote_cache, moved peer exports inhost_ranks.pyinto a transientnative_stage.path / "peer-cache"reclaimed infinallyafter releasingcore, hashed remote--no-weightsweight groups in one pass without local cache lookup, and validated presence and length against rank zero's coordinator cache inreceive_rank.
Pre-merge Checks
- [PASS] Security / malicious screen: No obfuscation, unauthorized network/exfil paths, or prompt-injection vectors; envelope binding strengthens integrity verification while controller-signed grants preserve rolling-upgrade compatibility.
- [PASS] Charter & value fit: Directly advances Orbit single-/multi-host serving and host-memory hygiene with zero model-specific branches or new user-facing knobs; priority contributor PR with strong adversarial Rust tests, though #630's GB10 KV benefit remains unmeasured (leave #630 open).
- [WARN] Related / duplicate / conflict check: Continues #646/#650/#618 without superseding anything; textual conflict with open #668 on
ignition/preparation/host_ranks.py:685-690, and #630 asks 2–3 remain open. - [WARN] Tests & verification evidence: CI passed on
7908ac3and the new Rust unit/integration tests are adversarial and well-isolated, but no Python unit test coversremote_cache=True/peer-cachewiring and GB10 hardware KV capacity (#630) is not yet re-measured.
Blockers
None.
Should Fix
- Propagate
core.identity()errors in--hostsgrant construction instead of swallowing with.ok()(flare-cli/src/launch.rs:145-149).controller.rs:2421-2423properly propagatesauthorized.identity().map_err(|e| e.to_string())?, whereasPeers::startwritescore.identity().ok().map(|id| id.tensor_parallel).filter(|&tp| tp > 0). Ifidentity()fails on a--hostslaunch where--tensor-parallelwas inferred fromargs.hosts.len() + 1(flare-cli/src/trust.rs:41-43) rather than passed explicitly,grant.core.tensor_parallelsilently becomesNoneand peers receive no--tensor-parallelflag.- Fix: Propagate the error (
let tp = core.identity().map_err(|e| e.to_string())?.tensor_parallel; tensor_parallel: (tp > 0).then_some(tp)).
- Update stale multi-host peer-cache documentation and disclose single-host cache invalidation (
docs/multi-host.md:306,319, PR Compatibility note).docs/multi-host.md:306still states that the peer host"Prepares and retains its rank's payload blobs locally", and:319still states"--no-weights requires matching cached payloads"without distinguishing coordinator cache vs. peers. Both are now inaccurate afterhost_ranks.py:685-698andtransfer.rs:880-886.- Additionally, because single-host
describe()now unconditionally suffixes{stem}with-{hex(&envelope_digest[..8])}(controller.rs:2448-2452) andhave()rejects unverified staging hits when bound (agent.rs:1584-1588), every existing single-host Payload cache entry (orbit:model-<len>) becomes a one-time miss/re-transfer on upgrade and leaves the old managed entry forflare models remove/gc. Document this in the PR's Compatibility section (and note it indocs/orbit.mdif appropriate).
- Remove dead
import contextliband add a Python unit test forremote_cacheplumbing (ignition/preparation/host_ranks.py:27,ignition/preparation/core_snapshot.py:26,ignition/preparation/runtime_core.py:331).import contextlibathost_ranks.py:27is now completely unused after removingcontextlib.nullcontext().- None of the Python tests assert that
export_options(..., remote_cache=True)propagates throughruntime_core._cache_optionsor thatserve_peercaptures intonative_stage.path / "peer-cache". Delete line 27 and add a focused CPU test intests/preparation/coveringexport_options(..., remote_cache=True)->_cache_options(...)["remote_cache"] is True.
- Keep #630 explicitly open and note the discrete-GPU page-cache trade-off (
flare-cli/src/distribution.rs:627,1136,1218,flare-cli/src/core_cache.rs:455,560,flare-cli/src/orbit/agent.rs:2046,helios/src/runtime_core/protection.rs:1706,2386).- Unlike
helios/src/runtime_core/model.rs:807-809(which gates post-load_payloadeviction onrank.integrated), the new page-cache releases across hashing, transfers, and verification run unconditionally on all Linux hosts, including discrete-GPU workstations with abundant host RAM where evicting pages can make subsequent warm re-hashes/restarts (#93) colder. Because the GB10 KV benefit for #630 is unmeasured on hardware (perdocs/design-review.mdPrinciple 12) and asks 2–3 of #630 are untouched, either gate non-integrated paths if warm re-reads matter or explicitly document the trade-off and ensure #630 stays open until measured on GB10.
- Unlike
Subtract / Simplify
- Collapse
Verifier'sOption<VerifiedCoreMeta>intoVerifiedCoreMeta(flare-cli/src/orbit/agent.rs:449-459,:513-535,:887-958).- Production
verify_corealways returnsOk(Some(VerifiedCoreMeta { ... })); only the test fake atagent.rs:2916-2927returnsOk(None). ChangingVerifierto returnResult<VerifiedCoreMeta, Failure>(and having test fakes return a syntheticVerifiedCoreMeta) lets you delete the fallbackelsebranch (agent.rs:901-919) and thereal_coreboolean gate (:950).
- Production
- Consolidate the three Unix
flock(LOCK_UN)Dropguards intoeos(flare/src/file_lock.rs:19-27,helios/src/core/cache.rs:4246-4259,helios/src/core/conversion.rs:2692-2702).eosalready depends onlibcandwindows-sys(eos/Cargo.toml:13-17) and is already depended on byhelios(helios/Cargo.toml:34) and transitivelyflare. Hosting the RAIIFileLock(or unlock-on-drop guard) ineosgives all three crates one implementation of thefork()/O_CLOEXECunlock invariant (and also letsflare/src/windows.rs:102-142lock/try_lock— now unused in-repo — be retired if not part of external API).
- Reuse
grant.core.expected_envelope()instead of re-implementing the zero check (flare-cli/src/orbit/controller.rs:1433-1434,:1467).grantis already constructed atcontroller.rs:1363-1379, solet expected_envelope = grant.core.expected_envelope();from line 1467 can simply be hoisted above line 1420 and reused at line 1437.
Nits
heliopause/src/export/transfer.rs:879:helios_core::core::cache::Root::open(cache)?is called inside thefor descriptor in &sources.cachedloop; hoisting it before the loop avoids re-opening the cache root per weight group. Also note the test nameremote_no_weights_peer_reuses_coordinator_cache_and_rejects_missing_or_corrupt(transfer.rs:2182) only tests length mismatch and missing blob (not on-disk byte corruption, which matches the intentional zero-readroot.payloadcheck described in the PR).flare-cli/src/orbit/agent.rs:5144,5279: replaceprimary_bwith_in the destructuring at:5144and deletelet _ = primary_b;at:5279.flare-cli/src/orbit/agent.rs:608-609:verify_envelope_on_run: boolis only cleared inwith_fakes; guarding the toggle behind#[cfg(test)](while keeping the check itself, which is load-bearing for node-heldgrant.core.sourcepaths) avoids carrying a test-only field in release builds.
Dropped on verification
- Dropped (False) — Correctness F1 (
controller.rs:2031allegedly drops free-space admission for same-node transfers): Verified all three callers oftransfer()(controller.rs:1478,:1513,:1545). Call sites:1513and:1545always satisfysource.public_key != node.public_key(:1500-1502,:1528). The only caller wheresource == nodeis:1478(Holder::Controller), wherehave(),check_space(&statuses[rank], needed)?(:1444), andput()already ran andtransfer()only verifies/publishes staged bytes (agent.rs:1748-1754). Without thesource != nodeguard, the newhave()staging rejection (agent.rs:1586) would double-countneededagainst stale pre-uploadstatuses[0]and print a bogus self-fetch log. - Dropped (False) — Subtraction S1 (delete
--tensor-parallelfromServingOptions::rank_optionsanddeduplicate_tensor_parallel): Verifiedcontroller.rs:689-707and:869-873.GroupSpechas no dedicatedtensor_parallelfield and persists serving flags inspec.serving; removing--tensor-parallelfromrank_optionsanddeduplicate_tensor_parallelwould break restarting saved persistent Orbit groups for multi-deployment cores. - Dropped (False) — Correctness F5 (
verify_envelope_on_rununtested and rank>0 legacy asymmetry) and Subtraction S4's suggestion to delete therun()check: Verifiedreal_agent_harness(agent.rs:5109-5135) usesAgent::new(verify_envelope_on_run = true), and both newagent.rstests exerciseframe::RUNwith it enabled (:5265-5278,:5374-5385). The check is load-bearing for node-heldgrant.core.sourcepaths (:2140-2146) wheretransfer()andresolve_orbit_entry_matching()do not run, andLegacyVerified::open(..., Some(rank))(protection.rs:639-643) already acceptsSome(rank)on complete multi-host cores (matchingagent.rs:1815). - Dropped (False threat model) — Correctness F4 (all-zero
envelope_digestas a Major "hostile opt-out"): Grants are Ed25519-signed by the trusted controller (a hostile controller already controls the grant signature, binary, and flags);#[serde(default)]+ all-zero fallback is intentional rolling-upgrade compatibility with older controllers, explicitly disclosed and tested (grant.rs:268-276), and consistent withdocs/design-review.mdPrinciple 13. - Dropped (False sub-claim) — Correctness F3's claim that
launch.rsspawns rank 0 without--tensor-parallel:main.rs:230-255runs rank 0 in-process andlaunch.rs:173-175spawns only peer ranks (rank = index + 1). Kept only the real.ok()error-swallow issue atlaunch.rs:145-149. - Dropped (Verified clean) — Open Q1 (TP1
open_tensor_parallelparity), Open Q2 (--verify-weightson multi-deployment cores), and Subtraction S5'score_cache is Nonebranch concern:select_deployment_index(protection.rs:385-426) handles single-deployment TP1 identically;Controller::runpopulateshub.tensor_parallel(controller.rs:697-707) beforeresolve_core->verify()->flare::trust::review(flare/src/trust.rs:508-523); andpeer_cache = Path(native_stage.path) / "peer-cache"is always valid even whencore_cache is None(binding.rs:864-882). - Dropped (Low-signal) — Subtraction S6's suggestion to add a
helios::release_page_cache_allhelper fordistribution.rs:1132-1139: Six lines in one call site do not warrant a new publicheliosAPI.