Opened by a workflow run, Dec 1, 2026 2:50 PM EST. decide malicious: all_clear (100%): No malicious content found
explore
Author: kbenkhaled (CONTRIBUTOR; one prior merged PR, #592 "Add sm110/thor identifiers"; no Discord handle given) Motivation: Gemma 4 E2B/E4B per-layer embedding tables are raw BF16, indexed directly by token ID, and cost 4.38–5.25 GiB — too much to keep resident on unified-memory GPUs. Helios' existing offloaded-embedding path only understood two-plane quantized n-gram tables, so this PR generalizes it with a single-plane BF16 encoding and identity (token = row) indexing. Scale: +1757 / −548 lines in 23 files Proposal:
- Append
EngramTable.Encoding.BF16 = 3(no scale plane) andEngramHash.Method.IDENTITY = 3(1 head, no hashing, GPU request mailbox publishing int64 row IDs); existing tags untouched. - Replace
[Plane; 2]withPlanes { weights: Plane, scales: Option<Plane> }across reader, row cache, advisory warm, RAM andPreparedTables, and make the scales plane optional in Heliopause export, weight reuse and peer descriptor handoff. - Gate
--embedding-table-resident-scaleson "any table has a scale plane" and hard-error when explicitly enabled with none. - Two shared fixes: enforce contiguous rank-ordered full shard coverage in signed-core validation; add
Table.partitionso byte-identical shards on two TP ranks no longer collapse into one delivery group. - Update four docs, the two
.protocomment blocks and regenerateruntime_core_pb2.py(protoc 36.2). Touches: helios/src/engram/{reader,prepared}.rs,helios/src/engram.rs— thePlanesrefactor through every storage pathhelios/src/core/schema.rs+helios/src/runtime_core/{engram,model,selection}.rs— validation, decode, resident-scale policyheliopause/src/export/{core,binding}.rs,embedding_tables.rs— optional scale plane in signing, publishing and peer handoff Related items:- #566 perf(engram): graph-driven advisory lookahead prefetch (merged): direct predecessor; same contract-approval problem, merged with the blocker open
- #590 helios,ignition: Engram reader fixes + PLE lookahead publish (merged): established the two-plane PLE disk path this generalizes
- #334 Read Engram rows ahead of prefill on every rank (open): rejected as "Helios must not hash"; IDENTITY is compatible with that ruling
- #535 Engram read-ahead: approval for an advisory mailbox (open): the still-open contract-approval venue for the neighbouring mailbox
- #554 DRAFT: RDMA row-cache misses (open): overlapping files, will collide mechanically with the
Planesrefactor Link: https://github.com/NVIDIA/hyperflare-inference/pull/664 Autobot comments: No producer exists in-tree — Ignition still emits only FP8/NVFP4 two-plane tables (ignition/components/engram.py:52-84), so no artifact in this repo can exercise BF16/IDENTITY end to end. Two undeclared effects: shard validation is tightened for all partitioned cores (older gapped/short cores now failvalidate, untested against charter line 42), andheliopause/src/export/binding.rs:648-657now silently skips anullplane JSON instead of erroring. Thepartitionfield is never read in production; it works only viaTable: PartialEqdedup athelios/src/runtime_core/model.rs:458. New core-contract values (=3) carry no owner-approval note, unlike #566. The only memory figures are unverified arithmetic, and Validation still contains the author's placeholder for a missing Thor export/benchmark; no GPU, serving replay, Windows build, CI checks, labels, reviews or comments.
Value Proposition
Value Proposition — PR #664: single-plane BF16 and identity-indexed offloaded embedding tables
Charter alignment — right layer, wrong process. The PR adds a general storage encoding and a general indexing method, appends enum tags (= 3) without disturbing existing FP8/NVFP4 wire layout, and introduces no model allowlist, capability flag, or per-model branch — the "solve the right problem in the right place" posture the charter asks for (#267/#334). Method.IDENTITY removes hashing from the runtime, consistent with the line yatesdr drew in #334. The tension is procedural: Encoding.BF16, Method.IDENTITY and the mailbox semantics (helios/manifest.md:455-470) are new core-contract surface, and the charter requires owner approval before writing such contracts. The PR records none, unlike #566's explicit approval note. The charter's recipe rule ("prove they export and serve cleanly from the PR branch") is also unmet.
Novelty & status — additive. No competing implementation of single-plane BF16 or identity indexing exists among open or closed items. #566 and #590 are the foundations it extends, not substitutes; #554/#334 are adjacent and will collide mechanically. Neither obsolete nor superseded.
Value vs cost — real constraint, weak evidence, high review cost. The motivating problem (4.38 GiB E2B / 5.25 GiB E4B PLE tables crowding KV headroom on unified-memory GPUs) is plausible but is unverified arithmetic, and Validation still carries the placeholder "(update this line once the Thor E2B export + benchmark completes)": no GPU, no serving replay, no Windows build, no mutation testing. Decisively, no producer exists in-tree — ignition/components/engram.py:40-58 still emits only two-plane FP8/NVFP4 — so nothing in this repository exercises the new contract end to end. Cost is substantial: +1757/−548 across 23 files whose surrounding code changed twice in the preceding 48 hours, plus two undeclared behavior changes (stricter shard validation that can reject previously signed gapped cores, untested for compatibility; null tolerance at heliopause/src/export/binding.rs:648-658). The partition fix is sound but its effect flows only through derived PartialEq (runtime_core/model.rs:458) and is undocumented.
Required changes: (1) recorded owner approval for the enum values and mailbox contract (#535 is the venue); (2) a linked recipe/producer plus one exported-and-served BF16/IDENTITY core and a benchmark against main; (3) split shard-contiguity and binding fixes into a separate PR with an issue and an old-core load test; (4) document the partition mechanism and the undeclared relaxations.
Verdict: Worth it with changes.
Full report Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.
Classify intake
Selected: performance, enhancement, area:engram
Threshold: 65%
Triage
-
triage:design-review: 49.8% -
triage:review: 49.8% -
triage:validation: 0.2% -
triage:investigate: 0.1% -
none: 0.0% -
triage:integration: 0.0% -
triage:partial: 0.0% -
triage:superseded: 0.0% -
triage:verify-for-closure: 0.0%
Priority
-
none: 99.7% -
priority:P1: 0.2% -
priority:P2: 0.0%
Type
- [✓]
enhancement: 98.2% - [✓]
performance: 81.8% -
community: 46.9% -
bug: 4.2% -
duplicate: 0.7% -
documentation: 0.0%
Area
- [✓]
area:engram: 92.4% -
area:preparation: 50.0% -
area:memory: 46.9% -
area:api: 29.4% -
area:packaging: 11.9% -
area:caching: 10.7% -
area:selene: 1.1% -
area:kernels: 0.8% -
area:orbit: 0.8% -
area:scheduling: 0.2% -
area:rocenante: 0.0%
Model
-
model:gemma4: 20.2% -
model:inkling-small: 2.9% -
model:deepseek-v4: 0.7% -
model:deepseek-v4.1: 0.4% -
model:kimi-k3.1: 0.3% -
model:mimo-v2.6: 0.3% -
model:muse-glimmer: 0.3% -
model:qwen3.8-flash-next: 0.3% -
model:glm-5.3: 0.2% -
model:nemotron-3.5-bolt: 0.1% -
model:qwen3.8-27b: 0.1%
Apply Labels (Intake)
Applied: +performance, +enhancement, +area:engram
Subtraction and simplicity
Subtraction/simplicity review of PR #664. The structural core is lean — Planes { weights, scales: Option<Plane> } is the minimal generalization of [Plane; 2], test fixtures were updated not duplicated, and no new flags, allowlists or env switches appear. The validation layer is where the diff is not lean.
-
The "single-plane table cannot carry a scale plane" rejection is copy-pasted eight times with six different messages, and each site separately re-decides whether a required scale plane exists — helios/src/core/schema.rs:451-453, :495-499, helios/src/runtime_core/engram.rs:47-49, :68-72, :107-111, :200-202, :273-276, heliopause/src/export/core.rs:117-121, :149-153, :437-441, :458-462, :1577-1583, :1632-1638. Collapse into one strict
engram_scales(encoding, span) -> Result<Option<&Span>>besideengram_encoding_has_scales(schema.rs:319); removes ~40 lines and the drift risk between the four exporter groups that must agree on assets. -
TableSourcecarries twoOptions that must agree (scales_plane+scales, helios/src/engram/prepared.rs:39-48), enforced by hand at prepared.rs:71 and again at :163-167 with a bespoke error string; same coupling inTable(helios/src/engram.rs:178-183).Option<(PlaneSource, String)>makes the illegal state unrepresentable and deletes three checks. -
Table.partition(helios/src/engram.rs:179) is written once (runtime_core/engram.rs:425) and never read in production — only a test at :1076. Its effect is purely to perturb derivedPartialEqat the dedup in helios/src/runtime_core/model.rs:458. Compare an explicit delivery key there, or read the field there; don't leave behaviour riding on==. -
Row geometry is computed three ways in one type:
Planes::row_bytes/scale_row_bytes(reader.rs:83-89) vs the unchecked hand-rolledtry_foldin helios/src/engram.rs:195-199. AddPlanes::try_row_bytes()and use it; that also lets theif scales > 0sentinels (reader.rs:970, :1102, :1156) be driven fromplanes.iter(). -
engram_encoding_has_scales(schema.rs:316-329) returnstrueforUnspecifiedfor legacy fixtures and pushes a separateUnspecifiedrejection onto every strict caller (schema.rs:355-359). Fold into finding 1; letspans()special-case it locally.
Smaller: helios/manifest.md:456 still says "two pinned payload frames" directly above the new single-plane paragraph; ignition/preparation/rank_group.py:47 duplicates the descriptor count helios/src/engram/prepared.rs:181-187 already validates with the same message; heliopause/src/export/core.rs:1559-1584 and :1604-1637 hold four near-identical format! plane pairs that one plane_job() closure replaces.
Open: whether the partition-as-PartialEq mechanism was intentional; why Python re-checks the descriptor count; and confirming the validate_shards sibling-absence rule (runtime_core/engram.rs:101-106) is genuinely distinct so the shared helper doesn't swallow it. No CI on head, so pass counts unverified.
Correctness and contracts
Correctness/contracts review of PR #664 (single-plane BF16 + IDENTITY engram tables). The wire change is clean and backwards compatible, and the new single-plane reader path is actually tested end to end (disk, row cache, warm, RAM) — contrary to the description's own waiver. The problems are elsewhere.
Most important: (1) Major — per-table staging and miss workspace are sized embedding_width * 2 * heads * max_tokens with STAGING_FRAMES = 2 and no width cap; the PR's own test uses 17,920-byte rows, so ~35–42 tables cost several GiB of pinned host memory on the same unified pool the feature is meant to free (engram.rs:195-201, 677-685; reader.rs:1049; charged at model.rs:762-777). (2) Major/process — Encoding.BF16 = 3 and Method.IDENTITY = 3 plus a new captured-graph mailbox contract (row ID in [0, stored_rows), -1 inactive, partition-local) are new core contract with no recorded owner approval, while the description claims no new captured-graph families (manifest.md:455-470). (3) Minor — engram_encoding_has_scales returns Ok(true) for Unspecified, making it the wrong authority for plane presence in 8 call sites. (4) Minor — the "distinct delivery groups" fix rests on an unread partition field whose only effect is derived PartialEq dedup (engram.rs:176-187, model.rs:458), and prepared.rs:131 sets it None unconditionally. (5) Minor — append_planes now tolerates "weights": null (undeclared relaxation, binding.rs:653-657), and four distinct partition errors collapsed into "invalid partitioned engram table" (schema.rs:455-461). (6) The stricter shard-contiguity rule is a genuine fix that matches the loader, but it changes validation for previously signable cores and no test covers an older gapped artifact.
Open: who approved the IDENTITY mailbox; where the producer lives (none in-tree; ignition still emits two-plane FP8 only); whether a gapped existing core was ever observed.
Final review
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.
Classify triage
Selected: triage:review
Threshold: 65%
Triage
- [✓]
triage:review: 67.9% -
triage:design-review: 28.3% -
triage:validation: 3.4% -
triage:investigate: 0.1% -
triage:partial: 0.1% -
none: 0.1% -
triage:verify-for-closure: 0.0% -
triage:integration: 0.0% -
triage:superseded: 0.0%
Apply labels
Applied: +triage:review Decision to Test: no (100%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with. decide malicious: all_clear (100%): No malicious content found
explore
Author: kbenkhaled (CONTRIBUTOR; one prior merged PR, #592 "Add sm110/thor identifiers"; description states Discord: no username provided)
Motivation: Gemma 4 E2B/E4B carry huge per-layer embedding tables (4.38–5.25 GiB) that crowd out KV cache on unified-memory GPUs; Flare's offloaded-embedding path assumed two-plane quantized tables indexed by a hash, so this PR adds raw single-plane BF16 storage and direct token-ID indexing so those tables can live on disk with a host row cache.
Scale: +1722 / −548 lines in 23 files
Proposal:
- Append
EngramTable.Encoding.BF16 = 3(rawembedding_width * 2-byte rows, no scale plane) andEngramHash.Method.IDENTITY = 3(1 head, empty token_map/hash arrays,compressed_vocabulary == rows, row IDs via the existingrequest_buffer). - Replace
[Plane; 2]withPlanes { weights, scales: Option<Plane> }across disk, row-cache, advisory warm, RAM andPreparedTables; skip resident scales automatically and reject explicit--embedding-table-resident-scaleswhen no table has scales. - Make the scale plane optional in Heliopause
roles()/validate_ranks()/core_engram()and peer handoff; signing now pins BF16 payload bytes exactly. - Two shared fixes: signed-core shard contiguity matching native loading, and explicit
Index::shares_delivery_withso TP ranks with byte-identical shards stay distinct delivery groups; plus an undeclared panic fix invalidate_buffer. - Docs (manifest, core-format, cli, model-preparation) and CPU tests across schema, decode, gather, export/reuse, gapped-shard rejection and mixed-plane Python handoff. Touches:
helios/src/core/schema.rs+helios/proto/{core,runtime_core}.proto— signed core-format contract, compliance risk.helios/src/engram/{reader,prepared}.rs,helios/src/engram.rs,helios/src/runtime_core/{engram,model,selection}.rs— native staging/row-cache/delivery pipeline.heliopause/src/export/core.rs,heliopause/src/embedding_tables.rs— exporter and Python boundary. Related items:- #566 perf(engram): add graph-driven advisory lookahead prefetch (merged): direct predecessor, 15 shared files; shipped with the approval note and recipe PR that #664 lacks.
- #590 helios,ignition: fix Engram reader bugs and add PLE lookahead publish (merged): established the two-plane PLE-on-disk path being generalized.
- #535 Engram read-ahead: approval for an advisory mailbox (open): the repo's precedent for how mailbox contract approval is recorded.
- #334 Read Engram rows ahead of prefill on every rank (open): rejected hashing in Helios; #664 is compatible and moves hashing out entirely.
- #554 DRAFT: engram: read row-cache misses over RDMA READ (open): mechanical overlap on the
Planesrefactor. Link: https://github.com/NVIDIA/hyperflare-inference/pull/664 Autobot comments: Amendments to my earlier report: the "no GPU evidence" and "undeclared null-plane relaxation" findings are retracted — head263dfe9bnow reports a Jetson AGX Thor E2B export+serve with AIPerf numbers, and the description declares thenull-plane tolerance and the Discord line. Six of the eight granular asks in the on-PR Autobot review (strictUnspecified, explicitshares_delivery_with, theengram_scaleshelper, the pairedOption<(PlaneSource, String)>, distinct diagnostics, description nits) are already implemented at the head — that review auditedc769355, 22 minutes earlier. One blocker survives:Encoding.BF16/Method.IDENTITYadd contract surface with no recorded owner approval and no producer/recipe link (docs/design-review.md:22-26,docs/core-design.md:276-280); the in-tree producer is still two-plane only (ignition/components/engram.py:38-58). The CI half is smaller than it looked: Windows, pytest and lifecycle workflows already trigger onpull_requestand simply have not run. Also surviving: single-checkpoint evidence only (E4B is nowhere but docs/templates), nomainbaseline so no speed claim, self-reported test counts, no FP8/NVFP4 replay of an existing core, and an undeclared panic fix invalidate_buffer.
Classify intake
Selected: triage:review, performance, enhancement, area:engram
Threshold: 65%
Triage
- [✓]
triage:review: 90.7% -
triage:design-review: 8.4% -
triage:validation: 0.8% -
none: 0.1% -
triage:investigate: 0.0% -
triage:partial: 0.0% -
triage:integration: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0%
Priority
-
none: 99.9% -
priority:P1: 0.1% -
priority:P2: 0.1%
Type
- [✓]
performance: 96.3% - [✓]
enhancement: 91.5% -
community: 13.3% -
bug: 8.5% -
duplicate: 1.2% -
documentation: 0.2%
Area
- [✓]
area:engram: 99.8% -
area:memory: 53.1% -
area:preparation: 46.9% -
area:packaging: 29.4% -
area:caching: 2.6% -
area:kernels: 2.3% -
area:api: 1.1% -
area:selene: 0.2% -
area:orbit: 0.2% -
area:rocenante: 0.1% -
area:scheduling: 0.1%
Model
-
model:gemma4: 9.5% -
model:inkling-small: 1.8% -
model:glm-5.3: 1.4% -
model:muse-glimmer: 1.0% -
model:mimo-v2.6: 0.8% -
model:deepseek-v4.1: 0.6% -
model:nemotron-3.5-bolt: 0.3% -
model:kimi-k3.1: 0.2% -
model:qwen3.8-27b: 0.2% -
model:deepseek-v4: 0.1% -
model:qwen3.8-flash-next: 0.0%
Apply Labels (Intake)
No label changes
Subtraction and simplicity
Subtraction/simplicity review of PR #664 at head 263dfe9b: the diff is lean overall — the [Plane; 2] → Planes { weights, scales: Option<Plane> } refactor removes indexing assumptions rather than adding a second path, and no env-var knob, capability flag, model allowlist or new captured-graph op family was introduced in code.
Four things are worth cutting (~30 lines, all zero behaviour change except item 3's fixture edit):
- HIGH — dead duplicate encoding validation,
helios/src/core/schema.rs:367-372: try_from plusif encoding == Unspecifiedis fully subsumed byengram_encoding_has_scaleson the next line, which returns the identical "engram table has no encoding" for Unspecified and unknown tags. Delete four lines. - HIGH — unreachable
Nonearm in thePlanesconstruction,helios/src/runtime_core/engram.rs:257-268:scale_bytes == Noneimplies no scale plane, already rejected for shared tables at:187-193and partitioned at:97-101. Replace the match withscale_bytes.map(|bytes| plane(scales, bytes)).transpose()?; the test at:1091-1094keeps its coverage because both errors come fromvalidate_shards. - HIGH — speculative legacy shim,
helios/src/runtime_core/engram.rs:28-34, whose own comment says fixtures are the justification; no published core can reach it given the PR's strict Unspecified rejection. Delete it (decode would then error at:155) and give the hand-encoded fixture at:498-500an explicit encoding. - MED-HIGH — the engram-plane walk exists three times:
heliopause/src/export/core.rs:96-142,:408-440(both with the duplicated "partitioned embedding tables cannot also hold shared planes" and both usingunwrap_or(&wire::Span::default())where helios rejects a missing plane), andhelios/src/runtime_core/engram.rs:19-68(spans). Extract one walker and have all three call it. - LOW —
Index::shares_delivery_with(helios/src/engram.rs:195-201) isself == otherwith a doc comment restatingTable::partition's; optional.
Cleared as non-excess: every new Planes helper has callers (iter, iter_mut, total_nbytes, row_bytes, scale_row_bytes; single/two are #[cfg(test)] and used widely); the embedding_tables.rs plane-pairing, prepared.rs closures, reader.rs:1350-1365 and the rank_group.py extraction all net-simplify; engram_scales is real centralization.
Open: whether any real core carries encoding == 0 (fixture-only vs missing migration); where the shared walker should live.
Correctness and contracts
Correctness/contracts/system review of PR #664 at 263dfe9b: one blocker, two majors, two minors. The Planes refactor and both shared correctness fixes are sound; the contract gate and the unreported staging cost are what block.
- Blocker —
Encoding.BF16 = 3/Method.IDENTITY = 3impose new captured-code mailbox obligations (helios/manifest.md:455-463) with no recorded owner approval (docs/design-review.md:22-26 (not opened),265-266; charter) and no in-repo producer:ignition/components/engram.py:117-126still emits 256-byte FP8 rows + 8-byte scales, never 17,920-byte BF16 rows or identity IDs. - Major (system) — pinned staging scales with row bytes × heads × max_tokens × 2 frames (
helios/src/engram.rs:203-219,348): ~17,920 B per staged token for a PLE table vs ~6,336 B for a 24-head FP8 table (~2.8×). Budgeted (helios/src/runtime_core/model.rs:491-493,764-779) but it eats the KV headroom the PR targets, and no staging figure is reported. Partitioned deployments now also split delivery groups unconditionally (helios/src/engram.rs:195-201), so each rank pins its own frames and the cache divides by group count (model.rs:842). - Major (coverage) — every new test hand-builds
wire::EngramTable(helios/src/core/schema.rs:1805-1813,heliopause/src/export/core.rs:5306-5336); no producer→exporter→Helios test exists, no CI ran on this head, Validation is one E2B run on one GPU with nomainbaseline, andflare_engram_resident_scale_bytes = 0is structurally zero for single-plane tables. - Minor — "two-plane tables keep their exact validation rules" is wrong for partitioned cores (
schema.rs:464-473,474-507), but rescoped:main's loader already enforced request delivery, rank count and contiguity (runtime_core/engram.rs:70-105atmain), so no loadable core is newly rejected — a claim-accuracy issue only. - Minor —
--embedding-table-resident-scaleshard-fails on a single-plane-only catalog (selection.rs:56-68) while a mixed catalog silently ignores it.
Verified sound: disk/row-cache/advisory/RAM/transfer paths, empty-scale tolerance, out-of-range ID rejection (engram/reader.rs:1416-1423), the validate_buffer panic fix (runtime_core/engram.rs:305-321), BF16 size pinning, descriptor arithmetic, FD accounting, shared-table grouping.
Open: no off-GitHub approval evidence; no producer/recipe PR; E4B unexercised; staging unmeasured; CI silence unexplained.
Re-review
Recommendation: Changes Requested
All six code and documentation follow-ups from the previous review were cleanly resolved in 263dfe9 (engram_encoding_has_scales strictness, engram_scales centralization, Index::shares_delivery_with, paired Option<(PlaneSource, String)>, distinct partitioned-table diagnostics, and PR description updates), the Thor E2B live export-and-serve run is now completed, and deep inspection of the reader, row cache, staging, export, conversion, and weight-reuse paths found no correctness or concurrency regressions. The PR remains blocked on two repository gates carried over (and narrowed) from the previous round: recorded project-owner approval and a linked producer/recipe PR for the new Encoding.BF16 / Method.IDENTITY wire contract, and passing CI plus a backward-compatibility serving replay of a pre-existing FP8/NVFP4 core without re-export.
Merge Risk
Level: Medium
- Modifies signed core schema validation (
helios/proto/{core,runtime_core}.proto,helios/src/core/{schema,reader}.rs), the native embedding reader/cache/transfer pipeline (helios/src/engram.rs,engram/{reader,prepared}.rs,runtime_core/{engram,model,selection}.rs), and theheliopauseexporter (export/{core,binding}.rs,embedding_tables.rs), all in recently active areas. - Backward wire compatibility for two-plane FP8/NVFP4 cores is preserved structurally (new enum values appended at
= 3, existing layouts untouched,runtime_core_pb2.py(not opened) regenerated, andDiskReader::gather/RowCachehandle wide single-plane rows via 4 KiB fragments and 64 KiB coalesced reads), and every downstream consumer (conversion.rs,weight_reuse.rs,describe.rs,reader.rs) cleanly toleratesscales: None. - No CI workflow has run on
263dfe9(leaving Windows I/O ring builds, TLA+ lifecycle conformance, and Kani sequential proofs unverified), and serving replay of a previously exported FP8/NVFP4 core without re-export has not been performed.
Walkthrough
- Wire contract & schema (
helios/proto/core.proto:258,294,helios/proto/runtime_core.proto:661,695,helios/src/core/schema.rs:318-511,helios/src/core/reader.rs:228-245,ignition/preparation/runtime_core_pb2.py(not opened)): AppendsEngramTable.Encoding.BF16 = 3(rawembedding_width * 2-byte rows, no scale plane/metadata, overflow-checked payload size pinning) andEngramHash.Method.IDENTITY = 3(1-head direct indexing overrequest_buffer, emptytoken_mapand hash arrays,compressed_vocabulary == rows), centralizes scale-plane checks inengram_encoding_has_scales/engram_scales, skips absent scale payloads inrequired_payloads, and aligns signed-core shard contiguity validation withruntime_core::engram::validate_shards. - Native reader, staging, and model loading (
helios/src/engram.rs:176-219,631-657,911-1029,helios/src/engram/reader.rs:60-102,792-1460,helios/src/engram/prepared.rs:39-224,helios/src/engram/reader/windows.rs,helios/src/runtime_core/{engram,model,selection}.rs): Replaces[Plane; 2]withPlanes { weights, scales: Option<Plane> }across disk, row-cache, advisory warm, RAM,Transfers, andPreparedTablespaths; recordsTable.partition: Option<usize>and groups ranks viaIndex::shares_delivery_withso byte-identical TP shards never collapse into one delivery group; skips resident scale loading for single-plane tables and rejects explicit--embedding-table-resident-scaleswhen no table carries a scale plane; fixes an out-of-bounds shape index invalidate_buffer(helios/src/runtime_core/engram.rs:306-309). - Exporter & peer handoff (
heliopause/src/export/{core,binding}.rs,heliopause/src/embedding_tables.rs:41-62,ignition/preparation/rank_group.py:44-61): Makes scale planes optional inroles(),validate_ranks(),core_engram(), FD preflight accounting, andNativeEmbeddingTables(pairingOption<(PlaneSource, String)>at the Python boundary); tolerates JSONnullplanes inappend_planes(matchingweight_reuse.rs:406); counts descriptors dynamically viasum(len(table["planes"]) for table in catalog["tables"])in_receive_embedding_tables. - Docs & tests (
helios/manifest.md:455-464,docs/{cli-design,core-format-design,model-preparation}.md,tests/preparation/test_embedding_table_handoff.py, Rust unit tests): Documents BF16 single-plane layout,IDENTITYmailbox semantics, omitted-scalesfiles, and--embedding-table-resident-scalesrejection; adds isolated CPU unit tests covering schema validation, decode, single-plane disk/cache/warm/RAM gathering, partitioned delivery-group separation, publish-time gapped-shard rejection, and mixed-plane peer descriptor handoff.
Pre-merge Checks
- [PASS] Security / malicious screen: No credential access, suspicious network/external behavior, or unsafe memory regressions;
validate_buffer(helios/src/runtime_core/engram.rs:305-321) hardens shape-arity validation before indexing. - [WARN] Charter & value fit: Clean, model-agnostic runtime extension with no allowlists or capability flags, but introduces new signed core-format / captured-graph contract semantics (
Encoding.BF16,Method.IDENTITY) without recorded project-owner approval (docs/design-review.md:22-26,docs/core-design.md:276-280) and without an in-repo or linked external producer recipe. - [PASS] Related / duplicate / conflict check: Additive to #566 and #590 with no competing implementation; note mechanical merge overlap with open drafts touching
Planes(e.g., #334, #554). - [WARN] Tests & verification evidence: Thor SM110 Gemma 4 E2B export+serve run is now reported and CPU unit tests are well isolated, but head
263dfe9has zero CI runs (Windows build, pytest, TLA+ lifecycle, and Kani unverified), E4B remains untested, and no serving replay of a pre-existing FP8/NVFP4 core without re-export has been run (docs/design-review.md:116-123,247-251).
Blockers
- Unapproved core-format / captured-graph contract extension with no linked producer (
helios/proto/core.proto:258,294,helios/proto/runtime_core.proto:661,695,helios/manifest.md:457-463,docs/core-format-design.md:92-103): AddingEngramTable.Encoding.BF16 = 3,EngramHash.Method.IDENTITY = 3, single-plane artifact packaging (omitting-scalessafetensors files), and theIDENTITYmailbox contract (1-headint64row IDs in[0, stored_rows)or-1, partition-local indices when sharded, out-of-range IDs failing gather) defines new producer obligations on captured graphs. Perdocs/design-review.md:22-26,docs/core-design.md:276-280, and the Project Charter, a new operation/wire contract requires explicit prior approval from project owner Luke Alonso even when reusing an existing graph kind or mailbox mechanism; no human review or approval is recorded on this PR. Additionally, no producer exists in this repository (ignition/components/engram.py:117-126emits only two-plane FP8/NVFP4) and no companion recipe PR (e.g., Gemma 4 E2B/E4B) is linked. Fix: Record explicit owner approval forEncoding.BF16andMethod.IDENTITY(and their mailbox semantics), and link the companion producer/recipe PR targeting this contract. - Missing CI verification on head
263dfe9and unverified legacy FP8/NVFP4 core replay (.github/workflows/native-serving.yml:13-78(not opened),.github/workflows/python-cpu.yml:13-41(not opened),.github/workflows/helios-lifecycle.yml:18-48(not opened),docs/design-review.md:116-123,247-251): While the Thor E2B export-and-serve run from Round 1 Blocker 2 is now complete, two verification gates remain unmet: (a) no CI workflows have reported on263dfe9, leaving the Windows I/O ring build (windows-2022matrix job), full release crate test suites,python-cpupytest/heliopausejob, andhelios-lifecycleTLA+ conformance and Kani proofs unverified (anddocs/design-review.md:247-251states that disclosing runnable CPU/formal checks as limitations does not waive them); and (b) the PR discloses that loading and serving replay of a previously exported FP8/NVFP4 core without re-export was not run, which is required by Principle 13 (docs/design-review.md:123) and the Project Charter. Fix: Unblock and pass CI on the PR head (native-serving,python-cpu, andhelios-lifecycle), and verify loading and serving replay of at least one previously exported FP8/NVFP4 core without re-export.
Should Fix
None.
Subtract / Simplify
- Remove redundant encoding validation in
validate_engram(helios/src/core/schema.rs:367-372):engram_encoding_has_scales(table.encoding)?(helios/src/core/schema.rs:318-327) already rejects unknown tags andEncoding::Unspecifiedwith the identical"engram table has no encoding"error. Delete the duplicatetry_from/Unspecifiedcheck at lines 367–371 (either checktable.encoding == wire::engram_table::Encoding::Bf16 as i32at line 433 or drop lines 369–371 afterengram_encoding_has_scales). - Delete unreachable
Nonebranch indecodePlanesconstruction (helios/src/runtime_core/engram.rs:259-267): Whenscale_bytesisNone(has_scales == false), shared tables have already rejectedtable.scales.is_some()at line 191 and partitioned tables have already rejectedshard.scales.is_some()for every shard insidevalidate_shardsat lines 97–101 (called at line 158). Replace lines 259–267 withscales: scale_bytes.map(|bytes| plane(scales, bytes)).transpose()?,(deleting 7 unreachable lines).
Nits
None.
Dropped on verification
- Round 1 code/doc asks (6 of 8 items from prior review on
c769355): All verified resolved in263dfe9— strictUnspecifiedrejection inengram_encoding_has_scales(helios/src/core/schema.rs:318-327),engram_scalescentralization (:330-341),Index::shares_delivery_with(helios/src/engram.rs:195-201,helios/src/runtime_core/model.rs:458-460), pairedOption<(PlaneSource, String)>(helios/src/engram/prepared.rs:43,heliopause/src/embedding_tables.rs:54-62), distinct partitioned-table diagnostics (helios/src/core/schema.rs:461-473), and PR description updates (parts.is_null()andDiscord: no username provided). - Correctness Lens §2 ("Major — pinned staging amplification ~2.8x and per-rank delivery split"): Dropped as misleading. Staging (
helios/src/engram.rs:204-219,STAGING_FRAMES = 2) is already accounted inembedding_host_bytesand checked before KV sizing (helios/src/runtime_core/model.rs:491-493,764-779), whereengram_tokens(:483-490) is already the maximum consuming graph'spacked_tokens(). Partitioned ranks with distinct shard spans already formed separate delivery groups onmain;Table.partitiononly prevents false cross-rank mailbox collapse when two ranks share byte-identical shard spans. - Correctness Lens §3 sub-claims ("missing
mainspeedup baseline" and "flare_engram_resident_scale_bytes = 0is structurally zero"): Dropped — the PR motivates a memory-headroom / enablement goal on Gemma 4 E2B/E4B rather than claiming a latency speedup overmain, and reportingflare_engram_resident_scale_bytes = 0alongside real gather/cache/direct-I/O counters simply confirms the resident-scale skip path. (The surviving CI and legacy-core replay gaps are retained in Blocker 2.) - Correctness Lens §4 ("inaccurate claim that two-plane FP8/NVFP4 tables keep exact validation rules"): Dropped as low-signal; Solution §3 of the PR description already explicitly discloses the pre-publication shard contiguity tightening, and Helios's loader (
helios/src/runtime_core/engram.rs:70-107) already enforced those exact rules onmain, so no previously loadable core is broken. - Correctness Lens §5 ("hard startup failure on
--embedding-table-resident-scalesfor BF16-only vs no-op on single-plane tables in a mixed catalog"): Dropped — failing fast when no table in the catalog has a scale plane is documented (docs/cli-design.md:791-799) and aligns with the Charter's rule against silently ignoring explicit flags, while mixed catalogs legitimately apply the flag to the tables that carry scales. - Subtraction Lens §3 ("delete legacy
encoding == 0shim inhelios/src/runtime_core/engram.rs:29-34") and §5 ("deleteIndex::shares_delivery_with"): Dropped to prevent moving goalposts — both were explicitly requested by Round 1's review (Should Fix #1/#2 and Subtract #1) to keepschema::engram_encoding_has_scalesstrict while preserving the pre-existingmetadata_without_partitions_retains_shared_planeswire fixture (helios/src/runtime_core/engram.rs:496-519) and documenting theTable.partitionequality invariant. - Subtraction Lens §4 ("deduplicate engram-plane walks across
roles,validate_ranks, andspans"): Dropped — those per-stage walks already existed onmainwith distinct validation/ownership semantics (rolesbounds-checksshard.rank,validate_rankslocates payload parts,spansenforcesworld/validate_shards/rank selection and legacyencoding == 0), and the author already centralized the scale-plane check viaengram_scalesas requested in Round 1.
Classify triage
Selected: triage:review
Threshold: 65%
Triage
- [✓]
triage:review: 86.1% -
triage:design-review: 10.3% -
triage:validation: 3.3% -
none: 0.2% -
triage:investigate: 0.0% -
triage:partial: 0.0% -
triage:integration: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0%
Apply labels
No label changes Decision to Test: no (100%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with. decide malicious: all_clear (100%): No malicious content found
explore
Author: kbenkhaled (CONTRIBUTOR; one prior merged PR, #592 "Add sm110/thor identifiers"; description states "Discord: no username provided")
Motivation: Gemma 4 E2B/E4B keep their per-layer embedding tables as raw BF16 indexed by token id, costing 4.38–5.25 GiB and squeezing KV headroom on unified-memory GPUs, but Helios and the Heliopause exporter only understand two-plane FP8/NVFP4 n-gram tables. The PR adds a single-plane BF16 encoding plus direct (identity) token indexing so those tables can be offloaded instead of resident.
Scale: +1711 / −550 lines in 23 files (head fd6dad6; was +1722/−548 at 263dfe9)
Proposal:
- Append
Encoding.BF16 = 3(rawwidth*2-byte rows, no scale plane/metadata) andMethod.IDENTITY = 3(1 head, empty token map/hashes, graph publishes int64 row ids or-1). - Replace
[Plane; 2]withPlanes { weights, scales: Option<Plane> }across disk, row cache, advisory warm, RAM andPreparedTables; centralize scale checks inschema::engram_scales. - Make the scale plane optional in exporter roles/rank validation/
core_engramand pair scale plane + buffer name asOption<(PlaneSource, String)>at the Python boundary. - Two shared fixes: signing now enforces contiguous rank-ordered shards (matching native loading) and decoded tables carry
partitionso identical TP shards don't collapse into one delivery group; also fixes an undeclaredvalidate_buffershape panic. - Docs/proto comments for single-plane layout, IDENTITY mailbox semantics and
--embedding-table-resident-scales; regeneratedruntime_core_pb2.py(not opened). Touches: helios/src/core/schema.rs(+236/−28) — signed core-format validation for all partitioned tableshelios/src/runtime_core/engram.rs(+366/−65) andhelios/src/engram/reader.rs(+229/−80) — decode, staging, RAM/row-cache pathsheliopause/src/export/core.rs(+351/−91) — exporter plane-optional plumbing Related items:- #566 perf(engram): advisory lookahead prefetch (merged): direct predecessor, had a recorded approval note #664 lacks
- #539 engram zero-staging export blob reuse (merged): shipped
flare::staged_engram_compactwith approval unrecorded — precedent for Blocker 1 being an owner decision - #696 helios: parallelize engram loading (open): heaviest mechanical overlap, same resident-table load path; land/rebase first
- #678 fix(ignition): propagate source roots (open): trivial disjoint overlap in
rank_group.py - #334 Read Engram rows ahead of prefill on every rank (open): opposite stance;
IDENTITYcomplies with it Link: https://github.com/NVIDIA/hyperflare-inference/pull/664 Autobot comments: Three bot posts, zero human comments/reviews and no recorded owner approval. Two blockers: (1) new signed core-format/captured-graph enums with no recorded owner approval and no producer in-tree (ignition/components/engram.py:36-48,58is still two-plane FP8); (2) no CI has reported on any head and no pre-existing FP8/NVFP4 core has been replayed. Correcting the 22:05 review: of its two Subtract/Simplify items, one is applied (helios/src/runtime_core/engram.rs:257-260) and one only half (helios/src/core/schema.rs:367vs:428). Undeclared in the description: a real out-of-bounds panic fix invalidate_buffer(helios/src/runtime_core/engram.rs:297-314). GPU/perf claims are one checkpoint (E2B), nomainbaseline, E4B arithmetic only; CPU test counts are self-reported.
Classify intake
Selected: triage:design-review, performance, enhancement, area:engram, area:memory
Threshold: 65%
Triage
- [✓]
triage:design-review: 90.8% -
triage:review: 8.4% -
triage:validation: 0.5% -
triage:investigate: 0.2% -
none: 0.1% -
triage:integration: 0.0% -
triage:verify-for-closure: 0.0% -
triage:partial: 0.0% -
triage:superseded: 0.0%
Priority
-
none: 100.0% -
priority:P1: 0.0% -
priority:P2: 0.0%
Type
- [✓]
performance: 99.4% - [✓]
enhancement: 98.9% -
community: 34.9% -
duplicate: 29.4% -
bug: 2.0% -
documentation: 0.4%
Area
- [✓]
area:engram: 99.5% - [✓]
area:memory: 67.9% -
area:preparation: 53.1% -
area:packaging: 32.1% -
area:kernels: 6.0% -
area:api: 4.2% -
area:caching: 2.6% -
area:scheduling: 0.5% -
area:orbit: 0.4% -
area:rocenante: 0.3% -
area:selene: 0.2%
Model
-
model:gemma4: 22.3% -
model:inkling-small: 2.9% -
model:muse-glimmer: 2.6% -
model:kimi-k3.1: 1.4% -
model:deepseek-v4: 0.8% -
model:glm-5.3: 0.8% -
model:nemotron-3.5-bolt: 0.8% -
model:deepseek-v4.1: 0.6% -
model:mimo-v2.6: 0.5% -
model:qwen3.8-flash-next: 0.5% -
model:qwen3.8-27b: 0.0%
Apply Labels (Intake)
Applied: +triage:design-review, +area:memory, -triage:review
Subtraction and simplicity
Subtraction/Simplicity lens on PR #664 (head fd6dad6): the diff is already lean and idiomatic — Planes { weights: Plane, scales: Option<Plane> } with Option-chained iterators is the right collapse of [Plane; 2], no new knob/module/flag, no structural AGENTS.md (not opened) violation. Four worthwhile subtractions, no blockers:
- (HIGH)
helios/src/core/schema.rs:367computeshas_scales, thenengram_scalesre-derives it at:331on both:452/:496call sites, and:428-436derives "is BF16" a third way via a raw tag compare. Pass the already-known bool intoengram_scalesand setbf16_row_bytes = (!has_scales).then(...)—!has_scalesIS "encoding == Bf16" after:318-327rejectsUnspecified. Same double-derivation athelios/src/runtime_core/engram.rs:35,45,59;core/reader.rs:231shows the cleaner pattern already in the PR. - (HIGH)
helios/src/runtime_core/selection.rs:52-70: the!has_tableserror arm is unreachable — the only caller (model.rs:477-481) deriveshas_scale_planesfrom the same tables, so true implies non-empty. Delete the parameter and arm; the surviving message already says the stronger thing. - (MEDIUM)
heliopause/src/embedding_tables.rs:41-62: four overlapping presence checks and a 3-arm match for one optional plane, whenTableSource.scales: Option<(PlaneSource, String)>makes the pairing unrepresentable. Readscalesname first, checkplanes.len() == 1 + usize::from(scales_name.is_some()); ~22 lines → ~8. - (MEDIUM)
heliopause/src/export/core.rs: the same 8-line "weights + optional scales" shape is hand-copied five times (:99-111,:122-138,:411-419,:426-436,:1538-1592) with sixengram_scalescalls. Onefn planes(...) -> Result<Vec<&Span>>helper and iterate.
Minors: Index::shares_delivery_with (helios/src/engram.rs:195-201) is self == other with a doc duplicating the Table::partition field doc; Table carries the scale plane twice in prepared.rs:161-166,270.
Open: I did not read AGENTS.md (not opened) in this run (convention verdict rests on observable diff facts); S1 and S4 should land together since export/core.rs consumes engram_scales across a crate boundary; test-greenness of S2 is read, not run.
Correctness and contracts
Correctness/contracts/system review of PR #664 at head fd6dad6. One Major, two Minor new findings; the rest of the change is sound.
Major — BF16 + 24-head XOR_MODULO is legal end-to-end, costing 24× host staging. helios/src/core/schema.rs:397-411 constrains hashing only by token-map emptiness, never by encoding, so a signed core can pair Encoding.BF16 with Method.XOR_MODULO; the decoder then awards 24 heads (helios/src/runtime_core/engram.rs:165-174) over 2-byte BF16 rows (:146-154), and staging is sum(row_bytes) * heads * max_tokens * 2 frames (helios/src/engram.rs:204-208, :212-219, STAGING_FRAMES = 2 at :348; rows at runtime_core/engram.rs:294-296). At 4,096 tokens and the E2B 17,920 B row width that is 3.28 GiB pinned host versus 140 MiB for the IDENTITY layout the PR ships — ~3.1 GiB avoidable on the exact bottleneck the PR targets, caught only by the generic budget check (runtime_core/model.rs:764-770). No producer, test, or doc line covers the combination. Fix: reject non-IDENTITY methods for BF16 in both schema::validate_engram and the decode arm.
Minor — sign/load parity is partial. Schema validates only rows/width plus the BF16 size pin (schema.rs:366-370, :428-436); the decoder requires exact width 256/160, block 32/16, Nvfp4 global_scale > 0 and full hash geometry (runtime_core/engram.rs:139-145, :177-178, :209-234). verify_published (heliopause/src/export/core.rs:3017) can still sign a core Helios refuses — the same class the PR closes only for gapped shards.
Minor — docs document BF16 and IDENTITY separately, never the accepted combination (helios/manifest.md:457-463).
Verified sound and not to be re-litigated: Planes propagation, Index::shares_delivery_with + Table::partition (helios/src/engram.rs:195-201, runtime_core/model.rs:458-465) preventing TP rank collapse, gather ID validation incl. -1 (engram/reader.rs:1416-1423), Windows lane mirror, exporter null/optional-scale handling, resident_scale_bytes = 0 genuinely enforced (engram/reader.rs:1362-1370), resident-scales CLI gating (selection.rs:52-76), Python descriptor counting. No new lock contention or hot-path reversal found.
Dossier blockers stand: owner approval for the enum values (AGENTS.md:376-381, "even if it reuses an existing graph kind or enum value"), and CI plus one legacy FP8/NVFP4 replay. Open: owner approval unrecordable from repo; no producer/recipe PR found; E4B unexercised; pr_diff broken for this PR.
Re-review
Recommendation: Changes Requested
The implementation at fd6dad6 is clean, model-agnostic, wire-compatible, and resolves every code-level Should Fix and Subtract/Simplify item from Rounds 1–2 (including removing the duplicate encoding check in schema.rs:367 and the unreachable None arm in runtime_core/engram.rs:259). No new correctness, concurrency, memory-budget, or hot-path defects were found. Merge remains blocked on two process/verification gates carried forward from prior rounds: recorded project-owner approval (plus a companion producer/recipe link) for the new core-format and captured-graph contract enums, and passing CI (native-serving, python-cpu, helios-lifecycle) plus a serving replay of a pre-existing FP8/NVFP4 core without re-export.
Merge Risk
Level: Medium
- Modifies signed core schema validation (
helios/proto/{core,runtime_core}.proto,helios/src/core/{schema,reader}.rs), the native offloaded-embedding reader/cache/delivery pipeline (helios/src/engram.rs,engram/{reader,prepared}.rs,engram/reader/windows.rs,runtime_core/{engram,model,selection}.rs), and theheliopauseexporter (export/{core,binding}.rs,embedding_tables.rs), all in active subsystems (heavy overlap with open #696 and open drafts #334/#554;rank_group.pyalready integrates merged #670 and is disjoint from open #678). - Wire backward compatibility and hot-path safety are preserved structurally: new enum values are appended at
= 3without altering FP8/NVFP4 layouts,DiskReader::gatherandRowCachecleanly handle wide single-plane rows via 4 KiB fragments and 64 KiB coalesced reads,validate_bufferfixes a pre-existing shape-index OOB bug, andhelios/src/execution/threaded.rschanges are test-fixture-only (no TP dispatch/transport behavior changed). - Residual risk stems from unverified gates: no CI workflows have reported on
fd6dad6(leaving thewindows-2022I/O ring build, full release crate tests, pytest, TLA+ lifecycle conformance, and Kani proofs unverified), and no serving replay of a previously exported FP8/NVFP4 binary core has been run.
Walkthrough
- Wire contract & signed schema (
helios/proto/core.proto:258,294,helios/proto/runtime_core.proto:664,698,helios/src/core/schema.rs:318-506,helios/src/core/reader.rs:230-247,ignition/preparation/runtime_core_pb2.py(not opened)): Appends orthogonal primitivesEngramTable.Encoding.BF16 = 3(rawembedding_width * 2-byte single-plane rows, no scale metadata/plane, overflow-checked payload size pinning) andEngramHash.Method.IDENTITY = 3(1-head direct indexing overrequest_buffer, emptytoken_mapand hash arrays,compressed_vocabulary == rows), centralizes strict scale validation inengram_encoding_has_scales/engram_scales, skips absent scale planes inrequired_payloads, and aligns signed-core shard contiguity checks with native loading. - Native reader, delivery grouping, and load options (
helios/src/engram.rs:176-219,631-657,911-1029,helios/src/engram/reader.rs:60-102,803-1460,helios/src/engram/prepared.rs:39-280,helios/src/engram/reader/windows.rs,helios/src/runtime_core/{engram,model,selection}.rs): Replaces[Plane; 2]withPlanes { weights: Plane, scales: Option<Plane> }across disk, row-cache, advisory warm, RAM,Transfers, andPreparedTables; recordsTable.partition: Option<usize>and groups ranks viaIndex::shares_delivery_withso byte-identical TP shards stay in distinct delivery groups; skips resident scale loading for single-plane tables (flare_engram_resident_scale_bytes = 0) and rejects explicit--embedding-table-resident-scaleswhen no table carries a scale plane; hardensvalidate_buffershape-arity matching (helios/src/runtime_core/engram.rs:297-314). - Exporter & peer handoff (
heliopause/src/export/{core,binding}.rs,heliopause/src/embedding_tables.rs:41-72,ignition/preparation/rank_group.py:44-60): Makes scale planes optional acrossroles(),validate_ranks(),core_engram(), andNativeEmbeddingTables(pairingOption<(PlaneSource, String)>at the Python boundary); tolerates JSONnullplanes inappend_planes(heliopause/src/export/binding.rs:655-657); counts handoff descriptors dynamically assum(len(table["planes"]) for table in catalog["tables"]). - Docs & tests (
helios/manifest.md:457-463,docs/{cli-design,core-format-design,model-preparation}.md,helios/src/execution/threaded.rs:1448-1638,helios/src/runtime_core/event_tests.rs,tests/preparation/test_embedding_table_handoff.py): Documents single-plane BF16 storage,IDENTITYmailbox semantics, omitted-scalesfiles, and--embedding-table-resident-scalesbehavior; adds isolated CPU unit tests covering schema validation, decode, single-plane disk/cache/warm/RAM gathering, single-descriptorPreparedTablessharing, partitioned delivery-group separation, publish-time gapped-shard rejection, and mixed-plane Python handoff.
Pre-merge Checks
- [PASS] Security / malicious screen: No suspicious network/external behavior, credential handling, or unsafe regressions;
validate_buffer(helios/src/runtime_core/engram.rs:297-314) fixes a pre-existing OOB shape index before length validation. - [WARN] Charter & value fit: Right model-agnostic runtime layer with no allowlists or capability flags, but appends core-format / captured-graph contract enums (
Encoding.BF16,Method.IDENTITY) without recorded project-owner approval (AGENTS.md:376-381,docs/design-review.md:22-26) or a linked producer recipe. - [PASS] Related / duplicate / conflict check: Additive to #566 and #590 with no competing implementation;
rank_group.pyalready incorporates merged #670 and is disjoint from open #678 (note mechanical overlap with open #696 and drafts #334/#554). - [WARN] Tests & verification evidence: CPU unit tests are thorough, isolated, and exercise real production entry points, and the Thor SM110 E2B run substantiates the memory-budget claim, but
fd6dad6has zero reported CI runs (Windows build, release crate suites, pytest, TLA+ lifecycle, and Kani unverified) and no serving replay of a pre-existing FP8/NVFP4 core without re-export (docs/design-review.md:116-123,247-251).
Blockers
- Unrecorded project-owner approval for new core-format / captured-graph contract surface and missing producer/recipe link (
helios/proto/core.proto:258,294,helios/proto/runtime_core.proto:664,698,helios/manifest.md:457-463,docs/core-format-design.md:94-103): AppendingEngramTable.Encoding.BF16 = 3,EngramHash.Method.IDENTITY = 3(1-head direct row-ID mailbox semantics overrequest_buffer), and the single-plane artifact layout (omitting-scalesfiles) extends the signed core contract and captured-graph mailbox semantics.AGENTS.md:376-381,docs/design-review.md:22-26, anddocs/core-design.md:276-280require prior explicit approval from project owner Luke Alonso ("even if it reuses an existing graph kind or enum value"; aDesign-Signed-Off-Bytrailer does not grant approval perdocs/design-review.md:26,313-318), and no approval is recorded on this PR. In addition, the in-tree producer remains two-plane FP8 only (ignition/components/engram.py:36-49,58) and no companion external recipe PR (e.g., Gemma 4 E2B/E4B) is linked. Fix: Record explicit project-owner approval forEncoding.BF16andMethod.IDENTITY(this is an owner decision, not code rework) and link the companion producer/recipe PR targeting this contract. - Unverified CI workflows on
fd6dad6and missing pre-existing FP8/NVFP4 core serving replay (.github/workflows/native-serving.yml:13-78(not opened),.github/workflows/python-cpu.yml:13-41(not opened),.github/workflows/helios-lifecycle.yml:18-48(not opened),docs/design-review.md:116-123,247-251): No CI checks have reported onfd6dad6, and the PR's Limitations line explicitly discloses that Windows I/O ring builds (windows-2022), mutation testing, and serving replay of a previously exported binary FP8/NVFP4 core were not run locally. Perdocs/design-review.md:247-251, disclosing runnable CPU/formal checks (native-serving,python-cpu,helios-lifecycleTLA+ conformance and Kani proofs) as limitations does not waive them, and Principle 13 (docs/design-review.md:116-123) plus the Project Charter require validating a pre-existing FP8/NVFP4 core through loading and serving without re-export. Fix: Run and passnative-serving(Linux +windows-2022),python-cpu, andhelios-lifecycleonfd6dad6, and replay at least one previously exported FP8/NVFP4 core without re-export. (Note: the Thor E2B run validates the memory budget, not a throughput/speedup claim overmain, and the 5.25 GiB E4B figure remains arithmetic.)
Should Fix
None.
Subtract / Simplify
None.
Nits
None.
Dropped on verification
- Correctness Lens F1 ("Major — BF16 + 24-head XOR_MODULO accepted with 24× staging amplification"): Dropped. The PR explicitly defines
Encoding.BF16andMethod.IDENTITYas orthogonal primitives, enabling narrow BF16 n-gram tables (e.g.,embedding_width = 128, matching FP8's byte width) or quantizedIDENTITYtables. Flippingencodingalone cannot silently trigger 24-head wide PLE staging becausedecodeenforces matchingtoken_map, hash arrays (helios/src/runtime_core/engram.rs:209-226),[T, 24]hash_buffer, and[T*24, row_bytes]weight_buffershapes (:315-326), andcheck_memory_limit(helios/src/runtime_core/model.rs:764-779) explicitly budgets host staging. - Correctness Lens F2 ("Minor — publish-time parity incomplete for FP8/NVFP4 per-encoding geometry"): Dropped. Pre-existing on
main(helios/src/core/schema.rs:339-384); the PR accurately scopes its parity claim to shard contiguity (:469-502), and its newBF16(:428-436,443-451,487-495) andIDENTITY(:412-422) validators already pin exact byte sizes and hash geometry at signing time. - Correctness Lens F3 ("Minor — docs omit BF16+XOR_MODULO combination"): Dropped as a corollary of F1;
helios/manifest.md:457-463accurately documentsBF16andIDENTITYas independent, orthogonal primitives. - Subtraction Lens S1 ("HIGH —
schema.rsdecides encoding three times per table"): Dropped.engram_scales(encoding: i32, ...)(helios/src/core/schema.rs:330-341) implements Autobot Round 1's requested helper signature and is called directly across 6 cross-crate sites inheliopause/src/export/core.rs(:108,131,416,431,1538,1580) wherehas_scalesis not precomputed; inferringBF16(width * 2) from!has_scalesatschema.rs:428would also be fragile if another single-plane encoding is added later. - Subtraction Lens S2 ("HIGH —
has_tablesis a dead/unreachable parameter invalidate_embedding_resident_scales"): Dropped as factually false. Whenengram.is_empty()is true (has_tables = false, has_scale_planes = false),if !has_tables(helios/src/runtime_core/selection.rs:58-62) is reachable and fires first with"resident embedding scales require an embedding table catalog", distinguishing models without embedding tables from models with single-plane tables (:63-67). - Subtraction Lens S3 ("MEDIUM — overlapping presence checks in
heliopause/src/embedding_tables.rs:41-62"): Dropped as low-signal Round 3 churn; the author implemented the Python-boundary pairing requested in Round 1 with distinctPyValueErrordiagnostics for bad plane count vs plane/binding mismatch. - Subtraction Lens S4 ("MEDIUM — five hand-copies of weights+scales in
heliopause/src/export/core.rs"): Dropped as overstated / low-signal Round 3 churn;:1528-1600builds distinct weight/scale filenames (-weights.safetensorsvs-scales.safetensors) and separate struct fields (weights_idx,scales_idx: Option<usize>), so a uniform span-slice helper would not cover them. - Dossier item #4 ("Round 2 Subtract/Simplify item 1 is only half done"): Dropped. Round 2 explicitly suggested either checking
table.encoding == wire::engram_table::Encoding::Bf16 as i32or dropping the duplicatetry_from/Unspecifiedcheck afterengram_encoding_has_scales; both Round 2 Subtract/Simplify items are fully resolved atfd6dad6(helios/src/core/schema.rs:367,helios/src/runtime_core/engram.rs:259). - Subtraction Lens minors (
shares_delivery_withdoc comment,prepared.rs:161-166,270,Planes::iter): Dropped as Round 3 nitpicks on clean code.
Classify triage
Selected: triage:review
Threshold: 65%
Triage
- [✓]
triage:review: 94.4% -
triage:design-review: 4.1% -
triage:validation: 1.2% -
none: 0.2% -
triage:integration: 0.0% -
triage:investigate: 0.0% -
triage:partial: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0% Decision to Test: no (99%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.
Apply labels
Applied: +triage:review, -triage:design-review