Final review report · NVIDIA/hyperflare-inference #664

Raw Markdown for agents: https://autobot.eidonix.com/p/e5da9833-b10c-4704-b34a-61d2209f3393.md

Recommendation: Changes Requested

The runtime and exporter generalization (Planes { weights, scales: Option<Plane> }, Encoding.BF16 = 3, Method.IDENTITY = 3, and the two shared correctness fixes) is technically clean, model-agnostic, and well-tested on CPU, and all audited downstream consumers (core/conversion.rs, runtime_core/protection.rs, export/weight_reuse.rs, engram/cache.rs, and the disk/cache/RAM/Windows reader paths) handle single-plane tables cleanly. However, the PR is blocked on repository contract and verification gates: it introduces new signed core-format / captured-graph contract enums (Encoding.BF16, Method.IDENTITY) without recorded owner approval or a linked producer recipe, and its validation section is unfinished (still carrying the Thor E2B TODO placeholder) with no CI checks, no live GPU export-and-serve proof, and no serving replay of an existing FP8/NVFP4 core.

Merge Risk

Level: Medium

Walkthrough

Pre-merge Checks

Blockers

  1. Unapproved core-format / captured-graph contract extension with no linked producer (helios/proto/core.proto:258,294, helios/proto/runtime_core.proto:660,695, helios/manifest.md:457-463, docs/core-format-design.md:94-104):
    • Verified impact: Adding EngramTable.Encoding.BF16 = 3, EngramHash.Method.IDENTITY = 3, and the single-plane artifact layout (omitting -scales safetensors files) extends the signed core format and captured-graph contract. While IDENTITY cleanly reuses the existing request_buffer mailbox protocol, docs/design-review.md:22-26 and the Project Charter require explicit project-owner approval (Luke Alonso) for new contract surface (contrast #566's explicit approval note / #535). In addition, no producer exists in this repository (ignition/components/engram.py and ignition/components/ngram_delivery.py only emit two-plane FP8/NVFP4) and no companion external recipe PR is linked (contrast #566 -> local-inference-lab/hyperflare-recipes#70, #590 -> hyperflare-recipes#87), leaving the new contract unexercised end to end.
    • Fix: Obtain and record explicit owner approval for Encoding.BF16 and Method.IDENTITY, and link the companion Gemma 4 E2B/E4B recipe PR (or producer) that exports cores targeting this contract.
  2. Incomplete validation and missing live export/serve & backward-compatibility verification (docs/design-review.md Principles 12 & 13; Project Charter):
    • Verified impact: The PR's Validation section still contains an unfinished placeholder (*(update this line once the Thor E2B export + benchmark completes)*), head c769355 has zero CI checks, and the PR explicitly discloses that live GPU export/serving replay of a BF16/IDENTITY core and serving replay of a previously exported FP8/NVFP4 core were not run. Both the Charter ("New model recipes, aliases, or formats ... prove they export and serve cleanly from the PR branch") and Principle 13 ("Validate previous cores through loading and serving") require these checks before merge.
    • Fix: Complete and report the live Thor/GPU export + flare run serving verification and memory measurement for at least one BF16/IDENTITY checkpoint (removing the placeholder), verify loading and serving replay of a previously exported FP8/NVFP4 core without re-export, and ensure CI passes on the updated head.

Should Fix

  1. Strict Unspecified handling in engram_encoding_has_scales (helios/src/core/schema.rs:319-329, heliopause/src/export/core.rs:98,426,1553):
    • engram_encoding_has_scales maps Encoding::Unspecified (0) to Ok(true) solely to accommodate legacy spans() test fixtures (helios/src/runtime_core/engram.rs:506-529). Because heliopause/src/export/core.rs calls this helper in roles(), validate_ranks(), and core_engram() without first rejecting Unspecified, a table with encoding == 0 is treated as two-plane and fails with misleading plane-absence diagnostics instead of "engram table has no encoding" (relying on validate_deployment later).
    • Fix: Make the shared helper reject Encoding::Unspecified and handle the legacy encoding == 0 two-plane fallback locally in helios/src/runtime_core/engram.rs::spans.
  2. Make Table.partition delivery-group semantics explicit (helios/src/engram.rs:179, helios/src/runtime_core/engram.rs:425, helios/src/runtime_core/model.rs:458):
    • Table.partition: Option<usize> is populated during decode (runtime_core/engram.rs:425) and never read directly in production code; its entire effect relies implicitly on derived #[derive(PartialEq, Eq)] at helios/src/runtime_core/model.rs:458 (engram.iter_mut().find(|(existing, _)| existing == &index)). Without a comment or explicit predicate, a future refactor removing an apparently unread field would silently reintroduce cross-rank mailbox collapse when two TP ranks share identical shard payload bytes.
    • Fix: Add an explicit Index::shares_delivery_with(&self, other: &Self) (or document the PartialEq invariant directly on Table.partition and at model.rs:458).

Subtract / Simplify

  1. Collapse repeated single-plane scale checks into one strict helper (helios/src/core/schema.rs:445-453,489-499, helios/src/runtime_core/engram.rs:39-49,60-72,197-203,269-277, heliopause/src/export/core.rs:108-153,432-462,1565-1637):
    • The identical if has_scales { require scales } else if scales.is_some() { reject } logic is hand-written across 10+ sites with six slightly different error strings. Introducing one strict generic helper pub fn engram_scales<'a, T>(encoding: i32, scales: &'a Option<T>) -> Result<Option<&'a T>> in helios/src/core/schema.rs (rejecting Unspecified, with spans() handling legacy 0 locally and validate_shards's rank-selective sibling-absence check at runtime_core/engram.rs:101-106 kept separate) deletes ~45 lines and prevents asset-list drift across exporter and validator stages.
  2. Pair optional scale plane and buffer name into a single Option (helios/src/engram/prepared.rs:39-48,71,163-167,271, helios/src/engram.rs:177-186,1005-1014, heliopause/src/embedding_tables.rs:46-53):
    • TableSource and Table store scales_plane/planes.scales and scales: Option<String> separately, forcing manual parity checks at prepared.rs:71 and a redundant mismatch arm at prepared.rs:166. Pairing them as Option<(PlaneSource, String)> at the Python boundary in heliopause/src/embedding_tables.rs makes mismatched scale metadata unrepresentable in Rust and eliminates both checks.

Nits

  1. Collapsed partitioned-table diagnostics (helios/src/core/schema.rs:455-461): Merging shared-plane presence, empty request_buffer, and shards.len() != ranks into one "invalid partitioned engram table" error loses specificity compared to main; keeping distinct messages makes malformed cores easier to diagnose.
  2. PR description details: Mention the parts.is_null() tolerance added to heliopause/src/export/binding.rs:655-657 (aligning with weight_reuse.rs:406), and update Discord: None to match docs/design-review.md Principle 17 (Discord: no username provided or a Discord username).

Dropped on verification