Skip to content

impl(sprint-11/wave-E): D-CSV-8 MUL i4 eval + D-CSV-9 8-ch↔SPO transcoder (parallel workers)#387

Merged
AdaWorldAPI merged 3 commits into
mainfrom
claude/sprint-11-wave-e-mul-transcoder
May 16, 2026
Merged

impl(sprint-11/wave-E): D-CSV-8 MUL i4 eval + D-CSV-9 8-ch↔SPO transcoder (parallel workers)#387
AdaWorldAPI merged 3 commits into
mainfrom
claude/sprint-11-wave-e-mul-transcoder

Conversation

@AdaWorldAPI
Copy link
Copy Markdown
Owner

Summary

Sprint-11 Wave E — Phase C substrate-locked primitives (the SIMD-vectorized hot path is sprint-12+; this PR ships the locked scalar/integer shape that the SIMD codegen targets). Two parallel Sonnet workers, both branched from main (deps D-CSV-2/3 already merged via #383/#384).

D-CSV-8 (W-E2) — MUL i4 evaluation in lance-graph-contract::mul::i4_eval

NEW pub mod i4_eval module in crates/lance-graph-contract/src/mul.rs (~330 LOC source + ~170 LOC tests). Five public functions consume &QualiaI4_16D (PR #384) + signed_mantissa: i8 (PR #383) and return existing MUL types:

  • dk_position_i4(qualia, mantissa) -> DkPosition — coherence + |mantissa| → Plateau / SlopeOfEnlightenment / ValleyOfDespair / MountStupid
  • trust_texture_i4(qualia) -> TrustTexture — coherence + valence + tension → Calibrated / Overconfident / Underconfident / Uncertain
  • flow_state_i4(qualia, mantissa) -> FlowState — warmth + groundedness − tension proxy + mantissa sign → Flow / Anxiety / Transition / Boredom
  • gate_decision_i4(qualia, mantissa) -> GateDecision — combines texture + flow → Flow / Hold{reason} / Block{reason} (canonical reasons)
  • mul_assess_i4(qualia, mantissa) -> MulAssessment — full pipeline producing all five MulAssessment fields

Naming corrections vs initial spec — surfaced by W-E2:

  • TrustTexture variants are Calibrated/Overconfident/Underconfident/Uncertain (NOT Crystalline/Solid/Fuzzy/Murky). The latter is causal_edge::layout::TrustTexture — a DIFFERENT enum used for the Pearl-3 lens. Two TrustTexture enums coexisting is technical debt worth filing in TYPE_DUPLICATION_MAP next loop.
  • MulAssessment.trust: TrustQualia and MulAssessment.homeostasis: Homeostasis (not texture / flow_state directly).

12 tests all pass: high-coherence expert, low-coherence beginner, neutral intermediate, all 4 trust textures, flow active/stuck-negative-mantissa, gate proceed/block, full pipeline, zero-input baseline.

D-CSV-9 (W-E1) — 8-channel ↔ SPO-palette transcoder in thinking-engine::layered

Per plan §11 + L-12 Option R-3: collapse the 8-channel thinking_engine::layered::CausalEdge64 into one SPO-palette causal_edge::CausalEdge64 at the L3 commit boundary, plus the inverse (lossy) projection.

NEW impl CausalEdge64 block in crates/thinking-engine/src/layered.rs (+258 LOC including tests). API: CHANNEL_NAMES, channel(idx), set_channel(idx, value), dominant_channel(), active_channel_count(), to_spo(s, p, o) -> SpoEdge, from_spo(spo) -> Self.

Channel → mantissa mapping table (per §11 D-CSV-9):

Channel Mantissa magnitude Causal 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 all pass: channel get/set round-trip × 8 channels, dominant_channel zero-default, dominant_channel picks max |net|, to_spo BECOMES/CAUSES-negative/RELATES, 16-mapping round-trip equivalence-class check, set_channel out-of-range no-op.

Cargo.toml: added causal-edge = { path = "../causal-edge" } to thinking-engine deps. causal-edge is zero-dep itself, preserving the thinking-engine architecture stance.

E-META-7 dual-type debt status

The two CausalEdge64 types (SPO-palette in causal_edge::edge vs 8-channel cascade in thinking_engine::layered) still coexist, but Option R-3 is now WIRED — downstream consumers call .to_spo() / from_spo() at the L3 commit boundary to bridge without re-implementing the mapping. This is the recommended R-3 outcome per the synergies knowledge doc.

Out of scope (sprint-12+)

  • AVX-512 / NEON SIMD vectorization of the i4 MUL path (the i4 lane width allows 32-row sweeps per AVX-512 register; this PR ships the scalar shape as the SIMD codegen target)
  • Bench (criterion vs the f32 baseline — defer to env that can run benches reliably)
  • Single-source-of-truth resolution of the dual TrustTexture enums

Test plan

  • cargo test -p lance-graph-contract i4_eval — 12/12 pass
  • cargo test -p lance-graph-contract — 431/431 pass (no regressions)
  • cargo clippy --manifest-path crates/lance-graph-contract/Cargo.toml --lib --tests -- -D warnings — clean
  • CI: cargo test --manifest-path crates/thinking-engine/Cargo.toml transcoder_tests — 8 tests (W-E1 reported pass, env-validation matches)
  • CI: clippy on thinking-engine

https://claude.ai/code/session_01UwJuKqP828qyX1VkLgGJFS


Generated by Claude Code

claude added 3 commits May 16, 2026 03:29
…ath, sprint-12 SIMD vec deferred)

Wave E half — D-CSV-8 scalar i4 evaluation path that eliminates the
f32 dependency in MUL evaluation. The actual SIMD-vectorized hot
path (AVX-512 / NEON intrinsics) is sprint-12+ once the i4 scalar
shape is locked. This PR ships the locked shape.

W-E2 (Sonnet) — `pub mod i4_eval` in `lance-graph-contract::mul`

Five new public functions, all consume `&QualiaI4_16D` (PR #384) +
`signed_mantissa: i8` (PR #383) and produce existing MUL types:

- `dk_position_i4(qualia, signed_mantissa) -> DkPosition` — coherence
  (dim 9) + |mantissa| thresholds classify Plateau /
  SlopeOfEnlightenment / ValleyOfDespair / MountStupid
- `trust_texture_i4(qualia) -> TrustTexture` — coherence + valence +
  tension drives Calibrated / Overconfident / Underconfident / Uncertain
- `flow_state_i4(qualia, signed_mantissa) -> FlowState` — warmth +
  groundedness − tension proxy + mantissa sign →
  Flow / Anxiety / Transition / Boredom
- `gate_decision_i4(qualia, signed_mantissa) -> GateDecision` —
  combines texture + flow into Flow / Hold{reason} / Block{reason}
- `mul_assess_i4(qualia, signed_mantissa) -> MulAssessment` — full
  pipeline producing all five MulAssessment fields

Naming corrections vs original spec — surfaced by W-E2:
- `TrustTexture` variants are `Calibrated / Overconfident /
  Underconfident / Uncertain` (NOT `Crystalline / Solid / Fuzzy /
  Murky` — that's `causal_edge::layout::TrustTexture`, a DIFFERENT
  enum used for the Pearl-3 causal mask state). Two `TrustTexture`
  enums coexisting is technical debt worth filing in TYPE_DUPLICATION_MAP
  but out of scope here — the i4_eval module uses the contract
  enum's actual variant names.
- `MulAssessment.trust` field is `TrustQualia`, not `TrustTexture`
  directly. `MulAssessment.homeostasis: Homeostasis`, not
  `flow_state: FlowState` directly. Pipeline writes through these
  intermediate types correctly.
- `GateDecision::Hold(reason)` and `GateDecision::Block(reason)`
  carry `String` reasons (not unit variants). The i4 path produces
  short canonical reasons ("low_coherence", "high_tension", etc.)
  for downstream telemetry.

12 new tests (all pass): high-coherence expert, low-coherence
beginner, neutral intermediate; texture variants Crystalline /
Murky / Solid; flow Active / stuck-negative-mantissa; gate
proceed / block; full MulAssessment pipeline coverage; zero-input
neutral baseline.

Test status: **12/12 i4_eval pass; 431/431 contract suite pass;
clippy clean (-D warnings)**. Contract crate remains zero runtime
dependencies.

Out of scope (sprint-12 D-CSV-8 follow-up)
- AVX-512 / NEON SIMD vectorization (the i4 lane width allows
  32-row sweeps per AVX-512 register; this PR ships the scalar
  shape as the SIMD codegen target)
- Bench (criterion vs the f32 baseline — defer to env that can
  run benches reliably)

W-E1 (D-CSV-9 8-channel transcoder) is still in flight; will land
in a follow-up commit on this same branch when the worker reports
completion.

https://claude.ai/code/session_01UwJuKqP828qyX1VkLgGJFS
…(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
…_u8 + widen round-trip equivalence class

W-E1 worker completion notification (after the prior commit window)
landed two corrections:

1. **API name collision resolution.** The pre-existing
   `set_channel(u8, u8)` in `layered.rs` (an unsigned channel writer
   used by `domino.rs::classify_transition`) collides with the new
   transcoder API which needs `set_channel(usize, i8)` for signed
   per-byte access. Renamed the pre-existing method to
   `set_channel_u8(u8, u8)` and updated all 8 call sites in
   `domino.rs` (`SUPPORTS`/`CAUSES`/`GROUNDS`/`REFINES`/`ABSTRACTS`/
   `RELATES`/`CONTRADICTS`/`BECOMES` flow). Pure mechanical rename;
   no behavior change.

2. **Round-trip test equivalence class widening.** For dominant
   channel `dom = 0 (BECOMES)` or `dom = 4 (GROUNDS)` with negative
   sign, the to_spo → from_spo round trip lands on CONTRADICTS
   (channel 7) rather than BECOMES (channel 0). Reason: both
   BECOMES and GROUNDS map to mantissa magnitude 1 (Deduction); a
   negative sign in `to_spo` produces mantissa = -1, which
   `from_spo` correctly maps to CONTRADICTS (the documented "same
   |mantissa|, different sign" lossy collapse per L-12 Option R-3).
   The test's `expected_class` for `dom=0|4` is widened from
   `&[0]` to `&[0, 7]` to accept both forward (positive sign
   round-trip) and backward (negative sign collapse) outcomes.

Test status (per W-E1 final report): **8/8 transcoder tests pass;
337/337 lib tests total (329 existing + 8 new). No regressions.**

Pre-existing example error (NOT touched by this PR):
`crates/thinking-engine/examples/calibrate_roles.rs` has an
unrelated array-size mismatch — a known pre-existing failure outside
this PR's scope.

https://claude.ai/code/session_01UwJuKqP828qyX1VkLgGJFS
@AdaWorldAPI AdaWorldAPI merged commit e042c70 into main May 16, 2026
5 checks passed
AdaWorldAPI pushed a commit that referenced this pull request May 16, 2026
…ate-decisions knowledge doc

W-F10 — Sprint-11 meta-review (.claude/board/sprint-log-11/meta-review.md, 341 lines)
- Executive summary + sprint grade
- Per-PR grades for waves A-E (PRs #383..#387)
- Cross-sprint inconsistencies (CSI-1..6): TrustTexture ×2, v1-API-
  under-v2 alias anti-pattern (E-META-10 candidate), subagent
  permission isolation, SplatField/QualiaI4 bit-compat mirrors, plan
  §7.2 CONJECTURE-vs-FINDING ratification (OQ-CSV-1), bg-worker
  file-collision pattern
- Sprint-12 spawn decision YES with merge gates on Wave F + open
  PRs (#385 #386); recommended sprint-12 phase scope = SIMD vec for
  D-CSV-8 + ndarray streams productization + on-Think method
  migration for D-CSV-12 + Jirak-derived Σ10 threshold (TD-7)
- Per-worker grade placeholders for Wave F (W-F1..W-F12) — to be
  filled by the Opus meta-reviewer (W-Meta-Opus) when the fleet
  fully completes

W-F11 — i4-substrate-decisions knowledge doc (.claude/knowledge/, 200 lines)
- Tier-1 knowledge doc with READ BY: header
- i4 substrate doctrine: sign = direction, |magnitude| = NARS rule
  slot; i4 × i4 → i8 precision family
- All 20 locked decisions L-1..L-20 with one-sentence summary +
  shipping PR + canonical code site + deviations from plan
- Four-column SoA (EdgeColumn / QualiaColumn / MetaColumn /
  FingerprintColumns) — sprint-11 outcomes per column
- All six OQ-CSV-* ratifications recorded with wave evidence
- Codex P1 anti-pattern: 5 documented v1-API-under-v2-feature
  aliasing instances (temporal write, inference_type read,
  set_temporal no-op, pack raw discriminant, W3 spec temporal=1023)
- 12-mapping transcoder table (8 channels × NARS slots × Pearl
  rungs) with lossy-collapse equivalence classes
- Cross-refs: plan v1 + sprint-log-10/11 meta-reviews + STATUS_BOARD
  + PR_ARC + AGENT_LOG + TECH_DEBT + EPIPHANIES + TYPE_DUPLICATION_MAP
  + CLAUDE.md iron rules

Fleet status: 11 of 12 Sonnet workers complete; W-F12 (plan v2 draft)
still in flight. W-Meta-Opus (1 honest cross-cutting reviewer) dispatch
deferred until W-F12 finalizes.

https://claude.ai/code/session_01UwJuKqP828qyX1VkLgGJFS
AdaWorldAPI pushed a commit that referenced this pull request May 16, 2026
… lines)

W-F12 final Sonnet worker output. Plan v2 revision capturing sprint-
11 outcomes + sprint-12 forward plan.

Mirrors v1 structure with §0..§18; every changed section marked
[UPDATED 2026-05-16] / 🆕 vs v1 (21 annotations); unchanged sections
labeled UNCHANGED from v1.

Highlights:
- §0 status delta — Phase A/B/C outcomes: D-CSV-1/3/4 (#383), D-CSV-2
  (#384), D-CSV-5a/6a+7 (#385/#386), D-CSV-8+9 (#387), D-CSV-10
  (W-F1)
- §5 L-1..L-20 implementation-outcome annotations (PR #+commit+
  accessor file per row)
- §6/§8 UNCHANGED architecture, annotated with shipping commits +
  TD pointers for deviations (SmallVec)
- §11 D-CSV-* table — D-CSV-1..12 status; D-CSV-13/14/15 NEW Phase E
  sprint-12 entries (SIMD vec, on-Think method migration, Jirak Σ10)
- §12 OQ table — all 6 OQs annotated with ratification
- §13 Risk — 10 risks (vs 6 in v1); §13.7–13.10 new from sprint-11
  observations (subagent isolation, E-META-10 alias, two-TrustTexture)
- §15-§16 phasing + test growth — sprint-11 confirmed ~58 tests;
  sprint-12 projected ~70+

Fleet status: **12 of 12 Sonnet workers complete.** Honest cross-
cutting Opus meta-review (W-Meta-Opus) dispatched next.

https://claude.ai/code/session_01UwJuKqP828qyX1VkLgGJFS
AdaWorldAPI pushed a commit that referenced this pull request May 16, 2026
…ntries (#383..#390)

PP-9 (Opus) prepended 8 PR entries to PR_ARC_INVENTORY.md (1537→1903
lines, +366 / +50,619 bytes). APPEND-ONLY rule respected — no prior
entries touched. Top→bottom reverse chronological:

#390 sprint-12/wave-G (In PR, `bad0875`) — grade A−. D-CSV-5b cutover
   + D-CSV-6b WitnessCorpus + D-CSV-13 batch + D-CSV-15 Jirak math.
#389 sprint-12 wave-F codex P2 follow-up — AttentionMaskBackend impl
   + canonical MailboxId (CSI-10).
#388 sprint-12 Wave F fleet (12 Sonnet + 1 Opus) — grade B. D-CSV-
   10/11/12 scaffolds + AttentionMask + plan v2.
#387 sprint-11 Wave E — grade A−. D-CSV-8 MUL i4 scalar + D-CSV-9
   8-channel transcoder (Option R-3).
#386 sprint-11 Wave D — grade B+. D-CSV-7 MailboxSoA + D-CSV-6a
   WitnessCorpus core.
#385 sprint-11 Wave C — grade B+. D-CSV-5a sibling QualiaI4Column.
#384 sprint-11 Wave B — grade A. D-CSV-2 QualiaI4_16D + OQ-CSV-1
   Option α ratification.
#383 sprint-11 Wave A — grade A−. D-CSV-1 v2 layout + D-CSV-3 signed
   mantissa + D-CSV-4 CollapseGateEmission.

Every entry mirrors the #381/#379 template — Header / Confidence /
Added / Locked / Deferred / Docs / Cross-refs — with forward+backward
linkages (#383#385#390 D-CSV-5 chain; E-META-10 catch in #383 →
iron-rule promotion in #390 W-G5; etc.).

Total PR headers in file: 28 (was 20). 13 of 14 planners done.
Only PP-13 (brutally-honest-tester agent) still in flight.

https://claude.ai/code/session_01UwJuKqP828qyX1VkLgGJFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants