#1 [high] Change: what PR #664 does, file by file, verified
PR #664 by kbenkhaled, open 2026-12-01, branch engram-bf16-identity-pr -> main, head c769355, 23 files +1757/-548, 0 comments/reviews, no CI checks, "ready for review".
Verified in diff:
- helios/proto/core.proto and helios/proto/runtime_core.proto:
EngramTable.EncodinggainsBF16 = 3;EngramHash.MethodgainsIDENTITY = 3. Existing tags untouched. Comments updated (core.proto ~line 254-300; runtime_core.proto ~657-700). - helios/src/core/schema.rs: new
engram_encoding_has_scales(encoding)helper (schema.rs:316-329 at PR head);validate_engramnow: single-plane tables reject scale_buffer/scale_block/global_scale (incl. negative zero via to_bits), rejectscalesplane; BF16 rows must be exactlyrows*width*2bytes (shared and per shard); IDENTITY requires empty orders/multipliers/primes/offsets andcompressed_vocabulary == rows; token_map_empty now accepts EOS_XOR_MODULO or IDENTITY with request_buffer. - helios/src/core/schema.rs shard loop rewritten: now requires
shard.rank as usize == rank,shard.first_row == running end,rows != 0,shards.len() == ranks, andend == table.rows— i.e. contiguous, rank-ordered, complete coverage (previously only overlap/empty/absent-rank was checked). Error strings change from "engram partitions overlap or are empty"/"engram partition names an absent rank" to "engram partitions must cover table rows in rank order" / "must cover all table rows". - helios/src/engram/reader.rs: new
pub(crate) struct Planes { weights: Plane, scales: Option<Plane> }replacing[Plane; 2]everywhere (reader.rs:60-100); helpers row_bytes/scale_row_bytes/total_nbytes/iter/iter_mut;Data::Ram(Arc<Resident>, Option<Arc<Resident>>). - helios/src/engram.rs:
Table.planes: Planes, newTable.partition: Option<usize>,Table.scales: Option<String>,Transfer.scales: Option<usize>(engram.rs:177-187). - helios/src/engram/prepared.rs:
TableSource.planes: [PlaneSource;2]->weights_plane/scales_plane: Option<PlaneSource>,scales: Option<String>; descriptor count now1 + scales.is_some()per table instead of 2 per table. - helios/src/runtime_core/engram.rs: BF16 decode branch (row_bytes = embedding_width*2, block 0, no scale plane; requires
global_scale.to_bits()==0and width>0); IDENTITY branch (order None, heads=1, requires gpu request buffer + empty token_map); decodedTable.partition = (!shards.is_empty()).then_some(rank). - helios/src/runtime_core/model.rs: resident-scale decision now keyed on
has_scale_planes(any decoded table with a scales plane) instead of!engram.is_empty(). - helios/src/runtime_core/selection.rs:
embedding_resident_scales(has_tables, integrated)->validate_embedding_resident_scales(has_tables, has_scale_planes)+embedding_resident_scales(has_scale_planes, integrated); explicitSome(true)now errors when no table carries a scale plane. - helios/src/core/reader.rs:
required_payloadsskips the scales payload for single-plane tables. - heliopause/src/export/core.rs: roles(), validate_ranks(), core_engram() all make the scale plane optional; new
verify_published()test helper. - heliopause/src/export/binding.rs:
append_planesskipsnullplane JSON (so"scales": nullfrom Python is tolerated). - heliopause/src/embedding_tables.rs: accepts 1 or 2 planes,
scaleskey optional/None. - ignition/preparation/rank_group.py: extracts
_receive_embedding_tables(control, model, catalog, count); expected descriptor count is nowsum(len(table["planes"]))instead of2*len(tables). - tests/preparation/test_embedding_table_handoff.py: covers mixed 2-plane + 1-plane handoff and a descriptor-count mismatch ValueError.
- Docs: docs/cli-design.md (resident-scales wording), docs/core-format-design.md (single-plane tables omit -scales file), docs/model-preparation.md, helios/manifest.md (BF16/IDENTITY contract paragraph).
#2 [high] Research summary
Case file for #664 — helios,heliopause,ignition: support single-plane BF16 and identity-indexed offloaded embedding tables (kbenkhaled, opened 2026-12-01, head c769355, open "ready for review", 23 files +1757/−548, 0 comments, 0 reviews, no CI checks on head). Scratchpad entry 1 holds the verified file-by-file change map; everything below is cited to file:line or PR/issue numbers.
Key findings a reader could not learn from the description
- No producer exists in-tree. The PR is consumer/contract-side only: ignition's Engram producers still emit two-plane FP8/NVFP4 (
ignition/components/engram.py:52-84, fixed 256-byte weight / 8-byte scale rows,lookup_op(..., weight.view(torch.float8_e4m3fn), scales, ...)). Nothing inignition/writesEncoding.BF16orMethod.IDENTITY; the only Python change is descriptor counting inignition/preparation/rank_group.py:44-60. The Gemma 4 E2B/E4B producer therefore lives outside this repo (recipes are external —docs/model-preparation.md:326already listsgemma-4-e2b/e4b, buttests/preparationhas no gemma/PLE test for it). So no in-tree artifact can exercise the new contract end-to-end — the same gap that drew #566's blocker ("its only in-tree producer is unexercised"). - The "distinct partitioned delivery groups" fix works indirectly, through
Indexequality, not through any reader.Table.partition: Option<usize>(helios/src/engram.rs:177-187) is never read in production code (only tests:helios/src/runtime_core/engram.rs:1076,helios/src/execution/threaded.rs:1471,1613). Its effect is viaTable: PartialEqand the index dedup athelios/src/runtime_core/model.rs:458(engram.iter_mut().find(|(existing,_)| existing == &index)): byte-identical shards on two ranks previously compared equal and collapsed onto oneShared/delivery group; the rank tag now keeps them distinct. Worth stating explicitly in review. - Loader validation is tightened for all partitioned tables, not just the new ones (
helios/src/core/schema.rs:440-500): shard count must equal rank count, ranks must be 0..N in order, rows contiguous and covering the whole table. Onmainthe schema only rejected overlap/empty/absent-rank whilehelios/src/runtime_core/engram.rs:80-117already enforced contiguity — so this aligns signing with loading, but it also means a previously-signed core with a gapped or short shard list now failsvalidaterather than loading. Charter line 42 explicitly asks for "verify that existing data, artifacts, and exported cores still load"; no test in the diff covers a legacy gapped core being rejected/accepted. - An undeclared behavior relaxation:
heliopause/src/export/binding.rs:652-657now silently skips anullweights/scalesJSON value instead of failing deserialization; not mentioned in the description. - No GPU, no benchmark, no serving replay, no Windows build — the PR says so, and its Validation section still contains the author's own placeholder "(update this line once the Thor E2B export + benchmark completes)". The only numbers in the description (4.38 GiB E2B / 5.25 GiB E4B PLE) are unverified arithmetic (≈128 MiB/layer for E4B) and are not reproduced by any test.
- Contract-surface change with no recorded owner approval.
Encoding.BF16 = 3andMethod.IDENTITY = 3plus changed mailbox semantics are documented as a captured-graph contract inhelios/manifest.md:454-466, and the charter requires owner approval and a served/exported demonstration for new contract/format surface. #566 (the direct predecessor, merged 2026-11-28) was merged with an unresolved blocker of exactly this kind (#566 review), and open #535 is still the approval thread for the advisory-mailbox contract.
The change
Two orthogonal additions plus two shared fixes, all consumed by the same machinery: single-plane storage (Planes { weights: Plane, scales: Option<Plane> } in helios/src/engram/reader.rs:60-100, replacing [Plane; 2] across disk/RAM/row-cache/advisory-warm/PreparedTables), and direct token indexing (1 head, empty hash arrays, compressed_vocabulary == rows, GPU request mailbox publishing int64 row IDs). Exporter paths make the scale plane optional in roles, validate_ranks, core_engram (heliopause/src/export/core.rs:95-160,422-460,1540-1720), peer handoff accepts 1–2 descriptors per table (helios/src/engram/prepared.rs:178-215, heliopause/src/embedding_tables.rs:38-62), and --embedding-table-resident-scales now keys on has_scale_planes and hard-errors when explicitly enabled with no scale-bearing table (helios/src/runtime_core/selection.rs:52-72, model.rs:475-479). Size is genuinely large: +1757/−548, with roughly half the Rust delta being tests (schema ~130 lines, runtime_core ~250, heliopause export ~250, prepared ~50, Python ~35). Docs: docs/cli-design.md:789-800, docs/core-format-design.md:89-104, docs/model-preparation.md:480-490, helios/manifest.md:454-466.
The why
A real memory constraint on unified-memory GPUs (DGX Spark / Thor class) for Gemma 4 E2B/E4B per-layer embedding tables. No issue in this repository asks for it: searching Gemma/PLE/BF16/identity returns only #664 itself, and the closest prior are #511 (disk-Engram rank idling, open) and #269 (row-cache eviction rates) — same subsystem, different problem. The desire is one author's, one month old, driven by external recipe work; #592 (their merged "sm110/thor identifiers" PR) and the "Thor E2B export" placeholder tie it to Jetson Thor bring-up.
Related work
- Builds on: #566 (merged 2026-11-28, advisory lookahead prefetch; 15 shared files) — this PR's
Planesrefactor has to threadprefetch/mailboxes through the same code; #590 (merged 2026-11-29, Engram reader fixes + Qwen PLE lookahead) which established the PLE-on-disk path with two planes; #580, #583, #586, #561, #528 (closed) in the same reader/row-cache area. - Diverges from: #334 (open draft, read-ahead on every rank) was rejected by yatesdr because Helios must not evaluate the Engram hash (
#334comment 2026-11-19). #664 is fully compatible with that stance —IDENTITYremoves hashing from the runtime entirely and the graph publishes row IDs — which is worth crediting as the "right place" per the charter. - Adjacent, not competing: #554 (open draft, RDMA row-cache misses; 9 shared files), #511 (rank-partitioned idling), #535 (mailbox approval thread), #314 (signed tensor execution, touches the same schema/selection files), #620/#647 (recent churn in
model.rs/selection.rs).
Recent activity
The touched areas were heavily rewritten in the last three days by Luke Alonso and voipmonitor — #566, #580, #583, #586, #590, #620, #647, #628 — all in the same reader/exporter/selection files. #664 is stacked on that churn and duplicates none of it; it conflicts with none visibly, but it patches code that changed twice in the last 48 hours (helios/src/engram/reader.rs, helios/src/engram/prepared.rs, heliopause/src/export/core.rs) and its Planes refactor will collide mechanically with #554 and #334 if they move.
People
Author kbenkhaled is a CONTRIBUTOR with one prior merged PR (#592, Thor/SM110 identifiers, merged 2026-11-29) whose Autobot review was stopped as "low value / does not align with the charter" — the merge still happened, so contributor standing is not obviously weak, but it is not the priority-contributor tier the charter names (@voipmonitor, @original-el8, @lukealonso). The owning reviewers for every touched area are Luke Alonso (235 commits in helios/src, 63 heliopause, 160 ignition/preparation, 390 docs), Martin Vit, yatesdr — yatesdr in particular is the one who drew the "no model computation in Helios" line (#334). No one has engaged on #664 yet: no comments, no reviews, no labels (other PRs in this area get area:/triage:design-review labels and an Autobot case-file comment on day one; #664 had none at packet time).
Community
Zero reactions, zero comments, zero reviews. Interest so far is nil; all prior pressure in this subsystem came from other people (#511 by tastyrice90, #334 by javieratomic, #566 by voipmonitor).
Project fit
Aligned: no per-model branches or allowlists, no capability flags, both enum values appended (=3) leaving FP8/NVFP4 wire layout untouched (helios/proto/core.proto:254-300), a general storage/indexing primitive rather than a Gemma special case — exactly what the charter's "keep the runtime small and model-agnostic" and "solve the right problem in the right place" ask for, and it directly answers a measured memory problem (charter "measured performance/memory issue"). In tension: new core-contract values and mailbox semantics are the kind of surface that needs owner sign-off and a demonstrated export+serve (charter "Captured-graph op contracts" and "New model recipes, aliases, or formats … prove they export and serve cleanly"), and the PR supplies neither an exported BF16/IDENTITY core nor a served benchmark.
Claims and evidence
Evidence is unusually thick at the unit level and absent at the system level. Present in the diff: core::schema BF16/IDENTITY validation matrix including negative-zero global_scale, mismatched vocabulary, hash arrays, gapped/ short/ misordered/over-sized shards (helios/src/core/schema.rs:1771-1896), decode strictness plus an identical-shard/delivery-group test (helios/src/runtime_core/engram.rs:866-1110), single-descriptor sharing and gather (helios/src/engram/prepared.rs:417-465), Heliopause export of shared+partitioned BF16, weight reuse, FD accounting and a new verify_published signing round-trip plus a gapped-shard publish rejection (heliopause/src/export/core.rs:3059-3077, 3854-4070, 4354-4920, 5344-5380), and the mixed 2-plane/1-plane peer handoff Python test (tests/preparation/test_embedding_table_handoff.py). Claimed but unbacked: any GPU/serving behavior, the 4.38/5.25 GiB figures, "existing FP8/NVFP4 tests passing unchanged" (plausible — none of the touched FP8/NVFP4 assertions change), and the Windows absence is acknowledged (charter line 22 hardware matrix untouched).
Reach
Operators: --embedding-table-resident-scales semantics change only for catalogs with no scale plane (new hard error) — no change for existing FP8/NVFP4 cores; docs updated in four places. Core authors/Ignition: new enum values and a new mailbox contract that any PLE producer must match; the loader also becomes stricter about shard coverage, which can reject older artifacts. Disk layout gains/omits -scales files. No dependency, default, or CLI default changes.
Process
Ready-for-review, one commit, no CI, no labels, no reviewers, no discussion, ~1 day old; validation section is honest about the missing live-GPU qualification and self-referentially unfinished.
#3 [high] Claims/evidence gaps and undeclared effects in #664
-
NO IN-TREE PRODUCER. Ignition never emits BF16/IDENTITY: ignition/components/engram.py:52-84 still hardcodes FP8 weight (256-byte rows) + E8M0 scales (8 bytes) and calls lookup_op with weight.view(torch.float8_e4m3fn); ignition/components/ngram_delivery.py:115 PreparedPLELookup likewise. The only Python change in #664 is descriptor counting (ignition/preparation/rank_group.py:44-60: expected = sum(len(t["planes"]) for t in catalog["tables"]), was 2*len(tables)). Only Python test touched is tests/preparation/test_embedding_table_handoff.py. So nothing in this repo can produce a BF16/IDENTITY core; the Gemma 4 E2B/E4B recipe that would lives outside (docs/model-preparation.md:326 already lists gemma-4-e2b/e4b; no test path in this repo). Same "producer unexercised" blocker that was raised on #566.
-
partition FIELD IS NEVER READ IN PRODUCTION. helios/src/engram.rs:179
partition: Option<usize>set at helios/src/runtime_core/engram.rs:425 ((!table.shards.is_empty()).then_some(rank)) and used only by tests (runtime_core/engram.rs:1076; execution/threaded.rs:1471,1613). Its real effect is via derived PartialEq on Table/Index and the index dedup in helios/src/runtime_core/model.rs:458 (engram.iter_mut().find(|(existing,_)| existing == &index)): two ranks with byte-identical shards used to compare equal and collapse into one Shared/delivery group. Chosen mechanism is index-identity, not reader-side selection; should be stated in review. -
LOADER/SCHEMA TIGHTENED FOR ALL PARTITIONED TABLES. helios/src/core/schema.rs:440-500 now requires shards.len()==ranks, shard.rank==index in order, first_row==running end, rows!=0, and end==table.rows. main's schema (schema.rs:392-418 at main) only rejected overlap/empty/absent rank; helios/src/runtime_core/engram.rs:80-117 (main, unchanged) already enforced contiguity. Net: signing now matches loading, but a previously signed core with gapped/short shard lists now fails validate. Charter line 42 demands "verify that existing data, artifacts, and exported cores still load" — no test in the diff covers loading an older gapped core.
-
UNDECLARED RELAXATION: heliopause/src/export/binding.rs:652-657 append_planes now
continues on a JSON null plane instead of failing; not mentioned in the PR description. -
NO GPU/BENCH/SERVING EVIDENCE. Description Validation ends with the author's placeholder "(update this line once the Thor E2B export + benchmark completes)". Limitations admit Windows builds, mutation testing, serving replay of an exported FP8/NVFP4 core, and live GPU replay were not run. The 4.38 GiB (E2B, 35 layers) / 5.25 GiB (E4B, 42 layers) figures are unverified arithmetic and no test reproduces them.
-
CONTRACT SURFACE WITHOUT RECORDED APPROVAL. New values documented as core contract in helios/manifest.md:454-466; helios/proto/core.proto:254-300 and runtime_core.proto:657-700 add BF16=3 and IDENTITY=3 with mailbox semantics. Open #535 is still the pending approval thread for the advisory-mailbox contract, and #566 was merged with that blocker open. Charter: "Captured-graph op contracts: Adding a new one ... requires owner approval before you write it"; "New model recipes, aliases, or formats: ... prove they export and serve cleanly from the PR branch".