Opened by a workflow run, Dec 4, 2026 2:38 PM EST. decide malicious: all_clear (100%): No malicious content found
explore
Author: yatesdr (COLLABORATOR; 84 merged PRs in 180 days, mostly helios/src, selene, docs); Discord D-Rock Motivation: Some checkpoints (Qwen4-35B-A3B) store their huge offloaded PLE embedding tables as plain FP8 E4M3 bytes with a single shared scale, a shape the core format could not describe, so they could not be exported or served natively. This adds that one encoding by extending the single-plane mechanism a predecessor PR merged hours earlier. Scale: +565 / −145 lines in 10 files Proposal:
- Append
FP8_E4M3_GLOBAL = 4toEngramTable.Encodingin both protos (additive, wire compatible). - Validate it in
schema.rs: no scale plane/buffer,scale_block == 0, finite positiveglobal_scale, row size pinned toembedding_widthbytes. - Decode it in
runtime_core/engram.rswithscale_bytes = None, block 0. - Export needs no FP8-specific code — it routes through #664's
schema::engram_scalesseam and inherits scales-file omission and hardlink reuse. - Ignition binds it in
ngram_delivery.pyvia a three-wayquant_modebranch; docs and unit tests added. Touches: - helios/src (schema.rs, engram.rs) — signed core-format validation and decode
- heliopause/src/export/core.rs — export path (no new code, test fixture only)
- ignition/components/ngram_delivery.py — runtime binding of weights/scales Related items:
- #664 helios,heliopause,ignition: support single-plane BF16 and identity-indexed offloaded embedding tables (merged): the direct stack base; introduced BF16=3,
Planes{scales:Option},engram_scales - #716 helios: derive NVFP4 engram row and scale widths from embedding_width (merged): same file, hours earlier, same model family
- #723 helios,heliopause,ignition: fleet-wide 2-way codec green contexts (open): six files in common, textual conflict only
- #731 flashinfer pin for Qwen4-35B-A3B GDN 2:1 heads (open): gates the same recipe on SM120
- #711 add domain-agnostic AsyncTransfer primitive and runtime-sized device pools (merged): stack base below #664
Link: https://github.com/NVIDIA/hyperflare-inference/pull/732
Autobot comments: The body's enum numbering is wrong — it says
FP8_E4M3_GLOBAL = 3,NVFP4 = 1,BF16 = 2; the code hasNVFP4 = 2, BF16 = 3, FP8_E4M3_GLOBAL = 4because #664 took tag 3 first, which shows this is a stacked follow-on to #664 rather than a standalone feature. The PR also undeclaredly tightens BF16 validation (row-size pinning that #664 shipped without). Itsquant_modestrings live only in externalb12x, not in this repo, and no in-repo producer emits the new encoding. It links a recipe PR and claims an NVFP4 backward-compat replay — answering two of the three blockers #664 carried — but records no owner approval, whichdocs/design-review.md:22-26requires for a new operation contract.pr_diffhere is stale and shows #664/#711 work as if it were new; hours old, CI pending, zero reviews. Also note #732's stated use case needs open #731 to export on SM120.
Value Proposition
Value Proposition — PR #732 (FP8_E4M3_GLOBAL single-plane engram tables)
Verdict: Worth it with changes
Charter alignment — right layer, gate not yet passed. The change is a signed-format addition: one enum tag appended (FP8_E4M3_GLOBAL = 4), one match arm in helios/src/runtime_core/engram.rs, one validation branch in schema.rs. It reuses #664's Planes{weights, scales: Option} seam and adds no FP8-specific export code and no per-model runtime branch, consistent with "keep the runtime small and model-agnostic." But it is a format contribution: the charter requires listing checkpoints from an official or widely used source and more than one — two are listed, yet both are first-party (local-inference-lab, eidonix), so they are not independent evidence. And no owner approval is recorded, while docs/design-review.md:22-26 requires prior explicit approval for a new contract "even if it reuses a graph kind or enum value." Precedent cuts both ways: #664 merged without it; unanswered #535 shows the gate is otherwise live.
Novelty — genuinely additive. Not obsolete: #664 shipped BF16 = 3 and the single-plane seam, not FP8. Not superseded: no competing FP8 single-plane engram PR exists, and it reverses nothing. It stacks on #664/#716, sits above #711, and carries only textual conflict risk with #723 (6 shared files) and #334/#554 in engram.rs.
Value vs maintenance cost. The real logic is small — ~75 lines in heliopause/src/export/core.rs plus +207/−12 across schema.rs/engram.rs; the +112/−112 runtime_core_pb2.py churn is generated, and no dependencies are added. Beneficiaries are narrow: only Qwen4-35B-A3B–family FP8 E4M3 PLE checkpoints, and on SM120 access is blocked by open #731 (the author's hardware run was SM121). Evidence is unit-level and consistent with the tree, but the claimed DGX Spark end-to-end run and NVFP4 backward-compat replay have no commands, logs or artifacts — thinner than #664's or #716's. The TP>1 CPU-only limitation is honestly disclosed.
Required before merge: (1) fix the description's enum numbers — actual tags are FP8_E4M3_E8M0=1, NVFP4_E4M3_GLOBAL=2, BF16=3, FP8_E4M3_GLOBAL=4; (2) disclose and directly test the undeclared BF16 row-size tightening, a behaviour change to an already-merged encoding; (3) obtain lukealonso's explicit sign-off on the format contract; (4) attach commands/logs for the hardware run and NVFP4 replay; (5) establish authority for the external b12x fp8_e4m3_per_tensor mode name, which appears only in the two files this PR touches; (6) update stale docs/core-design.md:607; (7) rebase over #723.
Small, additive, backward-compatible at the wire level, and cheap to keep — worth it once the format gate and evidence gaps close.
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: triage:review, enhancement, area:engram
Threshold: 65%
Triage
- [✓]
triage:review: 90.9% -
triage:design-review: 8.5% -
triage:validation: 0.4% -
triage:integration: 0.1% -
none: 0.1% -
triage:partial: 0.1% -
triage:investigate: 0.1% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0%
Priority
-
none: 100.0% -
priority:P1: 0.0% -
priority:P2: 0.0%
Type
- [✓]
enhancement: 99.4% -
performance: 56.2% -
community: 50.0% -
duplicate: 4.2% -
bug: 0.5% -
documentation: 0.1%
Area
- [✓]
area:engram: 95.3% -
area:api: 50.0% -
area:preparation: 50.0% -
area:memory: 18.2% -
area:kernels: 2.6% -
area:packaging: 1.4% -
area:caching: 0.5% -
area:selene: 0.4% -
area:orbit: 0.2% -
area:rocenante: 0.1% -
area:scheduling: 0.0%
Model
-
model:gemma4: 14.8% -
model:inkling-small: 10.7% -
model:qwen3.8-flash-next: 6.0% -
model:deepseek-v4.1: 4.7% -
model:muse-glimmer: 4.7% -
model:qwen3.8-27b: 4.7% -
model:nemotron-3.5-bolt: 2.6% -
model:deepseek-v4: 1.4% -
model:glm-5.3: 1.2% -
model:kimi-k3.1: 0.4% -
model:mimo-v2.6: 0.2%
Apply Labels (Intake)
Applied: +triage:review, +enhancement, +area:engram
Subtraction and simplicity
Subtraction & Simplicity Audit — PR #732 (FP8_E4M3_GLOBAL single-plane engram)
Bottom line
The format/production code is genuinely lean — I am not asking for deletions there. The PR adds one enum tag, one validation branch, one decode arm, and zero lines of FP8-specific export code (it rides #664's schema::engram_scales seam). That is the right shape.
Three of the four changed areas still carry copy-paste that the new encoding made visible. The net recoverable size is small (~60–80 lines out of +565/−145), but two of the duplications are the exact kind that produce divergent validation messages, so they are worth fixing now rather than in a follow-up.
One honesty note on method: pr_diff on this PR diffs against a stale pre-#664 base (it renders #664's and #711's merged work as if #732 added it), and search_history errors out on a missing object (c513e46a). I therefore read the real delta from ref: pr/732 and attributed BF16 branches to #664 (merged) rather than to this PR.
1. Collapse the two single-plane decode arms — helios/src/runtime_core/engram.rs:150-167
The two arms differ in exactly three respects: a *2, a different overflow message, and which half of the global_scale contract is enforced.
wire::engram_table::Encoding::Bf16
if table.embedding_width > 0 && table.global_scale.to_bits() == 0 =>
{
let row_bytes = usize::try_from(table.embedding_width)
.ok()
.and_then(|width| width.checked_mul(2))
.ok_or_else(|| invalid("BF16 embedding row width overflow"))?;
(table.embedding_width, 0, row_bytes, None)
}
wire::engram_table::Encoding::Fp8E4m3Global
if table.embedding_width > 0
&& table.global_scale.is_finite()
&& table.global_scale > 0.0 =>
{
let row_bytes = usize::try_from(table.embedding_width)
.map_err(|_| invalid("FP8 global embedding row width overflow"))?;
(table.embedding_width, 0, row_bytes, None)
}
Both produce (width, 0, row_bytes, None). Collapsing to Fp8E4m3Global | Bf16 with bytes_per_element = 1 | 2 is ~9 lines instead of 18, and the guard becomes data (Ok(bytes) | Err(_)) instead of a duplicated if. Note also that both overflow guards are unreachable on any 64-bit target (u32::MAX * 2 < 2^33), so the two distinct messages "BF16 embedding row width overflow" / "FP8 global embedding row width overflow" are two unreachable strings defending the same non-event — a single usize::try_from(width).ok().and_then(...) covers both 32- and 64-bit.
2. The Python three-way quant_mode dispatch is duplicated verbatim — ignition/components/ngram_delivery.py:106-114 vs 137-144
This PR adds the second copy of the fp8_e4m3_per_tensor branch. The two copies must stay in lockstep or the pre-declared plan (line 145) will disagree with what run_lookup is actually called with at execution time:
# _lookup (106-114) # PreparedPLELookup.__init__ (137-144)
if mode == "bf16": if mode == "bf16":
... .view(torch.bfloat16), None, None lookup_weight, lookup_scale, lookup_scale_2 = self.weights.view(torch.bfloat16), None, None
elif mode == "fp8_e4m3_per_tensor": elif mode == "fp8_e4m3_per_tensor":
... .view(torch.float8_e4m3fn), scale, None ... .view(torch.float8_e4m3fn), table.scale, None
else: else:
... scales.view(...), scale lookup_scale = self.scales.view(torch.float8_e4m3fn) ...
Extract one module-level helper — _lookup_views(mode, weights, scales, scale) -> (weight, weight_scale, weight_scale_2) — and call it from both. That is ~8 lines removed, one fewer invalid state, and the two call sites become impossible to drift.
Related, adjacent to this PR's growth: the file now reads quant_mode from two different objects — caps.quant_mode (line 136) in __init__ and state.query.quant_mode (line 105) in _lookup. If those caps came from the same plan they could not disagree; worth a one-line confirmation from the author in review rather than a code change I can justify from the diff alone.
3. The new test is three assertions where one would do — tests/components/test_ngram_delivery.py:29-35, 80, 86, 104-131
135 lines for one behavioural claim. Concretely droppable:
has_scalesandscale_dtypeare dead parameters. They are passed at29-35and used only at80/86to build the fixture — andscale_dtype is Noneis true exactly whenmode == "bf16". So two of six columns are restatements of the first. The other three columns (row_bytes,expected_weight_dtype) are likewise constant per mode and could live inside a mode→fixture dict.- The
(weight, weight_scale, weight_scale_2)triple is asserted three times: the prepare-path run closure is never checked (only its plan arguments at108-115), then120-131re-checks the same triple fromseen_lookups[0]. Dropping the last block (if expect_scale_2: ... elif mode == "fp8_e4m3_per_tensor": ... else:) removes ~11 lines and loses no coverage, sincew_dtype == expected_weight_dtypeandtok_countare the only facts there not already asserted upstream. w_scaleis unpacked but unused (121,_), a tell that the block is redundant.
4. The new Rust tests clone their siblings instead of extending them — helios/src/core/schema.rs:2068-2167, helios/src/runtime_core/engram.rs:1162-1235
validates_single_plane_fp8_global_engram_table (2068) is the BF16 test that ends at 2065 with encoding/global_scale swapped. Verbatim duplication:
- the
assert_errclosure —2068's is character-identical to1991-1994; - the two-shard partitioned fixture —
2144-2161is2024-2041withnbytesre-derived; - a literally duplicate assertion:
2128-2130(scale_block = 16→"cannot carry scale metadata") re-tests what2008-2010(scale_buffer→ same message) already covers, sinceschema.rs:504ORs the two conditions into one error. That assertion can never fail independently and should go.
Same pattern in engram.rs: fp8_global_single_plane_tables_decode_shared_and_partitioned (1162) rebuilds a make(|global_scale, width, partitioned|) closure whose body is a near-copy of the existing make(|width, row_bytes, scale_bytes|) at 1113-1146, including the three buffer-geometry lines at 1212-1214 vs 1135-1137. Including the encoding in the existing make and adding a global_scale argument would merge both tests at roughly net-negative line count.
5. engram_scales already collapses the pair; validate_engram should match it — helios/src/core/schema.rs:504-512, 561-571
This PR puts the new encoding in the good group at 443-457 (engram_encoding_has_scales), which lets engram_scales (460-471) express plane present ⟺ encoding needs it in one expression. But validate_engram still hand-inlines the same predicate twice, and the two adjacent branches now need the same message:
} else if !table.scale_buffer.is_empty() || table.scale_block != 0 {
return Err(invalid("single-plane engram table cannot carry scale metadata"));
} else if table.encoding == wire::engram_table::Encoding::Bf16 as i32 {
if table.global_scale.to_bits() != 0 {
return Err(invalid("single-plane engram table cannot carry scale metadata"));
}
Folding the BF16 global_scale.to_bits() != 0 test into the preceding || collapses two branches and one duplicate string into one condition. Separately, single_plane_row_bytes (561-571) is a 4-branch if/else if/else over a minted Option<u64> whose Some-side overflow guard (566) is unreachable as noted in §1; the guard reduces to u64::from(table.embedding_width) * u64::from(stride) once the arm is chosen.
6. One predicate, two copies — schema.rs:504-505 vs engram.rs:204-206
The same rule is stated twice with different words for the same user-visible failure:
helios/src/core/schema.rs:505—"single-plane engram table cannot carry scale metadata"helios/src/runtime_core/engram.rs:205—"single-plane Engram table cannot carry scale bindings"
engram_encoding_has_scales/engram_scales already live in schema.rs and are already imported by engram.rs:35,45,59, so a schema::single_plane_bindings(table, &scales) -> Result<()> next to them would be a drop-in for both. Note the decoder copy (204) is dead for any core that passed validate_engram — it is defence in depth, which is fine, but it does not need its own wording.
7. What is already lean — do not touch
heliopause/src/export/core.rsadds no FP8 code path at all. The +74/−7 iswire::EngramTablefixture data (4560-4596), six filename entries (4609-4611), andinstalled.len()12(4636). The production routing at108/131/421/436/1556/1598is #664's and unchanged. Nothing to subtract — this is the seam working as designed.- Docs:
docs/core-format-design.md:94-95andhelios/manifest.md:526-528(not opened) are two-line, in-place edits. Correct, minimal. - Protos:
helios/proto/core.proto:269andruntime_core.proto:665are additive tag appends;runtime_core_pb2.py(not opened) (+112/−112) is generated descriptor churn, not hand-written. No knobs, flags, config keys or defaults are added anywhere in the PR — verified againstignition/components/ngram_delivery.pyandhelios/src/core/schema.rs, which gain no new public entry points beyond the enum value. - No dead/unreachable feature branches:
Unspecifiedstill has one live path (engram.rs:29-34legacy-fixture normalisation), untouched here.
One maintainability note rather than a deduction: the new encoding's contract is now stated in prose in three places — core.proto:267-268, runtime_core.proto:663-664, and helios/manifest.md:526-528 (not opened). That triplication is pre-existing, but it is exactly what let the PR body's tag numbers drift to FP8_E4M3_GLOBAL = 3 … BF16 = 2 when the code has = 4 … = 3. Single-sourcing the comment (cite manifest.md (not opened) from the protos) would have caught it.
Recommended asks, in priority order
| # | Where | Ask | Est. saving |
|---|---|---|---|
| 1 | ngram_delivery.py:106-114 + 137-144 |
One _lookup_views(mode, …) helper |
~8 lines, removes a drift class |
| 2 | engram.rs:150-167 |
Merge the two single-plane arms | ~9 lines |
| 3 | schema.rs:504-512 |
Fold BF16 global_scale guard into the ` |
|
| 4 | test_ngram_delivery.py |
Drop has_scales/scale_dtype columns and the 120-131 re-assert |
~15–20 lines |
| 5 | schema.rs:2068 / engram.rs:1162 |
Extend the BF16 tests' existing fixtures rather than cloning them | ~40–50 lines |
| 6 | schema.rs:505 vs engram.rs:205 |
One shared predicate + one message | consistency |
None of these is a correctness bug, and #732 should not be blocked on them — but #1 and #2 are cheap enough that they belong in this PR while the seam is fresh, and #6 prevents the decoder and the validator from describing the same rejection differently to operators.
Overall: the diff is lean where it counts (format, export, docs) and repetitive where it does not (tests, the mode dispatch, the second single-plane arm). Ship-able; polishable in an hour.
Gates and contracts
Audit report — PR #732 (contract, vendored-dependency, and mandatory-verification gates)
Scope: governance only (no algorithm/kernel review). I read the changed code at ref: pr/732 (not the stale pr_diff base), docs/design-review.md, AGENTS.md, docs/verification.md, docs/core-format-design.md, docs/runtime-core-design.md, helios/manifest.md, docs/core-design.md, both protos, pyproject.toml, and the diff's tests.
Verdict: Two gate items must be resolved before merge — one mandatory-verification (Layer 1) gap and one material claim/compatibility contradiction (an undeclared BF16 validation tightening presented as "preserved behavioral compatibility", plus wrong enum numbers for a signed format). No vendored-file violation. No unapproved-captured-graph-family violation is established, but an owner adjudication question is open.
Gate 1 — Signed core-format / wire / captured-graph / public contract boundaries
What the PR actually changes (verified):
helios/proto/core.proto:266-292andhelios/proto/runtime_core.proto:662-688:enum Encoding { UNSPECIFIED = 0; FP8_E4M3_E8M0 = 1; NVFP4_E4M3_GLOBAL = 2; BF16 = 3; FP8_E4M3_GLOBAL = 4; }— additive append only; existing values untouched, so signed cores and the wire encoding remain readable (AGENTS.md:436-449, principle 13).- Signed-format validation/decode:
helios/src/core/schema.rs:443-471(engram_encoding_has_scales,engram_scales),473-641(validate_engram),helios/src/runtime_core/engram.rs:139-169(single-plane arm,scale_bytes = None),200-206(rejects scale bindings). - Normative docs were updated consistently:
docs/core-format-design.md:91-103("single-plane encodings such asBF16andFP8_E4M3_GLOBALomit the-scalesfile") andhelios/manifest.md:522-528(rawembedding_width-byte rows, no scale plane, finite positiveglobal_scale). Nothing indocs/scheduling-theory.md/docs/scheduling-runtime-design.mdis touched or contradicted — no scheduler, admission, cache, or graph-kind change.
Owner-approval question (open, not a proven violation). docs/design-review.md:22-26 and AGENTS.md:377-382 require prior explicit owner approval for "a new operation contract … even if it reuses a graph kind or enum value." This PR adds an EngramTable.Encoding value on a signed format. It adds no new operation contract — the gather/mailbox/lookup operation family and its captured ops are unchanged; only = how the element bytes are interpreted differs — so on the plain reading of the rule this is a shape/format variant rather than a new operation family, and merged precedent (#664 added BF16 = 3 through the same seam) is the same. I do not score this as a blocker, but it is the one item a reviewer should not silently assume: no owner sign-off by lukealonso is recorded anywhere on #732, and docs/design-review.md:22-26 explicitly says a design acknowledgment does not grant that approval. Recommend an explicit yes/no from the owner rather than inferring consent from #664.
- Info/Nit:
docs/core-design.md:607still describes PLE lookup as "b12x NVFP4 PLE embedding" — stale for BF16 (from #664) and now FP8. Pre-existing, but this PR is the second format the line misrepresents.
Gate 2 — Vendored upstream dependencies and cross-PR dependencies
- No vendored-file fork.
helios/native/roce_proxy.c/roce_proxy_dlopen.care untouched,PROXY_ABIuntouched, andpyproject.tomlis not in the changed-file list, so the pin stays1441ce862ffbc9d8550fdda7ad90e97ca04f4b8e(pyproject.toml:47).tests/preparation/test_roce_proxy_parity.pytherefore remains meaningful and is not at risk from this diff. No new dependency, no version bump;ignition/preparation/runtime_core_pb2.pyis regenerated descriptor content (the enum blob at line 27;_ENGRAMTABLE_ENCODINGgrows 11543-11612 → 11543-11643) ashelios/manifest.md:578-583prescribes. - Pinned, but unverifiable in-repo, upstream contract (report, not blocker). The ignition binding branches on
quant_modestrings"bf16","fp8_e4m3_per_tensor","nvfp4_group16"(ignition/components/ngram_delivery.py:105-114,136-144). Those strings occur nowhere else in this repo; they come fromb12xvia the pinnedflashinfer-python[b12x](pyproject.toml:25,47). So the new branch's name has no in-repo authority, and the "else" arm is NVFP4 — an unrecognized/misspelled mode would silently fall into the two-plane path. The dependency is pinned (satisfying "pin everything"), so this is not an unpinned-external-PR violation; it is an unverifiable upstream contract that the PR should state explicitly ("supported by pinned b12x rev 1441ce86") or corroborate. - Cross-PR: open #731 pins flashinfer forward for the same Qwen4-35B-A3B recipe on SM120. It gates SM120 export of the checkpoint this PR targets; #732's own evidence is SM121, so no dependency violation — informational only.
Gate 3 — Mandatory verification evidence (docs/design-review.md testing hierarchy)
What is claimed and plausible in the tree: helios::core::schema::tests (18) including validates_single_plane_fp8_global_engram_table (schema.rs:2068-2167), runtime_core::engram (10) including fp8_global_single_plane_tables_decode_shared_and_partitioned (engram.rs:1162-1235), heliopause --lib payload_export_tests (33) including the 6-table NVFP4/BF16/FP8 shared+partitioned export and hardlink fixture (core.rs:4525-4689), flare --lib (247 passed / 4 ignored — the full suite for that crate), and pytest tests/components/test_ngram_delivery.py (3, parametrized over all three modes at tests/components/test_ngram_delivery.py:29-36). Layer-3 obligations for a core-format change (live export/serve + legacy-core replay, principle 12/13, docs/verification.md:32) are claimed: single-GPU SM121 ignition export + native flare run for FP8 (disk and RAM backing) and an NVFP4_E4M3_GLOBAL core. No failing CI or failing test is reported anywhere on 078b043, so nothing is flagged on that axis.
Blocker — Layer 1 not run as required for the affected crates. The Layer-1 command is cargo test --locked --release on every affected crate, matching .github/workflows/native-serving.yml (docs/design-review.md:180-194; AGENTS.md:309-321). #732 ran only name-filtered, non-release subsets for the two crates it changes:
helios:--lib core::schema::testsand--lib runtime_core::engram(no--release, and the crate was not run whole with--features runtime-core,server);heliopause:--lib payload_export_testsonly;heliostemplate-fixture and/dev/shm/selenetests were not run at all.
docs/design-review.md:247-251 is explicit that "Disclosure does not excuse skipping runnable CPU checks… Leaving an applicable crate test… unrun blocks commit and PR acceptance." Unlike the externally supplied template fixtures, an unfiltered cargo test --manifest-path helios/Cargo.toml --features runtime-core,server --release and the same for heliopause are runnable on CPU without a GPU or checkpoint. flare was run whole, which shows the intended pattern. Required: post the unfiltered release-mode results for helios and heliopause (and the affected Python component suite, which was run).
Additionally, the new Python test replaces the real upstream plan with stubs (tests/components/test_ngram_delivery.py:62-67 monkeypatches ple_embedding.invocation_from_tensors and ple_embedding.plan, and require_prepared at line 60). It does establish the changed view/scale selection, but it cannot establish that the pinned b12x accepts weight_scale_2=None with an FP8 weight and the "fp8_e4m3_per_tensor" mode (AGENTS.md:194-199).
Gate 4 — Material scope / claim contradictions
Major — the description claims preserved BF16 behavior while the diff tightens BF16 validation, and it misstates the wire numbers. Both are material for a signed-format PR:
- Undisclosed BF16 behavior change.
helios/src/core/schema.rs:561-571now pins row bytes for bothBf16(embedding_width * 2) andFp8E4m3Global(embedding_width), enforced for shared planes at578-586and per shard at622-630.mainhas no such check (main:helios/src/core/schema.rs:316-421validates presence/roles only). So a BF16 core whose plane size was notrows * width * 2— accepted after #664 — is now rejected at load/export. The body asserts "Preserved full wire and behavioral compatibility for existingNVFP4_E4M3_GLOBAL… andBF16cores," which the diff contradicts. Correctly exported BF16 cores are unaffected (export derives the size identically), and the exposure is narrow, butAGENTS.md:88-94requires material compatibility changes to be named with before/after, and no test asserts the tightened BF16 rejection (the new byte-size assertions are FP8-only:schema.rs:2140-2142,2164-2166). - Wrong enum numbers in the description. The body says
FP8_E4M3_GLOBAL = 3"alongsideNVFP4_E4M3_GLOBAL = 1andBF16 = 2"; the code isE8M0 = 1, NVFP4 = 2, BF16 = 3, FP8_E4M3_GLOBAL = 4(core.proto:269,runtime_core.proto:665). For a PR whose entire subject is a signed wire tag, tag numbers a reader could copy into a producer or into a review of core compatibility are not a phrasing nuance; the text also implies a standalone feature while the diff is a stacked follow-on to #664 (which took tag 3).
Nothing else is bundled: file scope matches the description (10 files), the +112/−112 runtime_core_pb2.py is generated, and no unrelated tooling is included.
Not flagged (deliberately)
- No CI-failure finding: the description and case file report none, and I cannot observe Actions check runs.
- No performance-gate finding: the PR makes a capability claim, not a speedup claim, so no
main-vs-branch A/B is required. - TP>1 covered only by CPU tests is honestly disclosed and matches Layer-1 requirements for that path; multi-GPU hardware execution is required for
helios/src/execution/*changes, which this PR does not touch. #731coupling,docs/core-design.md:607staleness, and theb12xmode-name provenance are recorded as Info/Major above rather than blockers except where stated.
Required before merge: (1) unfiltered cargo test --locked --release results for helios --features runtime-core,server and heliopause (docs/design-review.md:247-251 is non-waivable); (2) correct the enum numbers and disclose the BF16 row-size tightening with a direct BF16 rejection test; (3) an explicit owner decision on the format-contract question, plus a one-line statement of which pinned b12x revision provides fp8_e4m3_per_tensor.
Code correctness
Deep Code Correctness Audit — PR #732 (helios,heliopause,ignition: add FP8_E4M3_GLOBAL single-plane engram table support) @ 078b043
Scope note. The PR is 10 files / ~710 changed lines across helios/, heliopause/, ignition/ — under the >12-file / >900-line partition threshold, so I audited directly. The pr_diff base is stale and carries unrelated merged work (external_extents/async_transfers, workflow YAML, AGENTS.md (not opened), THIRD_PARTY_NOTICES.md (not opened), docs/api.md (not opened), flare-winui), so I compared main against head for each of the 10 files and confined findings to the encoding/schema/export/delivery change.
Finding 1 — Major: duplicated quant-mode dispatch in the PLE lookup, with a catch-all else that silently selects the NVFP4 two-plane path and dereferences a possibly-None scales
ignition/components/ngram_delivery.py:98-114 (changed):
@torch.library.custom_op("flare::staged_ple", mutates_args=("out", "timings", "barrier_output"))
def _lookup(source: torch.Tensor, weight: torch.Tensor, scales: torch.Tensor | None,
scale: torch.Tensor | None, ids: torch.Tensor, count: torch.Tensor, out: torch.Tensor,
...
mode = state.query.quant_mode
if mode == "bf16":
state.run_lookup(weight.view(torch.bfloat16), None, None, ids, count, out, token_count=out.shape[0])
elif mode == "fp8_e4m3_per_tensor":
state.run_lookup(weight.view(torch.float8_e4m3fn), scale, None, ids, count, out, token_count=out.shape[0])
else:
state.run_lookup(weight, scales.view(torch.float8_e4m3fn), scale, ids, count, out, token_count=out.shape[0])
and the second, independent decision at ignition/components/ngram_delivery.py:132-155 (changed):
self.scales = None if table.scales is None else table.scales[:tokens * heads]
...
mode = caps.quant_mode
if mode == "bf16":
lookup_weight, lookup_scale, lookup_scale_2 = self.weights.view(torch.bfloat16), None, None
elif mode == "fp8_e4m3_per_tensor":
lookup_weight, lookup_scale, lookup_scale_2 = self.weights.view(torch.float8_e4m3fn), table.scale, None
else:
lookup_weight = self.weights
lookup_scale = self.scales.view(torch.float8_e4m3fn)
lookup_scale_2 = table.scale
Three distinct defects in the same construct:
-
Two sources of truth for one decision.
__init__resolves the mode fromcaps.quant_modeand bakes the resulting tensor views into the captured plan (self.plan = ple_embedding.plan(...)/declare(... run=lambda: state.run_lookup(lookup_weight, ...)), lines 145-157), while__call__(lines 184-193) re-enters_lookup, which re-resolves the mode from a different object —state.query.quant_modeobtained fromrequire_prepared(plan_from_handle(plan), ...)at line 104. Nothing in the file tiesstate.query.quant_modetocaps.quant_mode. If they disagree, the graph-captured path uses the precomputed views while the eager path re-derives from rawuint8/None— same table, different numerics under graph replay vs eager, with no error. -
Non-exhaustive dispatch on a free-form string. Any mode value other than the two literals —
"nvfp4_group16"(the documented NVFP4 mode, seetests/components/test_ngram_delivery.py:32), a new"fp8_e4m3_per_block", a different casing ("FP8_E4M3_PER_TENSOR") — falls into theelsebranch, i.e. is treated as the two-plane NVFP4 layout. No validation error is raised. -
Nonedereference in the fallback. Becauseself.scalesis now legitimatelyNonefor single-plane tables (line 132) and is forwarded unconditionally as thescalesoperand (line 190), theelsebranch at line 113 executesscales.view(torch.float8_e4m3fn)onNone.Concrete counterexample (no hardware needed): a
Qwen4-35B-A3BPLE table declaredFP8_E4M3_GLOBAL(single plane ⇒table.scales is None⇒self.scales is None) served withcaps.quant_mode == "nvfp4_group16"(the model body's mode, since Helios' schema has no field tyingEngramTable.encodingto a quant mode — seehelios/proto/core.proto:266-292, which has no such field).PreparedPLELookup.__init__succeeds (itselsebranch is only reached ifcaps.quant_modeis also"nvfp4_group16", in which case line 143 already raises), but_lookupreaches line 113 withscales is None→AttributeError: 'NoneType' object has no attribute 'view'at the first decode step. The reverse skew (caps.quant_mode == "fp8_e4m3_per_tensor"butstate.query.quant_mode == "nvfp4_group16") silently runs the row data through the group-scale kernel instead.The new test cannot catch this:
tests/components/test_ngram_delivery.py:86only pairsscales=Nonewithmode in {"bf16", "fp8_e4m3_per_tensor"}, never exercising the fallback with a single-plane table.
Fix. Make the dispatch a single exhaustively-checked function returning a mode tag plus the views, use it in both places, and fail loudly:
def _planes(weight, scales, scale, mode, *, view):
if mode == "bf16":
return weight.view(torch.bfloat16), None, None
if mode == "fp8_e4m3_per_tensor":
return weight.view(torch.float8_e4m3fn), scale, None
if mode == "nvfp4_group16":
if scales is None:
raise ValueError("nvfp4_group16 requires a scale plane")
return weight, scales.view(torch.float8_e4m3fn), scale
raise ValueError(f"unsupported PLE quant mode {mode!r}")
and in __init__ assert (scales is None) == (mode != "nvfp4_group16"), then pass the precomputed views (or the resolved tag) into _lookup so the eager and captured paths cannot diverge.
Finding 2 — Minor: spans() accepts encoding == UNSPECIFIED while decode() and engram_encoding_has_scales() reject the same table
helios/src/runtime_core/engram.rs:29-36 (added):
// Legacy pre-encoding `ModelIndex` fixtures leave `encoding == 0` with two planes.
let encoding = if table.encoding == wire::engram_table::Encoding::Unspecified as i32 {
wire::engram_table::Encoding::Fp8E4m3E8m0 as i32
} else {
table.encoding
};
let has_scales = crate::core::schema::engram_encoding_has_scales(encoding)?;
validate_shards(table, world, has_scales)?;
versus helios/src/runtime_core/engram.rs:137-138 (unchanged in this respect):
let encoding = wire::engram_table::Encoding::try_from(table.encoding)
.map_err(|_| invalid("unknown n-gram encoding"))?;
and helios/src/core/schema.rs:445-456, which returns Err(invalid("engram table has no encoding")) for Unspecified.
Counterexample: wire::EngramTable { encoding: 0, weights: Some(w), scales: Some(s), .. } (exactly the "legacy pre-encoding fixture" the new comment describes, e.g. the byte fixture decoded in helios/src/runtime_core/engram.rs:500-524). spans(index, Some(rank)) returns Ok with two planes, but decode(...) on the same value returns Err("unknown n-gram encoding"). spans() is called on the payload-accounting/verification path (helios/src/runtime_core/protection.rs:1254, for (owner, span) in super::engram::spans(index, self.rank)?), so verification admits an index that loading then rejects — a late, misattributed failure ("unknown n-gram encoding" instead of a schema error). The same resolver also makes any future encoding value (≥ 5) fail verification with a stale message.
Fix. Hoist one resolver, e.g.
fn resolve_encoding(encoding: i32) -> Result<wire::engram_table::Encoding> // with the UNSPECIFIED→Fp8E4m3E8m0 legacy arm
and use it in both spans() and decode() (line 137 currently bypasses the legacy arm), or delete the fallback in spans() and let the single engram_encoding_has_scales error stand.
Finding 3 — Minor (hot path): per-call .view() tensor allocations, duplicating views already built once at plan time
ignition/components/ngram_delivery.py:107 and :110 allocate a fresh TensorImpl on every flare::staged_ple invocation — i.e. every PLE lookup, every decode step, on every rank. PreparedPLELookup.__init__ already precomputes exactly these views (lines 137-144) and hands them to the captured plan (line 155), so the per-call construction is redundant as well as cheap-but-nonzero. For a 160M-row, 8960-wide PLE table at decode time this is one extra ATen view per step per rank, plus it re-enters Python attribute lookups (state.query.quant_mode) inside an op that make_fx traces. Passing the precomputed lookup_weight/lookup_scale/lookup_scale_2 (or a small integer mode tag) as op operands removes both the allocation and Finding 1's divergence.
Verified sound (checked, no defect found)
- BF16
-0.0symmetry.helios/src/core/schema.rs:506-509rejects BF16 tables whoseglobal_scale.to_bits() != 0, andhelios/src/runtime_core/engram.rs:150-151requirestable.global_scale.to_bits() == 0in the matching match-arm. The two predicates are exact complements, so-0.0(bits0x8000_0000) is rejected by both rather than admitted by one — no validation/decode disagreement. - NVFP4 generalisation is behaviour-preserving.
helios/src/runtime_core/engram.rs:141-149replaces the hardcoded(160, 16, 80, 10)with(width, 16, width/2, width/16)guarded byembedding_width > 0 && embedding_width % 16 == 0; atwidth = 160this yields exactly(160, 16, 80, 10). The% 16guard prevents a fractionalwidth/16scale row. - New exact-coverage check closes a real hole.
helios/src/core/schema.rs:635-637(if end != table.rows { "engram partitions must cover all table rows" }) is new;mainonly checkedend > table.rows, so under-covering partitions passed schema validation whileruntime_core::engram::validate_shards(helios/src/runtime_core/engram.rs:103-105) already required exact coverage. The shards.length == ranks requirement atschema.rs:599-603is consistent withvalidate_deployment's rank commitments (ranks,tensor_parallel == ranks,schema.rs:423-435) and withvalidate_shards'world, so it does not reject legitimate rank-selective copies. - Optional scale plane is handled by every consumer I traced.
heliopause/src/export/core.rs:96-142(roles),:413-445(validate_ranks),:1534-1611/:1678-1706(core_engramTablePlan),:1474-1504(cached_engram, whichcontinues onNone),:1393-1417(estimated_export_fds, which uses.flatten()), andheliopause/src/export/weight_reuse.rs:397-410all guard the absent plane.helios/src/engram.rs:204-209/reader.rs:83-101/cache.rs:172-257reduce to zero-length slices whenplanes.scalesisNone(row[weights.len()..]is empty,debug_assert_eq!(weights.len() + 0, row_bytes)holds), so the row cache and staging paths do not panic — they simply omit the scale bytes. helios/proto/core.proto:269andhelios/proto/runtime_core.proto:665carry the identical append-only numbering{ UNSPECIFIED=0; FP8_E4M3_E8M0=1; NVFP4_E4M3_GLOBAL=2; BF16=3; FP8_E4M3_GLOBAL=4; }, so no existing wire value was renumbered. (The PR description's "FP8_E4M3_GLOBAL = 3,BF16 = 2" does not match the code's3/4; that is a description discrepancy, not a code defect, and appending is the correct choice.)
One item I could not verify (needs a command, not another read)
ignition/preparation/runtime_core_pb2.py shows +112/−112 with the only textual change being Protobuf Python Version: 7.36.1 → 7.36.2; the enum values live inside the single-line escaped DESCRIPTOR blob, so I could not confirm that the regenerated descriptor actually contains BF16 = 3 / FP8_E4M3_GLOBAL = 4. If it is stale, ignition would silently alias the new encodings. Worth one check: python -c "from ignition.preparation import runtime_core_pb2 as p; print(p.EngramTable.Encoding.items())" — expected [(0,'UNSPECIFIED'),(1,'FP8_E4M3_E8M0'),(2,'NVFP4_E4M3_GLOBAL'),(3,'BF16'),(4,'FP8_E4M3_GLOBAL')].
Full report Merge Risk: medium_high (100%): Medium or high merge risk (core runtime/scheduler/GPU/CUDA/VMM/RoCE/multi-rank/contracts/ABI, large multi-crate changes, or Blocker/Major findings) — route to Super Agent.
Final review
Recommendation: Changes Requested
The core format, schema validation, and runtime decoding additions for EngramTable.Encoding.FP8_E4M3_GLOBAL = 4 are small, additive, wire-compatible, and cleanly reuse #664's Planes { weights, scales: Option<Plane> } seam with zero FP8-specific exporter or native reader/staging branches. However, the PR is blocked on Layer-1 verification (docs/design-review.md:180-194, 247-251) because only narrow name-filtered debug subsets were run for helios and heliopause, and it has two real should-fixes: non-exhaustive fallback dispatch with missing None guards in ignition/components/ngram_delivery.py and factual discrepancies in the PR description (off-by-one wire enum numbers and an unbacked hardlink-reuse test claim).
Merge Risk
Level: Low
- Wire & runtime surface is strictly additive:
FP8_E4M3_GLOBAL = 4is appended toEngramTable.Encodinginhelios/proto/{core,runtime_core}.proto(withignition/preparation/runtime_core_pb2.pyregenerated to match), leavingFP8_E4M3_E8M0 = 1,NVFP4_E4M3_GLOBAL = 2, andBF16 = 3wire layouts and validation semantics intact. - No new exporter or native serving branches:
heliopause/src/export/core.rs,helios/src/core/reader.rs,helios/src/engram.rs,helios/src/runtime_core/selection.rs, andhelios/src/runtime_core/describe.rsalready route throughschema::engram_encoding_has_scales,schema::engram_scales, andPlanes { weights, scales: Option<Plane> }. - Remaining risk: Full release-mode Layer-1 test suites for
helios,heliopause, andtests/preparation/have not been run on078b043, andignition/components/ngram_delivery.pysilently falls into two-plane NVFP4 on unknownquant_modevalues (dereferencingNonewhenscalesis absent).
Walkthrough
- Protobuf & Python bindings (
helios/proto/core.proto:268-269,helios/proto/runtime_core.proto:664-665,ignition/preparation/runtime_core_pb2.py:27,182-183): AppendsEngramTable.Encoding.FP8_E4M3_GLOBAL = 4(raw 1-byte-per-element FP8 E4M3 rows, no scale plane,scale_block == 0, finite positiveglobal_scale) and regeneratesruntime_core_pb2.py(_ENGRAMTABLE_ENCODINGdescriptor expands by 21 bytes withFP8_E4M3_GLOBAL = 4). - Signed-core schema validation (
helios/src/core/schema.rs:451-454, 497-512, 561-586, 622-630, 2067-2167): ClassifiesFp8E4m3Globalas single-plane inengram_encoding_has_scales, enforces emptyscale_buffer,scale_block == 0, finite positiveglobal_scale, absentscalesplane, and exactrows * embedding_widthbyte lengths for both shared and partitioned tables (generalizing #664'sbf16_row_bytesintosingle_plane_row_byteswithout changing BF16 behavior), and addsvalidates_single_plane_fp8_global_engram_table. - Runtime-core decoding (
helios/src/runtime_core/engram.rs:159-167, 1161-1235): Adds theEncoding::Fp8E4m3Globaldecode arm yielding(embedding_width, 0, row_bytes, None)for positiveembedding_widthand finite positiveglobal_scale, plus unit testfp8_global_single_plane_tables_decode_shared_and_partitioned. - Heliopause export tests (
heliopause/src/export/core.rs:4413-4768): Adds shared and partitionedFp8E4m3Globaltables (plus scale-plane rejection and signed round-trip verification) tocore_engram_preserves_shared_and_partitioned_plane_layouts; production export paths require no changes. - Ignition PLE delivery & tests (
ignition/components/ngram_delivery.py:98-115, 131-157,tests/components/test_ngram_delivery.py): Updatesflare::staged_ple(_lookup) andPreparedPLELookup.__init__to accept optionalscales/scaletensors and select views/scales for"bf16","fp8_e4m3_per_tensor", and two-plane NVFP4, with a new parametrized CPU test covering view selection andmake_fxtracing. - Docs (
docs/core-format-design.md:94-95,helios/manifest.md:526-528): DocumentsFP8_E4M3_GLOBALsingle-plane layout, omitted-scalessafetensors file, andglobal_scalecontract.
Pre-merge Checks
- [PASS] Security / malicious screen: No unsafe code, credential handling, external network calls, or suspicious behavior introduced.
- [PASS] Charter & value fit: Model-agnostic format addition at the right layer (no per-model branches, flags, or new captured-graph operation families), linked to companion recipe PR
local-inference-lab/hyperflare-recipes#165and two target checkpoints (local-inference-lab/Qwen4-35B-A3B-NVFP4,eidonix/Qwen4-35B-A3B-MXFP8; note both are first-party orgs). - [WARN] Related / duplicate / conflict check: Additive follow-on to merged #664 and #716 with no competing PR; shares 6 files (
core.proto,runtime_core.proto,schema.rs,export/core.rs,manifest.md,runtime_core_pb2.py) with open PR #723 (mechanical rebase risk) and SM120 Qwen4-35B-A3B export is separately gated by open PR #731. - [WARN] Tests & verification evidence: Unit tests for the new paths are clean, but mandatory Layer-1 release-mode crate suites for
heliosandheliopauseandtests/preparation/were skipped in favor of narrow debug subsets (see Blocker #1), hardlink reuse is not actually covered forFP8_E4M3_GLOBAL, and the claimed SM121ignition export/flare run+ NVFP4 replay lacks commands/output summary (see Should Fix #2).
Blockers
- Incomplete Layer-1 CPU verification for affected crates (
docs/design-review.md:180-194, 247-251;AGENTS.md:309-321):- Verified gap: This PR modifies the signed core-format schema, runtime-core decoder, exporter tests, and Ignition ABI component across
helios,heliopause, andignition, yet reports only three narrow name-filtered debug test runs (helios --lib core::schema::tests,helios --lib runtime_core::engram,heliopause --lib payload_export_tests), non-releaseflare --lib, and a single pytest file (tests/components/test_ngram_delivery.py). It skipped--locked --releasebuilds and unfiltered tests across the affected crates—omittinghelios::engram::*,helios::core::reader,helios::core::conversion,helios::runtime_core::{protection,selection},heliopause::export::{weight_reuse,binding}, andtests/preparation/(includingtest_core_boundary.pyandtest_embedding_table_handoff.py(not opened)). Perdocs/design-review.md:247-251, disclosing skipped runnable CPU checks as limitations does not waive them and blocks PR acceptance. - Fix: Run and report the Layer-1 release-mode commands for the affected crates and Python suites (matching
.github/workflows/native-serving.yml(not opened) and.github/workflows/python-cpu.yml(not opened)):cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) --features runtime-core,server(withFLARE_TEST_TEMPLATE_DIRprepared viatests/frontend/prepare_templates.py(not opened), or running the full crate suite and noting only externally-gated template fixtures if offline),cargo test --locked --release --manifest-path heliopause/Cargo.toml (not opened) --lib,pytest tests/components/ tests/preparation/.
- Verified gap: This PR modifies the signed core-format schema, runtime-core decoder, exporter tests, and Ignition ABI component across
Should Fix
- Non-exhaustive catch-all
else:and missing optional-plane validation inignition/components/ngram_delivery.py:98-115, 132-145:- Verified behavior: Both
_lookup(flare::staged_ple, lines 105–114) andPreparedPLELookup.__init__(lines 136–144) duplicate the same three-wayif mode == "bf16" / elif mode == "fp8_e4m3_per_tensor" / else:dispatch. Becausescalesandscaleare nowtorch.Tensor | None(lines 99–100, 132):- Any unrecognized
quant_modestring silently falls into the two-plane NVFP4else:branch rather than raising an error, and crashes withAttributeError: 'NoneType' object has no attribute 'view'ifscales is None. "nvfp4_group16"withscales is Noneorscale is Nonecrashes withAttributeErroror forwardsNoneasweight_scale_2."fp8_e4m3_per_tensor"does not rejectscale is Noneor an unexpected non-Nonescalesplane, and"bf16"does not reject unexpectedscales/scale.
- Any unrecognized
- Fix: Extract one module-level helper
_ple_lookup_planes(mode, weights, scales, scale)called by bothPreparedPLELookup.__init__and_lookupthat explicitly handles"bf16","fp8_e4m3_per_tensor", and"nvfp4_group16", validates presence/absence ofscalesandscaleper mode, and raisesValueErroron unsupported modes or mismatched planes. Add negative test cases intests/components/test_ngram_delivery.py.
- Verified behavior: Both
- PR description wire-tag errors, unbacked hardlink-reuse claim, and missing SM121 verification details (
helios/proto/core.proto:269,helios/proto/runtime_core.proto:665,heliopause/src/export/core.rs:3907-4146):- Verified discrepancies:
- The description states
Added Encoding::FP8_E4M3_GLOBAL = 3 alongside NVFP4_E4M3_GLOBAL = 1 and BF16 = 2, which is off by one on every tag and omitsFP8_E4M3_E8M0 = 1. The actual signed-core enum in both.protofiles isUNSPECIFIED = 0; FP8_E4M3_E8M0 = 1; NVFP4_E4M3_GLOBAL = 2; BF16 = 3; FP8_E4M3_GLOBAL = 4. - The description claims
FP8_E4M3_GLOBALhardlink-reuse test coverage inheliopause/src/export/core.rs, butreuse_engram_hardlinks_shared_and_partitioned_embedding_planes(heliopause/src/export/core.rs:3907-4146) only loops overNvfp4E4m3GlobalandBf16((partitioned, bf16)at line 3910).Fp8E4m3Globalis only exercised incore_engram_preserves_shared_and_partitioned_plane_layouts(4560-4768), which passescache = None. - The claimed live SM121
ignition export+ nativeflare runverification (disk/RAMFP8_E4M3_GLOBALand backward-compatibleNVFP4_E4M3_GLOBALreplay) omits commands, observed results, and confirmation that the pinnedflashinfer-python[b12x]revision (1441ce86inpyproject.toml:47) provides"fp8_e4m3_per_tensor"(whichtests/components/test_ngram_delivery.py:56-67mocks out).
- The description states
- Fix: Correct the enum tag numbers in the PR description, either add
Fp8E4m3Globalcases toreuse_engram_hardlinks_shared_and_partitioned_embedding_planes(recommended—small loop extension) or update the description to match actual coverage, and include a brief command/result summary for the SM121 export/serve and NVFP4 replay runs (docs/design-review.mdPrinciples 12 & 16).
- Verified discrepancies:
Subtract / Simplify
- Match the decoded
Encodingenum once inhelios/src/core/schema.rs:497-512, 561-571: Afterengram_encoding_has_scales,validate_engramre-comparestable.encoding == ... as i32three times (506,561,567) and duplicates the"single-plane engram table cannot carry scale metadata"error return (505,508). Decodingwire::engram_table::Encodingonce and matching exhaustively removes raw-i32comparisons, collapses the duplicate error branch, and ensures future encodings cannot silently fall into anelsebranch. - Consolidate single-plane decode geometry in
helios/src/runtime_core/engram.rs:150-167:Encoding::Bf16andEncoding::Fp8E4m3Globalconstruct the same(table.embedding_width, 0, row_bytes, None)tuple differing only inbytes_per_element(2vs1) and theglobal_scalecheck; factoring the shared width-to-bytes conversion trims boilerplate while keeping both scale guards clear.
Nits
docs/core-design.md:607still describes PLE lookup as"b12x NVFP4 PLE embedding"(pre-existing staleness since #664's BF16, now also omittingFP8_E4M3_GLOBAL); consider updating it for consistency across the core-format doc set.- Although adding an
EngramTable.Encodingtag does not introduce a new captured-graph operation contract, getting a brief maintainer sign-off (@lukealonso) on the new signed-core enum tag andb12x"fp8_e4m3_per_tensor"vocabulary before merge is good hygiene.
Dropped on verification
- Value Prop / Discovery Dossier / Contracts Audit ("Undeclared BF16 validation tightening in
helios/src/core/schema.rs:561-586, 622-630and missing BF16 rejection tests"): Verified false—caused by diffing against a stale pre-#664main.pr/664:helios/src/core/schema.rs:433-500already enforced exactrows * embedding_width * 2plane sizing for shared and partitioned BF16 tables, andschema.rs:1996-1998, 2058-2060already test BF16 shared and partition size mismatch. PR #732 only renamedbf16_row_bytestosingle_plane_row_bytesand added theFp8E4m3Globalarm. - Code Correctness Lens Finding 2 (
helios/src/runtime_core/engram.rs:29-36spans()acceptsUNSPECIFIEDwhiledecode()rejects it): Pre-existing code from #664 (pr/664:helios/src/runtime_core/engram.rs:29-36), untouched by PR #732, and intentional for legacy pre-encodingModelIndexfixtures (engram.rs:500-524). - Code Correctness Lens Finding 3 (per-call
.view()hot-path allocation inignition/components/ngram_delivery.py:107,110): False hot-path defect—flare::staged_pleruns only during Python preparation/graph capture (AGENTS.md:414-421), never during native Rust serving, andmainalready called.view(torch.float8_e4m3fn)inside_lookup(main:ngram_delivery.py:105) to preserveuint8staging buffer dtypes (engram.rs:329). - Code Correctness Lens Finding 1 sub-claim ("
caps.quant_modevsstate.query.quant_modetwo sources of truth diverging"): Speculative—stateis retrieved viaplan_from_handle(self.plan.handle)forself.plan = ple_embedding.plan(caps, ...), sostate.queryoriginates fromcaps. (The non-exhaustiveelse:, missingNonevalidation, and duplicated dispatch remain valid and are retained in Should Fix #1.) - Code Correctness Lens unverified item (
ignition/preparation/runtime_core_pb2.pydescriptor blob staleness): Verified clean—_ENGRAMTABLE_ENCODINGgrew by exactly 21 bytes (pr/66411513..11592→pr/73211543..11643, the exact wire size ofFP8_E4M3_GLOBAL = 4) andP8_E4M3_GLOBAL(\x46P8_E4M3_GLOBAL) is present inDESCRIPTORon line 27. - Value Prop / Discovery Dossier (blocking on
docs/design-review.md:22-26captured-graph operation-family approval): Not a blocker—docs/design-review.md:22-26gates new captured-graph operation families/contracts; PR #732 adds no graph kind,ValueSource,EngramHash.Method, or mailbox protocol, only an encoding tag on #664's existing single-plane seam. - Subtraction Lens §3 (
tests/components/test_ngram_delivery.py"deadscale_dtypecolumn" and "redundant assertions at lines 120-131"): Verified false—scale_dtypehas three distinct values across the three modes (float32,bfloat16,Noneat lines 32–34), and lines 104–115 testPreparedPLELookup.__init__(invocation_from_tensors) while lines 120–131 testflare::staged_ple(run_lookup), covering two separate paths. - Subtraction Lens §4 (
helios/src/core/schema.rs:2128-2130"scale_block = 16is literally duplicate ofscale_buffer"): Verified false—schema.rs:504ORs!table.scale_buffer.is_empty() || table.scale_block != 0; testing onlyscale_bufferleaves thescale_block != 0branch uncovered. - Value Prop / Discovery Dossier ("Rebase over open PR #723" and "SM120 gated by open PR #731"): Informational context only; kept in Pre-merge Checks rather than Blockers or Should Fix.
Classify triage
Selected: triage:review
Threshold: 65%
Triage
- [✓]
triage:review: 99.3% -
triage:validation: 0.6% -
triage:design-review: 0.1% -
none: 0.0% -
triage:partial: 0.0% -
triage:integration: 0.0% -
triage:investigate: 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: yatesdr (COLLABORATOR; 84 merged PRs in 180 days, mostly helios/src, selene, docs); Discord D-Rock Motivation: Qwen4-35B-A3B checkpoints store their giant offloaded PLE/engram tables as raw FP8 with one shared scale per table, a layout the format could not yet describe, so those checkpoints could not be exported or served natively. This PR adds that one encoding tag, reusing the single-plane seam merged hours earlier in #664. Scale: +565 / −145 lines in 10 files Proposal:
- Appends
EngramTable.Encoding.FP8_E4M3_GLOBAL = 4to both protos and regeneratesruntime_core_pb2.py; existing tags untouched. - Validates it in
schema.rsas single-plane: no scales plane/buffer,scale_block == 0, finite positiveglobal_scale, row bytes pinned toembedding_width(shared and partitioned). - Decodes it in
engram.rswith one match arm; production export needed no change because it routes through #664'sengram_scales. - Updates
ngram_delivery.pyto accept optional scale tensors and pick FP8/BF16/NVFP4 views. - Docs (
core-format-design.md(not opened),manifest.md(not opened)) plus four test additions. Touches: helios/src/core/schema.rs— signed-core validation of a wire contractignition/components/ngram_delivery.py— dispatch on an out-of-repoquant_modevocabularyheliopause/src/export/core.rs— export tests only Related items:- #664 helios,heliopause,ignition: support single-plane BF16 and identity-indexed offloaded embedding tables (merged): the stack base this PR reuses
- #716 helios: derive NVFP4 engram row and scale widths from embedding_width (merged): same file, hours earlier
- #733 helios,heliopause,ignition: add FP8_E4M3_GLOBAL (=4) engram table encoding (closed): duplicate, closed in favor of #732
- #731 build: pin flashinfer-python to 6aff33c4 for Qwen4-35B-A3B GDN geometry (open): SM120 gate, now Ready To Merge
- #723 helios,heliopause,ignition: fleet-wide 2-way codec green contexts… (open): shares 6 files, rebase conflict only
Link: https://github.com/NVIDIA/hyperflare-inference/pull/732
Autobot comments: Amendments only since my last case file. One retraction: my earlier finding that #732 undeclaredly tightens BF16 validation is wrong — BF16 row-size pinning shipped in #664 (
schema.rs:555, enforcedmain:570-578/614-622); at head it is just a rename tosingle_plane_row_bytesplus an FP8 arm, behaviour unchanged. Resolved: the description's wrong enum numbering is fixed. New finding: the rewritten body overclaims — its headline_ple_lookup_planesrefactor does not exist anywhere at head, the hardlink test it cites is pre-existing onmain(export/core.rs:3907) and loops only NVFP4/BF16 (:3910) so it does not cover FP8,docs/core-design.mdis not in the file list and:607is still stale, and "pytest 10 passed" cannot come from a file with one test parametrized over 3 modes. The bareelsethat crashes on unknownquant_mode(Autobot Should-fix A) is still atngram_delivery.py:112-114,:141-143. #733 was an identical implementation, stopped as duplicate and closed in favor of #732; its body independently asserted the owner-approval requirement (docs/design-review.md(not opened)) that #732 still lacks. Evidence is now much stronger: nero- reports end-to-end verification plus full GSM8K-1319 on SM120 and SM121, though he authored the superseded #733 and attaches no artifacts. Autobot review is Changes Requested / merge risk Low, but it targets078b043, not current head02ba7629, so its release-mode-suite blocker and the new body's claimed suite counts cannot both be current; CI state is still unreported.
Classify intake
Selected: triage:review, performance, enhancement, area:engram
Threshold: 65%
Triage
- [✓]
triage:review: 95.0% -
triage:design-review: 4.7% -
triage:validation: 0.2% -
none: 0.1% -
triage:integration: 0.0% -
triage:investigate: 0.0% -
triage:partial: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0%
Priority
-
none: 100.0% -
priority:P1: 0.0% -
priority:P2: 0.0%
Type
- [✓]
enhancement: 98.9% - [✓]
performance: 81.8% -
community: 53.1% -
duplicate: 43.8% -
bug: 0.1% -
documentation: 0.0%
Area
- [✓]
area:engram: 97.1% -
area:preparation: 62.2% -
area:api: 50.0% -
area:kernels: 2.3% -
area:memory: 1.8% -
area:caching: 1.4% -
area:selene: 1.0% -
area:packaging: 0.9% -
area:orbit: 0.2% -
area:rocenante: 0.1% -
area:scheduling: 0.0%
Model
-
model:deepseek-v4.1: 10.7% -
model:glm-5.3: 4.2% -
model:nemotron-3.5-bolt: 2.0% -
model:qwen3.8-27b: 2.0% -
model:mimo-v2.6: 1.8% -
model:qwen3.8-flash-next: 1.6% -
model:inkling-small: 1.2% -
model:gemma4: 0.8% -
model:muse-glimmer: 0.7% -
model:deepseek-v4: 0.6% -
model:kimi-k3.1: 0.2%
Apply Labels (Intake)
Applied: +performance
Gates and contracts
Contracts, Charter & Verification Gates Audit — PR #732 @ 02ba762
Verdict: one mandatory-verification BLOCKER stands (Layer 1), plus one MAJOR claim contradiction (Gate 4). No vendored-file violation. No proven contract-boundary violation.
I read at ref: pr/732 (not pr_diff, which diffs against a stale pre-#664 base) and compared against main, covering docs/design-review.md, AGENTS.md, docs/verification.md, docs/core-format-design.md, docs/core-design.md, helios/manifest.md, both protos, pyproject.toml, and every changed source file.
Gate 1 — Signed core-format / wire / captured-graph contracts: CLEAN
- Append-only tag:
helios/proto/core.proto:269andhelios/proto/runtime_core.proto:665both read{UNSPECIFIED=0; FP8_E4M3_E8M0=1; NVFP4_E4M3_GLOBAL=2; BF16=3; FP8_E4M3_GLOBAL=4}. No value renumbered or reserved-value broken (AGENTS.md:442-449). - The contradicted normative doc was updated:
docs/core-format-design.md:94-95now namesFP8_E4M3_GLOBAL(atmain:94it namedBF16only), andhelios/manifest.md:526-528states the row geometry, absent scale plane,scale_block == 0, and finite positiveglobal_scale. - No graph kind, capacity list, cache scheme,
ValueSource, orEngramHash.Methodadded;docs/scheduling-theory.md(not opened) anddocs/scheduling-runtime-design.mdcontain no engram-encoding invariant this contradicts. - Owner approval (
docs/design-review.md:22-26,AGENTS.md:377-382) recorded as an open adjudication question, not a violation: no new operation contract is introduced (only element-byte interpretation changes), and merged #664 addedBF16 = 3through the same seam. - Info/Nit:
docs/core-design.md:607still says "b12x NVFP4 PLE embedding"; that file is not in the diff and the line is pre-existing staleness — doc hygiene, not a normative contradiction.
Gate 2 — Vendored dependencies & cross-PR: CLEAN
- No vendored fork:
helios/native/roce_proxy.c(not opened) /roce_proxy_dlopen.c(not opened) untouched, andpyproject.tomlis not among the 10 changed files, so the pin staysrev = "1441ce862ffbc9d8550fdda7ad90e97ca04f4b8e"(pyproject.toml:47);tests/preparation/test_roce_proxy_parity.py(not opened) stays meaningful. - The recipe PR is linked (
hyperflare-recipes#165), not consumed. - Report-not-blocker:
quant_modestrings ("bf16","fp8_e4m3_per_tensor","nvfp4_group16"atngram_delivery.py:105,136) occur nowhere else in the repo; they come from the pinnedflashinfer-python[b12x](pyproject.toml:25,47), so "pin everything" is satisfied. - #723 (6 shared files) is rebase-conflict only; #731 gates SM120 export of one checkpoint — informational.
Gate 3 — Mandatory verification: BLOCKER (checked prior round first)
I checked the Case File History and the 19:54 review at 078b043 before filing. The head moved to 02ba762, but the new body's evidence is still --lib and name-filtered subsets: heliopause --lib (234), helios --lib core:: (527), helios --lib runtime_core:: (204), flare --lib (247), and one pytest file.
The mandated command (AGENTS.md:317, .github/workflows/native-serving.yml (not opened)) is the whole crate: cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) --features runtime-core,server. That also runs helios/tests/, which holds exactly the core loading / legacy-core compatibility harnesses a core-format change must exercise — legacy_core.py (not opened) (v4/v5 ModelIndex fixtures), legacy_cluster_fixture.py (not opened), runtime_core_fixture.py (not opened), engram_core_fixture.py (not opened) — all omitted by a --lib filter. docs/verification.md:32 requires loading and compatibility tests for a core field change; docs/design-review.md:116-123 requires previous cores validated through loading and serving. tests/preparation/ also went unrun and is affected (test_core_boundary.py:15 (not opened) pins the engram module; test_core_protection.py:838 (not opened),873 exercise engram shard export). docs/design-review.md:247-251 is non-waivable: "Disclosure does not excuse skipping runnable CPU checks." Both commands run CPU-only. (heliopause has no tests/ dir, so its --lib run is effectively the whole crate — that part is fine.)
Layer 3 is plausibly satisfied, so I do not file that gap: live SM121 ignition export + native flare run (disk and ram) plus an NVFP4_E4M3_GLOBAL replay are claimed, and nero-'s 22:52 comment independently corroborates SM120 + SM121 with GSM8K-1319. Caveats: no artifacts, and the corroborator authored the closed duplicate #733.
No failing CI or failing test is reported anywhere, so nothing is flagged on that axis.
Gate 4 — Claim contradictions: MAJOR
Four checkable "what changed" claims are absent from the tree:
_ple_lookup_planesdoes not exist — repository-wide search returns no matches;ngram_delivery.py:105-114and:136-144still hold two duplicated three-way dispatches with a bareelse:(:112-114,:141-143) callingscales.view(...)on a possibly-Noneplane, and there is noValueErrorfor a mode anywhere in the file. The body presents this refactor as done.- The cited hardlink test is pre-existing and does not cover FP8 —
reuse_engram_hardlinks_shared_and_partitioned_embedding_planesexists identically atmain:3907andpr/732:3907, and its loopfor (partitioned, bf16) in [(false,false),(true,false),(false,true),(true,true)](:3910) has only NVFP4/BF16 branches.Fp8E4m3Globalappears incore.rsat exactly:4570and:4583, insidecore_engram_preserves_shared_and_partitioned_plane_layouts(cache = None). So FP8 hardlink reuse is genuinely uncovered. docs/core-design.mdis not in the 10 changed files and:607is still stale.- "pytest … 10 passed" is impossible — the file has one test (
tests/components/test_ngram_delivery.py:37) parametrized over three modes (:29-35) = 3 collected; the figure also changed from an earlier "3 passed."
Also unsupported: "exhaustively matches the decoded Encoding enum once" (raw i32 compares at schema.rs:506,561,567; duplicate error string at :505 and :508) and "consolidates single-plane row-byte geometry in runtime_core::engram" (no helper; inline arm at engram.rs:159-167). This is a docs/design-review.md:156-162 (principle 16) failure, and the exact in-scope class: prose asserting a test/refactor completely absent from the diff. Not scope bundling — the file list matches the stated subject and the +112/−112 runtime_core_pb2.py is generated churn, correctly regenerated (:5 shows protoc "7.36.2", so #664's regeneration carries over).
Explicitly not flagged
- BF16 tightening claim: retracted as a finding.
main:helios/src/core/schema.rs:555already hadbf16_row_bytes, enforced atmain:570-578andmain:614-622; head only renames it tosingle_plane_row_bytes(:561-571), adds theFp8E4m3Globalarm, and splits theglobal_scalepredicate into an explicitBf16arm — behaviour-identical. The body's backward-compatibility claim forBF16/NVFP4_E4M3_GLOBALis accurate. - No performance gate: capability claim, not a speedup claim; the GiB figures are resource observations.
- TP>1 covered by CPU tests is honestly disclosed and Layer-1-compliant; no
helios/src/execution/*change. - No CI finding (tools cannot query Actions, and nothing reports failure).
Required before merge
- Post unfiltered
--locked --releaseresults forhelios --features runtime-core,server(includinghelios/tests/legacy-core loading targets) andheliopause, pluspytest tests/preparation/—docs/design-review.md:247-251is non-waivable. - Correct or delete the four unsupported description claims, which also fixes the impossible pytest count.
- Optional: an explicit owner yes/no on the enum tag, and a statement of which pinned
b12xrevision provides"fp8_e4m3_per_tensor".
Subtraction and simplicity
Subtraction & Simplicity Audit — PR #732 (helios,heliopause,ignition: add FP8_E4M3_GLOBAL single-plane engram table support, head 02ba762)
Verdict: the wire additions are lean — one enum value, one match arm per layer, no new CLI flags, no new exporter path, no native-reader change (Fp8E4m3Global appears in exactly two non-test production sites: helios/src/core/schema.rs:453,567 and helios/src/runtime_core/engram.rs:159). But the change ships a duplicated mode→tensor-shape map in Python, duplicated encoding→row-bytes arithmetic across two crates, and ~170 lines of test code that re-derive fixtures already present in the same files. Concrete, high-signal reductions below.
1. HIGH — the same mode→(weight, scale, scale₂) mapping is written twice, and the extraction the description claims is missing
ignition/components/ngram_delivery.py:105-114 (in _lookup) and :136-144 (in PreparedPLELookup.__init__) are the same three-way branch:
105 mode = state.query.quant_mode
106 if mode == "bf16":
107 state.run_lookup(weight.view(torch.bfloat16), None, None, ids, count, out,
...
109 elif mode == "fp8_e4m3_per_tensor":
110 state.run_lookup(weight.view(torch.float8_e4m3fn), scale, None, ids, count, out,
...
112 else:
113 state.run_lookup(weight, scales.view(torch.float8_e4m3fn), scale, ids, count, out,
136 mode = caps.quant_mode
137 if mode == "bf16":
138 lookup_weight, lookup_scale, lookup_scale_2 = self.weights.view(torch.bfloat16), None, None
139 elif mode == "fp8_e4m3_per_tensor":
140 lookup_weight, lookup_scale, lookup_scale_2 = self.weights.view(torch.float8_e4m3fn), table.scale, None
141 else:
142 lookup_weight = self.weights
143 lookup_scale = self.scales.view(torch.float8_e4m3fn)
144 lookup_scale_2 = table.scale
search_code over the PR head for _ple_lookup_planes returns zero matches, so the description's "Extracts _ple_lookup_planes(mode, weight, scales, scale) shared by PreparedPLELookup and flare::staged_ple" is not in the tree — the duplication the bullet says it removed is still present, now as two copies of a three-mode switch instead of one NVFP4 path.
Subtraction — one helper used by both sites:
def _ple_lookup_planes(mode, weight, scales, scale):
if mode == "bf16": return weight.view(torch.bfloat16), None, None
if mode == "fp8_e4m3_per_tensor": return weight.view(torch.float8_e4m3fn), scale, None
if mode == "nvfp4_group16": return weight, scales.view(torch.float8_e4m3fn), scale
raise ValueError(f"unsupported PLE quant mode {mode!r}")
This also fixes, at one site instead of two, the defect that the last branch is a bare else (:112, :141): an unknown quant_mode silently takes the NVFP4 path and dereferences scales at :113/:143, which is None for single-plane tables (:132 sets self.scales = None if table.scales is None else ...). Making "nvfp4_group16" explicit is fewer lines than the current else and removes the crash. _lookup and __init__ then differ only in which tensor triple they pass; the run= lambda at :155 and the _lookup(...) call at :190 stay unchanged. The module already has a precedent for a named validating helper: _validate_staged_heads at ignition/components/engram.py:90.
2. HIGH — encoding→row-byte geometry is now computed twice, in two different crates
helios/src/core/schema.rs:561-571:
let single_plane_row_bytes = if table.encoding == wire::engram_table::Encoding::Bf16 as i32 {
Some(
u64::from(table.embedding_width)
.checked_mul(2)
.ok_or_else(|| invalid("BF16 engram row width overflow"))?,
)
} else if table.encoding == wire::engram_table::Encoding::Fp8E4m3Global as i32 {
Some(u64::from(table.embedding_width))
} else {
None
};
helios/src/runtime_core/engram.rs:150-167 (same PR, same commit) re-derives the identical quantity with the identical ×2 vs ×1 rule:
wire::engram_table::Encoding::Bf16
if table.embedding_width > 0 && table.global_scale.to_bits() == 0 =>
{
let row_bytes = usize::try_from(table.embedding_width)
.ok()
.and_then(|width| width.checked_mul(2))
.ok_or_else(|| invalid("BF16 embedding row width overflow"))?;
(table.embedding_width, 0, row_bytes, None)
}
wire::engram_table::Encoding::Fp8E4m3Global
if table.embedding_width > 0 && table.global_scale.is_finite() && table.global_scale > 0.0 =>
{
let row_bytes = usize::try_from(table.embedding_width)
.map_err(|_| invalid("FP8 global embedding row width overflow"))?;
(table.embedding_width, 0, row_bytes, None)
}
The FP8 arm is the BF16 arm minus checked_mul(2); and the two crates now encode the same elements-per-row→bytes-per-row table. The description claims it "consolidates single-plane row-byte geometry in runtime_core::engram" — no shared helper exists (single_plane occurs only at schema.rs:561,578,622).
Subtraction: add one pub fn engram_plane_row_bytes(encoding: i32, width: u32) -> Result<Option<u64>> beside engram_encoding_has_scales (schema.rs:445) and engram_scales (:460) — helpers the sibling crate already imports across the boundary (heliopause/src/export/core.rs:108,131,1556,1598), and runtime_core/engram.rs already imports from crate::core::schema (:35,:45,:59), so both call sites become two-liners. That also folds the two duplicated guards (is_finite() && > 0.0 here, to_bits() == 0 there) into one place, and lets the two single-plane match arms collapse into one parameterised by element bytes (~12 lines).
3. MEDIUM — schema.rs:504-512: three-branch chain, duplicated error string, as i32 instead of the enum
} else if !table.scale_buffer.is_empty() || table.scale_block != 0 {
return Err(invalid("single-plane engram table cannot carry scale metadata"));
} else if table.encoding == wire::engram_table::Encoding::Bf16 as i32 {
if table.global_scale.to_bits() != 0 {
return Err(invalid("single-plane engram table cannot carry scale metadata"));
}
} else if !(table.global_scale.is_finite() && table.global_scale > 0.0) {
return Err(invalid("FP8 global engram table requires a finite positive global scale"));
}
Same message at :505 and :508; the shape exists only because Bf16 rejects any nonzero scale while FP8 requires a finite positive one. The body claims it "exhaustively matches the decoded Encoding enum once in validate_engram" — the code actually compares table.encoding == ... as i32 three times (:506, :561, :567). One match Encoding::try_from(table.encoding) returning NoPlane | GlobalScale(f32) | BlockScale expresses all three cases in one place and removes every as i32 comparison.
4. MEDIUM — the new schema test re-implements the BF16 test 100 lines above it
helios/src/core/schema.rs:2068-2167 (validates_single_plane_fp8_global_engram_table) duplicates :1945-2065 (bf16_identity_single_plane_engram_validation): same catalog.insert(&descriptor(1..4)) (:2074-2077 vs :1951-1954), same use_ closure (:2078-2085 vs :1955-1962), same assert_err closure (:2117-2120 vs :1991-1994), same with_scales / with_scale_buf / bad_size / partitioned / bad_shard_bytes cases. The only genuinely new assertions are the four-value loop for bad_scale in [0.0f32, -0.25, f32::NAN, f32::INFINITY] (:2122-2126) and the byte factor (rows * u64::from(width) vs * 2, :2072-2073).
Subtraction: one table-driven test over [(Encoding::Bf16, 2, 0.0), (Encoding::Fp8E4m3Global, 1, 0.25)], running the negative-scale loop only for the case that can fail — ~25 net lines instead of ~100, and the two encodings' contracts become visibly identical in one place.
5. MEDIUM — runtime_core/engram.rs:1162-1235 builds a second bespoke fixture next to one 40 lines up
fp8_global_single_plane_tables_decode_shared_and_partitioned carries an inline make(global_scale, width, partitioned) closure that mutates a decoded fixture field-by-field (:1173-1214): sets encoding/width/scale_block/global_scale, clears scale buffer, rebuilds hash arrays, hand-builds two shards, then hand-patches the engram_1_weights buffer's shape/strides/nbytes and retains away engram_1_scales. The immediately preceding nvfp4_tables_accept_width_128_and_160_and_reject_unaligned_widths (:1111-1159) already has a make(width, row_bytes, scale_bytes) closure doing exactly that buffer patching, and bf16_identity_single_plane_decodes_and_enforces_strict_contract (:868) already covers the no-scales path. make is also called three times (:1218, :1223, :1229) rebuilding identical fixtures just to vary one scalar — a for (global_scale, partitioned) in [...] loop is ~8 lines instead of ~20.
6. LOW — heliopause/src/export/core.rs test additions are positional and hand-offset
:3910—for (partitioned, bf16) in [(false, false), (true, false), (false, true), (true, true)]is a hand-enumerated product of two bools; nested loops give the same coverage with no table to keep in sync. (And the PR does not extend this loop to FP8, so the FP8 hardlink-reuse gap stays untested — a subtraction the PR leaves on the table.):4641-4648—if bad_idx % 2 == 0 { .tables[bad_idx].scales = ... } else { .tables[bad_idx].shards[0].scales = ... }encodes "even index = shared, odd = partitioned" as index arithmetic. Listing pairs directly ([(2, false), (3, true), (4, false), (5, true)]) removes an invariant the reader must reconstruct from the fixture order at:4555-4595.:4557-4595, :4606-4611— three new hardcoded payload offsets (13064,13080,13088) with eachnbyteswritten twice (once in theSpan, once in the(offset, name, nbytes)list). This shape is inherited from the BF16 case, so the PR doubles existing debt rather than fixing it; one[(name, bytes)]slice walked to build both the file writes and the spans removes the coinciding-constant coupling.
Confirmed lean — no subtraction warranted
- No new CLI flags, config knobs, or env vars.
--embedding-table-storage disk|ramalready existed (docs/cli-design.md:767(not opened)); this PR adds none. - No new exporter path and no native reader change.
heliopause/src/export/core.rsproduction code is untouched — onlypayload_export_testschanged — precisely becauseengram_scales(core.rs:108,131) already handles the single-plane case generically. - No dead or unreachable branches introduced; every new arm is reachable and exercised.
ignition/preparation/runtime_core_pb2.py+112/−112 is purely regenerated descriptor bytes plus the protoc bump at:5(7.35.1 → 7.36.2); nothing hand-edited, nothing to simplify.tests/components/test_ngram_delivery.pyis one parametrised test over three modes (:29-35) — appropriate sizing for its coverage, though (per finding 1) it never exercises an unsupported-mode rejection, and the description's "10 passed" cannot come from this single file.
Summary table
| # | Site | Kind | Est. lines saved |
|---|---|---|---|
| 1 | ignition/components/ngram_delivery.py:105-114, 136-144 |
duplicated map + bare-else crash path |
~10 (and fixes a real defect) |
| 2 | helios/src/core/schema.rs:561-571 ↔ helios/src/runtime_core/engram.rs:150-167 |
duplicated encoding→row-bytes arithmetic across crates | ~15 |
| 3 | helios/src/core/schema.rs:504-512 |
three-branch chain, duplicated error string, as i32 vs enum match |
~6 |
| 4 | helios/src/core/schema.rs:2068-2167 |
test copies :1945-2065 |
~75 |
| 5 | helios/src/runtime_core/engram.rs:1162-1216 |
second bespoke fixture builder beside :1113 |
~30 |
| 6 | heliopause/src/export/core.rs:3910, 4641-4648, 4557-4611 |
positional bool/index coupling, doubled hardcoded offsets | ~10 |
Two of these (#1, #2) are cases where the PR description asserts a consolidation was done and the tree shows it was not; #1 additionally leaves an unguarded else that dereferences a possibly-None scales tensor. None of the requested functional behaviour is lost by any reduction above.
Code correctness
Deep Code Correctness, Invariants & Hot-Path Performance Audit — PR #732 (02ba762)
Scope: 10 files, ~565 changed lines across helios, heliopause, ignition → below the >12-file / >900-line partitioning threshold, so audited directly (no sub-agents).
Verdict: The Rust, protobuf, and export halves are correct and I verified several non-obvious invariants hold. I found one Major defect, in the Python (ignition) dispatch that this PR's new encoding makes newly reachable, plus three Minor observations.
Findings
1. Major — ignition/components/ngram_delivery.py:105-114 and :136-144: non-exhaustive mode dispatch folds unknown modes into the NVFP4 branch and dereferences a None scale plane; no ValueError on unsupported modes
The diff widens scales/scale to Optional (ngram_delivery.py:99-100) and turns scales is None into a normal, expected state for the new FP8_E4M3_GLOBAL encoding — precisely because the Rust decoder now emits scales: None for it (helios/src/runtime_core/engram.rs:159-167 → has_scales = scale_bytes.is_some() = false → :270-273 scales: scale_bytes.map(...) = None → :423 scales: has_scales.then_some(table.scale_buffer) = None, surfaced as table.scales on the Python side). The dispatch that then decides whether scales may be None is a two-literal if/elif with a catch-all else:
105 mode = state.query.quant_mode
106 if mode == "bf16":
107 state.run_lookup(weight.view(torch.bfloat16), None, None, ids, count, out, ...
109 elif mode == "fp8_e4m3_per_tensor":
110 state.run_lookup(weight.view(torch.float8_e4m3fn), scale, None, ids, count, out, ...
112 else:
113 state.run_lookup(weight, scales.view(torch.float8_e4m3fn), scale, ids, count, out, ...
and the identical structure in PreparedPLELookup.__init__:
136 mode = caps.quant_mode
137 if mode == "bf16":
138 lookup_weight, lookup_scale, lookup_scale_2 = self.weights.view(torch.bfloat16), None, None
139 elif mode == "fp8_e4m3_per_tensor":
140 lookup_weight, lookup_scale, lookup_scale_2 = self.weights.view(torch.float8_e4m3fn), table.scale, None
141 else:
142 lookup_weight = self.weights
143 lookup_scale = self.scales.view(torch.float8_e4m3fn)
144 lookup_scale_2 = table.scale
Callee/enum resolution: mode is not an enum — I grepped the whole repository and quant_mode occurs in exactly two places in production code (both lines above) plus the test's SimpleNamespace; there is no central vocabulary, no Literal, no validation, and no raise ValueError anywhere. The three literals ("bf16", "fp8_e4m3_per_tensor", and the implicit "nvfp4_group16" catch-all) exist only as string comparisons. _ple_lookup_planes(mode, ...) — the explicit validator with ValueError on unsupported modes / mismatched planes that the PR description says it "extracts" — does not exist in this diff or in the file; the logic is duplicated inline in two functions instead.
Concrete counterexample (provable by reading): a single-plane FP8_E4M3_GLOBAL table (table.scales is None, line 132 sets self.scales = None) combined with any quant_mode other than the two hardcoded literals — e.g. a recipe emitting "mxfp8", "fp8_e4m3", "fp8", or a capitalization variant "BF16" — takes the else arm at line 113 and raises an unhelpful
AttributeError: 'NoneType' object has no attribute 'view'
instead of a diagnosable ValueError. The same crash exists at line 143 during plan construction, so it fails at build time as well as at run time.
Second, subtler consequence of the same structure: the branch decision is read from two different objects — caps.quant_mode at plan time (line 136) and state.query.quant_mode at run time (line 105). If those ever disagree, the plan is built from one dtype/scale interpretation and the run executes another. The dangerous case is not the crash case but caps="fp8_e4m3_per_tensor" / query="bf16": the plan's invocation_from_tensors(weight=self.weights.view(torch.float8_e4m3fn), ...) binds an E4M3 view, while the run reinterprets the same uint8 buffer as bfloat16 (self.weights.view(torch.bfloat16)) and drops the scale — a silent reinterpretation of 1-byte rows as 2-byte rows, i.e. wrong embeddings with no error. (I could not prove from this repo that the two objects can differ, so I state this as a hazard created by the two-source-of-truth structure, not as a demonstrated failure.)
Also: mode == "bf16" silently discards table.scale (line 138 sets the scale to None unconditionally) rather than validating it is absent. Today helios/src/core/schema.rs:506-509 rejects a BF16 table with a nonzero global_scale, so the core backstops it — but helios/src/runtime_core/engram.rs:151 only requires global_scale.to_bits() == 0 (bf16-only path, not reproduced in the Python layer), so the Python layer is relying on an upstream guard it does not itself enforce.
Concrete fix — make the dispatch total and explicit, in one place, with the contract checks the PR describes:
def _ple_lookup_planes(mode, weight, scales, scale):
if mode == "nvfp4_group16":
if scales is None:
raise ValueError("nvfp4_group16 PLE table requires a scales plane")
return weight, scales.view(torch.float8_e4m3fn), scale
if mode == "bf16":
if scales is not None or scale is not None:
raise ValueError("bf16 PLE table must not carry scale planes")
return weight.view(torch.bfloat16), None, None
if mode == "fp8_e4m3_per_tensor":
if scales is not None:
raise ValueError("fp8_e4m3_per_tensor PLE table must not carry a scales plane")
if scale is None:
raise ValueError("fp8_e4m3_per_tensor PLE table requires a global scale")
return weight.view(torch.float8_e4m3fn), scale, None
raise ValueError(f"unsupported PLE quant mode {mode!r}")
then call it from both _lookup (line 105) and PreparedPLELookup.__init__ (line 136), so caps.quant_mode and state.query.quant_mode are validated by the same code and the None-deref is unreachable.
Supporting evidence that this path is untested: the new test only parametrizes the three supported modes (tests/components/test_ngram_delivery.py:31-35), so every case takes a matched branch; there is no test for an unsupported mode or a mismatched plane, despite the PR description claiming "invalid mode/plane rejection tests."
2. Minor — helios/src/runtime_core/engram.rs:190: the table.embedding_width != width conjunct is unconditionally false for the new arm (dead condition, no harm)
159 wire::engram_table::Encoding::Fp8E4m3Global
160 if table.embedding_width > 0
161 && table.global_scale.is_finite()
162 && table.global_scale > 0.0 =>
163 {
164 let row_bytes = usize::try_from(table.embedding_width)
165 .map_err(|_| invalid("FP8 global embedding row width overflow"))?;
166 (table.embedding_width, 0, row_bytes, None)
...
190 || table.embedding_width != width
The arm binds width = table.embedding_width (line 166), so line 190 compares the field to itself. This is intentional (any width is legal for this encoding, unlike Fp8E4m3E8m0's fixed 256 at line 140) and it is the pre-existing pattern for Nvfp4E4m3Global (line 147), so it is harmless dead code rather than a defect — noted only because it means the width is not range-checked beyond > 0 here; the real bounds come from validate_buffer (:310-327) against the declared buffer, which I confirmed is the enforcing check.
3. Minor — helios/src/runtime_core/engram.rs:157 / helios/src/core/schema.rs:565: inconsistent overflow treatment, cosmetically preserved BF16 message
schema.rs:561-571 guards the BF16 width with checked_mul(2) ("BF16 engram row width overflow") while the new FP8 arm is a plain u64::from(table.embedding_width) with no multiply — correct, since FP8 rows are exactly embedding_width bytes and no overflow is possible. The BF16-specific error string at schema.rs:565 was left un-renamed while its two sibling messages were generalized to "single-plane…" (:582, :584, :626, :628). Purely cosmetic; the arithmetic is sound.
4. Minor — helios/src/core/schema.rs:506-512: the final else is only sound because of the earlier engram_encoding_has_scales call
502 if has_scales {
503 bounded_name(&table.scale_buffer, 64, "engram scale buffer")?;
504 } else if !table.scale_buffer.is_empty() || table.scale_block != 0 {
505 return Err(invalid("single-plane engram table cannot carry scale metadata"));
506 } else if table.encoding == wire::engram_table::Encoding::Bf16 as i32 {
507 if table.global_scale.to_bits() != 0 {
508 return Err(invalid("single-plane engram table cannot carry scale metadata"));
509 }
510 } else if !(table.global_scale.is_finite() && table.global_scale > 0.0) {
511 return Err(invalid("FP8 global engram table requires a finite positive global scale"));
512 }
I traced the domains: has_scales == false at line 502 can only be reached with encoding ∈ {Bf16, Fp8E4m3Global}, because &?/"unknown" and Unspecified already returned Err at line 497 via engram_encoding_has_scales (:445-457, whose catch-all _ => Err covers Unspecified and out-of-range i32). So the else at 510 provably means Fp8E4m3Global exclusively — the guard is not dead and not contradictory. Recorded as a verified invariant, not a bug. The to_bits() != 0 test correctly rejects -0.0 and NaN for BF16, matching engram.rs:151 and the existing neg_zero assertion (schema.rs:2020-2022).
Checks that came back clean (verified, not assumed)
Regenerated Python descriptor is correct — I verified this arithmetically rather than assuming. My first pass suspected ignition/preparation/runtime_core_pb2.py was regenerated with a newer protoc (7.35.1 → 7.36.2) but a stale enum. It is not. The enum's serialized span grew from 11543..11622 (79 bytes, at main) to 11543..11643 (100 bytes, pr/732, lines 182-183). The added EnumValueDescriptorProto for FP8_E4M3_GLOBAL costs exactly: name (tag 1 + len 1 + 15 chars = 17) + number (tag 2 + varint 1 = 2) + outer repeated tag/len (2) = +21 bytes. 79 + 21 = 100 ✓, and every downstream span shifted by exactly 21 (_ENGRAMTABLE._serialized_end 11622→11643, _ENGRAMHASH 11768→11789, _BUNDLEINDEX 12057→12078, …). The new value is present and the file is internally consistent.
Signed-core schema validation (helios/src/core/schema.rs:445-457, 560-637): single-plane row geometry rows * embedding_width is byte-exact for both shared and partitioned planes; checked_mul guards overflow; scale_block == 0, empty scale_buffer, and absent scales are all enforced; partitioned shards are validated per-shard against shard.rows and the union must equal table.rows (:635-637). No off-by-one, no unsigned underflow.
Runtime decode (helios/src/runtime_core/engram.rs:159-167): finite-positive global_scale, row_bytes == embedding_width, scale_block == 0, and plane() (:257-269) re-checks stored_rows * row_bytes == span.nbytes — double-validated against the schema layer, with no window where one accepts and the other silently disagrees.
Export/combination (heliopause/src/export/core.rs:96-142, 1676-1733): engram_scales returning None correctly yields scales: None / scales_idx: None for both shared (line 1684 scales_idx.map(...)) and partitioned (line 1694) tables, and global_scale is propagated verbatim at line 1729. weight_reuse.rs:472 compares global_scale.to_bits() — the right comparison for -0.0/NaN equality — so cached Engram weights cannot be reused across differing global scales. conversion.rs:2862-2863 includes both encoding and global_scale in combined-core semantic identity.
Modified export test arithmetic (heliopause/src/export/core.rs:4413-4415, 4560-4596, 4633-4643, 4660-4690): installed.len() == 12 is correct (2 + 4 + 1 + 2 + 1 + 2 planes); the even/odd bad_idx convention (bad_idx % 2 == 0 → shared weights, else shards[0].weights) maps correctly onto the fixture's table order (0 shared, 1 partitioned, 2 shared, 3 partitioned, 4 shared, 5 partitioned) for all of [2,3,4,5]; FP8 payload sizes match exactly (rows=2 × width=8 = 16 shared, rows=1 × 8 = 8 per shard).
Hot-path complexity: the changed Rust adds one match arm (engram_encoding_has_scales, O(1) on an i32) and two constant-time predicates in decode. No loop, no per-iteration allocation, no Vec/HashMap clone, and no O(N·span) scan was introduced anywhere in the diff; decode's existing per-table loops are unchanged in shape.
Test file (tests/components/test_ngram_delivery.py): the fixture geometry is self-consistent with the Rust contract — row_bytes=256 for bf16 halves to 128 bf16 columns on .view(torch.bfloat16), row_bytes=128 for fp8 stays 128, row_bytes//8 scales for nvfp4 — and the assertions distinguish is table.scale (identity) from dtype checks correctly. The functional() → __call__ re-entry reuses output_shape/output_dtype and the retained weights/scales consistently. The only gap is the missing negative-mode case called out in Finding 1.
Summary
| # | Severity | Location | Defect |
|---|---|---|---|
| 1 | Major | ignition/components/ngram_delivery.py:112-114, :141-144 |
Non-exhaustive quant_mode dispatch: no validator exists (_ple_lookup_planes is absent), unknown modes fall into the NVFP4 branch and dereference the now-legitimately-None scales (AttributeError instead of ValueError); decision duplicated across two functions reading two different objects, risking plan/run dtype divergence |
| 2 | Minor | helios/src/runtime_core/engram.rs:190 |
table.embedding_width != width is self-comparison for the new arm (harmless, pre-existing pattern) |
| 3 | Minor | helios/src/core/schema.rs:565 vs :582,584,626,628 |
BF16-specific overflow message left un-generalized during the rename |
| 4 | Minor (verified sound, no action) | helios/src/core/schema.rs:506-512 |
Final else is Fp8E4m3Global-only by virtue of the line-497 guard — confirmed not dead, not contradictory |
No other correctness, ordering, boundary, or hot-path defect found in the changed code. The docs and manifest.md edits match the implemented semantics; I raise no documentation concerns (separate lens).
Full report Merge Risk: medium_high (100%): Medium or high merge risk (core runtime/scheduler/GPU/CUDA/VMM/RoCE/multi-rank/contracts/ABI, large multi-crate changes, or Blocker/Major findings) — route to Super Agent.
Re-review
Recommendation: Changes Requested
The underlying EngramTable.Encoding.FP8_E4M3_GLOBAL = 4 wire, schema, runtime-decode, and export additions remain sound, strictly additive, and wire-compatible (and independent end-to-end SM120/SM121 GSM8K-1319 verification from @nero- strengthens confidence in the contract). However, the follow-up code, test, and doc fixes described in the updated PR body are not present at head 02ba762 — the branch diff is still the original 10-file change (+565 / -145), leaving Round 1's ignition/components/ngram_delivery.py bare-else None-dereference defect and missing negative tests unfixed, while the PR summary and pytest count (10 passed) describe a local commit that appears not to have been pushed. In addition, Round 1's Layer-1 CPU verification blocker remains partially unresolved (helios still skips helios::engram::* and helios/tests/, and tests/preparation/ remains unrun).
Merge Risk
Level: Low
- Core Rust/wire surface is verified clean and additive:
FP8_E4M3_GLOBAL = 4is appended cleanly tohelios/proto/{core,runtime_core}.protowithignition/preparation/runtime_core_pb2.pyregenerated to match (+21bytes in_ENGRAMTABLE_ENCODING), and downstream consumers (helios/src/core/reader.rs:221,helios/src/engram.rs:203-219,helios/src/runtime_core/describe.rs:479,646,helios/src/core/conversion.rs:2862-2863,heliopause/src/export/weight_reuse.rs:397-410,472) already route generically through #664's single-plane seam. - Unpushed follow-up commit risk:
02ba762does not contain the_ple_lookup_planesrefactor, negative mode/plane tests, FP8 hardlink-reuse test coverage, or Rust/doc cleanups claimed in the PR description, meaning the reported verification runs (pytest: 10 passed, FP8 hardlink reuse) do not correspond to the commit currently queued to merge. - Remaining code & verification gaps:
ignition/components/ngram_delivery.py:105-114, 136-144still crashes withAttributeErroron unknownquant_modewith single-plane tables (scales is None), and unfilteredhelios+tests/preparation/Layer-1 CPU suites have not been reported on the pushed head.
Walkthrough
- Protobuf & Python bindings (
helios/proto/core.proto:268-269,helios/proto/runtime_core.proto:664-665,ignition/preparation/runtime_core_pb2.py:5,27,182-183): AppendsEngramTable.Encoding.FP8_E4M3_GLOBAL = 4(raw 1-byte-per-element FP8 E4M3 rows, no scale plane,scale_block == 0, finite positiveglobal_scale) and regeneratesruntime_core_pb2.py(_ENGRAMTABLE_ENCODINGspan11543..11643, verified consistent). - Signed-core schema validation (
helios/src/core/schema.rs:445-457, 497-512, 561-589, 622-637, 2067-2167): ClassifiesFp8E4m3Globalas single-plane inengram_encoding_has_scales, enforces emptyscale_buffer,scale_block == 0, finite positiveglobal_scale, absentscalesplane, and exactrows * embedding_widthbyte lengths for shared and partitioned tables (preserving #664's BF16 behavior), plusvalidates_single_plane_fp8_global_engram_table. - Runtime-core decoding (
helios/src/runtime_core/engram.rs:159-167, 1161-1235): Adds theEncoding::Fp8E4m3Globaldecode arm yielding(embedding_width, 0, row_bytes, None)for positiveembedding_widthand finite positiveglobal_scale, plusfp8_global_single_plane_tables_decode_shared_and_partitioned. - Heliopause export tests (
heliopause/src/export/core.rs:4410-4768): Adds shared and partitionedFp8E4m3Globaltables (plus scale-plane rejection and signed round-trip verification) tocore_engram_preserves_shared_and_partitioned_plane_layouts; production export code needs no FP8-specific branch. (reuse_engram_hardlinks_shared_and_partitioned_embedding_planesat:3907-3971is unchanged at02ba762.) - Ignition PLE delivery & tests (
ignition/components/ngram_delivery.py:98-115, 131-157,tests/components/test_ngram_delivery.py:29-135): Widensscales/scaletotorch.Tensor | Noneand adds an"fp8_e4m3_per_tensor"branch in both_lookupandPreparedPLELookup.__init__, with 1 parametrized test over the 3 valid modes. - Docs (
docs/core-format-design.md:94-95,helios/manifest.md:526-528): DocumentsFP8_E4M3_GLOBALsingle-plane layout, omitted-scalessafetensors file, andglobal_scalecontract.
Pre-merge Checks
- [PASS] Security / malicious screen: No unsafe code, credential handling, external network calls, or suspicious behavior introduced.
- [PASS] Charter & value fit: Model-agnostic wire/format extension on #664's single-plane seam with zero per-model runtime branches, flags, or new captured-graph operation families; linked to
local-inference-lab/hyperflare-recipes#165. - [PASS] Related / duplicate / conflict check: Duplicate PR #733 closed in favor of #732 with
@nero-'s endorsement; SM120 gate #731 is Ready To Merge; 6-file textual overlap with open #723 is rebase-only. - [WARN] Tests & verification evidence: Strong live hardware corroboration (author SM121 disk/RAM + NVFP4 replay, plus
@nero-SM120/SM121 GSM8K-1319) and enum tag numbers in the PR body are now fixed, but the pushed head02ba762does not match the PR body's claimed fixes/tests (10 passedpytest, FP8 hardlink reuse) and Layer-1 CPU suites forhelios(unfiltered) andtests/preparation/remain unrun.
Blockers
- Pushed branch head
02ba762is missing the follow-up changes and tests claimed in the PR description (docs/design-review.md:156-162):- Verified mismatch at
02ba762: Five concrete claims in the updated PR summary and verification section do not exist in the pushed tree (it appears the follow-up commit was tested locally and summarized in the PR body, but not pushed tofeat/qwen4-fp8-ple):ignition/components/ngram_delivery.py:_ple_lookup_planesdoes not exist anywhere in the repo (search_codereturns zero matches);:105-114and:136-144still contain the duplicatedif / elif / elsedispatch with noValueErrorvalidation (see Should Fix #1).tests/components/test_ngram_delivery.py:29-37: Contains only 1 test function parametrized over 3 valid modes (3test cases total, not10 passed), with zero invalid mode/plane rejection tests.heliopause/src/export/core.rs:3907-3971:reuse_engram_hardlinks_shared_and_partitioned_embedding_planesis unchanged frommainand loops only over NVFP4 and BF16 (for (partitioned, bf16)at:3910);Fp8E4m3Globalonly appears incore_engram_preserves_shared_and_partitioned_plane_layouts(:4570, :4583, wherecache = None).helios/src/core/schema.rs:504-512, 561-571andhelios/src/runtime_core/engram.rs:150-167: Neither the single exhaustiveEncodingmatch invalidate_engramnor the consolidated single-plane geometry helper inruntime_core::engramis present.docs/core-design.md: Not among the 10 changed files (:607still reads"b12x NVFP4 PLE embedding").
- Fix: Push the follow-up commit to
feat/qwen4-fp8-ple(which should resolve both this mismatch and Should Fix #1), or update both the code and PR description so the pushed head matches the claimed changes and test results.
- Verified mismatch at
- Unresolved Round-1 Layer-1 CPU verification gap (
docs/design-review.md:180-194, 247-251;AGENTS.md:309-321):- Verified gap: Since Round 1,
heliopause --release --lib(234 passed) andflare --release --lib(247 passed) were upgraded to full release-mode lib suites, andhelioswas expanded to--release --lib core::(527) and--lib runtime_core::(204). However, two runnable Layer-1 obligations remain unrun — and existing counts must also be confirmed on the pushed head once Blocker #1 is resolved:helioswas still filtered tocore::andruntime_core::, skippinghelios::engram::*(runtime table staging/reader/cache) andhelios/tests/integration/legacy-core targets (docs/verification.md:32(not opened)), and run without--locked.tests/preparation/(which includestest_core_boundary.py:15 (not opened),18coveringengram/ngram_delivery,test_core_protection.py(not opened), andtest_embedding_table_handoff.py) remains unrun.
- Fix: On the pushed head commit, run and report:
cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) --features runtime-core,server(ifFLARE_TEST_TEMPLATE_DIRcannot be prepared offline, run the full unfiltered--libplus non-template integration tests and note only the externally gated template fixtures),cargo test --locked --release --manifest-path heliopause/Cargo.toml (not opened) --lib,pytest tests/components/ tests/preparation/.
- Verified gap: Since Round 1,
Should Fix
- Unfixed Round-1 defect: Non-exhaustive bare
else:and missingNoneplane/scale validation inignition/components/ngram_delivery.py:98-115, 132-145:- Verified behavior at
02ba762: Becausescalesandscaleare now legitimatelytorch.Tensor | None(:99-100, :132), both_lookup(:105-114) andPreparedPLELookup.__init__(:136-144) duplicate anif mode == "bf16" / elif mode == "fp8_e4m3_per_tensor" / else:dispatch where:- Any unrecognized
quant_modestring silently falls into the two-plane NVFP4else:branch and crashes withAttributeError: 'NoneType' object has no attribute 'view'wheneverscales is None(which is now the normal state for single-planeFP8_E4M3_GLOBALandBF16tables). "nvfp4_group16"does not validatescales is not Noneandscale is not None;"fp8_e4m3_per_tensor"does not rejectscale is Noneor unexpected non-Nonescales;"bf16"silently drops unexpectedscales/scale.
- Any unrecognized
- Fix: Extract the shared
_ple_lookup_planes(mode, weight, scales, scale)helper (already described in the PR summary) called by bothPreparedPLELookup.__init__and_lookupthat explicitly handles"nvfp4_group16","fp8_e4m3_per_tensor", and"bf16", validates plane/scale presence per mode, raisesValueErroron unsupported modes or mismatched planes, and add negative test cases intests/components/test_ngram_delivery.py.
- Verified behavior at
Subtract / Simplify
- Match the decoded
Encodingenum once inhelios/src/core/schema.rs:497-512, 561-571: Replace the three rawtable.encoding == ... as i32comparisons (:506, :561, :567) and duplicated"single-plane engram table cannot carry scale metadata"error return (:505, :508) with a single exhaustive match on decodedwire::engram_table::Encoding. - Consolidate single-plane decode geometry in
helios/src/runtime_core/engram.rs:150-167: Factor the shared single-plane width-to-row_bytesconversion betweenEncoding::Bf16(* 2) andEncoding::Fp8E4m3Global(* 1) (or share a small helper withschema.rs) while keeping bothglobal_scaleguards explicit. - Deduplicate single-plane schema validation test (
helios/src/core/schema.rs:2068-2167vs:1945-2065): Optional cleanup —validates_single_plane_fp8_global_engram_tablemirrorsbf16_identity_single_plane_engram_validationalmost line-for-line and could share a small table-driven helper.
Nits
docs/core-design.md:607still reads"b12x NVFP4 PLE embedding"(stale since #664's BF16 and now also omittingFP8_E4M3_GLOBAL; already listed in the PR summary once the follow-up commit is pushed).helios/src/core/schema.rs:565keeps"BF16 engram row width overflow"while sibling messages (:582, :584, :626, :628) were generalized to"single-plane..."(cosmetic only).- Getting a brief maintainer sign-off (
@lukealonso) on the new signed-core enum tag and pinnedb12x(1441ce86inpyproject.toml:47(not opened))"fp8_e4m3_per_tensor"vocabulary remains good hygiene (non-blocking).
Dropped on verification
- Earlier Discovery / Value Prop / Contracts claim ("Undeclared BF16 validation tightening in
helios/src/core/schema.rs"): Verified false (and retracted in Round-2 audits) —main:helios/src/core/schema.rs:555-578already enforced exactrows * embedding_width * 2plane sizing for shared and partitioned BF16 tables from #664;02ba762only renamesbf16_row_bytestosingle_plane_row_bytesand addsFp8E4m3Globalwithout altering BF16 behavior. - Code Correctness sub-claim ("
caps.quant_modevsstate.query.quant_modetwo-source-of-truth silent dtype divergence"): Speculative —statecomes fromplan_from_handle(self.plan.handle)forself.plan = ple_embedding.plan(caps, ...)(ngram_delivery.py:104,145,192), sostate.queryoriginates fromcaps. (The non-exhaustive bareelse:,Nonedereference, missing plane/scale validation, and duplicated dispatch remain verified and are retained.) - Code Correctness Minor (
helios/src/runtime_core/engram.rs:190table.embedding_width != widthself-comparison): Intentional pre-existing pattern shared withNvfp4E4m3Global(:147) andBf16(:157); onlyFp8E4m3E8m0fixes width to 256 (:140), and buffer bounds are enforced byvalidate_buffer(:310-327). - Code Correctness Minor (
helios/src/core/schema.rs:506-512finalelsebranch): Verified sound —engram_encoding_has_scales(:445-457) already rejectsUnspecifiedand unknown encodings at:497, sohas_scales == falsereaches:506exclusively for{Bf16, Fp8E4m3Global}. - Owner-approval hard gate (
docs/design-review.md:22-26, cited from #733): Not a blocker — Principle 1 gates new captured-graph operation families/contracts; PR #732 adds no graph kind,ValueSource,EngramHash.Method, or mailbox protocol, only an encoding tag on #664's existing single-plane seam. - Open-PR overlap / external gating (
#7236-file textual overlap,#731SM120 pin, unobservable CI status): Informational context only (#731is already Ready To Merge and@nero-independently verified SM120 + SM121); not blockers or should-fixes. - Subtraction §6 (
heliopause/src/export/core.rs:4557-4648positionalbad_idx % 2and hardcoded test offsets): Pre-existing test-fixture style inherited from #664; low-signal nit, dropped.
Classify triage
Selected: triage:review
Threshold: 65%
Triage
- [✓]
triage:review: 99.9% -
triage:design-review: 0.0% -
none: 0.0% -
triage:integration: 0.0% -
triage:validation: 0.0% -
triage:partial: 0.0% -
triage:investigate: 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.