Skip to content

Commit cb77a31

Browse files
authored
Merge pull request #215 from AdaWorldAPI/claude/guid-canon-crystallization
docs(knowledge): GUID prefix→shape routing — GridLake continuation, φ-quorum anti-theater contract, deterministic phase + WHP
2 parents 94d4496 + 44d104d commit cb77a31

2 files changed

Lines changed: 292 additions & 0 deletions

File tree

.claude/blackboard.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@
33
> **Read this first.** The "Polyglot Notebook" architecture below is a
44
> separate/older program, not the current epoch.
55
6+
## 2026-06-10 — DECISION: GUID prefix→shape routing crystallized (docs-only)
7+
8+
The operator-pinned canonical GUID (`OGAR/CLAUDE.md`: hex dash-groups =
9+
`classid(8)-HEEL(4)-HIP(4)-TWIG(4)-[basin·leaf+id]`; 3×4 tiers, `>> 2`)
10+
now has its ndarray-side contract at
11+
`.claude/knowledge/guid-prefix-shape-routing.md`: ndarray = MECHANISM
12+
(layout-only `PrefixShapeTable`, opaque `ShapeId(u16)`, longest-prefix,
13+
L1/L2-resident, no distance API — no-umbrella honored), consumer =
14+
POLICY (lance-graph registers the table). GridLake continuation: key
15+
selects grid family + pyramid level; value stays one byte-store
16+
(column-substrate identity). φ-quorum anti-eigenvalue-theater contract
17+
pinned with the PP-13 casebook as failure catalog; probes named
18+
(ROUTE-1, QUORUM-1, PHI-1, PYR-1, CODEBOOK-44; HILBERT-L4 = existing
19+
P0-4 blocker for any L4 cascade claim). CONJECTURE until coded — no
20+
.rs touched in this commit.
21+
622
## Evidence model (binding — from PR #200)
723
- **L0** = source · passing tests · ratified standards (ground truth).
824
- **L1** = `.claude/PR-X12-docs-audit.md` (#200) + `.claude/knowledge/plans-alignment-triage.md` — claims-about-source; **spot-check, never inherit**.
Lines changed: 276 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,276 @@
1+
# GUID Prefix → Shape Routing — the GridLake continuation (crystallization)
2+
3+
> **READ BY:** savant-architect, vector-synthesis, product-engineer, any agent
4+
> touching `simd_soa.rs`, `blocked_grid/`, `splat3d/`, `cam_pq`, or proposing
5+
> a routing/dispatch surface.
6+
>
7+
> **Date:** 2026-06-10. **Canon source:** `OGAR/CLAUDE.md` (the operator-pinned
8+
> canonical GUID; auto-loaded there, cited here — do not fork the definition).
9+
> **Evidence discipline (per blackboard):** L0 receipts are cited by path;
10+
> everything not yet coded is marked **CONJECTURE** with a named probe, per the
11+
> insight-update cycle. No unmarked conjectures.
12+
13+
## 1. The canon this doc serves (cited, not redefined)
14+
15+
From `OGAR/CLAUDE.md` P0 — counted in HEX; the UUID dash-groups ARE the
16+
semantic delimiters:
17+
18+
```
19+
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
20+
classid HEEL HIP TWIG family-basin-leaf(6)+identity(6)
21+
8 hex 4 4 4 12 hex
22+
```
23+
24+
- **Key-of-key-value:** node = 4096 bits = `key(128/GUID) + value(3968)`.
25+
The key prerenders/routes/compares with **zero value decode**; the value
26+
compresses freely (Lance) — compression never costs addressability.
27+
- **3×4 uniform:** 3 tiers × 4 nibbles; `tier_of(nibble) = nibble >> 2`
28+
a shift, never a branch/divide. RFC 9562 is a *wrapper* concern; wrappers
29+
adapt at their membrane, never the canon.
30+
- **Centroid-tile reading [H]:** each tier's 4 nibbles = a 256×256 centroid
31+
tile (two byte-axes); path (HEEL+HIP+TWIG) = **6 bytes = the CAM-PQ 6×256
32+
code** — path distance = 3 tier-LUT lookups, O(1). Rigor condition:
33+
codebooks built as **4-level 4-ary hierarchies (256 = 4⁴)** so nibble
34+
prefixes = centroid ancestry. Codebooks are **scoped by class routing
35+
prefix** (longest-prefix wins).
36+
37+
## 2. The split — ndarray is MECHANISM, never policy
38+
39+
Same division as `simd.rs` dispatch and the W1a contract: ndarray ships the
40+
*routing mechanism*; the consumer (lance-graph) registers the *table*.
41+
ndarray never learns what a class, DOLCE category, or codebook MEANS.
42+
43+
Receipts for why this layering is already the house style:
44+
- `src/simd_soa.rs:14-27``MultiLaneColumn` is **layout-only**: "No
45+
`#[target_feature]` … No distance-aware API" (the no-umbrella rule,
46+
`cognitive-distance-typing.md`).
47+
- Blackboard "Settled architecture": distance lives in `hpc::cam_pq`
48+
(integer ADC) gated by `distance::similarity_z`**the router must not
49+
duplicate or wrap it**.
50+
- `CLAUDE.md` architecture rule: "ndarray = hardware (SIMD …), lance-graph
51+
= thinking."
52+
53+
## 3. Proposed surface — `PrefixShapeTable` (CONJECTURE — not yet coded)
54+
55+
Sibling of `MultiLaneColumn` in the `simd_soa` layer. Layout-only carrier +
56+
two methods; lanes go through `crate::simd::*` per W1a.
57+
58+
```rust
59+
/// Opaque to ndarray — the consumer's shape registry key.
60+
pub struct ShapeId(pub u16);
61+
62+
pub struct PrefixShapeEntry { pub prefix: u64, pub nibbles: u8, pub shape: ShapeId }
63+
64+
/// classid-byte direct index → sorted prefix runs (longest-prefix wins).
65+
pub struct PrefixShapeTable { /* [256] heads + sorted &[PrefixShapeEntry] */ }
66+
67+
impl PrefixShapeTable {
68+
pub fn route(&self, key: &[u8; 16]) -> ShapeId;
69+
pub fn route_batch(&self, keys: &[[u8; 16]], out: &mut [ShapeId]);
70+
}
71+
```
72+
73+
**Cheapness budget (the whole point):**
74+
- `route` = one u32 load (GUID group 1) → 256-way direct index (2 KB head
75+
table, L1-resident) → ≤1 binary-search step in a short sorted run.
76+
Worst-case full `entity_type` table: 65,536 × u16 = **128 KB = L2-resident**.
77+
- `route_batch` = SoA gather: classid bytes via `U8x64`-width loads, one
78+
table gather per lane group. No alloc, no `&mut self` (data-flow rule 1+2).
79+
- Tier selection downstream of routing: `nibble >> 2` — already canon.
80+
- The router returns `ShapeId` and STOPS. Distance/semantics stay in
81+
`hpc::cam_pq` / consumer land (no-umbrella).
82+
83+
**PROBE-ROUTE-1 (pass/fail):** `route_batch` ≡ scalar `route` on 10⁶ random
84+
keys (parity), and ≥4× scalar throughput at N=1024 on the v4 host.
85+
86+
## 4. GridLake, continued — the key selects the grid; the value stays one byte-store
87+
88+
The column-substrate identity is load-bearing and already written
89+
(`hhtl-gridlake-pre-sprint-prompt.md`): **Lance column ≡ Arrow buffer ≡
90+
ndarray SoA — same bytes, different lane width, no copy.** `MultiLaneColumn`
91+
is the value plane. This crystallization adds the key plane:
92+
93+
```
94+
NodeGuid (128b) ──route()──► ShapeId ──consumer registry──► which MultiLaneColumn
95+
│ family + lane width
96+
└─ tier nibbles (>>2) ──► pyramid LEVEL within the blocked grid
97+
```
98+
99+
- Grid stack points that already exist (L0): `hpc/blocked_grid/{compute,
100+
super_block,aliases}.rs`, `hpc/splat3d/depth_cascade.rs`,
101+
`hpc/pillar/hhtl_contraction.rs`.
102+
- **Stacked-pyramid perturbation = DETERMINISTIC PHASE (operator-pinned
103+
2026-06-10; CONJECTURE as code):** pyramid levels are *generated, not
104+
stored*, and the perturbation decomposes into four terms of which
105+
**three are already in the key**:
106+
107+
```
108+
perturb(addr, L) = M[addr @ coarse] · P( phase(addr, L) ) at loc(addr)
109+
110+
exponent = level L → the KEY's tier nibbles (>>2) — 0 bits stored
111+
location = sub-tile placement → implied mantissa (√u/golden) — 0 bits stored
112+
phase = deterministic recurrence from the address — 0 bits stored
113+
magnitude = the envelope M → THE ONLY STORED BITS
114+
(palette-quantized, coarser granularity than the phase varies)
115+
```
116+
117+
Phase is *convention, not data* — the decoder regenerates it bit-exact
118+
from the address, so synthesis is **lossless by construction** and
119+
stored cost scales with **magnitude smoothness, not perturbation
120+
bandwidth** (a 256×256 tile with a smooth envelope stores a 16×16
121+
magnitude plane — 256× cheaper than a full residual). DLSS/Halton-
122+
jitter logic made exact — and **helix already ships the split**
123+
("HHTL = deterministic PLACE; helix = orthogonal RESIDUE"):
124+
`HemispherePoint::lift` (√u) = the location mantissa; **`CurveRuler`
125+
stride-4-over-17 = the deterministic phase walk** (coprime → full
126+
permutation; integer → cross-platform bit-exact); `RollingFloor` =
127+
the magnitude quantizer.
128+
129+
**Fences (no theater):** (a) NOT lossless for arbitrary residuals —
130+
the unaligned remainder overflows to the next level or full-residual
131+
escalation, **decided per tile by the quorum certificate (§5)**,
132+
never assumed; (b) **D-QUANTGATE:** in quantized layers the phase
133+
generator MUST be the coprime-integer walk — float φ-recurrence
134+
drifts across platforms and loses aperiodicity under quantization;
135+
golden recurrence is build-time muscle-memory only. The deterministic
136+
phase doubles as the **anti-moiré dither** (aperiodic by coprimality).
137+
138+
**PROBE-PYR-1:** the full-residual escalation tier reconstructs
139+
byte-exact; corrupt-residual fails loudly. **PROBE-PHASE-1:** phase
140+
regeneration bit-exact across AVX-512/NEON/scalar and across
141+
platforms (integer walk only). **PROBE-PERT-RHO:** magnitude-only
142+
encoding meets the ρ anchors on a representative tile corpus; the
143+
measured escalation rate is reported, not hidden.
144+
145+
### 4b. Bipolar phase = signed bits = Walsh-Hadamard on VSA (CONJECTURE)
146+
147+
When §4's deterministic phase is **signed (±1)** — one bit per
148+
(addr, level) — the pyramid is the Walsh-Hadamard transform of the
149+
address tree carried on the workspace's bipolar VSA algebra
150+
(`Vsa16kF32` is already bipolar ±1 in role-key slices). Cascade:
151+
152+
```
153+
cell(addr) = ⊕_L sign(addr, L) ·_VSA M(addr, L)
154+
│ │
155+
XOR (vsa_bind) SUM+THRESHOLD (vsa_bundle)
156+
one shift+xor SIMD Markov-respecting
157+
```
158+
159+
**Receipts shipped:** bipolar carrier `Vsa16kF32` (lance-graph-contract
160+
`crystal/fingerprint.rs`); `vsa_bind` (multiply ±1 = XOR of sign bits)
161+
+ `vsa_bundle` (sum + threshold) = the iron-rule algebra; bit-exact
162+
integer phase walk = helix `CurveRuler` stride-4-over-17
163+
(D-QUANTGATE-compliant); Markov guarantee = `I-SUBSTRATE-MARKOV`
164+
(bundle ≡ Chapman-Kolmogorov).
165+
166+
**Quantum-shaped properties, all DETERMINISTIC:**
167+
- **Superposition** — cells hold many bundled contributions; unbinding
168+
with a role key (XOR with key's sign pattern) extracts one.
169+
- **Heisenberg-shaped bound**`I-VSA-IDENTITIES` Test 1:
170+
N ≤ √d/4 ≈ 32 distinct readouts per cell before SNR collapses. This
171+
IS the substrate's uncertainty principle; classical bound, real wall.
172+
- **Resonance field** — a region's "value" = inner product of its
173+
address-signature with the magnitude pyramid (Walsh-resonance, not
174+
Fourier).
175+
- **Roundtrip bit-exact** — phase generated not stored; Walsh-Hadamard
176+
self-inverse up to scale.
177+
178+
**TWO-ALGEBRA RULE (load-bearing, do not violate):**
179+
- **Sign side = XOR** (one SIMD op; allowed for single-target deltas per
180+
`data-flow.md` rule "single target: gated XOR").
181+
- **Magnitude side = `vsa_bundle`** (sum + threshold) — **NEVER** raw XOR
182+
on magnitudes; `MergeMode::Xor` breaks Markov per `I-SUBSTRATE-MARKOV`.
183+
- Two operators, two algebras, one pyramid. PP-13 P1-1
184+
("raw-XOR-u64 ordering as 'nearest'") is the named anti-pattern that
185+
confuses them.
186+
187+
**Honest fences (no theater):**
188+
1. "Quantum-like" is the BUNDLING ALGEBRA, not measurement randomness.
189+
No headline drift to "quantum substrate"; we shipped Walsh-Hadamard +
190+
VSA-bipolar — the win IS bit-exactness, not probabilism.
191+
2. Bipolar = 1-bit phase. Multi-bit phases stack above only when
192+
measured to be needed.
193+
3. Parseval-preservation requires the bundle. Raw-XOR-only =
194+
permutation algebra = no L2 conservation = no "top gaussian preserved".
195+
196+
**Probes (new):**
197+
- **PROBE-WHP-1 (Parseval):** for random ±1 sign-fields,
198+
`Σ|cell|² = Σ|M_L|²` within a Jirak-derived noise floor (never
199+
optimism).
200+
- **PROBE-WHP-2 (roundtrip):** encode→decode→encode is byte-identical
201+
across AVX-512/NEON/scalar.
202+
- **PROBE-WHP-3 (unbind):** binding then unbinding with a role-key
203+
recovers the bound element with measured margin; fails cleanly past
204+
N > √d/4 (the Heisenberg bound made explicit).
205+
- **PROBE-WHP-4 (two-algebra guard):** explicit failing test asserting
206+
raw-XOR on magnitudes breaks Chapman-Kolmogorov consistency; guards
207+
against future `MergeMode::Xor` drift.
208+
209+
## 5. The φ-quorum — so Morton cheapness never becomes eigenvalue theater
210+
211+
**Eigenvalue theater, defined by this repo's own casebook**
212+
(`pp13-brutally-honest-tester-verdict.md`): cheap arithmetic wearing
213+
spectral/metric language it does not earn —
214+
- P0-1: a PSD gate **structurally unsatisfiable** at its constants
215+
(contractive cascade → denormals; absolute ε vs relative needed);
216+
- P0-2: thresholds "chosen on optimism, not measured";
217+
- P0-3: placeholder thresholds **enforced** as PASS gates;
218+
- P0-4: "verified" claims whose level-4 test was never run;
219+
- P1-1: `nearest_basin` ordering by **raw XOR-u64** instead of popcount —
220+
"a function whose name promises one thing and silently delivers another."
221+
222+
**The guard — four rules (CONJECTURE as a typed surface; the mechanisms all
223+
exist):**
224+
225+
1. **Quorum certificate or escalate.** A cheap-path answer (Morton prefix /
226+
palette LUT / scent) ships only with a certificate: **k-of-n probes agree
227+
within τ**, where τ comes from *measured* anchors (Pflug-10 certifies the
228+
palette; Jirak 2016 sets the noise floor — never optimism), and the
229+
metric is a **named typed fn** (popcount Hamming, palette L1 ADC) — never
230+
raw-XOR-u64 ordering (P1-1). Quorum fail → **escalate one HHTL tier**
231+
(`RouteAction::Escalate` already exists in `bgz-tensor::hhtl_cache`);
232+
never silently accept.
233+
2. **φ-stride probe placement.** The n probe indices are golden-stride
234+
placed (`idx_k = (k · ⌊N/φ⌋) mod N`) so they equidistribute (Weyl; the
235+
proof-side twin is jc pillar P3). A quorum over clustered probes is
236+
theater with extra steps.
237+
3. **Spectral claims only via the pillar path.** Anything claiming
238+
PSD/eigen/Σ-propagation routes through `hpc/pillar/*` + `linalg/eig_sym`
239+
with **relative** tolerances (P0-1 lesson) and **measured** thresholds
240+
(P0-2); a placeholder threshold must not gate (P0-3).
241+
4. **Hierarchy claims need their level test — and HILBERT-L4 is
242+
VERIFIED GREEN (2026-06-10, run first-hand):** 13/13 tests pass
243+
including `level4_all_indices_unique` (**bijective onto [0,4096)**
244+
— exactly what cascade addressing needs) and
245+
`level4_curve_is_connected` (adjacent indices Manhattan-dist 1).
246+
**PP-13 P0-4's expectation (`encode([15,15,15],4) == 4095`) was an
247+
ORIENTATION assumption, not the contract** — under the shipped
248+
orientation the curve ends at a different corner; 2925 is a valid
249+
endpoint. The blocker framing is retired (Codex catch on #215); the
250+
exhaustive L4 suite stays as the **standing gate** — any future
251+
table change must keep it green before L-deep addressing claims.
252+
253+
**PROBE-QUORUM-1 (pass/fail):** on a sampled workload, quorum-accepted
254+
answers re-checked against full-plane recompute satisfy ρ ≥ the measured
255+
anchors (0.9973 HIP / 0.965 TWIG); quorum-rejected answers escalate and
256+
the escalated tier's answer satisfies the same bound. **PROBE-PHI-1:**
257+
φ-stride probe sets beat uniform-random sets on discrepancy at equal n.
258+
259+
## 6. Codebook build contract (the 4⁴ condition)
260+
261+
Per-class centroid codebooks (registered by the consumer, scoped by class
262+
prefix) must be built as **4-level 4-ary hierarchies** — flat k-means-256
263+
breaks nibble-prefix ancestry and with it `is_ancestor_of` in centroid
264+
space. **PROBE-CODEBOOK-44:** hierarchical-4⁴ vs flat-256 fidelity ρ on the
265+
same corpus; acceptance = within the Pflug-10 certification band of flat.
266+
267+
## 7. Cross-references
268+
269+
- `OGAR/CLAUDE.md` — the canon (GUID, key-of-key-value, 3×4, centroid tile,
270+
prefix-scoped codebooks, 3×4-vs-4×3 standing watch).
271+
- `OGAR/docs/INTEGRATION-MAP.md` — seams S1/S7/S9, gates F10–F14 (the
272+
jc×hpc floor this doc's probes extend).
273+
- lance-graph `.claude/knowledge/guid-canon-and-prefix-routing.md` — the
274+
policy-side counterpart (registry mint, codebook shelf, quorum type).
275+
- `hhtl-gridlake-pre-sprint-prompt.md` — the column-substrate identity.
276+
- `pp13-brutally-honest-tester-verdict.md` — the theater casebook.

0 commit comments

Comments
 (0)