Skip to content

Commit fdafd1a

Browse files
committed
impl(sprint-11/wave-E): D-CSV-9 — 8-channel ↔ SPO-palette transcoder (Option R-3) at thinking-engine L3 commit boundary
Wave E other half — D-CSV-9 per plan §11 + L-12 Option R-3: collapse the 8-channel `thinking_engine::layered::CausalEdge64` (BECOMES / CAUSES / SUPPORTS / REFINES / GROUNDS / ABSTRACTS / RELATES / CONTRADICTS) into one SPO-palette `causal_edge::CausalEdge64` at the L3 commit boundary, and the inverse (lossy) projection back. W-E1 (Sonnet) — `impl CausalEdge64` block in `crates/thinking-engine/src/layered.rs` (+258 LOC including tests). Public API - `pub const CHANNEL_NAMES: [&str; 8]` — diagnostic labels matching `causal-edge-64-thinking-engine-variant.md` - `pub fn channel(&self, idx) -> i8` / `pub fn set_channel(&mut self, idx, value)` — per-byte signed accessors (SIMD-friendly bitcast; out-of-range idx is a defensive no-op on set, debug_assert on get) - `pub fn dominant_channel(&self) -> usize` — max |net_strength|; ties break to lowest channel idx (stable per L-12) - `pub fn active_channel_count(&self) -> u8` — for confidence proxy - `pub fn to_spo(&self, s_idx, p_idx, o_idx) -> SpoEdge` — Option R-3 collapse: dominant channel → (mantissa magnitude, causal_mask) per the table in §11 D-CSV-9; mantissa sign = sign of dominant net; freq = |net|/32 quantized to u8; conf = active_channel_count/8 quantized; direction triad = 0b000 (sign carried by signed mantissa per L-9); W-slot = 0, truth = Crystalline, spare = 0 (caller stamps later via `with_routing` / `with_spare`) - `pub fn from_spo(spo: SpoEdge) -> Self` — inverse projection (lossy by design — 8 channels collapse to 1 in the forward direction; the inverse picks the dominant-equivalent channel and writes the mantissa magnitude × frequency back as the channel net_strength). Used for round-trip tests + debugging visualisations. Channel → mantissa mapping table (per §11 D-CSV-9): | Channel | Mantissa magnitude | Mask | Sign convention | |---|---|---|---| | 0 BECOMES | 1 (Deduction) | SPO | + forward | | 1 CAUSES | 6 (Intervention/Counterfactual per L-9) | SPO | sign = direction | | 2 SUPPORTS | 4 (Revision +) | PO | + only | | 3 REFINES | 5 (Synthesis) | PO | + only | | 4 GROUNDS | 1 (Deduction, S-grounded) | S | + only | | 5 ABSTRACTS | 2 (Induction) | P | + only | | 6 RELATES | 0 (Identity/neutral) | None | sign-aware | | 7 CONTRADICTS | 1 (Abduction backward) | SPO | sign = polarity | 8 transcoder tests added (per §11 D-CSV-9 "16-mapping round-trip test" target): - channel get/set round-trip across [-128, -1, 0, 1, 127] × all 8 channels - dominant_channel zero-default (idx 0 when all-zero) - dominant_channel picks max |net_strength| (with ties to lower idx) - to_spo BECOMES → mantissa +1 (Deduction) - to_spo CAUSES with negative net → mantissa -6 (Counterfactual per L-9) - to_spo RELATES → mantissa 0 (Identity/neutral) - 16-mapping round-trip: for each (dom, sign) pair the back-channel lands in the documented equivalence class - set_channel out-of-range no-op Cargo.toml: added `causal-edge = { path = "../causal-edge" }` to `crates/thinking-engine/Cargo.toml` deps. causal-edge is zero-dep itself, so this preserves the thinking-engine architecture stance. Combined with the prior commit (W-E2 D-CSV-8 MUL i4 SIMD evaluation in `lance-graph-contract::mul::i4_eval`), this PR completes Wave E's two parallel-worker scope: the contract-side i4 MUL evaluator + the thinking-engine-side dual-CausalEdge64 reunification transcoder. E-META-7 dual-type debt status (per `causal-edge-64-synergies-and- pr-trajectory.md`): unchanged in shape (the two `CausalEdge64` types still exist), but Option R-3 is now wired — downstream consumers can call `.to_spo()` at the L3 commit boundary to bridge without re-implementing the mapping each time. https://claude.ai/code/session_01UwJuKqP828qyX1VkLgGJFS
1 parent da8e8f7 commit fdafd1a

3 files changed

Lines changed: 265 additions & 15 deletions

File tree

crates/thinking-engine/Cargo.lock

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/thinking-engine/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ One MatVec per cycle. 10 cycles per thought. ~7 ms on CPU.
1313
"""
1414

1515
[dependencies]
16+
causal-edge = { path = "../causal-edge" }
1617
ndarray = { path = "../../../ndarray", default-features = false, features = ["std"] }
1718
bgz-tensor = { path = "../bgz-tensor" }
1819
highheelbgz = { path = "../highheelbgz" }

0 commit comments

Comments
 (0)