#1 [high] PR #664 subtraction-lens findings (verbatim + citations)
Head 263dfe9b. All line numbers verified this run.
F1 (HIGH, dead duplicate check) helios/src/core/schema.rs:367-372:
let encoding = wire::engram_table::Encoding::try_from(table.encoding)
.map_err(|_| invalid("engram table has no encoding"))?;
if encoding == wire::engram_table::Encoding::Unspecified {
return Err(invalid("engram table has no encoding"));
}
let has_scales = engram_encoding_has_scales(table.encoding)?;
engram_encoding_has_scales (schema.rs:318-327) already returns Err("engram table has no encoding") for both Unspecified (=0) and unknown. Lines 367-371 are unreachable-by-effect duplicates with the identical message. Keep let encoding (used at :433,:457) but drop the try_from/map_err + Unspecified if → 5 lines.
F2 (HIGH, dead fallback branch) helios/src/runtime_core/engram.rs:257-268:
let planes = Planes {
weights: plane(weights, row_bytes)?,
scales: match scale_bytes {
Some(bytes) => Some(plane(scales, bytes)?),
None => {
if scales.is_some() {
return Err(invalid("single-plane Engram table cannot carry scales"));
}
None
}
},
};
The None+scales.is_some() case is already rejected earlier for both sources: shared → :191 else if !table.scale_buffer.is_empty() || table.scales.is_some(); partitioned → validate_shards(..., false) at :97-101 rejects shard.scales.is_some(). Replace with scales: scale_bytes.map(|bytes| plane(scales, bytes)).transpose()?, (test at :1026 expects a different error string from :191 path, so no test loss).
F3 (HIGH, speculative legacy fallback) helios/src/runtime_core/engram.rs:29-34:
// 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
};
Its own comment says the justification is fixtures. The fixture is engram.rs:496-503 (hand-encoded bytes without field 12) asserting 2 planes at :513-518. Delete the fallback, set the encoding byte in the fixture (or make encoding explicit). AGENTS.md "Reject unsupported abstractions and churn: ... speculative compatibility, fallback layers". If a real pre-existing core has encoding unset this is instead a compat bug (correctness lens) — flag both readings, but the comment names only fixtures.
F4 (MED-HIGH, duplicated plane walk) heliopause/src/export/core.rs:96-142 roles() and :408-440 validate_ranks() repeat the same table walk incl. duplicated error "partitioned embedding tables cannot also hold shared planes" (:113-117 and :421-425). validate_ranks could call roles(&source.index) and locate each engram Role span instead of re-walking the catalog. NOTE: weight_reuse.rs:389-402 engram_uses is a third copy (unconditional weights.chain(scales)) and was not touched by the PR.
F5 (LOW) helios/src/engram.rs:195-201 Index::shares_delivery_with body is literally self == other; its doc comment duplicates Table::partition's doc (:179). Not worth changing alone; mention only as optional.
#2 [high] Research summary
Reviewed PR #664 at head 263dfe9b for subtraction, simplicity and conventions. The diff is mostly a disciplined [Plane; 2] → Planes { weights, scales: Option<Plane> } refactor, and most of it earns its keep; I found three high-value deletions and one duplication, and otherwise nothing to cut.
Findings (all citations verified this run, saved to scratchpad #1):
-
Dead duplicate validation —
helios/src/core/schema.rs:367-372. Thetry_from(...).map_err(...)plusif encoding == Unspecified { return Err("engram table has no encoding") }is fully subsumed byengram_encoding_has_scales(table.encoding)?on the next line, which returns the same message forUnspecifiedand for unknown tags. Five lines to delete; retainencodingfor the later BF16 checks. -
Dead fallback branch —
helios/src/runtime_core/engram.rs:257-268. TheNone => { if scales.is_some() { return Err("single-plane Engram table cannot carry scales") } None }arm is unreachable: shared tables are already rejected at:191(!table.scale_buffer.is_empty() || table.scales.is_some()) and partitioned tables at:97-101viavalidate_shards(..., false). Replace the wholematchwithscale_bytes.map(|bytes| plane(scales, bytes)).transpose()?. -
Speculative legacy fallback justified only by a test fixture —
helios/src/runtime_core/engram.rs:29-34. Theencoding == 0 → Fp8E4m3E8m0shim's own comment says "Legacy pre-encodingModelIndexfixtures"; treating a missingEncodingas two-plane contradicts the PR's explicitUnspecifiedrejection everywhere else anddocs/design-review.md(not opened)'s compat rule, and AGENTS.md rejects "speculative compatibility, fallback layers". The single consumer is the hand-encoded fixture at:496-503(asserting two planes at:513-518). Delete the shim and give the fixture an explicit encoding field; if a real pre-existing core can carryencoding == 0, this is a compatibility bug rather than a subtraction, and should be settled explicitly either way. -
Duplicated plane walk in the exporter —
heliopause/src/export/core.rs:96-142(roles) and:408-440(validate_ranks) traverse the same engram catalog with the same branches and the same error string duplicated twice ("partitioned embedding tables cannot also hold shared planes").validate_rankscan callroles(&source.index)andlocateeach kind-4 span. A third copy lives inheliopause/src/export/weight_reuse.rs:389-402(engram_uses, untouched by this PR) — worth noting as the direction of the fix, not as a demand. -
Cosmetic only —
helios/src/engram.rs:195-201:Index::shares_delivery_withis literallyself == otherwith a doc comment that repeatsTable::partition's. I would not change it on its own; it does name the invariant at the call site.
I verified and found no excess in the rest: Planes helper methods are each used; the TableSource.scales: Option<(PlaneSource, String)> pairing removes a two-element unwrap dance rather than adding one; the Python _receive_embedding_tables extraction is a net simplification (it exists so the test can exercise the loop); engram_scales/engram_encoding_has_scales genuinely centralize what would otherwise be five copies; and no environment-variable knob, supports_* flag, or model allowlist was introduced. Total reasonable reduction: roughly 25-30 lines across items 1-3, plus a shared walk for item 4.
#3 [high] PR #664 subtraction lens — what I checked and cleared (keeper)
Head 263dfe9b. Companion to note #1 (the five findings). This note records what must NOT be reported as excess, so the report does not over-claim.
Verified-USE, no dead code (search_code over helios/ this run):
Planes::iterused at helios/src/engram.rs:205 (staging_payload_bytes), :202 area, and helios/src/engram/reader.rs:1419 (for plane in planes.iter()).Planes::iter_mutsingle consumer: helios/src/runtime_core/model.rs:849.Planes::total_nbytestwo consumers: helios/src/engram.rs:634,640.Planes::row_bytesconsumers: helios/src/engram/reader.rs:1014,1417; engram.rs:435 (run_reader_worker).Planes::scale_row_bytesconsumers: helios/src/engram/reader.rs:1094,1202 only — used twice, keep.Planes::single/Planes::twoare#[cfg(test)](helios/src/engram/reader.rs:60-77) and used broadly in tests (reader.rs:1500,1656,1772,1819,1888,1957,2012,2073,2140,2312,2380,2442,2546; engram.rs:1066,1250,1392,1493; windows.rs:227,322; threaded.rs:1457,1599). Not speculative.
Net-simplifying changes (not findings):
heliopause/src/embedding_tables.rs:41-62removes the[planes.remove(0), planes.remove(0)]dance and pairs plane+buffer name in one place; also replaces two separateuselines with one groupeduse(cosmetic only).ignition/preparation/rank_group.py:44-61extracts_receive_embedding_tables; the only reason it was extracted is that tests/preparation/test_embedding_table_handoff.py:11 imports it directly. Behavior unchanged (descriptors closed infinally,control.send("embedding_tables_ready")last). Net ~zero lines, better testability — do not flag.helios/src/engram/prepared.rs:143-160, 177-215: the newload_plane/dup_planeclosures replace the oldplanes.remove(0), planes.remove(0)pairs; this is a genuine simplification.descriptors()(:215-224) parity with the Pythonexpected = sum(len(table["planes"]) ...)at rank_group.py:47 — consistent.helios/src/engram/reader.rs:1350-1365:resident_scalesload is now nested underif let Some(scale_plane)instead of indexingplanes[1]— removes an out-of-range assumption.helios/src/runtime_core/selection.rs:52-79:validate_embedding_resident_scalessplit out ofembedding_resident_scalesis a real behavioral addition (explicit--embedding-table-resident-scalesnow errors when no table has a scale plane), not speculative — documented at docs/cli-design.md:789-800.heliopause/src/export/binding.rs:652-657addsif parts.is_null() { continue; }— 3 lines, declared in the PR description as matchingweight_reuse.rs(which handles null at :405-406 viafilter(|parts| !parts.is_null())).
Conventions checked and NOT violated:
- No env-var knob, no
supports_*/can_*flag, no model allowlist added (AGENTS.md:450-472, :352-364).partition: Option<usize>(helios/src/engram.rs:179-180) is geometry, not model identity. - No new captured-graph operation family introduced in code (the approval question is the other lens's blocker, A6 in the dossier — do not re-litigate here).
- Proto additions appended as
= 3(helios/proto/core.proto:258, :294);helios/proto/runtime_core.protosame.runtime_core_pb2.pyis a pure regeneration (+109/−109) — no hand edits. - Docs updated in the same change set as the behavior: manifest.md, core-format-design.md, cli-design.md, model-preparation.md — matches AGENTS.md:52-60.
- Tests added are behavioral (GPU/host buffers, decode errors, publish round-trips, descriptor counts), not source-text checks — matches AGENTS.md:194-199.
verify_published(heliopause/src/export/core.rs:3017-3035) is a test-only helper that does the full sign+verify round trip; it earns its ~18 lines.
Net reduction available from findings 1-3 only: ~25-30 lines, zero behavior change (each is a branch already unreachable or a check already performed by a callee). Finding 4 is a structural de-duplication, not a line count.
Verdict for the report: the diff is lean and idiomatic for what it does; the five items are the whole of my list, and items 1-2 are the only ones I would insist on.