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
- Touches the core signed-artifact schema (
helios/proto/{core,runtime_core}.proto,helios/src/core/schema.rs), native embedding reader/staging/delivery pipeline (helios/src/engram.rs,reader.rs,prepared.rs,runtime_core/{engram,model,selection}.rs), andheliopauseexporter (export/{core,binding}.rs,embedding_tables.rs), all of which saw heavy recent churn (#566, #580, #586, #590, #620, #647). - Wire backward compatibility for existing two-plane FP8/NVFP4 cores is preserved (enum tags appended at
= 3, existing layouts untouched,runtime_core_pb2.py(not opened) regenerated), and wide BF16 rows (e.g., 17,920 B for E2B / 21,504 B for E4B) split cleanly across 4 KiB-aligned direct-I/O fragments and 64 KiB coalesced reads inDiskReader::gather. - No CI checks have run on head
c769355, Windows I/O ring compilation was not verified, and no end-to-end GPU export/serving replay (for either a new BF16/IDENTITY core or a previously exported FP8/NVFP4 core) has been executed yet.
Walkthrough
- Core schema & wire contract (
helios/proto/{core,runtime_core}.proto,helios/src/core/{schema,reader}.rs,ignition/preparation/runtime_core_pb2.py(not opened)): AppendsEngramTable.Encoding.BF16 = 3(single-plane raw BF16 rows ofembedding_width * 2bytes, no scale plane/buffer/block/global scale) andEngramHash.Method.IDENTITY = 3(1-head direct indexing via existingrequest_buffer, emptytoken_mapand hash arrays,compressed_vocabulary == rows), skips scale payloads inrequired_payloads, and aligns signed-core shard validation withruntime_core::engram::validate_shards(contiguous, rank-ordered full-table coverage). - Runtime reader, staging, and selection (
helios/src/engram.rs,engram/{reader,prepared}.rs,engram/reader/windows.rs,runtime_core/{engram,model,selection}.rs): Replaces[Plane; 2]withPlanes { weights: Plane, scales: Option<Plane> }across disk, row-cache, advisory warm, RAM,Transfers, andPreparedTablespaths; recordsTable.partition: Option<usize>so TP ranks with byte-identical shard spans do not collapse into one delivery group; gates--embedding-table-resident-scalesonhas_scale_planesand rejects explicit use when no table carries scales. - Exporter & peer handoff (
heliopause/src/export/{core,binding}.rs,heliopause/src/embedding_tables.rs,ignition/preparation/rank_group.py): Makes the scale plane optional inroles(),validate_ranks(),core_engram(), andNativeEmbeddingTables; tolerates JSONnullplanes inappend_planes(matchingweight_reuse.rs:406); updates peer descriptor counting in_receive_embedding_tablestosum(len(table["planes"]) for table in catalog["tables"]). - Docs & tests (
helios/manifest.md,docs/{cli-design,core-format-design,model-preparation}.md,tests/preparation/test_embedding_table_handoff.py, Rust unit tests): Documents single-plane BF16 storage,IDENTITYindexing semantics, omitted-scalessafetensors files, and--embedding-table-resident-scalesbehavior; adds CPU unit tests across schema validation, decode, single-plane disk/cache/warm/RAM gathering, single-descriptorPreparedTablessharing, export/reuse/gapped-shard rejection, and mixed-plane Python handoff.
Pre-merge Checks
- [PASS] Security / malicious screen: No suspicious code, credential handling, external calls, or unsafe regressions;
validate_buffer(helios/src/runtime_core/engram.rs:315-332) fixes a pre-existing out-of-boundsbuffer.shape[0]index before length checking. - [WARN] Charter & value fit: Right model-agnostic layer (no model allowlists, capability flags, or runtime hashing), but adds new signed core-format / captured-graph contract enums (
Encoding.BF16,Method.IDENTITY) without recorded owner approval (docs/design-review.md:22-26) and with no in-tree or linked external producer recipe. - [PASS] Related / duplicate / conflict check: Additive to #566 and #590, aligns with #334's runtime-boundary stance, and has no competing implementation; note mechanical merge overlap with open drafts touching
Planes(e.g., #554). - [WARN] Tests & verification evidence: CPU unit tests are thorough, isolated (PID-scoped temp paths, clean
monkeypatch), and test real production entry points, but headc769355has zero CI runs, the Validation section still holds an unfinished Thor E2B TODO placeholder, and neither live BF16/IDENTITY export+serving nor existing FP8/NVFP4 core serving replay has been run (docs/design-review.mdPrinciples 12–13).
Blockers
- 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-scalessafetensors files) extends the signed core format and captured-graph contract. WhileIDENTITYcleanly reuses the existingrequest_buffermailbox protocol,docs/design-review.md:22-26and 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.pyandignition/components/ngram_delivery.pyonly 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.BF16andMethod.IDENTITY, and link the companion Gemma 4 E2B/E4B recipe PR (or producer) that exports cores targeting this contract.
- Verified impact: Adding
- Incomplete validation and missing live export/serve & backward-compatibility verification (
docs/design-review.mdPrinciples 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)*), headc769355has 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 runserving 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.
- Verified impact: The PR's Validation section still contains an unfinished placeholder (
Should Fix
- Strict
Unspecifiedhandling inengram_encoding_has_scales(helios/src/core/schema.rs:319-329,heliopause/src/export/core.rs:98,426,1553):engram_encoding_has_scalesmapsEncoding::Unspecified(0) toOk(true)solely to accommodate legacyspans()test fixtures (helios/src/runtime_core/engram.rs:506-529). Becauseheliopause/src/export/core.rscalls this helper inroles(),validate_ranks(), andcore_engram()without first rejectingUnspecified, a table withencoding == 0is treated as two-plane and fails with misleading plane-absence diagnostics instead of"engram table has no encoding"(relying onvalidate_deploymentlater).- Fix: Make the shared helper reject
Encoding::Unspecifiedand handle the legacyencoding == 0two-plane fallback locally inhelios/src/runtime_core/engram.rs::spans.
- Make
Table.partitiondelivery-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)]athelios/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 thePartialEqinvariant directly onTable.partitionand atmodel.rs:458).
Subtract / Simplify
- 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 helperpub fn engram_scales<'a, T>(encoding: i32, scales: &'a Option<T>) -> Result<Option<&'a T>>inhelios/src/core/schema.rs(rejectingUnspecified, withspans()handling legacy0locally andvalidate_shards's rank-selective sibling-absence check atruntime_core/engram.rs:101-106kept separate) deletes ~45 lines and prevents asset-list drift across exporter and validator stages.
- The identical
- 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):TableSourceandTablestorescales_plane/planes.scalesandscales: Option<String>separately, forcing manual parity checks atprepared.rs:71and a redundant mismatch arm atprepared.rs:166. Pairing them asOption<(PlaneSource, String)>at the Python boundary inheliopause/src/embedding_tables.rsmakes mismatched scale metadata unrepresentable in Rust and eliminates both checks.
Nits
- Collapsed partitioned-table diagnostics (
helios/src/core/schema.rs:455-461): Merging shared-plane presence, emptyrequest_buffer, andshards.len() != ranksinto one"invalid partitioned engram table"error loses specificity compared tomain; keeping distinct messages makes malformed cores easier to diagnose. - PR description details: Mention the
parts.is_null()tolerance added toheliopause/src/export/binding.rs:655-657(aligning withweight_reuse.rs:406), and updateDiscord: Noneto matchdocs/design-review.mdPrinciple 17 (Discord: no username providedor a Discord username).
Dropped on verification
- Correctness Lens §1 ("Major — Memory amplification: 7.5–9.2 GiB of pinned host memory ... cap
embedding_width≤ 8 KiB"): Factually false due to double-counting the layer factor. The8,960BF16 row width (17,920B/row inhelios/src/engram/reader.rs:2540) already packs all 35 E2B layers (35 × 256) into one table (262,144 × 8,960 × 2 = 4.375 GiB; E4B is one table of42 × 256 = 10,752BF16 elements =5.25 GiB). Atmax_tokens = 4,096,heads = 1, total host staging is2 × 4,096 × 17,920 = 140 MiBplus70 MiBmiss_outputdrawn from the 1 GiB integrated default row-cache budget (selection.rs:89) — a >4.1 GiB net reduction, already accounted inembedding_host_bytes(model.rs:489-491,762-777). The suggested≤ 8 KiBrow cap would break Gemma 4 E2B (17.5 KiB/row) and E4B (21 KiB/row). - Correctness Lens §2's claim that
request_bufferis a new mailbox mechanism:EngramTable.request_buffer(field 13) already existed onmainforEOS_XOR_MODULO(helios/proto/core.proto:272-277,helios/src/runtime_core/engram.rs:176-180,ignition/components/ngram_delivery.py:18-39). Blocker #1 was scoped accurately to the genuinely newEncoding.BF16andMethod.IDENTITYcontracts. - Correctness Lens §4's claim that
partition: Noneinhelios/src/engram/prepared.rs:131is an inconsistent bug:PreparedTables::bind()(prepared.rs:320-332) always creates a rank-localSharedwithranks: 1and never groups ranks byIndexequality; cross-process RAM sharing inrank_group.py:56compares Python catalogs and keeps independent delivery mailboxes per process. - Correctness Lens §5a (
heliopause/src/export/binding.rs:653-657accepting"weights": null): False defect.append_planesruns on both top-level tables (binding.rs:507) and shards (binding.rs:510), and partitioned tables legitimately carry"weights": nullon the parent table object — matchingheliopause/src/export/weight_reuse.rs:405-406, which already filters!parts.is_null()for both"weights"and"scales". Rejecting"weights": nullhere would break partitioned tables serialized with explicitNonefields. - Correctness Lens §6 (backward-compatibility concern for gapped partitioned cores in
helios/src/core/schema.rs:462-503): False compatibility regression.helios/src/runtime_core/engram.rs:80-117(validate_shards) already rejected gapped, misordered, and incomplete shards onmain, so no previously exported gapped core could load or serve. Tighteningvalidate_engrampreventsheliopausefrom signing unloadable cores, and is already tested inschema.rs:1874-1891andheliopause/src/export/core.rs:5348-5381. - Subtraction Lens §4 ("
staging_payload_bytesis unchecked" and replacingif scales > 0withplanes.iter()inreader.rs): Contradicted by the code —helios/src/engram.rs:196uses.try_fold(0usize, |total, plane| total.checked_add(plane.row_bytes)). Replacingif scales > 0inside the hot per-row raw-pointer copy loops (reader.rs:970,1102,1156) with an iterator would add unnecessary overhead. - Subtraction Lens §6a ("
helios/manifest.md:456'two pinned payload frames' contradicts single-plane tables"): Misread double-buffering as planes. Lines 456 and 469 describeSTAGING_FRAMES = 2(helios/src/engram.rs:339,678), which remains two frames for single-plane tables. - Subtraction Lens §6b ("
ignition/preparation/rank_group.py:47duplicates count validation already done inPreparedTables::from_shared"): Factually wrong —_receive_embedding_tablesmust validatecountbefore readingcountFDs viarecv_handle(control)(lines 52–53), and for partitioned tables (catalog != model.embedding_catalog, line 56)descriptorsis passed asNone, soPreparedTables::from_sharednever runs on those handles. - Subtraction Lens §6c (
heliopause/src/export/core.rs:1559-1637format string closure): Low-signal micro-cleanup; four explicit path literals are readable and greppable.