Skip to content

Commit e6df766

Browse files
committed
docs(mailbox): ThoughtStruct = transparent hot/cold view over SurrealDB container; 64k–256k working set
- plan §2.7: the one-SoA contract extends past RAM — ThoughtStruct is later also a transparent view into the SurrealDB-on-Lance container table(s); same SoA layout hot (mailbox) or cold (container), no RAM↔storage re-encode; persisted_row is the seam - capacity: hot ceiling ~64k–256k thoughts; 64k ≈ 300–600 MB ⇒ ~6 KB/thought, dominated by the content/topic/angle Hamming planes that STAY hot — dropping only the 64 KB Vsa16kF32 cycle plane is what makes the working set fit. Resolves OQ-1 (Hamming planes hot; CAM-PQ ref is the cold/spill form) - §3 footprint reconciled (bare columns ~24–50 B vs full hot thought ~6 KB) - STATUS_BOARD: D-MBX-6 (transparent hot/cold ThoughtStruct view); TD-RESONANCEDTO-DUP-1 -> Deferred - TECH_DEBT + EPIPHANIES updated Design/spec only. https://claude.ai/code/session_017GFLBnDy23AWBqvkbHHC41
1 parent 98d68f8 commit e6df766

4 files changed

Lines changed: 67 additions & 8 deletions

File tree

.claude/board/EPIPHANIES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
**Gated staging (plan §6):** S1 add columns behind `mailbox-thoughtspace` feature → S2 move `engine_bridge` surface onto mailbox rows → S3 driver holds a sea-star of mailboxes (kill the 4096 singleton in `serve.rs`) → S4 death→SPO+Lance tombstone-witness → S5 delete `BindSpace`+`cycle` plane. Gated on `D-CE64-MB-1-impl` (par-tile) + `PR-NDARRAY-MIRI-COMPLETE`; S5 blocked on the CLAUDE.md "The Click" / `Vsa16kF32` doctrinal update (OQ-4, already flagged in `surreal/RECONCILIATION`).
1414

15-
**Refinement (same session, 2026-05-27):** the per-mailbox SoA *is* **THE little-endian contract** — singular, and the **same SoA layout runs the whole vertical with no boundary re-encode**: cognitive-shader-driver `MailboxSoA` → `lance-graph-contract` LE types (`CausalEdge64`/`QualiaI4_16D`/`MetaWord`/`SoaColumns`/`entity_type`) → lance-graph storage (Lance columns / tombstone-witness); `ShaderCrystal.persisted_row` is a pointer to the same SoA row, not a serialized copy (plan §2.5). **The Ontology is NOT in the SoA and stays AS IS** — lazylock (`registry.rs:39 LazyLock<NamespaceRegistry>`) + the `ontology_dictionary` Lance **cache** (`lance_cache.rs`, TTL-sourced, drop-and-rebuild; its own header already says "BindSpace … never lands here") (plan §4). **DTO audit (plan §2.6):** `p64-bridge` already conforms (maps `CausalEdge64`/`ThinkingStyle` straight to palette, no re-encode — the template); the legacy re-encode seam is `engine_bridge.rs` `bind_busdto`/`unbind_busdto`/`busdto_to_binary16k` (collapse in S2); `thinking-engine` DTOs survive only as the `StreamDto` ingress adapter + thin read-projections (`BusDto`/`ThoughtStruct`) over the mailbox SoA; `ResonanceDto.energy` *is* `MailboxSoA.energy` (the two `ResonanceDto` defs are `TD-RESONANCEDTO-DUP-1`).
15+
**Refinement (same session, 2026-05-27):** the per-mailbox SoA *is* **THE little-endian contract** — singular, and the **same SoA layout runs the whole vertical with no boundary re-encode**: cognitive-shader-driver `MailboxSoA` → `lance-graph-contract` LE types (`CausalEdge64`/`QualiaI4_16D`/`MetaWord`/`SoaColumns`/`entity_type`) → lance-graph storage (Lance columns / tombstone-witness); `ShaderCrystal.persisted_row` is a pointer to the same SoA row, not a serialized copy (plan §2.5). **The Ontology is NOT in the SoA and stays AS IS** — lazylock (`registry.rs:39 LazyLock<NamespaceRegistry>`) + the `ontology_dictionary` Lance **cache** (`lance_cache.rs`, TTL-sourced, drop-and-rebuild; its own header already says "BindSpace … never lands here") (plan §4). **DTO audit (plan §2.6):** `p64-bridge` already conforms (maps `CausalEdge64`/`ThinkingStyle` straight to palette, no re-encode — the template); the legacy re-encode seam is `engine_bridge.rs` `bind_busdto`/`unbind_busdto`/`busdto_to_binary16k` (collapse in S2); `thinking-engine` DTOs survive only as the `StreamDto` ingress adapter + thin read-projections (`BusDto`/`ThoughtStruct`) over the mailbox SoA; `ResonanceDto.energy` *is* `MailboxSoA.energy` (the two `ResonanceDto` defs are `TD-RESONANCEDTO-DUP-1`, **deferred**). **Hot/cold (plan §2.7):** the SoA extends past RAM — `ThoughtStruct` is *later also a transparent view into the SurrealDB ThoughtStruct container table(s)*, same SoA layout hot (mailbox) or cold (container), no RAM↔storage re-encode. Hot ceiling **~64k–256k thoughts** (64k ≈ 300–600 MB ⇒ ~6 KB/thought, dominated by the content/topic/angle Hamming planes that stay hot — dropping only the 64 KB `Vsa16kF32` plane is what makes the working set fit; **resolves OQ-1**). New deliverable D-MBX-6.
1616

