|
| 1 | +# Cascade Synergies — Epiphany Capture (2026-06-08) |
| 2 | + |
| 3 | +> **Epistemic status: EPIPHANY‑CAPTURE — not pinned architecture.** |
| 4 | +> Filed under the standing "document everything before it dilutes" |
| 5 | +> mandate. Purpose: record the cross‑domain synergies converging on the |
| 6 | +> **Morton‑cascade + palette256 + golden‑helix** substrate so the shader |
| 7 | +> shape can be *optimized later against a complete map*, not rediscovered |
| 8 | +> piecemeal. Nothing here is a contract; ADR‑022/023/024/025 are the |
| 9 | +> pinned floors, and a future **ADR‑026** is expected to formalize the |
| 10 | +> subset of this doc that survives verification. |
| 11 | +> |
| 12 | +> **Grading legend (applied per claim):** |
| 13 | +> - **[G] Grounded** — both sides are real verified artifacts / public |
| 14 | +> specs; the synergy is structural, not analogical. |
| 15 | +> - **[H] Hypothesis** — the mechanism is sound and one side is real; |
| 16 | +> the other side needs a measurement or a definition to confirm. |
| 17 | +> - **[S] Speculative** — suggestive shape‑match, not yet load‑bearing; |
| 18 | +> recorded so it isn't lost, flagged so it isn't trusted. |
| 19 | +> - **`[per runtime session]`** — depends on a runtime‑owned internal |
| 20 | +> (`crates/helix`, `crates/jc`, `cognitive-shader-driver`, `blasgraph`) |
| 21 | +> that the OGAR session has not personally verified. |
| 22 | +
|
| 23 | +--- |
| 24 | + |
| 25 | +## 0. The convergence thesis |
| 26 | + |
| 27 | +Six independent engineering lineages each arrived — separately, for their |
| 28 | +own reasons — at the **same three primitives**: |
| 29 | + |
| 30 | +| Primitive | Why each lineage needed it | |
| 31 | +|---|---| |
| 32 | +| **Quadtree tiling** (recursive 4×4 / Morton subdivision) | rate‑distortion‑optimal block coding; spatial LOD; mip pyramids | |
| 33 | +| **256‑entry palettes** (8‑bit codebooks) | indexed color; product‑quantization centroids; attention weight buckets | |
| 34 | +| **Aperiodic / irrational placement** (break periodicity) | anti‑moiré without an optical low‑pass filter; anti‑aliasing | |
| 35 | + |
| 36 | +| Lineage | Tiling | Palette | Aperiodic | |
| 37 | +|---|:--:|:--:|:--:| |
| 38 | +| Video codecs (HEVC/x265, VVC/x266) | CTU quadtree | SCC palette mode | dithering | |
| 39 | +| Camera sensors (Fuji X‑Trans) | — | Bayer/X‑Trans CFA | **X‑Trans 6×6 aperiodic** | |
| 40 | +| Displays (OLED PenTile) | subpixel grid | RGBG subpixel | subpixel offset | |
| 41 | +| Transformer attention (bgz‑tensor) | head tiling | **WeightPalette(256)** | — | |
| 42 | +| Vector quantization (CAM‑PQ) | subspace split | **6 × 256 centroids** | — | |
| 43 | +| 3D‑tile rendering (Cesium) | **implicit quadtree** | — | — | |
| 44 | +| **The substrate** | **Morton cascade** | **palette256 / CAM** | **golden helix** | |
| 45 | + |
| 46 | +**They converged because the math is the same.** The substrate is the |
| 47 | +unification: Morton cascade = the tiling, palette256/CAM = the codebook, |
| 48 | +golden helix = the irrational placement. This doc maps each lineage's |
| 49 | +contribution and the optimization each unlocks. |
| 50 | + |
| 51 | +--- |
| 52 | + |
| 53 | +## 1. Morton cascade ↔ x265/x266 CTU quadtree **[G]** |
| 54 | + |
| 55 | +**Both sides real.** HEVC (x265) codes pictures as **Coding Tree Units** |
| 56 | +(CTU, up to 64×64) recursively **quadtree**‑split down to 4×4 transform |
| 57 | +blocks. VVC (x266) extends the CTU to 128×128 with a quadtree + multi‑type |
| 58 | +(binary/ternary) tree (QTMT). The substrate's cascade (64 → 256 → 1024 → |
| 59 | +4096 → … per‑axis, 4×4 Morton leaf) **is** the CTU partition structure. |
| 60 | + |
| 61 | +**The structural identity:** |
| 62 | + |
| 63 | +| Codec concept | Substrate concept | |
| 64 | +|---|---| |
| 65 | +| CTU (64×64 / 128×128) | the coarse cascade level (64‑ or 128‑per‑axis) | |
| 66 | +| quadtree split decision | the LOD level pick (which depth to refine to) | |
| 67 | +| rate‑distortion optimization (RDO) of split | **the *probe* version** of the level pick | |
| 68 | +| split flag per node | one Morton nibble per hop | |
| 69 | +| 4×4 transform block | the Morton leaf nibble | |
| 70 | + |
| 71 | +**The synergy that matters:** a codec decides split depth by **probing** |
| 72 | +rate‑distortion at each node (try a split, measure cost, keep or prune). |
| 73 | +ADR‑025 decides the same split depth by **closed form** (`r* = |
| 74 | +⌈log₄(C/τ)⌉` from the Jirak bound). **The codec's RDO loop is exactly the |
| 75 | +trial‑and‑error collapse test ADR‑025 removes.** Same tree, two ways to |
| 76 | +pick the depth — probe vs certificate. |
| 77 | + |
| 78 | +**Optimization unlocked (later):** |
| 79 | +- *Borrow the codec hardware quadtree.* x265/x266 CTU partitioning is |
| 80 | + hardware‑accelerated on most GPUs/ASICs; the substrate's Morton |
| 81 | + addressing could ride that silicon. |
| 82 | +- *Feed closed‑form splits to the codec.* The Jirak `r*` could replace |
| 83 | + (or seed) the RDO split search — a probe‑free encoder front‑end. |
| 84 | +- *Palette mode reuse.* HEVC‑SCC and VVC both ship an **indexed‑color |
| 85 | + palette mode** for screen content — the codec's own palette primitive, |
| 86 | + the same indexed‑codebook idea as palette256. |
| 87 | + |
| 88 | +--- |
| 89 | + |
| 90 | +## 2. Golden helix ↔ Fuji X‑Trans moiré protection **[H — the key insight]** |
| 91 | + |
| 92 | +**The insight (operator, 2026‑06‑08):** the golden‑ratio irrationality of |
| 93 | +the helix placement isn't *only* for deterministic addressing — it doubles |
| 94 | +as a **baked‑in anti‑moiré interlacing protocol**, the same job Fuji's |
| 95 | +X‑Trans color‑filter array does. |
| 96 | + |
| 97 | +**Why it's sound:** Fuji X‑Trans uses a **6×6 aperiodic** CFA (vs Bayer's |
| 98 | +2×2 periodic) specifically so the sensor pattern has **no regular period to |
| 99 | +beat against** image frequencies → moiré without an optical low‑pass |
| 100 | +filter. The golden angle (137.5°, φ = the *most irrational* number) is the |
| 101 | +classic phyllotaxis anti‑aliasing construction (sunflower seeds, Vogel |
| 102 | +spiral): irrational spacing → **no rational period → no aliasing beat**. |
| 103 | +The helix golden‑stride placement inherits this for free. |
| 104 | + |
| 105 | +**"x256 that can't collapse" — two senses of collapse, distinguished:** |
| 106 | + |
| 107 | +| Sense | What it is | Golden helix's role | |
| 108 | +|---|---|---| |
| 109 | +| **Good collapse** (LOD) | intentional coarsening: use a parent tile when SSE permits (ADR‑025) | unaffected — still closed‑form | |
| 110 | +| **Bad collapse** (moiré) | degenerate aliasing: periodic sampling beats against periodic content → the 256‑palette tile aliases into a false pattern | **prevented** — irrational placement has no period to beat, so the palette tile *can't* alias‑collapse | |
| 111 | + |
| 112 | +So a 256‑cell palette tile placed on the golden lattice carries an |
| 113 | +**anti‑degeneracy guarantee**: it can be intentionally LOD‑collapsed |
| 114 | +(good) but cannot moiré‑collapse (bad). The irrationality is the guard. |
| 115 | + |
| 116 | +**What's `[H]` here:** the phyllotaxis anti‑moiré math is established; the |
| 117 | +specific claim that the helix's *actual* golden‑stride spacing delivers |
| 118 | +X‑Trans‑grade protection for the palette tiles needs the runtime session's |
| 119 | +helix geometry to confirm the exact stride. **`[per runtime session]`** on |
| 120 | +the spacing constant; the *mechanism* is `[H]`. |
| 121 | + |
| 122 | +**Optimization unlocked (later):** |
| 123 | +- Skip the optical‑low‑pass‑filter analog entirely (X‑Trans's whole point): |
| 124 | + no separate anti‑alias pass needed if placement is golden. |
| 125 | +- The θ‑window (ADR‑025/026, [1.45,1.6] near‑orthogonal) and the |
| 126 | + irrational placement are the **same conditioning story from two angles**: |
| 127 | + near‑orthogonal *codebook* + aperiodic *lattice* = no degenerate beat in |
| 128 | + either the value space (palette) or the position space (tile). Worth |
| 129 | + unifying as "the no‑collapse precondition" in ADR‑026. |
| 130 | + |
| 131 | +--- |
| 132 | + |
| 133 | +## 3. palette256 ↔ Product Quantization ↔ codec palette mode ↔ OLED subpixel |
| 134 | + |
| 135 | +**Mixed grade per leg.** |
| 136 | + |
| 137 | +| Leg | Grade | Evidence | |
| 138 | +|---|:--:|---| |
| 139 | +| palette256 = one PQ subspace's 256 centroids | **[G]** | `nsm_word.rs`: CAM codebook = **6 subspaces × 256 centroids**; `cam_codes.bin` = N words × 6 bytes (lance‑graph PR #477) | |
| 140 | +| palette256 ↔ indexed‑color codec palette | **[G]** | HEVC‑SCC + VVC ship an indexed‑palette mode (the codec's own ≤‑256‑ish codebook for screen content) | |
| 141 | +| palette256 ↔ OLED subpixel emission | **[S]** | OLED PenTile RGBG is a palette‑on‑a‑lattice for *perceived* resolution; shape‑match only, no structural identity yet | |
| 142 | + |
| 143 | +**The convergence number is 256 = 2⁸ = one byte.** PQ centroids, codec |
| 144 | +palette indices, attention weight buckets (§4), and Binary16K lane |
| 145 | +structure (256² = 64k) all land on it because one byte is the natural |
| 146 | +SIMD‑lane / cache‑line / palette‑index granule. ADR‑024 already pins this |
| 147 | +as "the codec"; the new observation is how *many* independent lineages |
| 148 | +chose the same byte. |
| 149 | + |
| 150 | +**Optimization unlocked (later):** a single 256‑entry codebook can serve |
| 151 | +PQ (semantic), codec palette (compression), and tile centroid (spatial) |
| 152 | +*simultaneously* if the codebook is laid out once in Morton/Hilbert order |
| 153 | +(see §7 — the nesting precondition). One palette, three consumers. |
| 154 | + |
| 155 | +--- |
| 156 | + |
| 157 | +## 4. Attention headers ↔ bgz‑tensor WeightPalette ↔ attention‑driven LOD **[G→H]** |
| 158 | + |
| 159 | +**Grounded base:** `bgz-tensor` ships `WeightPalette::build(…, 256)` + |
| 160 | +`AttentionTable::build` (ADR‑024 reference) — attention weights are |
| 161 | +palette‑quantized to 256 on the model hot path. |
| 162 | + |
| 163 | +**The hypothesis to wire:** if attention is already palette256‑coded, and |
| 164 | +tiles are Morton‑addressed, then **attention can rank tiles → ranking |
| 165 | +drives Morton refinement depth.** The cognitive‑shader‑driver attends to a |
| 166 | +region; the attention header is the importance map; importance ranks tiles; |
| 167 | +rank sets `r*` (refine the attended tiles deeper, coarsen the ignored |
| 168 | +ones). This is **attention‑driven LOD** — the transformer's importance map |
| 169 | +*is* the LOD oracle. |
| 170 | + |
| 171 | +**Structural identity:** attention = a learned importance distribution; |
| 172 | +LOD = an importance‑driven refinement. ADR‑025's `r* = ⌈log₄(C/τ)⌉` uses a |
| 173 | +*Jirak‑certificate* tolerance τ; attention‑driven LOD would use a |
| 174 | +*learned‑attention* tolerance. Same `r*` machinery, different source of τ — |
| 175 | +certificate for provable bounds, attention for learned saliency. They can |
| 176 | +compose: τ = min(certificate, attention) → refine where *either* the bound |
| 177 | +or the model demands it. |
| 178 | + |
| 179 | +**Optimization unlocked (later):** "palette ranking attention headers wired |
| 180 | +into cognitive‑shader‑driver" (operator's phrasing) = the attention table's |
| 181 | +top‑ranked palette entries select which tile centroids materialize first — |
| 182 | +a saliency‑ordered lazy materialization. Free at the index (rank is a |
| 183 | +sort over 256 bytes); paid only at the materialized leaves. |
| 184 | + |
| 185 | +--- |
| 186 | + |
| 187 | +## 5. cognitive‑shader‑driver — the consumer **`[per runtime session]`** |
| 188 | + |
| 189 | +The `cognitive-shader-driver` (the BindSpace‑dissolution target, bardioc |
| 190 | +PR #18 / lance‑graph PR #470) is the hot‑path shader that *consumes* the |
| 191 | +Morton‑addressed, palette‑coded, attention‑ranked tiles. It is the literal |
| 192 | +"GPU shader" in the "akin to a GPU shader with free upscaling" framing: |
| 193 | + |
| 194 | +| Shader stage | Substrate input | |
| 195 | +|---|---| |
| 196 | +| vertex / tile fetch | Morton prefix → address‑derived bounds (no fetch‑test) | |
| 197 | +| fragment / per‑cell | helix template → centroid + Σ (closed‑form) | |
| 198 | +| texture sample | palette256 / CAM code → value (1 Lance read at the leaf) | |
| 199 | +| LOD / mip select | `r*` closed‑form (ADR‑025) or attention‑ranked (§4) | |
| 200 | + |
| 201 | +**`[per runtime session]`** on everything inside the driver — OGAR sees the |
| 202 | +*contract* (Morton address + palette code + `r*`), not the shader internals. |
| 203 | + |
| 204 | +--- |
| 205 | + |
| 206 | +## 6. blasgraph + neighborhood = structured‑sparse BLAS **[H, `[per runtime session]` on `blasgraph`]** |
| 207 | + |
| 208 | +*(Inferring `blasgraph` = the BLAS / GEMM execution layer over the |
| 209 | +lance‑graph structure; correct me if it's a specific crate.)* |
| 210 | + |
| 211 | +The cascade's **neighborhood** operation (neighbor‑XOR walk at a level + |
| 212 | +parent‑prefix for context — §1 of the prior turn) is a **structured sparse |
| 213 | +matrix**: the Morton‑neighbor adjacency is a banded/block matrix with |
| 214 | +constant per‑row fan‑out (4 neighbors + 1 parent). Aggregating over a |
| 215 | +neighborhood = a sparse matrix‑vector product over that adjacency = |
| 216 | +**a BLAS op** (`blasgraph`). The GPU shapes this enables: |
| 217 | + |
| 218 | +| GPU/BLAS shape | Cascade neighborhood equivalent | |
| 219 | +|---|---| |
| 220 | +| 2D convolution / stencil | neighbor‑XOR aggregation at a fixed level | |
| 221 | +| trilinear interp across mips | cross‑level XOR‑weighted blend (Morton‑Hamming weight) | |
| 222 | +| sparse GEMM | neighborhood message‑passing over the Morton adjacency | |
| 223 | +| anisotropic filtering | neighbor walk weighted by the helix Σ (the per‑cell ellipsoid) | |
| 224 | + |
| 225 | +**Optimization unlocked (later):** because the adjacency is *structured* |
| 226 | +(Morton‑regular, constant fan‑out), the sparse BLAS is a **dense |
| 227 | +block‑banded** op — no sparse‑matrix overhead, no gather/scatter; it's a |
| 228 | +shifted‑add stencil, the cheapest GPU primitive. The neighborhood compute |
| 229 | +is therefore as fast as a blur kernel. |
| 230 | + |
| 231 | +--- |
| 232 | + |
| 233 | +## 7. The nesting precondition — what's free vs paid (carried from prior turn) |
| 234 | + |
| 235 | +The "self‑fulfilling cascade" is free **only along one Morton‑nested axis.** |
| 236 | +lance‑graph PR #477 ships **two different orderings of the same 4096 words**: |
| 237 | + |
| 238 | +- `word_rank_lookup.csv` — **frequency** order (`MAX_VOCAB = 4096`). |
| 239 | +- `cam_codes.bin` — **semantic** PQ order (6 × 256). |
| 240 | + |
| 241 | +These don't nest into one Morton order (frequency‑rank ≠ semantic‑centroid). |
| 242 | +So: |
| 243 | + |
| 244 | +- **Free (one‑time, build):** lay the codebook out in Morton/Hilbert order |
| 245 | + on the *chosen* axis → prefix‑truncation = coarsening → the vertical |
| 246 | + shader cascade (mip / trilinear / DLSS‑upscale) is free at runtime. |
| 247 | +- **Paid (stored):** the *other* axis's relationship stays a CAM lookup |
| 248 | + (`cam_codes.bin` *is* that stored freq↔semantic map). You cannot |
| 249 | + Morton‑nest both on one axis. |
| 250 | + |
| 251 | +**The design decision §3 of ADR‑026 must record:** *which* axis gets the |
| 252 | +free cascade — **frequency** (common‑words‑first LOD) or **semantic** |
| 253 | +(palette‑coherent LOD). Mutually exclusive on one Morton order. |
| 254 | + |
| 255 | +--- |
| 256 | + |
| 257 | +## 8. The synergy matrix (everything against everything) |
| 258 | + |
| 259 | +| | Morton cascade | golden helix | palette256/CAM | attention | Cesium | x265/x266 | |
| 260 | +|---|---|---|---|---|---|---| |
| 261 | +| **HHTL** | address = prefix [G] | placement template [per‑rt] | codebook leaf [G] | rank → depth [H] | tileset id [G] | CTU id [G] | |
| 262 | +| **helix** | centroid/Σ from prefix [per‑rt] | — | θ‑window conditioning [H] | — | implicit bounds [H] | — | |
| 263 | +| **palette256** | leaf value [G] | anti‑moiré value [H] | — | weight bucket [G] | — | SCC palette [G] | |
| 264 | +| **neighborhood** | XOR walk [G] | Σ‑weighted [per‑rt] | — | — | LOD blend [H] | deblock filter [S] | |
| 265 | +| **Cesium** | implicit quadtree [G] | — | — | saliency LOD [H] | — | shared tiling [G] | |
| 266 | +| **x265/x266** | CTU = cascade [G] | dither analog [S] | palette mode [G] | — | shared tiling [G] | — | |
| 267 | + |
| 268 | +*(Cells: the synergy + its grade. Empty = no direct synergy identified yet.)* |
| 269 | + |
| 270 | +--- |
| 271 | + |
| 272 | +## 9. Optimization roadmap — the "later‑optimize" targets this doc unlocks |
| 273 | + |
| 274 | +Ordered by leverage (highest first): |
| 275 | + |
| 276 | +1. **Unify the "no‑collapse precondition"** (ADR‑026 §2+): θ‑window |
| 277 | + (near‑orthogonal codebook) + golden placement (aperiodic lattice) are |
| 278 | + one story — no degenerate beat in value‑space or position‑space. One |
| 279 | + precondition, two guards. |
| 280 | +2. **Pick the nesting axis** (ADR‑026 §3): frequency vs semantic free |
| 281 | + cascade. Blocks all vertical‑shader optimization until chosen. |
| 282 | +3. **Attention‑driven LOD** (§4): wire the bgz‑tensor WeightPalette rank |
| 283 | + into the `r*` pick — saliency‑ordered lazy materialization. |
| 284 | +4. **Borrow codec silicon** (§1): map Morton addressing onto x265/x266 CTU |
| 285 | + hardware quadtree; evaluate HEVC‑SCC/VVC palette mode for the leaf codec. |
| 286 | +5. **Structured‑sparse neighborhood BLAS** (§6): implement the neighbor |
| 287 | + walk as a block‑banded stencil, not a sparse GEMM. |
| 288 | +6. **Confirm `CausalEdge64 = 2⁶`** (prior turn): if the 64 is the 6‑role |
| 289 | + mask space, the 64‑level is structural and the codebook cascade is |
| 290 | + complete; if it's a 64‑bit word, the 64‑level is decorative. |
| 291 | + |
| 292 | +--- |
| 293 | + |
| 294 | +## 10. What the runtime session must confirm |
| 295 | + |
| 296 | +| Claim | Owner | Confirms | |
| 297 | +|---|---|---| |
| 298 | +| helix golden‑stride spacing constant | `crates/helix` | §2 X‑Trans‑grade moiré protection | |
| 299 | +| `CausalEdge64` cardinality (2⁶ mask vs 64‑bit) | lance‑graph‑contract | §0 64‑level structural vs decorative | |
| 300 | +| θ‑window [1.45,1.6] + ρ 0.93–0.9973 envelope | `crates/jc` | §2/§9 the no‑collapse precondition | |
| 301 | +| `blasgraph` actual scope | runtime | §6 neighborhood‑BLAS framing | |
| 302 | +| cognitive‑shader‑driver tile contract | bardioc/lance‑graph | §5 consumer interface | |
| 303 | + |
| 304 | +--- |
| 305 | + |
| 306 | +## 11. Cross‑references |
| 307 | + |
| 308 | +- `docs/ARCHITECTURAL-DECISIONS-2026-06-04.md` — ADR‑022 (boundary), |
| 309 | + ADR‑023 (IR‑as‑wire‑truth), ADR‑024 (palette256 + HHTL codec), |
| 310 | + ADR‑025 (probe‑free hot path). The pinned floors this doc sits on. |
| 311 | +- `docs/RDF-OWL-ALIGNMENT.md` §4.10 — the 4096‑dim Deep‑NSM encoder / |
| 312 | + Wierzbicka primes (`NUM_PRIMES = 63`, lance‑graph `nsm/encoder.rs`). |
| 313 | +- `lance-graph` PR #477 — `CausalEdge64`, the CAM‑PQ codebook |
| 314 | + (6 × 256), `nsm/nsm_word.rs`, the SoA envelope LE contract. |
| 315 | +- `lance-graph` PR #478 — singleton‑to‑snapshot nudge; read‑only |
| 316 | + codebooks (role keys `SUBJECT_KEY…`) stay as const tables. |
| 317 | +- `lance-graph` PR #470 + bardioc PR #18 — BindSpace dissolution, |
| 318 | + the cognitive‑shader‑driver target. |
| 319 | +- External specs (public): ITU‑T H.265 (HEVC/x265) CTU + SCC palette |
| 320 | + mode; ITU‑T H.266 (VVC/x266) CTU + QTMT; Fuji X‑Trans CFA; |
| 321 | + Vogel/phyllotaxis golden‑angle anti‑aliasing; Product Quantization |
| 322 | + (Jégou et al.). |
| 323 | + |
| 324 | +--- |
| 325 | + |
| 326 | +> **Reminder of status:** this is epiphany‑capture. The grades and the |
| 327 | +> `[per runtime session]` marks are the honest boundary between what the |
| 328 | +> OGAR session can stand behind and what awaits the runtime session's |
| 329 | +> internals. Optimize *from* this map; pin *into* ADR‑026 only the subset |
| 330 | +> that survives §10's confirmations. |
0 commit comments