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.