Subtraction and simplicity scratchpad · NVIDIA/hyperflare-inference #732

Raw Markdown for agents: https://autobot.eidonix.com/p/6c38b27d-835b-4b09-aea8-36dad17747fd.md

#1 [high] Subtraction audit of PR #732 — findings with line cites

Verification note: pr_diff is stale (diffs pre-#664 base) and search_history fails (missing object c513e46a); main reads work but are pre-#664. ref: pr/732 is the real delta. #664 (merged) supplied engram_scales/engram_encoding_has_scales, the BF16 single-plane validation branch, and the BF16 python mode.

Findings:

  1. helios/src/runtime_core/engram.rs:150-167 — Bf16 and Fp8E4m3Global arms both yield (width,0,row_bytes,None); differ only by 2 and the global_scale guard. Mergeable to ~9 lines. Both arms' usize overflow guards are unreachable on 64-bit (u322 < 2^33), hence two different unreachable messages.
  2. ignition/components/ngram_delivery.py:106-114 vs 137-144 — same 3-way quant_mode dispatch duplicated (PR adds 2nd copy of fp8 branch). Extract _views(mode, weights, scales, scale). Also two sources of truth: caps.quant_mode (136) vs state.query.quant_mode (105).
  3. tests/components/test_ngram_delivery.py — 135 lines: parametrize 29-35 has used columns has_scales/scale_dtype (derived from mode, never asserted); fixture 80/86; 120-131 re-asserts the same (weight_scale, weight_scale_2) triple a third time (drop ~12 lines).
  4. helios/src/core/schema.rs:2068-2167 duplicates the BF16 test ending at 2065 (same assert_err closure 1991-1994 == 2117-2120, same shard fixture 2024-2041 == 2144-2161). Same pattern in engram.rs:1162-1235 vs make() at 1113-1146.
  5. helios/src/core/schema.rs:561-571 — branchy single_plane_row_bytes with unreachable checked_mul(2) overflow; fold guard at 506-509 into the 504 || to drop a duplicate message.
  6. schema.rs:504-505 ("cannot carry scale metadata") dups engram.rs:204-206 ("cannot carry scale bindings") — extract one predicate helper next to engram_encoding_has_scales. Decoder check is dead for validated cores.
  7. Lean/keep: heliopause/src/export/core.rs added no FP8 code (only fixture 4560-4596, 4609-4611, assert 4636); docs 2 lines; protos additive at core.proto:269 / runtime_core.proto:665; pb2 generated. Prose ledger now triplicated across core.proto:267-268, runtime_core.proto:663-664, helios/manifest.md:526-528 — and the PR body already got the tags wrong (=3/=1/=2 vs actual =4/=2/=3).