1717
**Cross-ref:** `E-BATON-1`, `E-CE64-MB-4`, `E-LADDER-SERVES-MAILBOX` (§6 tombstone-witness), `I-VSA-IDENTITIES`, `I-LEGACY-API-FEATURE-GATED` (feature-gate the v1 accessors during S1–S4), `E-CONTRACT-NO-SERIALIZE` (compile-time handshake, no membrane serialize — same byte layout to disk), `causaledge64-mailbox-rename-soa-v1` (§5 MailboxSoA), `cognitive-substrate-convergence-v1` (D-CSV-7 shipped accumulator), `TD-RESONANCEDTO-DUP-1`.
1818

.claude/board/STATUS_BOARD.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,8 @@ Plan path: `.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md`. Epiphany `E
525525
| D-MBX-3 | `ShaderDriver` holds a sea-star of mailboxes; kill the `BindSpace::zeros(4096)` singleton in `serve.rs` | cognitive-shader-driver | 160 | HIGH | **Queued** | blocked on D-MBX-2 + OQ-2 (temporal/expert fold) |
526526
| D-MBX-4 | death → SPO-G quad + Lance tombstone-witness (link-integrity back-pointer) | cognitive-shader-driver + Lance | 200 | HIGH | **Queued** | blocked on D-MBX-3 + Zone-2 persistence |
527527
| D-MBX-5 | delete `BindSpace` singleton + `Vsa16kF32` `cycle` plane; remove feature gate | cognitive-shader-driver | 80 | MED | **Queued** | blocked on D-MBX-4 + OQ-4 (CLAUDE.md "The Click" doctrinal update) |
528+
| D-MBX-6 | `ThoughtStruct` = transparent hot/cold view over SurrealDB container table(s) (same SoA both tiers; ~64k–256k hot ceiling, ~6 KB/thought) | cognitive-shader-driver + surreal_container | 220 | HIGH | **Queued** | blocked on D-MBX-3 + surreal_container unblock (BLOCKED A/B/C/D) or callcenter Zone-2 |
529+
| TD-RESONANCEDTO-DUP-1 | dedup the two `ResonanceDto` (thinking-engine) | thinking-engine | 60 | LOW | **Deferred** | user 2026-05-27 — fold into D-MBX-2 |
528530

529531
---
530532

.claude/board/TECH_DEBT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
- **Surfaced in:** DTO vertical audit, 2026-05-27, branch `claude/splat3d-cpu-simd-renderer-MAOO0`
2020
- **What:** `crates/thinking-engine/src/dto.rs:59` defines `ResonanceDto { energy: Vec<f32>, top_k, cycle_count, converged }` (the Ψ ripple field); `crates/thinking-engine/src/awareness_dto.rs:21` defines a *different* `ResonanceDto { hdr: HdrResonance, dominant_perspective, gate, dissonance, total_energy, … }` (multi-perspective S/P/O). Same name, different shape, same crate.
2121
- **Owed:** dedup under `bindspace-singleton-to-mailbox-soa-v1` — the `dto.rs` energy field unifies into `MailboxSoA.energy: [f32; N]`; the `awareness_dto.rs` scalars map to SoA `meta`/`edge` columns and `HdrResonance` becomes the S/P/O read over the SoA. Rename/merge so one canonical resonance read remains.
22-
- **Status:** Open
22+
- **Status:** Open**Deferred** (user, 2026-05-27): not now; revisit folded into D-MBX-2 (the `engine_bridge` re-encode-seam collapse).
2323

2424
### TD-GHOST-ECHO-DUP-1 (D-PERSONA-1)
2525

.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md

Lines changed: 63 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,57 @@ hot path translates to/from. p64-bridge is the conformance template for the stor
196196

197197
---
198198

199+
## 2.7 — Hot/cold: `ThoughtStruct` is a transparent view over the SurrealDB container table(s)
200+
201+
The same "one SoA, no re-encode" rule (§2.5) extends **past RAM into persistence**. The hot
202+
path can hold **only ~64k–256k thoughts**; beyond that, thoughts live in the **SurrealDB-on-Lance
203+
container table(s)** (`crates/surreal_container`, the Zone-2 cold tier — currently a BLOCKED
204+
skeleton, see `surreal/RECONCILIATION`). The ruling:
205+
206+
> `ThoughtStruct` (the Γ-collapse thought) is **later also a transparent view into the
207+
> ThoughtStruct container table(s)** — reading a thought resolves over the **same SoA layout**
208+
> whether it is hot (in a mailbox) or cold (in the SurrealDB container). No re-encode at the
209+
> RAM↔storage boundary: the container columns are the mailbox columns. `persisted_row` is the
210+
> seam; the view spans hot+cold transparently.
211+
212+
### Capacity (the working-set bound)
213+
214+
- **Hot ceiling: ~64k–256k thoughts.** At **64k ≈ 300–600 MB RAM****~4.5–9 KB/thought** hot.
215+
256k ⇒ ~1.2–2.4 GB.
216+
- **Why ~6 KB/thought (not the ~24–30 B of bare SoA columns):** the dominant cost is the
217+
**content/topic/angle Hamming identity planes** = 3 × 256 × 8 B = **6 KB/thought**. The bare
218+
migrated columns (edge 8 + qualia 8 + meta 4 + entity_type 2 + accumulator ~9 B) add only
219+
~30–50 B. **6 KB × 64k ≈ 400 MB** — squarely in the stated 300–600 MB range. (This is *with*
220+
the 64 KB `Vsa16kF32` `cycle` plane dropped; keeping it would make 64k thoughts ≈ 4.7 GB, so
221+
dropping it is what makes the 64k–256k hot working set fit at all.)
222+
- **Resolves OQ-1 (content reference shape):** the 300–600 MB-for-64k budget implies the
223+
**Hamming identity planes stay hot per thought** (≈ 6 KB) — they are *not* reduced to a 6 B
224+
CAM-PQ ref in the hot path. The only thing dropped is the 64 KB f32 `cycle` carrier. A
225+
CAM-PQ/codebook ref is the *cold/storage* form (and the spill key), not the hot form.
226+
227+
### The spill / transparent-read model
228+
229+
```
230+
hot (mailbox SoA, ≤ 64k–256k thoughts, ~300–600 MB)
231+
│ energy decays / mailbox dies / working set full
232+
▼ spill — SAME SoA columns, no re-encode (persisted_row)
233+
cold (SurrealDB-on-Lance container table(s), append-only/versioned)
234+
235+
│ ThoughtStruct view reads hot OR cold transparently (same layout)
236+
```
237+
238+
- The SurrealDB container is the **same SoA columns** persisted (edge/qualia/meta/entity_type
239+
+ content identity), append-only/versioned — so the cold store *is* the tombstone-witness +
240+
GoBD trail (`E-LADDER-SERVES-MAILBOX` §6) by construction.
241+
- `ThoughtStruct` (`thinking-engine`) becomes the **transparent view** over `(hot mailbox row |
242+
cold container row)`; text stays lazy. This makes the §2.6 ruling literal at the storage tier:
243+
`ThoughtStruct` is a read-projection, identical whether the row is in RAM or in SurrealDB.
244+
- **Gating:** the cold tier needs `surreal_container` unblocked (BLOCKED(A/B/C/D) — fork dep +
245+
Lance 6 pin) **or** the `lance-graph-callcenter` Zone-2 path; the transparent-view wiring is
246+
migration step **S4** (plan §6) and new deliverable **D-MBX-6**.
247+
248+
---
249+
199250
## 3. Column-by-column migration map
200251

201252
| `BindSpace` column | → Destination | How |
@@ -210,10 +261,14 @@ hot path translates to/from. p64-bridge is the conformance template for the stor
210261
| `entity_type` (u16) | **Own** `[u16; N]` | 1-based index into the **shared** ontology; the index is per-row mailbox state, the table it indexes is shared (next row). |
211262
| `ontology` (`Arc<OntologyRegistry>`) | **Stays shared** | Read-only cold Zone-2; handed by `Arc` to the mailbox, never owned/copied. See §4. |
212263

213-
**Net footprint:** per-row hot state drops from ~71.6 KB (dominated by the 64 KB `cycle`
214-
plane) to **≈ 24–30 B/row** (edge 8 + qualia 8 + meta 4 + entity_type 2 + optional
215-
content_ref ≤ 6). That is the whole point: the mailbox thoughtspace is L1/L2-resident
216-
(canonical plan §5 ~1.2 KB/compartment), the singleton never was.
264+
**Net footprint (two figures — don't conflate):**
265+
- *Bare migrated SoA columns***24–50 B/row** (edge 8 + qualia 8 + meta 4 + entity_type 2 +
266+
accumulator energy/plasticity/last_emit ~21).
267+
- *Full hot thought***~6 KB** — because the **content/topic/angle Hamming identity planes
268+
(3 × 2 KB) stay hot** (see §2.7; this is what sets the 64k ≈ 300–600 MB budget). The win is
269+
dropping the **64 KB `Vsa16kF32` `cycle` plane**: per-thought ~71.6 KB → ~6 KB, which is what
270+
makes the 64k–256k hot working set fit. The bare columns are L1/L2-resident; the Hamming
271+
planes are the bulk and bound the working-set ceiling.
217272

218273
---
219274

@@ -310,8 +365,10 @@ fold (OQ-2) reclaims bits.
310365

311366
## 8. Open questions (ratify before the gated step that needs them)
312367

313-
- **OQ-1 (S2):** content identity in the mailbox — CAM-PQ code, codebook id, or a slim
314-
Hamming slice? (drives the per-row content_ref width). Default proposal: CAM-PQ code (6 B).
368+
- **OQ-1 (S2): RESOLVED by §2.7 capacity.** The 64k ≈ 300–600 MB budget implies the
369+
content/topic/angle **Hamming identity planes stay hot (~6 KB/thought)**; only the 64 KB
370+
`Vsa16kF32` `cycle` plane is dropped. CAM-PQ/codebook ref is the *cold/storage + spill-key*
371+
form, not the hot form.
315372
- **OQ-2 (S3):** fold `temporal`/`expert` into `CausalEdge64` (v2 already reclaimed the
316373
temporal bits) vs keep separate columns. Default proposal: fold; keep only if a step needs a
317374
standalone stamp.

0 commit comments

Comments
 (0)