#1 [high] Dossier baseline: PR #664 context (from prompt)
PR #664 (NVIDIA/hyperflare-inference), author kbenkhaled, head 263dfe9b, 23 files, +1722/-548. Title: helios,heliopause,ignition: support single-plane BF16 and identity-indexed offloaded embedding tables.
Dossier facts (trust, do not re-discover):
- Prior @flare-autobot "Changes Requested" review at 20:05 audited c769355 (22 min older); 6 of its 8 code asks are stale at 263dfe9b.
- Verified present at head: strict Unspecified rejection (helios/src/core/schema.rs:316-327), legacy fallback (helios/src/runtime_core/engram.rs:29-36), schema::engram_scales (schema.rs:329-341), Index::shares_delivery_with (helios/src/engram.rs:195-201; used runtime_core/model.rs:458-460; tested runtime_core/engram.rs:1079-1084), TableSource.scales Option<(PlaneSource,String)> (engram/prepared.rs:43), python binding (heliopause/src/embedding_tables.rs:54-62).
- Blocker A6: no recorded owner approval for Encoding.BF16=3 / Method.IDENTITY=3 (docs/design-review.md:22-26,265-266; docs/core-design.md:276-280; charter "Captured-graph op contracts"). No producer/recipe link (ignition/components/engram.py:38-58 is still two-plane FP8/NVFP4). Precedent #566 shipped with approval note + #535 ref + hyperflare-recipes#70.
- Second blocker shrank: CI unblock (Windows job .github/workflows/native-serving.yml, python-cpu.yml, helios-lifecycle.yml exist but no check runs attached to 263dfe9b) + one replay of a pre-existing FP8/NVFP4 core without re-export (charter "verify that existing data, artifacts, and exported cores still load").
- Validation is one checkpoint (E2B on Jetson AGX Thor SM110), no main baseline; E4B unexercised; test counts self-reported.
- Undeclared panic fix: validate_buffer destructures shape (runtime_core/engram.rs:305-317) vs main indexing shape[0]/[1].
- Signing pins BF16 payload size: schema.rs:448-456 (shared), :492-500 (shard).
- New test: gapped-shard publish rejection heliopause/src/export/core.rs:5306-5336; verify_published at core.rs:3017.
- No human reviewer/approval anywhere on #664. Discord: no username provided. Labels: area:engram, enhancement, performance, triage:review (no triage:design-review).
#2 [high] Research summary
Correctness, Contracts & System-Level Consequences review — PR #664 (head 263dfe9b)
I opened every changed Rust/Python file plus the direct callers that matter for this lens (helios/src/runtime_core/{model,engram,selection,protection,describe,conversion,event_tests}.rs, helios/src/core/{schema,reader,conversion}.rs, helios/src/engram{,/reader,/reader/windows.rs,/prepared.rs,/cache.rs}, heliopause/src/{embedding_tables.rs,export/{core,binding,weight_reuse}.rs}, ignition/preparation/{rank_group,model}.py, ignition/components/engram.py, tests/preparation/test_embedding_table_handoff.py, helios/manifest.md, both .proto files, the touched docs). Findings below; each carries a verbatim quote, severity, impact and fix. Where the refactor is sound I say so instead of inventing issues.
1. BLOCKER — new captured-graph contract (Encoding.BF16 = 3, Method.IDENTITY = 3) has no owner approval and no in-repo producer
helios/proto/core.proto (new lines, and identically helios/proto/runtime_core.proto):
+ // IDENTITY selects 1-head direct indexing without token_map: requires `request_buffer`, empty
+ // hash arrays, and `compressed_vocabulary == rows`; mailboxes publish row IDs in `[0, stored_rows)` or `-1`.
+ enum Method { UNSPECIFIED = 0; XOR_MODULO = 1; EOS_XOR_MODULO = 2; IDENTITY = 3; }
helios/manifest.md:455-463:
Single-plane `BF16` tables store raw `embedding_width * 2`-byte rows without a
scale plane (`scales` absent, `scale_buffer` empty, `scale_block == 0`,
`global_scale == 0`). Tables with `EngramHash.Method.IDENTITY` use one lookup
head (`heads = 1`), empty `token_map` and hash arrays, `compressed_vocabulary == rows`,
and GPU request delivery (`request_buffer`): captured code publishes one `int64`
row ID per token in `[0, stored_rows)` (converting to partition-local indices
when sharded) or `-1` for inactive slots; out-of-range row IDs fail gathering.
This is a new producer-side obligation on captured code (who writes the mailbox, in which index space, with -1 semantics), not a mere appended enum value — so the description's "no model allowlists, capability flags, or new captured-graph operation families" does not clear docs/design-review.md:22-26 (not opened),265-266 / docs/core-design.md:276-280 (not opened) / the charter's "Captured-graph op contracts" gate. There is also no in-tree producer: ignition/components/engram.py:117-123 still allocates torch.zeros((tokens * heads, 256), dtype=torch.uint8 ...) / torch.zeros((tokens * heads, 8) ...) and _lookup views weights as torch.float8_e4m3fn (:58), i.e. 256-byte FP8 rows + 8-byte scales, structurally unable to emit 17,920-byte BF16 rows or identity row IDs; ignition/components/engram.py:126 still exports exactly weights/scales/hashes. Impact: the wire contract lands with no recorded approval and no producer in this repository, so it cannot be exercised or regression-tested here. Fix: record maintainer approval for the two enum values and the mailbox semantics, and link the producer/recipe PR (precedent #566 did all three); otherwise land the Planes refactor only.
2. MAJOR — description claim "two-plane FP8/NVFP4 tables keep their … exact validation rules" is inaccurate for partitioned cores
helios/src/core/schema.rs:464-473 (all new; main accepted these shapes):
if table.request_buffer.is_empty() {
return Err(invalid(
"partitioned engram table requires GPU request delivery",
));
}
if table.shards.len() != ranks as usize {
return Err(invalid(
"engram partitions must match the deployment rank count",
));
}
plus the new full-coverage requirement at :474-507 (shard.first_row != end → reject, end != table.rows → reject). main's signer only required shard.rank < ranks, non-empty shards and no overlap. On main a partitioned two-plane table with a token map and an empty request_buffer was decodable and serveable — helios/src/runtime_core/engram.rs:136,167 treats request_buffer.is_empty() as the host hash-upload path (let gpu = !table.request_buffer.is_empty();) — but such a core now fails verification (validate_deployment → validate_engram). Impact: an already-published core can stop verifying, which is exactly the charter's "verify that existing data, artifacts, and exported cores still load" check, and the PR text says the opposite. Contiguity alone is fine (loading already enforced it, so no loadable core is newly rejected — that part of the tightening is genuinely safe). Fix: correct the description to say which rules changed and why, and either drop the request_buffer hard requirement for two-plane partitioned tables (keep it for IDENTITY/BF16, where the mailbox is the only row source) or state it as a deliberate compatibility break.
3. MAJOR — the new contract and its paths are covered only by hand-built wire fixtures; no CI check ran on this head
Every new in-repo test constructs wire::EngramTable by hand (helios/src/core/schema.rs:1805-1813, helios/src/runtime_core/engram.rs:861-991, heliopause/src/export/core.rs:3822-3900,4424-4462,5311-5336) and the reader tests use synthetic planes (helios/src/engram/reader.rs:2535-2599, helios/src/engram/prepared.rs:418-462). Nothing in the repository produces a BF16/IDENTITY core, so no test proves the producer→exporter→Helios chain, and the description's Validation is a single out-of-tree E2B run with no main baseline (one checkpoint, E4B unexercised). Combined with the missing Windows/pytest/lifecycle check runs on 263dfe9b, the "keeping existing FP8/NVFP4 unit and wire-format tests passing" and the CPU/pytest counts are self-reported only. Fix: attach CI, and replay one previously exported FP8/NVFP4 core without re-export.
4. MAJOR (system-level) — per-token pinned staging grows ~2.8× and partitioned delivery groups duplicate staging
helios/src/engram.rs:204-219 sizes staging as sum(plane.row_bytes) * heads * max_tokens per table and STAGING_FRAMES = 2 (:348); helios/src/runtime_core/model.rs:840-843 then divides the row cache across groups:
let group_budget = embedding_table_cache_bytes / engram.len() as u64;
A DeepSeek two-plane row costs 256 + 8 = 264 B per head (24 heads ⇒ 6,336 B/token), while the new PLE row costs 8960 * 2 = 17,920 B per token (1 head) — ~2.8× more pinned mapped-host memory per staged token per table (helios/src/engram.rs:686-693). Second effect: Index::shares_delivery_with (helios/src/engram.rs:195-201, used at helios/src/runtime_core/model.rs:458-460) now always splits partitioned ranks (partition: Some(rank) at helios/src/runtime_core/engram.rs:415), so TP ranks with byte-identical shards get separate Shared instances and separate staging frames where main shared one. It is accounted for (embedding_host_bytes includes staging_bytes, helios/src/runtime_core/model.rs:491-493,764-779), so this is budgeted amplification rather than an unbounded leak — but it directly eats the KV headroom the PR exists to protect, and the PR reports no staging figure for its Thor run. Fix: quantify staging in the description (or size BF16/identity staging by prefill chunk × width and document the budget line), and note the duplicated-staging cost of the new grouping.
5. MINOR — explicit --embedding-table-resident-scales on a single-plane-only core is a hard startup failure
helios/src/runtime_core/selection.rs:56-68 / helios/src/runtime_core/model.rs:477-481:
if self.embedding_table_resident_scales == Some(true) {
...
if !has_scale_planes {
return Err(invalid(
"resident embedding scales require an embedding table with a scale plane",
));
}
Not a regression for main cores (a catalog with tables always had scale planes before), and it fails early — before GPU init — which is the right place. But any launcher that passes the flag unconditionally now refuses to start on a BF16-only core, and the mixed-catalog case silently succeeds with the flag doing nothing for the single-plane tables. The docs were updated (docs/cli-design.md:791-799), so this is documented behaviour, not a bug; worth confirming with the operator-facing consumers (flare-cli/src/cli.rs:1193-1197 (not opened),2260-2306 just forwards it) that fail-fast is intended rather than "ignore for single-plane tables".
Areas I checked and found sound (no findings)
Planes { weights, scales: Option<Plane> }refactor is correct across all four paths. Disk (helios/src/engram/reader.rs:792-902,basewalk overplanes.iter()), row cache (:1083-1164,scale_base = ids.len() * weightswith every scale write guarded byif scales > 0;copy_cached_hits_slice:946-980takesweights + scalesas the row length and guards the second copy), advisory warm (:1199-1264), RAM (:1428-1438, guarded byplanes.scales.is_some() != scales.is_some()), transfers (helios/src/engram.rs:1009-1024uploads scales at offsetrows * weightsonly when both sides exist).RowCache::insert/insert_advisory(helios/src/engram/cache.rs:172-214) toleratescales = &[]since onlylen(w)+len(s) == row_bytesis asserted.- IDENTITY out-of-range rejection is real, not just documented:
helios/src/engram/reader.rs:1416-1423validates every id against each plane'snbytes / row_bytesbefore any read, matchinghelios/manifest.md:462. - The undeclared panic fix is genuine and correctly placed:
helios/src/runtime_core/engram.rs:305-309now destructuresshape.as_slice()into[r, c]and rejects other arities instead of indexingshape[0]/[1]before the length check. - Signing now pins BF16 payload geometry (
helios/src/core/schema.rs:448-456shared,:492-500per shard, both overflow-checked) but does not pin it for two-plane encodings — consistent with "existing wire layout unchanged". - Descriptor handoff arithmetic is consistent on both sides:
ignition/preparation/rank_group.py:44-51(sum(len(table["planes"]) ...)) matcheshelios/src/engram/prepared.rs:180-186(1 + usize::from(scales.is_some())), and thecursor.next().unwrap()at:203-207is unreachable given that check;heliopause/src/embedding_tables.rs:41-62rejects plane/scale-name mismatches at the Python boundary instead of silently dropping a scale binding. - Export FD accounting still counts single-plane tables (
heliopause/src/export/core.rs:1375-1399flattens[weights, scales]and skipsNone); the new test pins(14, 14, 0)andverify_published(:3017) round-trips the signed core including the reserved-scalesrelative names, so no phantom lease is created for absent planes. - The gapped-shard publish rejection test asserts no output directory is created (
heliopause/src/export/core.rs:5306-5336), so signing cannot emit a partitioned table Helios would refuse.
#3 [high] Lens findings (correctness/contracts/system) PR #664 — verified at 263dfe9b
FINDING 1 — BLOCKER: new captured-graph contract unapproved, no in-tree producer.
Cites: helios/proto/core.proto (IDENTITY enum cmt: "IDENTITY selects 1-head direct indexing without token_map: requires request_buffer, empty // hash arrays, and compressed_vocabulary == rows; mailboxes publish row IDs in [0, stored_rows) or -1."), same in helios/proto/runtime_core.proto; helios/manifest.md:455-463 ("Tables with EngramHash.Method.IDENTITY use one lookup head (heads = 1) ... captured code publishes one int64 row ID per token in [0, stored_rows) ... or -1"); gate: docs/design-review.md:22-26,265-266; docs/core-design.md:276-280; charter "Captured-graph op contracts".
Producer absent: ignition/components/engram.py:117-123 allocs torch.zeros((tokensheads,256) uint8) + (tokensheads,8) uint8; :58 lookup_op(plan, weight.view(torch.float8_e4m3fn), scales, ...); :126 buffers() exports only weights/scales/hashes. Cannot emit 17,920-B BF16 rows or identity IDs.
Fix: record approval + link producer/recipe PR (precedent #566 with approval note + #535 ref + hyperflare-recipes#70); else land only the Planes refactor.
FINDING 2 — MAJOR: claim "two-plane FP8/NVFP4 keep their exact wire layout and validation rules" is wrong for partitioned cores.
Cite helios/src/core/schema.rs:464-473 + :474-507 (new): if table.request_buffer.is_empty() { return Err(invalid("partitioned engram table requires GPU request delivery")) } and if table.shards.len() != ranks as usize { return Err(invalid("engram partitions must match the deployment rank count")) }, plus full-coverage shard.first_row != end / end != table.rows.
main only required shard.rank < ranks, non-empty, no overlap. Host-hash partitioned tables were valid on main: helios/src/runtime_core/engram.rs:136 let gpu = !table.request_buffer.is_empty(); and :167 EosXorModulo if gpu && value.token_map.is_empty(); host path is the upload branch at helios/src/engram.rs:934-993 (transfer.request.is_some() else hash upload). So a previously published partitioned two-plane core can now fail verification (validate_deployment -> validate_engram, schema.rs:310-312). Charter: "verify that existing data, artifacts, and exported cores still load".
Note: contiguity alone is safe (native loading already enforced it — no loadable core newly rejected).
Fix: correct description; relax request_buffer requirement to IDENTITY/BF16 only, or declare the break.
FINDING 3 — MAJOR: coverage is hand-built fixtures only; no CI on head. Fixtures: helios/src/core/schema.rs:1805-1813; helios/src/runtime_core/engram.rs:861-991 (bf16_identity_single_plane_decodes...), 1035-1099 (partitioned + shares_delivery_with at 1079-1084); heliopause/src/export/core.rs:3822-3900, 4424-4462, 5306-5336; reader tests helios/src/engram/reader.rs:2535-2599 (synthetic Planes::single, row_bytes 17920), helios/src/engram/prepared.rs:418-462. No in-repo producer => producer->exporter->Helios chain untested. Validation = one E2B run, no main baseline, E4B unexercised; Windows (native-serving.yml matrix), python-cpu.yml, helios-lifecycle.yml jobs exist but no check run attached to 263dfe9b. Test counts self-reported. Fix: attach CI; replay one pre-existing FP8/NVFP4 core without re-export.
FINDING 4 — MAJOR system-level: staging amplification + per-rank duplicated staging.
helios/src/engram.rs:204-219 staging_payload_bytes = sum(plane.row_bytes) * heads * max_tokens, :348 STAGING_FRAMES: usize = 2; two frames pinned per table helios/src/engram.rs:686-693 (stream.mapped_host_buffer(staging_bytes)).
Arithmetic: FP8 row 256+8=264 B/head, 24 heads => 6,336 B/token; BF16 PLE 8960*2=17,920 B/token (1 head) => ~2.8x per staged token.
Grouping: helios/src/engram.rs:195-201 shares_delivery_with (self == other) with helios/src/runtime_core/model.rs:458-460; partition set at helios/src/runtime_core/engram.rs:413-415 partition: (!table.shards.is_empty()).then_some(rank) => identical-shard TP ranks no longer share one Shared/staging (main collapsed them). Budgeted, not a leak: staging counted in helios/src/runtime_core/model.rs:491-493 and embedding_host_bytes :764-779; cache split per group :840-843 group_budget = embedding_table_cache_bytes / engram.len().
Fix: report staging bytes for the Thor run / size PLE staging by prefill chunk; document duplicated staging.
FINDING 5 — MINOR: explicit --embedding-table-resident-scales on single-plane-only core hard-fails.
helios/src/runtime_core/selection.rs:56-68 (validate_embedding_resident_scales: if !has_scale_planes { return Err(invalid("resident embedding scales require an embedding table with a scale plane")) }), applied helios/src/runtime_core/model.rs:477-481; early (pre-GPU) and documented in docs/cli-design.md:791-799; flag forwarded unchanged by flare-cli/src/cli.rs:1193-1197,2260-2306. Mixed catalogs silently no-op the flag. Confirm fail-fast is intended.
VERIFIED SOUND (no finding):
- Disk reader helios/src/engram/reader.rs:792-902 (base walk over planes.iter(), resident_scales only ordinal==1 :804-808).
- Row cache :1083-1164 (weights = planes.weights.row_bytes; scales = scale_row_bytes(); scale_base = ids.len()*weights; all scale writes guarded
if scales > 0); copy_cached_hits_slice:946-980; warm :1199-1264. - RAM :1428-1438 with
planes.scales.is_some() != scales.is_some()mismatch error. - Transfers helios/src/engram.rs:1009-1024 (scales upload at offset rows*weights only when both exist); Transfers::new table.scales Option at :911-923.
- RowCache::insert/insert_advisory helios/src/engram/cache.rs:172-214 tolerate empty scales (debug_assert len sum == row_bytes).
- Out-of-range ID rejection helios/src/engram/reader.rs:1416-1423 (
*id as usize >= plane.nbytes / plane.row_bytes). - Panic fix helios/src/runtime_core/engram.rs:305-309 destructures shape.as_slice() -> rejects arity instead of indexing.
- Signing pins BF16 sizes schema.rs:448-456 / :492-500 (overflow-checked); two-plane not pinned (unchanged).
- Descriptor arithmetic: ignition/preparation/rank_group.py:44-51 vs helios/src/engram/prepared.rs:180-186 (1 + usize::from(scales.is_some())); cursor.next().unwrap() :203-207 unreachable; python boundary heliopause/src/embedding_tables.rs:41-62.
- Export FD accounting heliopause/src/export/core.rs:1375-1399 skips None planes; test asserts (14,14,0) at :4886-4890; verify_published :3014-3031; gapped-shard test no output dir :5306-5336.
- core/reader.rs:228-247 + protection.rs:332-350 only shape checks, no arity crash.
- Docs consistent: docs/cli-design.md:791-799, docs/core-format-design.md:92-103, docs/model-preparation.md:483-487.