Feature/split bitwise byte op#577
Conversation
Codex Code ReviewFindings
Tests not run; review was based on the requested PR diff. |
| 22 => Ok(BusId::Bitwise), | ||
| other => Err(other), | ||
| } | ||
| } |
There was a problem hiding this comment.
High — TryFrom<u64> is completely out of sync with From<BusId> for u64
From<BusId> for u64 is id as u64 — it uses the enum discriminant. Because Bitwise was inserted before AndByte without an explicit value, the auto-assigned discriminants shifted:
| Variant | Old discriminant | New discriminant (after PR) |
|---|---|---|
Bitwise |
— | 3 |
AndByte |
3 | 4 |
OrByte |
4 | 5 |
| … | … | … |
CommitNextByte |
20 | 21 |
Commit |
21 | 22 |
TryFrom maps 3 ⇒ AndByte and 22 ⇒ Bitwise, but From now emits 3 for Bitwise and 22 for Commit. The two impls are inverses of completely different mappings.
While TryFrom isn't on the core proof path, it's used in filtering helpers and any future serialisation. Any round-trip gives a wrong BusId for every variant ≥ position 3.
Fix: append Bitwise at the end of the enum with an explicit discriminant:
Commit = 21,
Bitwise = 22, // ← explicit, no shift to existing variants| entry.4 += 1; | ||
| // tt.aux_cols may differ across instances of a split table; track the | ||
| // last value seen (split tables share aux_col count by construction). | ||
| entry.1 = tt.main_cols; |
There was a problem hiding this comment.
Low — comment says "aux_col count" but updates main_cols
entry.1 is the main_cols slot. The comment is a copy-paste error: it says aux_col count but both the field updated and the value assigned are main_cols.
| entry.1 = tt.main_cols; | |
| // main_cols is identical for every chunk of a split table. | |
| entry.1 = tt.main_cols; |
…orByte unification into BusId::Bitwise
|
/bench |
Benchmark — fib_iterative_8M (median of 3)Table parallelism: auto (cores / 3)
Commit: 2d6a26a · Baseline: built from main · Runner: self-hosted bench |
Splits the unified BITWISE precomputed table into BITWISE (20-bit lookups: Zero/IsB20/Hwsl) and a new BYTE_OPS table (byte-pair lookups: AndByte/OrByte/XorByte/IsByte/IsHalf/Msb16), and peels AND/OR/XOR rows out of the unified CPU table into a dedicated CPU_BITWISE chip. The CPU chip can then drop the unified
BusId::Bitwisesender from its bus_interactions, so non-bitwise CPU rows stop paying aux EF cells for that bus