Explore scratchpad · NVIDIA/hyperflare-inference #618

Raw Markdown for agents: https://autobot.eidonix.com/p/52f31b37-0bb5-4efa-91ec-50df721f7f02.md

#1 [high] Why: 128 MiB envelope limit vs TP16 aggregate metadata — driven by #398 Kimi TP16 stack

PR #618 (open, lukealonso, 2026-11-29, +4784/-399, 23 files, head 3a57a70) changes helios/src/core/protection.rs (+834/-38), adds helios/src/core/synthesis.rs (+1804), flare/src/hub.rs (+619/-34), heliopause/src/export/capture.rs (+261/-62), ignition/preparation/aot.py (+168/-34), capture.py (+110/-91), helios/proto/core.proto (+13).

Area 2 (external bodies) is the direct continuation of:

#2 [high] Process: #618 open + ready, CI failed, zero reviews, large single-author PR

PR #618 process facts (orientation packet + read_item #618):

#3 [high] Claims/evidence: HF LFS + adoption defects verified real on main (hub.rs:1741, 1621, 1558)

Verified against main (read at ref main):

  1. Bare-hex LFS oid is not treated as a digest. flare/src/hub.rs:1741 content_digest() requires the sha256: prefix ("A bare 64-hex ETag is opaque", hub.rs:1737-1752). fetch_tree_identities (hub.rs:1073) stores lfs.oid verbatim as FileIdentity.etag (hub.rs:1144-1152). So for every tree-API LFS entry, content_digest(etag) = None on main ⇒ pending_network_from_identities treats a size-matching complete blob as settled (hub.rs:1305-1313) and no SHA-256 checking happens downstream. The PR adds FileIdentity.sha256 (populated by parse_sha256_hex on lfs.oid, content_digest on ETag) and switches pending_network_*, fetch_file_with_identity_and_streams, transfer_blob_with_streams to metadata.sha256(). So claim 1's premise is TRUE on main.
  2. Temp-name mismatch is REAL. flare/src/download_cache.rs:1103-1107 adopted_key() parses .<key>.adopt-<pid>-<n> via transient_key(name, ".adopt-") (download_cache.rs:1081-1095: requires .<key> then .adopt- then digits-digits). main's publish_copy (hub.rs:1621-1640) creates .adopt-<pid>-<n>-<destination name>, which does NOT satisfy that pattern (after stripping the leading dot the string starts adopt-, and there is no .adopt- marker; also the trailing -<name> breaks digits-only count). Crash orphans were therefore unreclaimable. PR renames temporaries to .<key>.adopt-<pid>-<n> and adds a reclaim test.
  3. adopt_complete had no lock and could overwrite. main hub.rs:1558-1581 adopt_complete checks destination.exists() and calls publish_copy WITHOUT taking <key>.lock (contrast adopt_partial, hub.rs:1595-1598, which does try_lock_exclusive), and publish_copy hub.rs:1656-1665 falls back to std::fs::rename over an existing destination on AlreadyExists — i.e. it can replace an existing complete blob. PR takes a non-blocking exclusive <key>.lock, and gates the rename fallback behind replace (true only for the .part path). Claim 1's second and third premises are TRUE. Chronology: drop-in these behaviours came from Luke Alonso's own recent Hub work — commits 21b2eae3 (2026-11-23, "Speed up Hub core downloads with authenticated HTTP/2 and parallel range transfers") and 9710cadc (2026-11-23, "Bound core acquisition descriptors, eliminate warm re-downloads, and speed up core verification") are the last two touches of hub.rs before this PR (search_history path=flare/src/hub.rs). So #618 is partly self-repair of the author's own unmerged-to-reviewer-attention Hub work, and the tree-API path is unconditional (no flag) — plan_dependency_download always tries the tree API first (hub.rs:1203-1216), falling back to per-file range probes.

#4 [high] The change: verified mechanics of spill, synthesis gating, single-pass capture, streaming forwards

Verified in the PR tree (pr/618):

#5 [high] The change: what the description does not say (version bump absent, sign() API break, empty bodies, Orbit/inspect/reuse-weights)

Facts a reader would not learn from the PR description:

  1. Core format version is not bumped. sign_envelope still writes version: schema::FORMAT_VERSION (helios/src/core/protection.rs:1400 area) and core.proto only adds a new optional ExternalBody message/fields (helios/proto/core.proto:396-420). Consequence to flag as a question, not a verdict: a core exported from this branch whose envelope exceeded 128 MiB has empty inline body fields, and older readers reject it — on main, signed_rank_entry passes an empty body through (helios/src/core/protection.rs main: body.len() > MAX_BODY check only) and then fails check_commitment(body_digest, body). The PR's own test asserts the mirror-image case: verify(&signed.manifest, publishers, Selection::Deployment{..}) errors without a BodyStore (new test external_body_spills_and_round_trips_through_container_conversion_and_cache). So spilled cores are only loadable by this version or newer, and nothing in the description says which release/tag first ships it. Cores ≤128 MiB keep the byte-identical inline layout, so the compatibility claim in the description ("existing inline v2 cores continue to verify") is supported.
  2. New public API surface, no user-facing flag. EnvelopeBuilder::with_inline_limit(usize) is new public API clamped to MAX_ENVELOPE (protection.rs:1354-1360); production export never sets it, so the trigger is automatic at 128 MiB. EnvelopeBuilder::sign() is now a failing API for oversized cores (protection.rs:1370-1378 returns "core envelope exceeds its inline limit and requires external body tensors") — out-of-tree signers using sign would break, in-tree callers were moved to sign_envelope.
  3. Behaviour change in the builder. EnvelopeBuilder::deployment/rank now reject empty bodies (protection.rs:1362-1372, body.is_empty() || body.len() > MAX_BODY), previously only oversized ones. That silently tightens what conversion/edit/third-party signing may pass.
  4. flare inspect (unverified path) changed shape. helios/src/runtime_core/metadata.rs:129-210 now picks the deployment before decoding rank bodies (filters SignedRank by deployment == dep_index instead of the old deployment_id string match), enforces the 1 GiB aggregate on declared sizes before decompressing, and decodes external bodies through the container. Error text changes ("unverified rank metadata exceeds its limit"). No test in the diff covers this path; the PR cites --test unverified_empty only.
  5. Orbit mirroring changed. flare-cli/src/orbit/controller.rs:2143-2160 mirrored_ranges now mirrors every flare.body.* tensor and refuses a core whose body exceeds MAX_BODY or whose bodies sum above MAX_SELECTED_RANK_METADATA. This is an Orbit agent/controller wire behaviour: an older controller on a peer node will not mirror flare.body.*, so a spilled core mirrored by a mixed-version fleet is a deployment hazard worth checking. The description says "mirrored over Orbit" but not that the mirrorer must be this version.
  6. --reuse-weights serialized Source grew a field. heliopause/src/export/weight_reuse.rs:19-40 adds external_bodies: Vec<ExternalBodyEntry> (base64 frames) with #[serde(default)], so old JSON still parses; new JSON carrying external bodies cannot be read by an older heliopause. Relevant because this JSON is passed between preparation and export processes/binaries.
  7. Capture holds a publication lock across the capture phase. ignition/preparation/capture.py:124-131 enters cache._publication_lock(coordinator) for the whole capture_forwards body when streaming (retain_forwards=False), i.e. the export now holds the forward-cache publication lock while capturing every graph. Description says "holds the publication lock and materializes, captures, and retires one compiled forward at a time" but does not discuss the added lock duration / concurrency with other ranks or processes.
  8. Deferred forwards are re-materialized from the cache path at capture time (aot.py:672-694 DeferredCompiledForward.materialize_for_capture → cache._load(owner, path, required=True)). If the artifact file disappears or is reaped between warm and capture, capture fails with required=True; only the share compiler publishes to a shared path (capture.py/aot.py _prepare_ranks bound.artifact.save_compiled_function(path)), so the non-share paths rely on a temp path still existing. Not covered by the described tests.

#6 [high] Related work: #371 → #618 lineage; conflicts with open #586/#606; extends merged #559/#587/#498

#7 [high] People + Community: lukealonso owns every touched area and wrote the buggy Hub code; no engagement yet

#8 [high] Research summary

I prepared the case file for PR #618 (open, opaque-cleared as ready for review, 0 reviews/comments, CI failing on head 3a57a70, +4784/−399 across 23 files), covering all eight angles. Notes are in the scratchpad (7 entries) and organised as follows.

The change (verified in code). Four independent fixes bundled in one PR: (1) FileIdentity.sha256 in flare/src/hub.rs so tree-API lfs.oid digests are actually checked, plus a locked, never-overwriting adopt_complete and reclaimable .<key>.adopt-<pid>-<n> temp names; (2) ExternalBody/flare.body.<sha256> zstd spill in helios/src/core/protection.rs sign_envelope so flare.manifest stays ≤128 MiB while deployment/rank bodies go external; (3) single-pass capture_group_into_cache and capture_streaming_payload in heliopause, create_new staging with {stable|tuned} qualifiers, and DeferredCompiledForward/retire_after_capture streaming in ignition/preparation; (4) new 1,804-line helios/src/core/synthesis.rs that rebuilds shifted weight payloads from installed donor cores and only accepts a byte-identical SHA-256 match.

What the description omits (highest-value findings). No core-format version bump accompanies external bodies, so a spilled core is unreadable by main (the PR's own test asserts verification fails without a BodyStore); EnvelopeBuilder::sign() becomes a failing API past 128 MiB and now rejects empty bodies; flare inspect (unverified path), Orbit mirrored_ranges (older controllers cannot mirror flare.body.*) and the --reuse-weights Source JSON all change shape without being called out; and capture_forwards now holds the forward-cache publication lock across the whole capture phase.

Claims vs evidence. I verified on main that all three Hub-adoption defects are real (content_digest prefix gate at hub.rs:1741, unreclaimable .adopt- names at hub.rs:1621 vs download_cache.rs:1103, unlocked overwrite at hub.rs:1558). Test evidence is broad CPU-only (exact pass counts given); the PR itself admits no live multi-GPU export memory, throughput, CUDA-gated capture, Windows or frontend-template runs.

Related work. #371 (merged) → #398 TP16 Kimi stack is the lineage for the 128 MiB work; #559, #587, #498, #593 are merged work in the same files this extends; #586 (open) and #606 (open, "ready to merge") both conflict textually, #606 with capture_forwards itself; #79 covers the same no-clobber publication problem at another layer.

People/community. lukealonso is the dominant committer in every area touched and authored the Hub code being repaired six days earlier; charter lists them as a priority contributor. No reviewers (yatesdr, voipmonitor, FujitsuPolycom review these areas routinely) have engaged yet.

Process. Ready, same-day single push, CI failed — cause not visible locally; the description's own failure list attributes CI-adjacent failures to pre-existing tests, which I could not confirm.

#9 [high] Why: capture/staging/re-download defects — no linked issue, only author's framing

Searches for tracked motivation behind areas 3 and 4 of #618 found nothing filed:

So the "why" for area 3 (double D2H read, stable/tuned staging truncation, peak capture host RAM) and area 4 (full weight re-download after layer-layout edits) rests entirely on the PR description's own diagnosis, with no user report, issue, or benchmark behind it. Nearest predecessors in the same code, all authored/reviewed around it:

#10 [medium] Recent activity: #618 sits on top of a week of the author's own one-day-per-file churn

Last up-to-8 commits per area on the default branch within 60 days (orientation packet + search_history):

#11 [medium] Project fit: charter lines that support and that cut against #618

Charter (read_charter) statements that bear on #618, as facts: