diff --git a/.claude/PR-X12-docs-audit.md b/.claude/PR-X12-docs-audit.md index 76c04f49..94b01cb6 100644 --- a/.claude/PR-X12-docs-audit.md +++ b/.claude/PR-X12-docs-audit.md @@ -314,3 +314,58 @@ If you read nothing else of this audit: > verified by whole-file read. _Last edit: 2026-05-22._ + +--- + +## 8. Addendum — corrections applied (2026-07-16) + +This audit sat unapplied from 2026-05-22 to 2026-07-16 ("no edits made to +the audited docs"). The following recommendations were executed on branch +`claude/x265-x266-plans-review-h9osnl`: + +**Tier 2 targeted fixes (applied):** + +- Findings #1/#2/#3/#4 — R-7 inversion + fabricated symbols: corrected in + `pr-x12-canon-resolutions-delta.md` (§0 item 3, §3.2), + `pr-x12-substrate-canon-resolutions.md` (R-7, §12 item R-7), + `pr-x12-codec-cognitive-substrate-mapping.md` (§13.3), + `pr-x12-x265-blasgraph-gemm.md` (§1 table row 4, §2.4). blasgraph is + restored as canon; `ScalarCsr::spmv_min_plus` correctly named as the only + shipped min-plus (lossy sibling, prototype only); `tropical_spmv` / + `tropical_gemm` free-function citations removed. +- Finding #5 — `batched_ssd_search`: marked **[PLANNED symbol]** at every + citation site (delta §3.1, substrate-canon R-6, mapping §13.1, GEMM lens + §1/§5). +- Findings #6/#7 — per-arch DCT crossover constants: marked + **[UNCALIBRATED ESTIMATES]** in delta §6, substrate-canon R-5, GEMM lens + §2.2; the self-fabricating "Graviton=128" withdrawn from mapping §5.3. +- Finding #8 — "132,710 CTUs/frame" mislabel: fixed to leaves-at-8×8 in + delta §2.3 (budget recomputed per-leaf). Review follow-up (same day): + the count itself was also wrong — exact 8×8 accounting at 3840×2160 is + **129,600** leaves (padded 64×64: 2,040 CTUs → 130,560); the audit's own + finding #8 had accepted 132,710 as "correct-as-leaves," which it wasn't. + Budget recomputed to ~129 ns/leaf; the "~132K CTUs" figures in the three + RDO paragraphs corrected to ~2,040 CTUs; R-11 matrix row re-unitized to + ≤210 ns/leaf. +- Finding #9 — false `signature_kernel_pde` Goursat-PDE bug claim: + withdrawn at all four sites (delta §11/§12, substrate-canon R-14/R-15). +- Finding #19 — §9 falsifiability matrix: tagged FORWARD-CONDITIONAL + (Plan G binary does not exist; rows are planned tests, not passed ones). + +**Tier 1 (quarantined, rewrite still owed):** + +- `pr-x12-woa-multiarch-orchestration.md` and + `pr-x12-bgz-jc-substrate-synergies.md` carry ⛔ QUARANTINED headers + naming the findings and forbidding citation as evidence. Full rewrites + per §5 Tier 1 remain open work. + +**Status change since audit:** `src/hpc/codec/` now also contains `ans.rs` +(A7 rANS) and `rdo.rs` (A6 λ-RDO) — the audit-era debts D-CODEC-2 (P0) and +D-CODEC-3 (P1) have shipped code. Still no `ndarray-codec` crate (Plan H +unextracted). + +**New in the same pass:** the x265/x266 lens line is grounded against the +public JVET trajectory in `pr-x12-h266-h267-standards-landscape.md` +(H.266/VVC facts, ECM, NNVC, H.267 CfP-Jul-2026 → finalize-2028 timeline, +≥40%-over-VVC requirement), with a dated §12 reality-check addendum in +`pr-x12-x266-3dgs-spacetime-upscaling.md`. diff --git a/.claude/blackboard.md b/.claude/blackboard.md index 2f5b1cca..7fe3a8dc 100644 --- a/.claude/blackboard.md +++ b/.claude/blackboard.md @@ -679,3 +679,54 @@ parity CI + the matryoshka chacha20 fork. Plan in `.claude/CHACHA20_MATRYOSHKA_P Follow-ups (documented in `.claude/CHACHA20_MATRYOSHKA_PLAN.md`): wasm matryoshka backend (simd128 branch); cross-repo `[patch]` for MedCare-rs; the workspace default is x86-64-v3 (avx2) so ndarray_simd activates on avx512 builds only. + +--- + +## 2026-07-16 — PR-X12 x265/x266 plan review: audit applied + H.267 standards grounding + +- **PR-X12-docs-audit corrections finally APPLIED** (they had sat unapplied + since 2026-05-22): fabricated symbols marked ([PLANNED] `batched_ssd_search`; + `blasgraph::tropical_gemm` / `bgz17::tropical_spmv` removed — real min-plus is + method `ScalarCsr::spmv_min_plus`, lossy sibling); blasgraph restored as + bit-exact canon over bgz17; per-arch DCT crossovers tagged [UNCALIBRATED]; + false `signature_kernel_pde` Goursat-bug claim withdrawn (its convergence + tests pass); the R-11 unit is leaves-at-8×8 not CTUs, and the count itself + was corrected to 129,600 exact (padded 130,560; the old 132,710 was + ungrounded) → ~129 ns/leaf budget; §9 falsifiability matrix tagged + FORWARD-CONDITIONAL. Tier-1 docs (`woa-multiarch-orchestration`, + `bgz-jc-substrate-synergies`) ⛔ QUARANTINED pending rewrite. +- **NEW: `.claude/knowledge/pr-x12-h266-h267-standards-landscape.md`** — + sourced public-standards anchor: H.266/VVC (2020, ~40-50% over HEVC, dec + 1.5-2×/enc ~10×), ECM-16.1 (~27% over VTM, complexity flagged impractical), + NNVC v7 (NN in-loop ≈9% RA each — the antithesis of our anti-neural rule), + H.267 (CfP Jul 2026 → submissions Nov 2026 → evaluation Jan 2027 → finalize + ~2028; requirement ≥40% over VVC Main 10 at 4K+). "x266" in our docs = + PR-X12 3DGS scene codec, never H.266. +- x266 lens doc got §12 reality-check addendum + F-3b falsifier + (conventional-plus-neural acceptance risk); capstone + 3DGS plan index got + standards-watch sections. Watch dates: Nov 2026, Jan 2027. +- Status note: `src/hpc/codec/` now has `ans.rs` + `rdo.rs` (A7/A6 debts + D-CODEC-2/-3 have code); still no `ndarray-codec` crate (Plan H open). + +--- + +## 2026-07-16 (2) — H.268 codename + graded Morton/wgpu synergy matrix + +- **Codename ruling:** the "x266" placeholder (PR-X12 3DGS scene codec) is + internally codenamed **H.268** — INTERNAL ONLY, never an ITU designation + (H.267 itself is still prospective). Registered in the x266 lens header, + landscape doc, capstone, 3DGS plan index. +- **NEW: `.claude/knowledge/pr-x12-h268-morton-wgpu-synergies.md`** — the + "industry-impractical vs realistically-achievable" matrix, every claim + adversarially verified (workflow wf_6c6fb99a-cb4, 15 agents, file:line + receipts): 1× FEASIBLE-NOW (the scoping row), 2× NEEDS-PROBE, 7× + OVERCLAIM-CORRECTED. Load-bearing findings: wasm SIMD128 lane IS real + + CI-parity-verified (simd_wasm.rs; wasm-simd/parity-node); bgz17 256×256 + tables are texture-isomorphic (dense u16, R16Uint-ready) but zero GPU-LUT + code exists; ctu.rs is an ARENA tree (no Morton in codec dir) — flat + Morton SoA is an unimplemented refactor; D-PHASE/D-WHP are [H] with unrun + probes (J2 kill: dither-only); a2ui-paint wgpu = untested quad demo, + `webgl` feature unwired; ndarray deliberately "no GPU, no wgpu". +- **Probe queue established:** PROBE-GPU-LUT, PROBE-MORTON-CTU, + PROBE-RANS-INTERLEAVE (new names), + OGAR PHASE-1/PERT-RHO/PYR-1, + WHP-1..4, Plan E bits/Gaussian, a2ui N2 — each with pass/kill conditions. diff --git a/.claude/knowledge/pr-x12-bgz-jc-substrate-synergies.md b/.claude/knowledge/pr-x12-bgz-jc-substrate-synergies.md index 313833af..5e3ca7b4 100644 --- a/.claude/knowledge/pr-x12-bgz-jc-substrate-synergies.md +++ b/.claude/knowledge/pr-x12-bgz-jc-substrate-synergies.md @@ -1,5 +1,18 @@ # PR-X12 ↔ bgz family + jc proof crate — Substrate Synergies & Identified Gaps +> ⛔ **QUARANTINED — Tier-1 audit finding (2026-05-22, tagged 2026-07-16).** +> `.claude/PR-X12-docs-audit.md` findings #4, #17, #18: the §0 thesis +> force-couples the **lossy** bgz17 stack to the **bit-exact** codec mode +> taxonomy ("bgz17's 4-layer cascade IS the Skip/Merge/Delta/Escape grammar") +> — a soundness violation, not a unification; "HHTL 16×16×16 = 4096-leaf" +> matches no real codec (CAM-PQ is 6×256, `Codebook4096` is flat 4096, +> `HhtlDEntry` is 4×16×256); and §2.7 misattributes jc Pillar 11's theorem +> (path-signature uniqueness, not bgz bitstream uniqueness). §2.2 carries the +> correct nuance — read bgz17 / highheelbgz / bgz-hhtl-d / cam_pq as +> **siblings**, never substitutes for blasgraph. **Do not cite §0 / §2.5 / +> §2.7 / §4 / §7-§8 as evidence.** Pending rewrite per audit Tier-1 +> recommendation. +> > Date: 2026-05-22 > Status: **substrate grounding doc** — connects PR-X12's abstract substrate claims to the **already-implemented** crates in `lance-graph/crates/`. Companion to the five perspective lenses written 2026-05-22. > diff --git a/.claude/knowledge/pr-x12-cam-pq-sigker-dn-tree-substrate-bindings.md b/.claude/knowledge/pr-x12-cam-pq-sigker-dn-tree-substrate-bindings.md index e1deb77d..8de06b33 100644 --- a/.claude/knowledge/pr-x12-cam-pq-sigker-dn-tree-substrate-bindings.md +++ b/.claude/knowledge/pr-x12-cam-pq-sigker-dn-tree-substrate-bindings.md @@ -284,7 +284,7 @@ Updating the inventory from `pr-x12-bgz-jc-substrate-synergies.md` §7 with the | 4096-entry basin codebook | `bgz-tensor::Codebook4096` (literal 4096-entry type), trained by **`cam_pq`**. `bgz-hhtl-d` is a *different* basin-codebook strategy (4-basin × 16-HIP × 256-TWIG = 16,384-cell address space over a shared 256-entry palette) — not the canonical 4096 | | `CurveOrder` | `highheelbgz` spiral addressing | | `LinearReduce + Basis` | `bgz-tensor` AttentionSemiring + ComposeTable + DistanceTable; **`sigker::SignatureBasis`** (proposed) | -| Tropical-GEMM (R-7) | `bgz17::scalar_sparse::tropical_spmv` | +| Tropical-GEMM (R-7) | canonical home `lance-graph::blasgraph` (kernel unwritten); shipped min-plus is the method `bgz17::ScalarCsr::spmv_min_plus` [lossy sibling, prototype only — corrected 2026-07-16 per audit] | | Federated codebook (R-13) | `bgz-hhtl-d` shared-palette + **`cam_pq::CamCodebook`** + **`dn_tree`** (online update) + **`merkle_tree`** (integrity) | | Formal correctness — codec quantization | `jc` **Pillar 10 (Pflug-Pichler)** — nested-distance Lipschitz on Sigma DN-trees, certifies CAM-PQ tree quantization preserves FreeEnergy within Lε | | Formal correctness — path-signature lane | `jc` **Pillar 11 (Hambly-Lyons)** via **`sigker`** — certifies Index-regime classification (sigker only, not bgz) | @@ -335,15 +335,22 @@ Recommended edits to `pr-x12-canon-resolutions-delta.md`: > - **Quantization correctness (Pillar 10, Pflug-Pichler):** nested-distance Lipschitz on Sigma DN-trees — proves CAM-PQ tree quantization preserves FreeEnergy within Lε. This is the proof PR-X12 cites for "wire-format quantization is faithful." > - **Path-signature correctness (Pillar 11, Hambly-Lyons):** signature uniqueness on tree-quotient — proves any path is uniquely determined by its truncated signature up to tree-like equivalence. Active under `--features hambly-lyons` (since 2026-05-07, PR #348). This is the proof PR-X12 cites for the `SignatureBasis` lane (R-15). > -> Both pillars exist; the codec cites them and does not reprove. **Status: Pillar 10 active; Pillar 11 active under feature gate. Production-scale benchmarking + PR #350 (signature_kernel_pde math correction) — see Gap G-4.** +> Both pillars exist; the codec cites them and does not reprove. **Status: Pillar 10 active; Pillar 11 active under feature gate. Production-scale benchmarking — see Gap G-4.** *(Corrected 2026-07-16, audit #9: the "PR #350 signature_kernel_pde math correction" claim is withdrawn — the PDE form's convergence tests to `I₀(2·√⟨u,v⟩)` pass; there is no known bug.)* -**R-7 path correction** — the kernel home: +**R-7 kernel home** *(corrected 2026-07-16, audit #1-#4 — the earlier "path +correction" here had the canon/adapter relationship inverted)*: -> R-7 (corrected): tropical-GEMM lives at `lance-graph::bgz17::scalar_sparse::tropical_spmv` (not the abstract `blasgraph` namespace). The codec's tropical-GEMM RDO call is `bgz17::scalar_sparse::tropical_spmv(edge_weights, dag)`. +> R-7 (corrected): the canonical, bit-exact home for the tropical-GEMM +> partition kernel is `lance-graph::blasgraph`; that f32 min-plus kernel is +> UNWRITTEN today. The only shipped min-plus is the method +> `bgz17::ScalarCsr::spmv_min_plus` (`fn(&self, x: &[f32]) -> Vec`) — +> a lossy-sibling prototype, never a substitute for the blasgraph canon. +> The free function `tropical_spmv(edge_weights, dag)` cited previously +> does not exist. **R-15 (new candidate)** — signature-basis as Basis impl: -> R-15 (candidate): the substrate supports path-structured signals via `sigker::SignatureBasis: Basis`, alongside `DctIIBasis: Basis` (video) and `EwaSplatBasis: Basis` (3DGS). Implementation: ~1 week wrapper around `sigker::signature_kernel_pde`. **Plan G** gets a fifth lane (path-structured: audio waveform, time-series, gesture/handwriting). +> R-15 (candidate): the substrate supports path-structured signals via `sigker::SignatureBasis: Basis`, alongside `DctIIBasis: Basis` (video) and `EwaSplatBasis: Basis` (3DGS). Implementation: ~1 week wrapper around `sigker::signature_truncated` (the form Pillar 11 cites; the PDE form is equally sound — audit #9 — but the truncated path is what R-15 commits). **Plan G** gets a fifth lane (path-structured: audio waveform, time-series, gesture/handwriting). --- diff --git a/.claude/knowledge/pr-x12-canon-resolutions-delta.md b/.claude/knowledge/pr-x12-canon-resolutions-delta.md index fd6795b7..d6d03e88 100644 --- a/.claude/knowledge/pr-x12-canon-resolutions-delta.md +++ b/.claude/knowledge/pr-x12-canon-resolutions-delta.md @@ -13,7 +13,7 @@ The merged canon (`bc9da4ad`) argued the architecture; canon-resolutions makes i 1. **Concrete trait signatures** — R-1 (`Basis` + `LinearReduce` split), §8 surface (`PredictiveSignal`, `CurveOrder`, `RdoMetric`) 2. **Quantified budgets** — R-3 LoC envelope per sub-card / per consumer + audit rule; R-4 four Plan G thresholds; R-11 4K@60fps latency budget -3. **Math identities** — R-6 SSD-via-VNNI (`||A||² - 2A·B + ||B||²`), R-7 tropical-GEMM partition (`O(4^d) → O(d²)`, kernel at `bgz17::scalar_sparse::tropical_spmv`) +3. **Math identities** — R-6 SSD-via-VNNI (`||A||² - 2A·B + ||B||²`), R-7 tropical-GEMM partition (`O(4^d) → O(d²)`; kernel home is `lance-graph::blasgraph` [canonical, bit-exact]; the only shipped min-plus today is the method `bgz17::ScalarCsr::spmv_min_plus` — a sibling lossy-stack adapter, NOT the canon. Corrected 2026-07-16 per `PR-X12-docs-audit.md` #1/#2) 4. **Type-level invariants** — R-2 bit-15/bit-14 split, R-9 topology-FREE codec 5. **Phasing patterns** — R-8 confidence-gate framing, R-13 Option-A-then-B for federated codebook (primitives: `cam_pq` + `bgz-hhtl-d` + `dn_tree` + `merkle_tree`) 6. **Formal-correctness + stream lane (post-merge)** — R-14 (`jc::pflug` Pillar 10 + `jc::hambly_lyons` Pillar 11), R-15 (`SignatureBasis` as fifth Plan G lane) @@ -159,10 +159,14 @@ Three-way pass per load: (ratio + quality + LoC). Sub-threshold on any one = blo |---|---| | 4K resolution | 3840 × 2160 = 8.3 M pixels | | 60 fps | 16.67 ms/frame | -| 64×64 CTU | 132,710 CTUs/frame | -| **Per-CTU budget** | **125 ns/CTU** | +| 8×8 leaf | 129,600 leaves/frame (exact: 3840·2160/64; padded 64×64 accounting: 2,040 CTUs → 130,560 leaves) | +| **Per-leaf budget** | **~129 ns/leaf** (16.67 ms / 129,600) | -Encoder per-CTU breakdown: +> Corrected 2026-07-16 (audit #8 + review): the unit is 8×8 **leaves**, not +> 64×64 CTUs, and the previously-cited 132,710 count was not numerically +> grounded (exact 8×8 accounting gives 129,600; padded 64×64 gives 130,560). + +Encoder per-leaf breakdown: | Stage | Scalar reference | SIMD-batched target | |---|---|---| @@ -174,7 +178,7 @@ Encoder per-CTU breakdown: | rANS encode (A7) | ~40 ns | ~40 ns | | **Total** | **~960 ns** | **~210 ns** | -Scalar misses 60 fps by 7.6×; SIMD-batched misses by 1.7× (same OoM). **Pins B:D-CODEC-8 / A:T-7 from P2 → P1** — A4-impl and A6 must ship SIMD-batched, not scalar-then-vectorize. +Scalar misses 60 fps by ~7.5×; SIMD-batched misses by ~1.6× (same OoM). **Pins B:D-CODEC-8 / A:T-7 from P2 → P1** — A4-impl and A6 must ship SIMD-batched, not scalar-then-vectorize. --- @@ -198,7 +202,7 @@ A_batch @ B : N×256 @ 256×1 → N×1 GEMV **Throughput:** VNNI VPDPBUSD = 64 i8·i8→i32 dot-products per cycle on Cascade Lake+. One 256-elem dot = 4 VPDPBUSD ops = ~4 cycles. Hand-tuned SAD via VPSADBW = ~128 cycles per 16×16 block. **Speedup: 30-50×.** -**Layering:** lands as `batched_ssd_search` in `ndarray::hpc::blas_level2`. Not codec-specific. Codec uses the math; BLAS owns the math. +**Layering:** lands as `batched_ssd_search` in `ndarray::hpc::blas_level2`. Not codec-specific. Codec uses the math; BLAS owns the math. **[PLANNED symbol — does not exist in `blas_level2.rs` (verified absent 2026-05-22 audit #5, re-verified 2026-07-16). Do not cite as an existing API.]** ### 3.2 Tropical-GEMM partition RDO (R-7) @@ -215,11 +219,21 @@ Tropical-semiring (+, min) formulation: **Complexity:** `O(d² × |nodes|)`. For d=4, |nodes|=85: 1360 ops/CTU vs 21,760 naive. **~16× speedup.** -At 4K 132K CTUs/frame: ~4 ms vs ~64 ms just for partition RDO. At 60 fps, the difference between fitting and missing budget. +At 4K (~2,040 CTUs/frame; corrected 2026-07-16 — "132K" was the leaf count, not CTUs): ~2.8 ms vs ~44 ms just for partition RDO at ~1 op/ns. At 60 fps, the difference between fitting and missing budget. **Dep direction:** `ndarray-codec → lance-graph::blasgraph` (tropical-GEMM kernels nominally live in blasgraph). Allowed post-Plan-H because ndarray-codec is a sibling crate, not the bottom. -**Actual kernel home (current):** `lance-graph::bgz17::scalar_sparse::tropical_spmv`. The `blasgraph` namespace is the eventual abstraction; until that lands, ndarray-codec depends on bgz17 directly. Cite the symbol when wiring A6, not the namespace. +**Kernel home (corrected 2026-07-16, audit #1/#2):** `lance-graph::blasgraph` +is the **canonical, bit-exact** substrate — the prior framing here ("bgz17 is the +actual kernel home; blasgraph is the eventual abstraction") had the relationship +inverted. blasgraph today exports 7 HDR semirings over 16384-bit BitVec, none of +which is a numerical min-plus over weighted f32 edges — so the tropical-GEMM +partition kernel is **unwritten** and must land in blasgraph when A6 wires it. +The only shipped min-plus primitive is `bgz17::ScalarCsr::spmv_min_plus` +(a method on `ScalarCsr`, `fn(&self, x: &[f32]) -> Vec`; the free function +`tropical_spmv(edge_weights, dag)` cited earlier does not exist). bgz17 is a +**lossy sibling encoding** — usable as a prototype adapter for A6, never a +substitute for the bit-exact canon. **Plan A6 (1 week) ships this.** λ-RDO knob scales edge weights; tropical-GEMM relaxation computes optimal mode tree. @@ -322,7 +336,12 @@ FlushUnit::Reserved 11 ## 6. Cross-architecture DCT-II crossover (R-5) -DCT-II vs GEMM dispatch crossover varies by architecture. Plan A4-impl calibrates per arch: +DCT-II vs GEMM dispatch crossover varies by architecture. Plan A4-impl calibrates per arch. + +> **[UNCALIBRATED ESTIMATES — no measurement source]** (audit #6, marked +> 2026-07-16). Every crossover number below is a pre-bench heuristic, not a +> commitment. They stay in the table because they may be roughly right, but no +> codec-bench has run. Treat as hypotheses until Plan G produces measurements. | Architecture | Crossover N | Per-block path | Batched path | |---|---|---|---| @@ -368,7 +387,7 @@ Highlights of falsifiers — the canary tests: | R-1 | A7 has to subclass `LinearReduce` to make rANS work | Trait factoring wrong; A7 wastes 1.5 wks | | R-3 | Cumulative generic LoC > 1500 after A4-A8 | M:H-NEW-2 falsified; the abstraction grew domain-specific code | | R-9 | `grep -E 'North|East|West|South' src/hpc/codec/*.rs` returns production paths | Topology-free contract broken; consumer semantics leaked into codec | -| R-11 | SIMD-batched encode > 210 ns/CTU on SPR | Plan G video threshold can't pass; 4K real-time falsified | +| R-11 | SIMD-batched encode > 210 ns/leaf on SPR | Plan G video threshold can't pass; 4K real-time falsified | --- @@ -429,7 +448,7 @@ The substrate-binding doc (`pr-x12-cam-pq-sigker-dn-tree-substrate-bindings.md`) R-4's quality-floor rows for video / KV / gradient inherit Pillar 10's Lipschitz bound. R-15's signature lane gates on Pillar 11. -**Open work (G-4):** PR #350 corrects `sigker::signature_kernel_pde`'s known Goursat-PDE math bug; Pillar 11's probe deliberately uses `signature_truncated` (tensor-algebra) until PR #350 lands. Production-scale benchmarking pending. +**Open work (G-4):** Production-scale benchmarking pending. *(Corrected 2026-07-16, audit #9: the earlier claim that `sigker::signature_kernel_pde` "ships a known Goursat-PDE math bug" is withdrawn — the function's own passing tests prove convergence to `I_0(2·√⟨u,v⟩)` at `rel<1e-3` with O(1/N) refinement. Pillar 11's probe uses `signature_truncated` as a valid design choice, not a bug workaround.)* --- @@ -453,7 +472,7 @@ impl Basis for SignatureBasis { **Plan G gets a fifth lane: "stream signal"** — audio waveforms / time-series / gesture / handwriting paths. Codec is `SignatureBasis` + standard rANS over the four-mode taxonomy; quality floor inherits from Pillar 11 (R-14); compression target ~10× over raw f32 path samples (calibrate during Plan G). -**Why `signature_truncated` not `signature_kernel_pde`:** the PDE form ships a known divergence bug (PR #350). The tensor-algebra path is correct today and is what Pillar 11 cites. +**Why `signature_truncated` not `signature_kernel_pde`:** design choice — the tensor-algebra path is what Pillar 11 cites directly. *(Corrected 2026-07-16, audit #9: the previous "known divergence bug" rationale was false; the PDE form's convergence tests to `I_0(2·√⟨u,v⟩)` pass. Either form is numerically sound.)* --- diff --git a/.claude/knowledge/pr-x12-codec-cognitive-substrate-mapping.md b/.claude/knowledge/pr-x12-codec-cognitive-substrate-mapping.md index e40157ca..81aa3469 100644 --- a/.claude/knowledge/pr-x12-codec-cognitive-substrate-mapping.md +++ b/.claude/knowledge/pr-x12-codec-cognitive-substrate-mapping.md @@ -183,7 +183,7 @@ This is **the most underrated** of the four mappings. Optimizer research treats ### 5.3 The DCT-II / GEMM tradeoff (for downstream batched encode) -> [Resolved post-merge as **R-5**: per-arch crossover constants, calibrated by Plan G's `codec-bench`. Concrete defaults landed in canon-resolutions-delta §R-5 — SPR=64, ICX=32, Zen4=96, Apple M=256, Graviton=128. See `pr-x12-x265-blasgraph-gemm.md` §2.2 for the full GEMM-form derivation.] +> [Resolved post-merge as **R-5**: per-arch crossover constants, to be calibrated by Plan G's `codec-bench`. The candidate defaults in canon-resolutions-delta §R-5 (SPR≈64, ICX≈32, Zen4≈96, Apple M≈256) are **uncalibrated estimates** (audit #6, marked 2026-07-16); the previously-cited "Graviton=128" appears in no source doc and is withdrawn (audit #7 — self-fabricating cross-reference). See `pr-x12-x265-blasgraph-gemm.md` §2.2 for the GEMM-form derivation.] Single 32×32 DCT-II via butterflies: ~80 ops. Same via GEMM (`C = A @ DCT_BASIS`): ~32K ops. **Per-block, butterfly wins by 400×**. But: @@ -510,7 +510,7 @@ Six places where blasgraph + MKL change the algorithmic complexity, not just con ### 13.1 Block-matched ME → batched i8gemm (E-7) -> [Pinned as **R-6**: SSD-via-GEMM identity is the canonical ME path; the API lives at `ndarray::hpc::blas_level2::batched_ssd_search`. The 50× win is reproduced in the GEMM-lens companion doc; the bench is asserted by Plan G video lane (R-4).] +> [Pinned as **R-6**: SSD-via-GEMM identity is the canonical ME path; the API is **planned** for `ndarray::hpc::blas_level2::batched_ssd_search` — the symbol does not exist yet (audit #5, re-verified 2026-07-16; `blas_level2.rs` ships only the 8 classical L2 methods). The 30-50× estimate is derived in the GEMM-lens companion doc; the bench is asserted by Plan G video lane (R-4) when it ships.] Classical ME: SAD over 32×32 window. Reformulate as SSD via `||A||² - 2A·B + ||B||²` — middle term is a GEMM. AVX-512 VNNI `i8gemm_i32` does a whole CTU's motion candidates in one call. **~50× over hand-tuned NEON/AVX2 SAD.** @@ -520,9 +520,9 @@ Per-block butterfly wins for single 32×32. Per-frame batched `C = A_batch @ DCT ### 13.3 CTU partition mode-decision as tropical-GEMM (E-8) -> [Pinned as **R-7**: tropical-GEMM kernel lives in `lance-graph::blasgraph::tropical_gemm`; the codec calls into it. The `ndarray-codec → lance-graph` dep direction was confirmed *allowed* post-merge (both are sibling crates above `ndarray::hpc` and below `woa-rs`). See R-7 in the delta doc for the dep-graph audit.] +> [Pinned as **R-7**: the tropical-GEMM kernel's canonical home is `lance-graph::blasgraph` — but the symbol `blasgraph::tropical_gemm` **does not exist** (audit #3, corrected 2026-07-16; blasgraph's 7 HDR semirings are binary-Hamming over 16384-bit BitVec, no numerical min-plus). The kernel is unwritten; the only shipped min-plus is `bgz17::ScalarCsr::spmv_min_plus` (lossy sibling, prototype only). The `ndarray-codec → lance-graph` dep direction was confirmed *allowed* post-merge (both are sibling crates above `ndarray::hpc` and below `woa-rs`). See the corrected R-7 in the delta doc.] -x265 spends ~30% CPU on recursive partition RDO. Reformulate: each partition is a node in an 85-node DAG, edges = split/merge transitions, weights = ΔRDO. Optimal partition = shortest path. blasgraph's tropical-semiring GEMM (`D ← min(D, D + W)`) solves all partitions in **one batched matrix-relax**. `O(4^d)` → `O(d²)` per CTU. +x265 spends ~30% CPU on recursive partition RDO. Reformulate: each partition is a node in an 85-node DAG, edges = split/merge transitions, weights = ΔRDO. Optimal partition = shortest path. A **planned** tropical-semiring GEMM in blasgraph (`D ← min(D, D + W)`; unwritten today, per the R-7 correction above) would solve all partitions in one batched matrix-relax — the `O(4^d)` → `O(d²)` reduction holds algebraically but the speedup is **conditional on the future A6 partition bench** confirming it on real edge weights. ### 13.4 CABAC context modeling → tiny transformer (E-9) diff --git a/.claude/knowledge/pr-x12-h266-h267-standards-landscape.md b/.claude/knowledge/pr-x12-h266-h267-standards-landscape.md new file mode 100644 index 00000000..9bc17f2e --- /dev/null +++ b/.claude/knowledge/pr-x12-h266-h267-standards-landscape.md @@ -0,0 +1,218 @@ +# PR-X12 — H.266/VVC · ECM · NNVC · H.267 Public-Standards Landscape + +> READ BY: savant-architect, codec-architect, l3-strategist, sentinel-qa, +> product-engineer, truth-architect. +> +> Date: 2026-07-16 +> Status: **research doc — externally sourced.** Every load-bearing number +> here carries a source (§8). This doc grounds the PR-X12 "x265/x266" lens +> cluster in the *actual* JVET/MPEG standards trajectory, so the workspace's +> codec claims are benchmarked against the public state of the art rather +> than against a 2013-era HEVC strawman. +> +> **Naming disambiguation (read first):** the workspace doc +> `pr-x12-x266-3dgs-spacetime-upscaling.md` uses "x266" loosely for +> "our next-gen 3DGS scene codec." That is NOT H.266/VVC (finalized 2020, +> already shipping) and NOT the real x266 encoder project (an x265-style +> VVC encoder effort). Where precision matters, say **"PR-X12 3DGS scene +> codec"** for ours and **H.266/VVC**, **ECM**, **NNVC**, **H.267** for the +> standards-track artifacts. This doc is the reference for the latter four. +> +> **Codename update (2026-07-16):** the internal codename for the PR-X12 +> 3DGS scene codec is **H.268** (replacing the "x266" placeholder in prose; +> filenames keep the historical slug). INTERNAL ONLY — never an ITU +> designation. Ruling + graded feasibility matrix: +> `pr-x12-h268-morton-wgpu-synergies.md`. + +--- + +## 1. H.266 / VVC — the shipped baseline (finalized July 2020) + +| Fact | Value | Confidence | +|---|---|---| +| Finalized | July 2020 (ITU-T H.266 / ISO/IEC 23090-3) | [G] | +| Bitrate savings vs HEVC | **up to ~50% subjective** at equal quality; objective (PSNR/BD-rate) studies report **~31-40%**, ~36% average for VTM | [G] | +| Decoder complexity vs HEVC | **~1.5-2×** (150-200% depending on configuration) | [G] | +| Encoder complexity vs HEVC | **up to ~10×** (VTM vs HM reference) | [G] | +| Market adoption (2026) | still small; the "H.266/VVC <5% market share" claim in the x266 lens doc's F-3 falsifier remains directionally true | [H] | + +Two VVC facts matter directly to the PR-X12 lens set: + +1. **Reference Picture Resampling (RPR)** — VVC already ships codec-native + resolution switching, but as a *2D resample*. This is the weak sibling of + the PR-X12 3DGS-lens claim (`Basis` swap → re-rasterization from a 3D + scene model). The lens doc's §1 characterization ("H.266/VVC adds RPR, but + it's still a 2D resample, not a 3D-scene-aware reconstruction") is + **confirmed accurate** against public sources. +2. **The complexity asymmetry** (10× encode, 2× decode) is the pattern + PR-X12's GEMM thesis targets: the encode-side inner loops (ME, transform, + RDO) are exactly the stages `pr-x12-x265-blasgraph-gemm.md` maps to BLAS. + VVC's toolset was frozen against ~2018 hardware; the same + "hardware-floor inversion" argument the GEMM lens makes for HEVC/2013 + applies to VVC/2020 (no AMX, VNNI barely shipping). + +## 2. ECM — Enhanced Compression Model (the conventional H.267 track) + +JVET's post-VVC exploration software, the likely foundation of H.267: + +| Fact | Value | Confidence | +|---|---|---| +| ECM-16.1 BD-rate gain vs VTM-11 | **~27%** (Random Access) | [G] | +| ECM-13..15 typical figures | ~25% RA; **up to ~40% for screen content** | [G] | +| ECM-1.0 (2021 start) | ~12% RA — gains accreted tool-by-tool over ~15 versions | [G] | +| Complexity | high on both sides; industry commentary: "**far too complex**" for practical deployment as-is | [H] | +| Benchmark position | best overall coding performance vs AVM (+16.1%) and learned codecs (DCVC-FM +11%) in low-delay benchmarking | [G] | + +**Architectural reading for PR-X12:** ECM is the *tool-accretion* strategy — +more modes, more context models, more per-block branching. It buys ~27% at a +complexity cost the industry itself flags as impractical. PR-X12's bet is +orthogonal: keep the mode taxonomy small (Skip/Merge/Delta/Escape) and win +the *implementation* dimension by reformulating inner loops as GEMM against +the 2026 hardware floor (VNNI/AMX/BF16). These are complementary, not +competing: an ECM-class toolset running on per-pixel scalar loops and a +4-mode codec running on tile GEMM are different points on the +(compression-ratio × watts × latency) surface. PR-X12 should **benchmark +against x265/VTM as ratio baseline but against ECM's complexity trajectory +as the cautionary tale** — every tool added to the codec body must survive +the R-3 LoC envelope precisely because ECM shows where unbounded tool +accretion lands. + +## 3. NNVC — Neural Network Video Coding (the learned H.267 track) + +| Fact | Value | Confidence | +|---|---|---| +| First common software (NCS-1.0) | two NN in-loop filter tools, **8.71% / 9.44%** RA gain each | [G] | +| Current software | NNVC at **version 7+** of algorithm/software spec | [G] | +| Adopted tool classes | NN intra prediction + NN in-loop filtering | [G] | +| Canonical reference | arXiv:2309.05846 "Designs and Implementations in Neural Network-based Video Coding" | [G] | +| Deployment blocker | decoder-side kMAC/pixel cost; industry (Samsung at ITU 2025 workshop): **low decoder complexity, especially mobile, matters more than bitrate alone** | [H] | + +**Architectural reading for PR-X12:** NNVC is the *direct antithesis* of the +workspace's anti-neural rule (`pr-x12-anti-neural-lookup-inversion.md`: +"NNs may train tables; NNs must not sit in the codec hot loop"). JVET is +putting NNs *in* the decode loop; PR-X12 compiles learned structure into +frozen lookup tables (k-means basins, distance LUTs, Gaussian-tail rANS) +so the hot loop stays deterministic table-lookup + GEMM. The public record +now supplies evidence for both directions: + +- *For NNVC:* every single CfE response for H.267 incorporated some form of + NN tool — the field has voted. +- *For the inversion:* the decoder-complexity/power pushback (Samsung et + al.) is precisely the failure mode the anti-neural rule predicts. The + reproducibility argument needs stating precisely: a *standardized* + NN-in-loop codec can be bit-exact (JVET conformance requires fixed-point + decode), so "NN = nondeterministic" is wrong as a universal claim. The + PR-X12 advantage is **reproducibility-by-construction and governance**: + closed-form math with no model artifact to pin, version, or govern — + versus NN tools whose reproducibility depends on disciplined model + pinning and whose behavior is not analytically auditable (x266 lens §7). + Un-standardized AI-upscaler pipelines (DLSS-class, RIFE-class) DO drift + across model versions; that comparison stands unqualified. + +This — stated in the qualified form above — is the sharpest external +differentiator the PR-X12 line has. Keep it, and keep it precise. + +## 4. H.267 — the process, the requirement, the dates + +| Milestone | Date | Status (2026-07-16) | +|---|---|---| +| Joint CfE issued (ITU-T SG21 + ISO/IEC MPEG WG04) | 2024-2025 | done | +| CfE responses evaluated (40th JVET meeting, Geneva) | **October 2025** | done — best responses ~**30% over VVC**, all with NN tools; "conventional-plus-neural" is the emergent architecture | +| **Final Call for Proposals** | **July 2026 — NOW** | in flight | +| CfP submissions due | November 2026 | upcoming | +| Proposal evaluation / collaborative-phase launch | **January 2027** (key milestone) | upcoming | +| Target finalization | July-October **2028** (some projections ~2030) | projected | +| Meaningful deployment (historical lag) | ~2034-2036 | projected | + +**The requirement (JVET, July 2024):** ≥**40% bitrate reduction vs VVC +Main 10** for 4K-and-above at similar subjective quality, while remaining +implementable in real-world encoders/decoders with controlled decoder +complexity and power. Scope explicitly includes HDR, 8K, gaming, and +user-generated content. + +**What this gives PR-X12, concretely:** + +1. **An external stretch anchor.** R-4's video threshold is anchored to + x265 ultrafast; the H.267 requirement (VVC −40%) defines the public + 2028 frontier. A Plan G stretch row "ratio vs VTM" places PR-X12 on the + same axis the standards world uses. +2. **A timing window.** H.267 finalizes ~2028 and deploys ~2034+. The x266 + lens doc's conservative estimate (24-36 months from PR-X12 merge to a + 3DGS scene codec) lands *years* inside the deployment gap — a + deterministic scene codec does not have to outrun H.267 adoption, only + NN-upscaler pipelines. +3. **A falsifier update.** The lens doc's F-3 ("wire format ossifies; VVC + story — <5% share in 2026") stays valid; add F-3b: *if the January 2027 + CfP evaluation converges on a conventional-plus-neural design whose + decoder complexity is accepted by the mobile vendors, the + "determinism-as-differentiator" argument weakens for consumer video* — + though it survives untouched for legal/medical/scientific recording. + +## 5. Side activities worth one line each + +- **MPEG-AI / VCM (Video Coding for Machines):** coding for machine + consumption (surveillance, autonomous vehicles) — adjacent to the + PR-X12 cognitive-cell load, where the "viewer" is also a machine. +- **MPAI-EEV (v4):** end-to-end neural video coding outside JVET — the + fully-learned pole of the spectrum; no commercial readiness reported. +- **AVM (AOMedia Video Model):** AV1's successor exploration; ECM + currently leads it by ~16% in JVET-side benchmarking [H — single-source]. + +## 6. Hardening actions applied to the PR-X12 plan set (2026-07-16) + +| # | Action | Where | +|---|---|---| +| H-1 | Naming disambiguation — "PR-X12 3DGS scene codec" vs H.266/H.267 | this doc header; x266 lens addendum | +| H-2 | ECM complexity trajectory adopted as the R-3 LoC-envelope cautionary anchor | §2 | +| H-3 | NNVC named as the explicit antithesis of the anti-neural rule; determinism differentiator sharpened with Samsung complexity evidence | §3 | +| H-4 | H.267 requirement (VVC −40% @ 4K+) recorded as external stretch anchor for Plan G | §4 | +| H-5 | Standards-watch calendar: **Jul 2026 CfP (now) → Nov 2026 submissions → Jan 2027 evaluation → 2028 finalization** | §4 table | +| H-6 | F-3b falsifier added to the x266 lens (conventional-plus-neural acceptance risk) | §4; x266 lens addendum | +| H-7 | Audit Tier-2 corrections applied to the canon docs in the same PR (fabricated symbols marked, uncalibrated numbers tagged, PDE-bug claim withdrawn) | `PR-X12-docs-audit.md` addendum | + +**Standing watch rule:** any session citing "H.267" or "beyond-VVC" numbers +re-checks §4's table against the JVET document registry if more than ~6 +months have passed since the last-edit date below. The CfE→CfP→evaluation +cadence moves roughly twice a year (JVET meets quarterly). + +## 7. Reading list (arXiv / primary) + +- arXiv:2309.05846 — *Designs and Implementations in Neural Network-based + Video Coding* (the NNVC reference) +- arXiv:2404.07872 — *Video Compression Beyond VVC: Quantitative Analysis + of Intra Coding Tools in ECM* (per-tool gain attribution) +- arXiv:2503.18679 — *Merge Mode for Template-based Intra Mode Derivation + (TIMD) in ECM* (example of ECM tool-accretion granularity) +- arXiv:2408.05042 — *Benchmarking Conventional and Learned Video Codecs + with a Low-Delay Configuration* (ECM vs AVM vs DCVC-FM numbers) +- arXiv:2005.10801 — *Complexity Analysis of Next-Generation VVC Encoding + and Decoding* (the 10×/2× VVC complexity source) +- arXiv:2310.13093 — *Video Quality Assessment and Coding Complexity of + the VVC Standard* (the ~31-40% objective-gain source) +- JVET-AA0006 — *AHG report: ECM software development* (complexity + reporting home) +- Kerbl et al. SIGGRAPH 2023 (3DGS), Zwicker et al. 2001 (EWA) — carried + over from the x266 lens doc's list; the scene-codec math is unchanged. + +## 8. Sources (web, retrieved 2026-07-16) + +- Ofinno, "The Next-Generation Video Coding Race Heats Up" (40th JVET + meeting readout: CfE evaluation Oct 2025, ~30%-over-VVC best responses, + all-NN-flavored, Jan 2027 CfP milestone, ~2030 collaborative completion, + decoder complexity/power requirement) +- Streaming Learning Center, "AI Video Compression Standards: Who's Doing + What and When" (ECM-15 ~25% RA / 40% SC; NNVC v7; H.267 finalization + Jul-Oct 2028; deployment 2034-2036; MPEG-AI/VCM/MPAI-EEV; Samsung + decoder-complexity position) +- Streaming Media, "H.267: A Codec for (One Possible) Future" + Rethink, + "H.267 — VVC's heir officially proposed" (requirement: ≥40% vs VVC + Main 10 at 4K+, July 2024 JVET timeline document) +- themoonlight.io review of arXiv:2509.25668 (ECM-16.1 = 27.06% BD-rate + vs VTM-11.0) +- kpubs/KIBME, Choi, "Neural Network based Video Coding in JVET" + (NCS-1.0 filter gains 8.71%/9.44% RA) +- Elecard, "A review of the VVC codec" + Spin Digital VVC page (VVC + decoder 150-200% of HEVC; up-to-50% subjective savings; ~36% objective) +- Wikipedia, "Versatile Video Coding" (finalization date, profile facts) + +_Last edit: 2026-07-16._ diff --git a/.claude/knowledge/pr-x12-h268-morton-wgpu-synergies.md b/.claude/knowledge/pr-x12-h268-morton-wgpu-synergies.md new file mode 100644 index 00000000..31fc47b1 --- /dev/null +++ b/.claude/knowledge/pr-x12-h268-morton-wgpu-synergies.md @@ -0,0 +1,129 @@ +# PR-X12 / H.268 — Morton-Cascade × Perturbation-Pyramid × wgpu/wasm Synergies (graded) + +> READ BY: savant-architect, codec-architect, l3-strategist, truth-architect, +> sentinel-qa, product-engineer, vector-synthesis. +> +> Date: 2026-07-16 +> Status: **graded synthesis** — every row below carries a verdict from an +> adversarial verify pass (10 claims × skeptic agents with file:line receipts, +> run under the PR-X12-docs-audit discipline). Verdicts: **FEASIBLE-NOW** +> (shipped or trivially composable from shipped pieces), **NEEDS-PROBE** +> (plausible, gated on a named unrun probe/bench), **OVERCLAIM-CORRECTED** +> (the naive claim failed against source; the corrected wording is what this +> doc carries). Nothing here is presented above its evidence grade. + +--- + +## 0. Codename ruling — H.268 (INTERNAL) + +**"H.268" is the internal codename for what the doc set previously called +"x266"** — the PR-X12 3DGS scene codec / deterministic beyond-standards +track (`pr-x12-x266-3dgs-spacetime-upscaling.md`). + +- INTERNAL ONLY. It is **not** an ITU designation and must never be + presented as one: H.267 itself is still a prospective standardization + effort (CfP July 2026, finalize ~2028), and a real ITU "H.268" would be + a 2030s artifact. The codename encodes intent — *the generation after + the one currently being standardized* — nothing more. +- Filenames keep the historical `x266` slug (link stability); prose says + "H.268 (internal codename)" on first use. +- Never in commit messages to public-facing artifacts as a standards claim; + never in marketing copy without the INTERNAL qualifier. + +--- + +## 1. The hand we actually hold (verified FINDINGs, whole-file receipts) + +| Substrate | Status | Receipt | +|---|---|---| +| **wasm SIMD128 backend** — `F32x16=[v128;4]`, `F64x8`, `I8x16` (incl. W1a primitives), `U32x16` ARX; kernels `hamming_u8x64_wasm` (Fingerprint<256>), `base17_l1_wasm`, `codebook_gather_f32x4_wasm`, `dot_f32x4_wasm`; optional relaxed-simd madd | FINDING — CI bit-parity-verified under Node 22 (`wasm-simd/parity-node`) | `src/simd_wasm.rs:65,87,742,1060,1108`; `.github/workflows/ci.yaml:115-142`; `crates/wasm-simd-parity/src/lib.rs:13-67` | +| **Browser crypto lane** — vendored chacha20 `ndarray_simd` backend lowers the same `U32x16` to AVX-512 on server and v128 on browser | FINDING (shipped 2026-07-12; CI compile-guarded) | `vendor/chacha20/src/backends.rs:11-18` | +| **Codec wire format** — 16-bit header: 12-bit basin + 2-bit mode (Skip/Merge/Delta/Escape) + 2 reserved; `pack_leaf` 2/3/3/6 bytes; integer-only rANS mode coder (static per-block tables, no float, no unsafe) | FINDING | `src/hpc/codec/mode.rs:15-41,94,212-295`; `src/hpc/codec/ans.rs:1-56` | +| **256×256 tables are texture-isomorphic** — bgz17 `PaletteDistanceTable` is a dense, zero-padded row-major `vec![0u16; 256*256]` (≡ one R16Uint texture); compose = k×k u8 (≡ R8Uint); bgz-tensor Attention/Compose tables mirror; lookups exact, no filtering semantics | FINDING (shape); GPU realization ABSENT | `lance-graph crates/bgz17/src/palette.rs:77-88`, `palette_semiring.rs:20-43` | +| **Morton 2bit×2bit primitives exist** — lance-graph `FacetTier::morton` (4⁴ nibble ancestry), symbiont `morton4`, perturbation-sim cascade keys; OGAR 3×4 canon pins tier-of-level = `>>2` shift [G] | FINDING (primitives); the CTU codec does NOT use them (see §3 row 1) | lance-graph facet/symbiont sources; OGAR `CLAUDE.md` §3×4 | +| **Certificate-gated cascade** — splat3d `depth_cascade.rs`/`depth_cert.rs`: HEEL→HIP→TWIG→LEAF preselection with Reject/KeepCoarse/Refine/ProjectExact/RenderExact actions | FINDING — but it gates **render** work on decoded data, not decode work | `src/hpc/splat3d/depth_cascade.rs:1-65` | +| **Deterministic phase generator** — helix `CurveRuler` stride-4-over-17 coprime walk (bit-exact integer, full-17 permutation tests) | FINDING (the generator leg of the pyramid) | lance-graph `crates/helix` | +| **wgpu in the workspace** — a2ui-paint only: **off-by-default** feature, constant-color quad pipeline, **no textures/bind groups**, wgpu's `webgl` cargo feature NOT enabled (WebGL2 is doc-comment-only), untested, repo has no CI. ndarray itself: **zero wgpu by design** ("no GPU, no wgpu", splat3d) | FINDING (negative) | a2ui-rs `a2ui-paint` manifest+src; ndarray `Cargo.lock` (0 matches), `src/hpc/splat3d/mod.rs:7-9` | +| **Perturbation pyramid + two-algebra rule** — D-PHASE and D-WHP are operator-pinned **[H] hypotheses with named unrun probes** (PHASE-1, PERT-RHO, PYR-1; WHP-1..4), CANON-pin not CODED; losslessness fenced to *synthesis* (dither/anti-moiré grade) with quorum-certificate escalation | CONJECTURE [H], probe-gated | OGAR `docs/DISCOVERY-MAP.md:249-250`, `CLAUDE.md` fences; J2 kill condition | + +## 2. The industry walls (from `pr-x12-h266-h267-standards-landscape.md`, sourced) + +W1 — **Complexity spiral:** ECM-16.1 buys ~27% over VTM-11 at complexity the +industry itself calls impractical. W2 — **NN-in-loop decoder cost:** NNVC +filters ≈9% RA each at kMAC/pixel costs; mobile vendors weight decoder +complexity above bitrate. W3 — **No browser story:** no post-VVC codec has a +credible wasm/WebGL deployment path; VVC browser decode is effectively absent. +W4 — **Upscaler drift:** un-standardized AI upscaling (DLSS/RIFE-class) is +non-reproducible across model versions; standards-track upscaling is 2D RPR +only. W5 — **3DGS delivery weight:** stock web viewers ship tens of MB per +scene. W6 — **Serial entropy:** CABAC's per-bit context serialization resists +GPU/SIMD decode. + +## 3. The graded synergy matrix + +| # | Industry wall | Naive synergy claim | **Verdict** | What is true (corrected wording) | Gate | +|---|---|---|---|---|---| +| 1 | W1 (tree-walk partitioning) | "Morton 2bit×2bit makes the CTU quad-tree flat address arithmetic" | **OVERCLAIM-CORRECTED** | Shipped Morton primitives prove a 4-level quadtree address CAN be pure shift/interleave math — but the shipped `ctu.rs` stores an **arena tree with `[NodeIdx;4]` child links and O(N) BFS walks**, zero Morton code in the codec dir. The flat 85-slot SoA re-plumb (1+4+16+64, index computable from address) is a plausible, unimplemented refactor with unmeasured GPU/wasm advantage | **PROBE-MORTON-CTU** (new): flat Morton-addressed arena vs pointer arena, bench partition sweep | +| 2 | W3 (browser LUT decode) | "256-palettes are textures; decode = one texelFetch on WebGL2/WebGPU" | **NEEDS-PROBE** | The data shapes are texture-isomorphic **today** (dense 256×256 u16 / k×k u8, exact unfiltered lookups — R16Uint/R8Uint + `texelFetch`/`textureLoad` is standard practice); a full SPO distance = 3 fetches, CAM-PQ path = 6, multi-hop compose = dependent-fetch chain. **Zero GPU-LUT code exists**; a2ui-paint has no textures and no `webgl` feature | **PROBE-GPU-LUT**: upload bgz17 tables, fragment-shader distance parity vs `batch_palette_distance`, on wgpu gles (WebGL2) + WebGPU | +| 3 | W4 (deterministic upscaling) | "Perturbation pyramid = synthesis-lossless reconstruction at arbitrary density, zero NN" | **OVERCLAIM-CORRECTED** | D-PHASE [H]: magnitude-only storage + address-derived deterministic phase is the *design*; the shipped leg is the `CurveRuler` coprime generator. Losslessness is fenced to **synthesis (dither/anti-moiré grade)** — treating it as *content* reconstruction is exactly falsification joint **J2** ("lossless-for-synthesis scope drift"; kill = all codec-savings claims struck) | OGAR **PHASE-1** (file absent), **PERT-RHO** (escalation rate must be reported), **PYR-1** | +| 4 | W2 (decoder complexity wall) | "Certificate-gated skip makes decoder work scale with the viewed region" | **OVERCLAIM-CORRECTED** | The cascade-skip pattern is shipped **for render preselection** on decoded data. Decode-side region scaling needs the unshipped A8 stream framing (region-addressable CTU markers), a codec region index (explicitly deferred), and a reconstruction-error certificate (depth_cert certifies a different quantity). Skip rates (95/60/30) are unmeasured doc claims | A8 + **PROBE-REGION-DECODE**; measure skip rates | +| 5 | W3 (two-tier browser lane) | "wasm SIMD128 + wgpu = CPU decode + GPU raster in browser, today" | **OVERCLAIM-CORRECTED** | The **CPU-wasm foundation is real and CI-parity-verified**; the codec itself is scalar (F32x16 CTU sweep is a documented follow-up) and the GPU tier is absent (a2ui-paint = untested quad demo, WebGL2 unwired). Two-tier is a **roadmap**: (a) SIMD-batched CTU sweep, (b) wasm32-tested wgpu raster with `webgl` + texture upload (a2ui N2), (c) a bridge crate that doesn't exist | codec SIMD sweep (predict.rs:55-58) + a2ui N2 + bridge | +| 6 | W6 (serial entropy) | "rANS + 2-bit alphabet = GPU-parallel entropy decode; 4×4 = workgroup tiling" | **OVERCLAIM-CORRECTED** | Shipped rANS is **single-state scalar**; but each CTU's tag stream is self-contained (count + table in header), so **CTU-granular parallel decode works today on any host incl. wasm**. Interleaved N-state lane rANS (the genuinely GPU/SIMD form) is unimplemented. The 4×4 ergonomics belong to the 3DGS/L4 substrate, NOT this codec (64×64 CTU / 8×8 leaf) — drop that fusion | **PROBE-RANS-INTERLEAVE** (new) | +| 7 | W2 (NN governance) | "Anti-neural discipline achieves reproducibility at browser complexity" | **OVERCLAIM-CORRECTED** | The discipline is a design rule, correctly stated in *qualified* form (standardized NN decode can be bit-exact; our differentiator is **no model artifact to pin/version/govern**). The shipped substrate is *consistent* with it (integer-only codec fragment, exact LUTs) but **no end-to-end decoder exists** (A3 ships encoder direction only; A4/A8 deferred; zero GEMM in the shipped codec) — you cannot claim a decoder property for a decoder that doesn't exist | end-to-end decode path (A4/A8) then complexity measurement | +| 8 | W5 (3DGS web streaming) | "~4 bits/Gaussian + wgpu raster = web-streamable scenes now" | **OVERCLAIM-CORRECTED** | R-10 is paper math with an **assumed** 60/20/15/5 mode mix and an unrun bench gate; IF Plan E confirms ~4 bits/Gaussian, 1M-Gaussian scenes ≈ 500 KB (~100× under stock PLY viewers). Today: mode/rANS coder is for cognitive cells (not splats), the splat codec is absent, and the renderer is deliberately CPU-only | **Plan E bench** (bits/Gaussian on Mip-NeRF 360) | +| 9 | GPU determinism | "Two-algebra rule (XOR/bundle) ports bit-exact to WGSL" | **OVERCLAIM-CORRECTED** | IF a GPU port were built: sign side = u32 xor (order-independent, trivially bit-exact); magnitude side needs 8-bit lanes **packed into u32 with emulated saturation** (WGSL has no u8) and is bit-exact **only with pinned accumulation order** (saturating add is non-associative). Integer LUTs port bit-exactly by construction. Float EWA is never bit-exact across GPUs — keep it outside all bit-exactness claims. D-WHP itself is [H], probes WHP-1..4 unrun, CPU-only parity scope | WHP-1..4 (add a GPU arm to WHP-2 if the port is attempted) | +| 10 | (scoping) | "We don't race ECM/H.267 BD-rate; no browser encode; WebGL2 prefix-scan limits acknowledged" | **FEASIBLE-NOW** | All three exclusions verified against shipped code; positive claims stay scoped to predictable-codebook signals + 3DGS/tensor loads, and even there only to shipped mechanism — no BD-rate, fps, or skip-rate figure is measured yet | — (this row IS the discipline) | + +## 4. So what CAN we honestly say vs the industry? (the synthesis) + +**Where the industry wall is real and our position is genuinely differentiated:** + +1. **The browser foundation exists and theirs doesn't.** A CI-bit-parity- + verified wasm SIMD128 kernel lane (Hamming-on-Fingerprint, Base17, + codebook gather, ARX) plus table shapes that are already + texture-isomorphic is a *foundation* no post-VVC codec effort has. What's + missing on our side is composition (SIMD CTU sweep, GPU LUT probe, bridge + crate) — engineering, not research. +2. **Decoder-side determinism-by-construction remains the moat** — in the + qualified form: no model artifact to pin, version, or audit; integer + tables + closed-form math. The industry's own CfE record (every response + NN-flavored) plus the mobile decoder-complexity pushback makes this the + one axis where the "impractical" judgment *helps* us: they declared the + tables-only path insufficient for BD-rate racing, and we never entered + that race (row 10). +3. **The complexity inversion is a hypothesis we can actually test cheaply.** + The industry wall is "gains cost decoder complexity." Our counter-shape — + address-arithmetic partitioning (row 1), region-scaled decode (row 4), + CTU-granular then lane-parallel rANS (row 6) — is fully probe-able on + shipped substrate within single-PR-sized efforts, unlike ECM tool + ablations. + +**Where "impractical" stays true for us too (do not drift):** general-video +BD-rate competition, browser-side encoding/3DGS fitting, content-grade (vs +dither-grade) pyramid reconstruction until PHASE-1/PERT-RHO/PYR-1 run, and +any float-path GPU bit-exactness claim. + +## 5. Probe queue (ordered, with kill conditions) + +| Probe | Question | Pass | Kill | +|---|---|---|---| +| PROBE-GPU-LUT | bgz17 256×256 tables as R16Uint/R8Uint; fragment-shader distance == `batch_palette_distance`? | bit-parity on wgpu gles + WebGPU | GPU lane abandoned for LUTs; CPU-wasm only | +| PROBE-MORTON-CTU | flat Morton-addressed 85-slot SoA vs shipped arena tree | ≥2× partition-sweep throughput, code no larger | keep arena; Morton stays address-canon only | +| PROBE-RANS-INTERLEAVE | N-state interleaved rANS, wasm SIMD128 lanes | ≥4× decode throughput vs scalar at equal ratio | CTU-granular parallelism declared sufficient | +| OGAR PHASE-1 / PERT-RHO / PYR-1 | phase determinism; escalation rate; pyramid roundtrip | per OGAR canon | **J2**: D-PHASE stays dither-only; all codec-savings claims struck | +| WHP-1..4 (+GPU arm) | two-algebra pyramid parity | per OGAR canon | magnitude side stays CPU | +| Plan E bench | bits/Gaussian on Mip-NeRF 360 | ≤4 bits | R-10 re-derived; web-streaming claim withdrawn | +| a2ui N2 | wgpu `webgl` feature + texture upload, wasm32-tested | render parity headless vs browser | GPU raster tier deferred; CPU raster only | + +## 6. Cross-references + +- `pr-x12-h266-h267-standards-landscape.md` — the industry walls, sourced +- `pr-x12-x266-3dgs-spacetime-upscaling.md` — the H.268 lens body (+ §12) +- `PR-X12-docs-audit.md` — the discipline this doc's verdicts ran under +- OGAR `CLAUDE.md` (perturbation, bipolar pyramid, 256×256 tile, 3×4) + + `docs/DISCOVERY-MAP.md` D-PHASE/D-WHP — the [H] canon and its fences +- lance-graph `le-contract.md` §3 (L4 palette256 tenant), bgz17/bgz-tensor + table sources; a2ui-rs `a2ui-paint` (the only wgpu in the workspace) + +_Last edit: 2026-07-16. Verdicts from workflow run wf_6c6fb99a-cb4 (15 agents, +whole-file receipts; journal retained in session transcript dir)._ diff --git a/.claude/knowledge/pr-x12-substrate-canon-resolutions.md b/.claude/knowledge/pr-x12-substrate-canon-resolutions.md index 26e99042..93886a5e 100644 --- a/.claude/knowledge/pr-x12-substrate-canon-resolutions.md +++ b/.claude/knowledge/pr-x12-substrate-canon-resolutions.md @@ -431,6 +431,11 @@ real measurement during A4-impl pins per-arch. **Per-architecture override matrix (Plan A4-impl deliverable):** +> **[UNCALIBRATED ESTIMATES]** (audit #6, marked 2026-07-16): the crossover +> numbers below are pre-bench heuristics with no measurement source. Plan +> A4-impl / Plan G produce the real numbers; until then these are hypotheses, +> not commitments. + | Architecture | Per-block path | Crossover N | Batched path | |--------------|----------------|-------------|--------------| | Sapphire Rapids (AMX-BF16) | Loeffler 1D + transpose | ~64 | AMX TDPBF16PS via `bf16_tile_gemm` | @@ -495,6 +500,9 @@ in A4 or A5 ships as a `batched_ssd_search` primitive in `ndarray::hpc:: blas_level2` that downstream consumers (video, splat scene flow) call into. **Not a codec-specific function** — landing in BLAS L2 keeps the factoring clean (codec uses the math; BLAS owns the math). +**[PLANNED symbol — `blas_level2.rs` today exports only the 8 classical +BLAS-L2 methods; `batched_ssd_search` does not exist yet (audit #5, +re-verified 2026-07-16). Do not cite as an existing API.]** **Cite as R-6 in any ME-path or splat scene-flow PR description.** @@ -537,23 +545,31 @@ blasgraph`. For d=4, |nodes|=85: O(16 × 85) = O(1360) ops per CTU. Vs. O(4^4 × |nodes|) = O(21,760) ops for the naive recursive RDO. ``` -**Speedup: ~16×.** For a 4K frame at ~132K CTUs, this is the difference -between ~4 ms and ~64 ms per frame just for partition RDO. At 60 fps, -that's the difference between fitting and missing the latency budget. - -**Why this needs `lance-graph::blasgraph`:** Standard BLAS GEMM uses -(× , +) semiring. Tropical uses (+ , min) semiring. blasgraph already -ships tropical-GEMM kernels. No new code in ndarray; cross-repo dep +**Speedup: ~16×.** For a 4K frame at ~2,040 CTUs (corrected 2026-07-16 — +the earlier "~132K CTUs" was the 8×8 leaf count), this is the difference +between ~2.8 ms and ~44 ms per frame just for partition RDO at ~1 op/ns. +At 60 fps, that's the difference between fitting and missing the budget. + +**Why this targets `lance-graph::blasgraph`:** Standard BLAS GEMM uses +(× , +) semiring. Tropical uses (+ , min) semiring. blasgraph is the +**canonical, bit-exact** kernel home for semiring algebra. *(Corrected +2026-07-16, audit #1-#3: blasgraph today exports 7 HDR semirings over +16384-bit BitVec — XorBundle, BindFirst, HammingMin, SimilarityMax, +Resonance, Boolean, XorField — none of which is a numerical min-plus +over weighted f32 edges. The claim "blasgraph already ships +tropical-GEMM kernels" was wrong; the f32 tropical-GEMM kernel is +UNWRITTEN and lands in blasgraph when A6 wires it.)* Cross-repo dep from ndarray-codec → lance-graph::blasgraph (after Plan H extraction, this is dep-allowed because ndarray-codec is a sibling, not the bottom). -**Actual kernel home (current).** The tropical-GEMM kernel lives today -at `lance-graph::bgz17::scalar_sparse::tropical_spmv` — NOT in an -abstract `blasgraph` namespace. The codec's tropical-GEMM call is -`bgz17::scalar_sparse::tropical_spmv(edge_weights, dag)`. The -`lance-graph::blasgraph` name above is the eventual abstraction layer -(post-Plan-H extraction); until that lands, ndarray-codec depends on -bgz17 directly. Cite the symbol, not the namespace, when wiring A6. +**Shipped min-plus today (corrected).** The only shipped min-plus +primitive is the method `bgz17::ScalarCsr::spmv_min_plus` +(`fn(&self, x: &[f32]) -> Vec`, `crates/bgz17/src/scalar_sparse.rs:98`). +The earlier citation `bgz17::scalar_sparse::tropical_spmv(edge_weights, dag)` +named a free function that **does not exist** (audit #2). bgz17 is a lossy +sibling encoding stack — its CSR may serve as an A6 prototype adapter, but +substituting it for the bit-exact blasgraph canon is a soundness violation, +not a re-targeting (audit ground-truth #5). **Plan A6 RDO (1 week) ships this.** The λ-RDO knob (per A:§10.3) and the tropical-GEMM partition solver are the same kernel: λ scales the @@ -781,12 +797,13 @@ to the budget. 60 fps = 16.67 ms/frame At 8×8 leaf granularity (HEVC's smallest CU; the unit at which the encoder's inner-loop work is paid): - 132,710 leaves/frame - (= 2,040 CTUs/frame at 64×64, × ~64 - leaves/CTU at maximum split depth; - 130,560 from clean 3840·2160/64, with - ~1.6 % bias for chroma alignment) -Per-leaf budget: 16.67 ms / 132,710 = 125 ns/leaf + 129,600 leaves/frame (exact: 3840·2160/64) + (padded 64×64 accounting: 60×34 = 2,040 + CTUs/frame → 130,560 leaves at max split) +Per-leaf budget: 16.67 ms / 129,600 = ~129 ns/leaf +(Corrected 2026-07-16: the earlier 132,710 figure — 130,560 plus an +unsourced "~1.6 % chroma alignment bias" — was not numerically +grounded; use exact 129,600 or padded 130,560.) ``` **Encoder per-leaf breakdown (scalar reference, current):** @@ -801,11 +818,11 @@ Per-leaf budget: 16.67 ms / 132,710 = 125 ns/leaf | rANS encode (A7) | ~40 ns | ~40 ns | | **Total per-leaf** | **~960 ns** | **~210 ns** | -**At scalar reference (960 ns/leaf): 4K @ 60 fps requires 132,710 × -960 ns = 127 ms/frame. Misses 60 fps by 7.6×.** +**At scalar reference (960 ns/leaf): 4K @ 60 fps requires 129,600 × +960 ns = 124 ms/frame. Misses 60 fps by ~7.5×.** -**At SIMD-batched (210 ns/leaf): 132,710 × 210 ns = 28 ms/frame. Misses -60 fps by 1.7×; needs further work but in the same order of magnitude.** +**At SIMD-batched (210 ns/leaf): 129,600 × 210 ns = 27 ms/frame. Misses +60 fps by ~1.6×; needs further work but in the same order of magnitude.** **To hit 60 fps 4K real-time** requires the SIMD-batched-encode path to land. **This pins B:D-CODEC-8 / A:T-7 from P2 to P1.** Plan A4-impl @@ -1005,11 +1022,13 @@ signature-lane gates on Pillar 11. - Pillar 11: active under `--features hambly-lyons`; passes its probe (forward < 1e-9, converse > 0.05, discrimination ratio ≥ 1e6 over N=100 random pairs in d=3 at depth-2). -- Production-scale benchmarking + PR #350 (`signature_kernel_pde` - Goursat-PDE math correction) remain open — see Gap G-4 in - `pr-x12-cam-pq-sigker-dn-tree-substrate-bindings.md`. Pillar 11's - probe deliberately uses `signature_truncated` (tensor-algebra path), - not the buggy PDE form. +- Production-scale benchmarking remains open — see Gap G-4 in + `pr-x12-cam-pq-sigker-dn-tree-substrate-bindings.md`. *(Corrected + 2026-07-16, audit #9: the "PR #350 Goursat-PDE math correction" + claim is withdrawn — `signature_kernel_pde`'s own tests prove + convergence to `I_0(2·√⟨u,v⟩)` at `rel<1e-3` with O(1/N) refinement; + there is no known bug. Pillar 11's probe uses `signature_truncated` + as a design choice, not a workaround.)* **Falsifies if.** Pillar 10 ever flips state (a regression in the Pflug-Pichler proof bound) — Plan G's video / KV / gradient quality @@ -1047,12 +1066,14 @@ impl Basis for SignatureBasis { } ``` -**Why `signature_truncated` and not `signature_kernel_pde`.** The -PDE form in sigker ships a known math bug (PR #350: Goursat-PDE form -diverges from the true kernel `I₀(2·√⟨u, v⟩)` at moderate inner -products). The tensor-algebra path (`signature_truncated`) is correct -today and is what jc Pillar 11 cites. R-15 wraps the truncated path; -the PDE form becomes available after PR #350 lands. +**Why `signature_truncated` and not `signature_kernel_pde`.** Design +choice: the tensor-algebra path (`signature_truncated`) is what jc +Pillar 11 cites directly, so R-15 wraps it. *(Corrected 2026-07-16, +audit #9: the earlier "known math bug — Goursat-PDE form diverges" +rationale was false. `sigker/src/kernel.rs`'s tests +`pde_kernel_converges_to_closed_form_for_linear_paths` and +`pde_and_truncated_agree_on_linear_paths_in_the_limit` pass; both +forms compute the same kernel. Either is usable.)* **Plan G gets a fifth lane.** "Stream signal" mode: @@ -1242,17 +1263,23 @@ that decides whether each holy-grail claim is demonstrated. | R-8 (Plan G is confidence gate) | this doc | Phase order | Plan G ships before A7 | A7 PR doesn't merge until Plan G binary green | | R-9 (topology-free) | this doc | grep audit | Codec body has no spatial-semantic refs | `grep -rE 'North\|East\|West\|South' src/hpc/codec/*.rs` returns only test/doc | | R-10 (4 bit/Gaussian floor) | this doc | Plan E bench | bits/Gaussian on Mip-NeRF 360 | ≤4 bits/Gaussian without offline codebook | -| R-11 (4K 60fps SIMD-batched) | this doc | Plan G video latency assert | Per-CTU encode time | ≤210 ns/CTU on Sapphire Rapids | +| R-11 (4K 60fps SIMD-batched) | this doc | Plan G video latency assert | Per-leaf encode time | ≤210 ns/leaf on Sapphire Rapids (≡ ≤13.4 µs per fully-split 64×64 CTU = 64 leaves; corrected 2026-07-16 — the earlier "≤210 ns/CTU" mislabeled the per-leaf breakdown total) | | R-12 (per-CTU flush) | this doc | A8 frame-header parse + decode | First-CTU latency | First CTU decodable before frame complete | | R-13 (Option A per-shard) | this doc | Plan F on BERT-glue | 8× compression + accuracy | Holds; else escalate to Option B | | R-14 (Pillar 10 active) | this doc | `cargo test -p jc` (default features) | Pflug-Pichler Lipschitz bound | Pillar 10 probe green | | R-14 (Pillar 11 active) | this doc | `cargo test -p jc --features hambly-lyons` | Signature uniqueness probe | forward < 1e-9, converse > 0.05, ratio ≥ 1e6 | | R-15 (SignatureBasis lane) | this doc | Plan G stream-signal lane | signature-space discrimination under Pillar 11 (forward-only — path inversion is N/A per R-15) | forward < 1e-9, converse > 0.05, ratio ≥ 1e6 (or agreed DEPTH-specific floor) | -**Every row of this matrix is a test.** Plan G's bench harness binary -emits a JSON report containing the actual measurement for each row; -the merge job for Phase 2 consumer PRs reads that report and gates on -pass-fail. +**Every row of this matrix is a test — FORWARD-CONDITIONAL.** Plan G's +bench harness binary emits a JSON report containing the actual +measurement for each row; the merge job for Phase 2 consumer PRs reads +that report and gates on pass-fail. + +> **[Status tag, 2026-07-16 per audit #19]:** the Plan G bench-harness +> binary does not exist yet. Every row above is a *planned* test, not a +> passed one — this matrix is a falsification contract, never a +> passed-tests dashboard. Rows citing "Plan G binary" as the test are +> circular until that binary ships. --- @@ -1382,12 +1409,14 @@ When this doc is summarised across context windows, preserve at minimum: - R-4: 4 threshold pairs (video, splat, kv, grad) - R-5: DCT crossover ~64 blocks - R-6: SSD via VNNI ≥30× over SAD - - R-7: tropical-GEMM partition O(4^d) → O(d²) via - `bgz17::scalar_sparse::tropical_spmv` + - R-7: tropical-GEMM partition O(4^d) → O(d²); canonical home + `lance-graph::blasgraph` (kernel unwritten); shipped min-plus is + `bgz17::ScalarCsr::spmv_min_plus` [lossy sibling, prototype only — + corrected 2026-07-16 per audit] - R-8: Plan G is confidence gate - R-9: topology-FREE codec layer - R-10: ~4 bits/Gaussian near target, ~1 bit stretch - - R-11: 210 ns/CTU SIMD-batched encode + - R-11: 210 ns/leaf SIMD-batched encode (per-leaf, not per-CTU) - R-12: per-CTU flush default; per-bucket Plan F - R-13: Option A (per-shard codebook) for Plan F v1; primitives are `cam_pq` + `bgz-hhtl-d` + `dn_tree` + `merkle_tree` diff --git a/.claude/knowledge/pr-x12-woa-multiarch-orchestration.md b/.claude/knowledge/pr-x12-woa-multiarch-orchestration.md index e3f53e81..097bf346 100644 --- a/.claude/knowledge/pr-x12-woa-multiarch-orchestration.md +++ b/.claude/knowledge/pr-x12-woa-multiarch-orchestration.md @@ -1,5 +1,16 @@ # PR-X12 — WoA Orchestration & Multi-Arch Dispatch Lens +> ⛔ **QUARANTINED — Tier-1 audit finding (2026-05-22, tagged 2026-07-16).** +> `.claude/PR-X12-docs-audit.md` findings #10-#16 show §3 of this doc +> contradicts `src/simd.rs` and `.cargo/config.toml` (which pins x86-64-v3 +> with AVX-512 opt-in + a real runtime `LazyLock` dispatcher), lists a +> nonexistent SVE2 backend while omitting the real `simd_amx.rs`, and carries +> fabricated cfg-crossover constants, µs latency numbers, and a `Reducer` / +> `OrderedKahanReducer` trait shape that contradicts R-1. **Do not cite this +> doc as evidence for anything.** Pending rewrite per audit Tier-1 +> recommendation; the W1a consumer contract at +> `vertical-simd-consumer-contract.md` is the authoritative source. +> > Date: 2026-05-22 > Status: **perspective doc** — examines how the orchestration crates (`woa-rs`, `woa`, `q2`, `surrealdb`, `MedCare-rs`, `smb-office-rs`) consume the PR-X12 substrate, and how PR-X12's per-arch polyfill decisions (R-4, R-5, R-11) generalise to the entire HPC stack. > diff --git a/.claude/knowledge/pr-x12-x265-blasgraph-gemm.md b/.claude/knowledge/pr-x12-x265-blasgraph-gemm.md index 493b8cb0..29701c37 100644 --- a/.claude/knowledge/pr-x12-x265-blasgraph-gemm.md +++ b/.claude/knowledge/pr-x12-x265-blasgraph-gemm.md @@ -17,10 +17,10 @@ | # | Primitive | HEVC native form | GEMM form | Where it lands | |---|---|---|---|---| -| 1 | Motion estimation | SAD `Σ \|A-B\|` | SSD `\|\|A\|\|² - 2A·B + \|\|B\|\|²` → GEMV | `ndarray::hpc::blas_level2::batched_ssd_search` | +| 1 | Motion estimation | SAD `Σ \|A-B\|` | SSD `\|\|A\|\|² - 2A·B + \|\|B\|\|²` → GEMV | `ndarray::hpc::blas_level2::batched_ssd_search` *(planned — not yet in blas_level2.rs)* | | 2 | Forward transform | 4×4 / 8×8 / 16×16 / 32×32 DCT-II butterflies | Batched DCT as GEMM at N≥64 | `ndarray::hpc::fft::DctIIBasis` + `bf16_tile_gemm` | | 3 | Quantization | Scalar divide + round | Dot product against quant matrix | Inline; uses existing `simd_int_ops` | -| 4 | Mode decision (CTU split) | Recursive RDO, `O(4^d)` | Tropical-GEMM Bellman-Ford, `O(d²)` | `lance-graph::blasgraph::tropical_gemm` | +| 4 | Mode decision (CTU split) | Recursive RDO, `O(4^d)` | Tropical-GEMM Bellman-Ford, `O(d²)` | `lance-graph::blasgraph` *(canonical home; kernel unwritten — shipped min-plus today is only `bgz17::ScalarCsr::spmv_min_plus`, a lossy-sibling prototype)* | | 5 | Basin assignment (palette / k-means) | Linear scan distance comparisons | Batched Hamming/L2 dist as GEMM | `ndarray::hpc::cam_pq::kmeans` | | 6 | Deblocking filter | 3×3 / 5×5 per-pixel separable conv | im2col + GEMM at block size ≥ 16 | `ndarray::hpc::activations` (existing conv path) | | 7 | rANS state advance | u32 state machine | Symbol-frequency lookup; **not GEMM** | `ndarray-codec::ans` | @@ -74,7 +74,7 @@ if N >= 64: batched DCT as GEMM via DctIIBasis + bf16_tile_gemm ~256 cycles for 64 blocks (AMX) vs ~1280 cycles butterfly ``` -Crossover (R-5) varies per arch: SPR=64, SKX/ICL=32, Zen 4=96, Apple Silicon=256. +Crossover (R-5) varies per arch: SPR≈64, SKX/ICL≈32, Zen 4≈96, Apple Silicon≈256 — **[UNCALIBRATED ESTIMATES, no measurement source; Plan G calibrates (audit #6)]**. **The trait pattern (R-1):** `DctIIBasis` implements `Basis` — the basis is data (the cosine matrix, computed once at startup). The reduction (`A4 transform path` and `EWA splat rasterizer Plan E`) both call `basis.apply(src, dst)`. **Same basis, two consumers.** @@ -104,9 +104,9 @@ Tropical-GEMM: O(d²) × |nodes| = 16 × 85 = ~1.4 K ops/CTU ~16× speedup ``` -For 4K @ 60 fps with 132K CTUs/frame, this is the difference between **4 ms and 64 ms per frame just for partition RDO**. At 60 fps's 16.67 ms budget, naive RDO doesn't fit. +For 4K @ 60 fps with ~2,040 CTUs/frame (corrected 2026-07-16 — the earlier "132K CTUs" was the 8×8 leaf count), this is the difference between **~2.8 ms and ~44 ms per frame just for partition RDO** at ~1 op/ns. At 60 fps's 16.67 ms budget, naive RDO doesn't fit. -**Dep direction:** the tropical-GEMM kernel lives in `lance-graph::blasgraph` (it's been the cognitive-side substrate for years). Post-Plan-H, `ndarray-codec → lance-graph::blasgraph` is allowed because both are sibling crates above `ndarray` hardware. +**Dep direction:** the tropical-GEMM kernel's canonical home is `lance-graph::blasgraph` (the bit-exact cognitive-side substrate). *(Corrected 2026-07-16, audit #3: blasgraph's shipped semirings are binary-Hamming over 16384-bit BitVec — the numerical f32 min-plus kernel is UNWRITTEN and lands there when A6 wires it; the only shipped min-plus today is `bgz17::ScalarCsr::spmv_min_plus`, a lossy-sibling prototype.)* Post-Plan-H, `ndarray-codec → lance-graph::blasgraph` is allowed because both are sibling crates above `ndarray` hardware. ### 2.5 Basin assignment: k-means as batched dist + argmin @@ -178,7 +178,15 @@ The HEVC spec was finalised in early 2013, against the following hardware: ## 5. What lands in `ndarray::hpc::blas_level2` (the codec's BLAS surface) -The codec uses, but does not own, these four primitives: +The codec uses, but does not own, these four primitives. + +> **[Status, 2026-07-16]:** all four signatures below are **target API +> shapes**, not shipped symbols. `batched_ssd_search` / `batched_dct_ii` / +> `tropical_partition_rdo` do not exist yet (audit #5, #3); +> `kmeans_predict_batched` is a planned wrapper over the real +> `cam_pq::kmeans` + `CamCodebook::distance_batch`. The paragraph after the +> block ("zero new lines — all four already exist") overstated; the *building +> blocks* exist (`bf16_tile_gemm`, `cam_pq`, `simd_int_ops`), the wrappers do not. ```rust // R-6: ME via SSD identity @@ -210,7 +218,7 @@ pub fn kmeans_predict_batched( ); ``` -**Codec layer:** ~30-50 LoC per stage to wrap the BLAS call into the predict/A6/A4 flow. **BLAS layer:** zero new lines — all four already exist or land via existing infrastructure (`bf16_tile_gemm`, `cam_pq`, `simd_int_ops`). +**Codec layer:** ~30-50 LoC per stage to wrap the BLAS call into the predict/A6/A4 flow. **BLAS layer:** the four wrapper APIs above still require implementation — what exists today is the underlying infrastructure they compose (`bf16_tile_gemm`, `cam_pq::kmeans` + `CamCodebook::distance_batch`, `simd_int_ops`); the wrappers are thin but not written (corrected 2026-07-16 — the earlier "zero new lines, all four already exist" overstated). This is what makes R-3's ≤1500 generic-codec-LoC ceiling reachable. Most of the heavy lifting is already in `blas_level2`; the codec adds wrappers and orchestration, not new BLAS code. diff --git a/.claude/knowledge/pr-x12-x266-3dgs-spacetime-upscaling.md b/.claude/knowledge/pr-x12-x266-3dgs-spacetime-upscaling.md index b22eb80a..a62c58eb 100644 --- a/.claude/knowledge/pr-x12-x266-3dgs-spacetime-upscaling.md +++ b/.claude/knowledge/pr-x12-x266-3dgs-spacetime-upscaling.md @@ -1,5 +1,18 @@ # PR-X12 — x266 / Next-Gen Codec via 3DGS Space-Time Upscaling +> **Naming + standards anchor (2026-07-16):** "x266" in this doc means the +> **PR-X12 3DGS scene codec** — internal codename **H.268** (ruled +> 2026-07-16; "x266" was a placeholder). H.268 is INTERNAL ONLY, never an +> ITU designation: it is NOT H.266/VVC (finalized 2020, shipping) and not +> H.267 (JVET's *prospective* beyond-VVC standardization effort — not yet +> a standard; CfP running July 2026, finalization targeted ~2028). Codename +> ruling + graded synergy matrix: +> `pr-x12-h268-morton-wgpu-synergies.md`. For the +> grounded public landscape — VVC facts, ECM, NNVC, +> H.267 requirement + dates — read +> `pr-x12-h266-h267-standards-landscape.md` alongside this doc, and see +> §12 below for the dated reality-check addendum. +> > Date: 2026-05-22 > Status: **speculative perspective doc** — explores what becomes possible when the codec substrate (PR-X12) is extended one step beyond HEVC compatibility, into territory that subsumes both AI-frame-interpolation and AI-super-resolution as codec-native deterministic operations. Companion to `pr-x12-x265-blasgraph-gemm.md`. > @@ -326,5 +339,60 @@ Concretely: - **GEMM lens:** `pr-x12-x265-blasgraph-gemm.md` - **Bandwidth comparison reading list:** 3DGS (Kerbl et al. SIGGRAPH 2023), Mip-Splatting (Yu et al. 2024), 4DGS (Wu et al. 2024) -_Last edit: 2026-05-22._ +--- + +## 12. Standards reality-check addendum (2026-07-16) + +Written against the live JVET landscape; sources and full detail in +`pr-x12-h266-h267-standards-landscape.md`. + +**What the standards world did since this doc was drafted:** + +- The H.267 **Call for Evidence was evaluated October 2025** (40th JVET, + Geneva). Best responses reached ~**30% bitrate reduction over VVC** — and + *every* response incorporated NN tools ("conventional-plus-neural" is the + emergent architecture). The final **Call for Proposals is running now + (July 2026)**, submissions November 2026, evaluation **January 2027**, + finalization targeted **2028** (deployment historically lags to ~2034+). +- The H.267 requirement is ≥**40% bitrate reduction vs VVC Main 10 at + 4K-and-above**, with explicit decoder-complexity/power constraints — + mobile vendors (Samsung at the ITU 2025 workshop) now weight decoder + complexity above raw bitrate. +- ECM-16.1 sits at ~**27% BD-rate over VTM-11** (RA), up to ~40% for screen + content — at a complexity the industry itself calls impractical. NNVC is + at software v7 with NN in-loop filters worth ~9% RA each. + +**What this changes in this doc — and what it doesn't:** + +1. §1's characterization of the field **holds**: codec-native upscaling in + the standards track is still 2D resampling (VVC RPR). Precision update + on the learned track: *standardized* NN-in-loop decode can be bit-exact + (JVET conformance requires fixed-point inference), so §7's contrast + applies unqualified only to un-standardized AI-upscaler pipelines + (DLSS/RIFE-class, which do drift across model versions); against NNVC + the argument is reproducibility-by-construction vs model-governance + burden. No CfE response ships a scene-model reference frame — the + 3DGS-as-`Basis` bet remains unoccupied territory. +2. §7's argument is **sharpened, with a qualification**: closed-form EWA + math gives "same scene, same pose, same t → same pixels" with no model + artifact to pin, version, or audit — a reproducibility-and-governance + advantage over conventional-plus-neural H.267 candidates (whose + bit-exactness, where achieved, rests on model pinning and fixed-point + conformance discipline). For legal/medical/scientific video this + remains a moat, stated as governance rather than as "NN = + nondeterministic." +3. §8's "24-36 months from PR-X12 merge" estimate lands comfortably inside + the H.267 deployment gap (finalize 2028, deploy 2034+). The scene codec + does not race H.267; it races NN-upscaler pipelines. +4. **F-3 update:** the "H.266/VVC <5% market share" premise remains + directionally true in 2026. **F-3b (new falsifier):** if the January + 2027 CfP evaluation converges on a conventional-plus-neural design whose + decoder complexity mobile vendors accept, the determinism differentiator + weakens for consumer video (it survives for evidentiary/medical/ + scientific recording regardless). +5. **Watch calendar:** re-check the landscape doc after the November 2026 + CfP submissions and the January 2027 evaluation — those two events fix + H.267's architecture and decide F-3b. + +_Last edit: 2026-07-16 (addendum §12 + naming anchor; body unchanged from 2026-05-22)._ _Status: speculative — explores what's possible after PR-X12 lands; not in PR-X12 scope._ diff --git a/.claude/plans/3DGS-PLAN-INDEX.md b/.claude/plans/3DGS-PLAN-INDEX.md index 5d3ac5af..9fecb4b8 100644 --- a/.claude/plans/3DGS-PLAN-INDEX.md +++ b/.claude/plans/3DGS-PLAN-INDEX.md @@ -74,6 +74,24 @@ Fisher-z -> optional statistical angular scorer/gate after candidate ranking PR-X12-tensor-container-expansion-capstone.md ``` +Public-standards anchor (2026-07-16): the x265/x266 lens line is grounded +against the real JVET trajectory (H.266/VVC 2020, ECM ~27% over VTM, +NNVC v7, H.267 CfP Jul 2026 → finalize ~2028, ≥40%-over-VVC requirement) in + +```text +../knowledge/pr-x12-h266-h267-standards-landscape.md +``` + +Codename + graded synergy matrix (2026-07-16): the former "x266" placeholder +is internally codenamed **H.268** (INTERNAL ONLY, never an ITU designation). +The Morton-cascade / perturbation-pyramid / wgpu-wasm feasibility matrix — +every claim adversarially graded FEASIBLE-NOW / NEEDS-PROBE / +OVERCLAIM-CORRECTED with receipts — lives in + +```text +../knowledge/pr-x12-h268-morton-wgpu-synergies.md +``` + This capstone connects: ```text diff --git a/.claude/plans/PR-X12-tensor-container-expansion-capstone.md b/.claude/plans/PR-X12-tensor-container-expansion-capstone.md index 32c38374..5d6ee4f4 100644 --- a/.claude/plans/PR-X12-tensor-container-expansion-capstone.md +++ b/.claude/plans/PR-X12-tensor-container-expansion-capstone.md @@ -23,6 +23,38 @@ This document connects the existing perspective docs: .claude/knowledge/pr-x12-x266-3dgs-spacetime-upscaling.md .claude/knowledge/pr-x12-gguf-llm-weights-encoding.md .claude/knowledge/pr-x12-anti-neural-lookup-inversion.md +.claude/knowledge/pr-x12-h266-h267-standards-landscape.md (2026-07-16: public JVET anchor) +``` + +## Standards watch (added 2026-07-16) + +The public trajectory this capstone must track is now grounded in +`pr-x12-h266-h267-standards-landscape.md`: + +```text +H.266/VVC finalized 2020 up to ~50% over HEVC subjective; ~31-40% objective + BD-rate; decoder 1.5-2x, encoder ~10x +ECM-16.1 ~27% over VTM the conventional H.267 track; complexity flagged impractical +NNVC v7 NN in-loop the learned H.267 track; ~9% RA per filter; antithesis of our anti-neural rule +H.267 prospective standard: CfP Jul 2026 -> submissions Nov 2026 -> + evaluation Jan 2027 -> finalize ~2028 + requirement: >=40% over VVC Main 10 at 4K+, decoder complexity constrained +``` + +Positioning consequences for this capstone: + +```text +- "x266" in our docs = the PR-X12 3DGS scene codec, never H.266/VVC. + Internal codename since 2026-07-16: H.268 (INTERNAL ONLY, never an ITU + designation; see pr-x12-h268-morton-wgpu-synergies.md). +- ECM's complexity spiral is the cautionary anchor for the R-3 LoC envelope. +- NNVC-in-the-loop vs our tables-only hot loop is the sharpest external + differentiator; the moat is reproducibility-by-construction + governance + (closed-form math, no model artifact to pin/version/audit) for + legal/medical/scientific video — standardized NN decode can be bit-exact, + so state it as governance, not "NN = nondeterministic." +- The H.267 40%-over-VVC requirement is the external stretch axis for Plan G. +- Watch dates: Nov 2026 (CfP submissions), Jan 2027 (evaluation). ``` ## Capstone thesis diff --git a/tests/knowledge/__pycache__/test_pr_x12_knowledge_docs.cpython-311.pyc b/tests/knowledge/__pycache__/test_pr_x12_knowledge_docs.cpython-311.pyc index e69de29b..8a741f85 100644 Binary files a/tests/knowledge/__pycache__/test_pr_x12_knowledge_docs.cpython-311.pyc and b/tests/knowledge/__pycache__/test_pr_x12_knowledge_docs.cpython-311.pyc differ diff --git a/tests/knowledge/test_pr_x12_knowledge_docs.py b/tests/knowledge/test_pr_x12_knowledge_docs.py index ef4f9edc..f5e9310c 100644 --- a/tests/knowledge/test_pr_x12_knowledge_docs.py +++ b/tests/knowledge/test_pr_x12_knowledge_docs.py @@ -235,7 +235,9 @@ class TestCanonResolutionsDelta(unittest.TestCase): Validates changes to pr-x12-canon-resolutions-delta.md: - Category count updated from five to six. - Sixth category covers R-14 and R-15. - - R-7 now cites the actual kernel symbol bgz17::scalar_sparse::tropical_spmv. + - R-7 cites the corrected kernel canon: blasgraph is the canonical home + (kernel unwritten); the shipped min-plus is the method + bgz17::ScalarCsr::spmv_min_plus (audit 2026-07-16 correction). - R-13 phasing pattern includes the four implementation primitives. - R-14 / R-15 sections added. - Falsifiability matrix row count updated to 24+3. @@ -273,12 +275,28 @@ def test_sixth_category_references_formal_correctness(self): self.assertIn("Formal-correctness", self.content) self.assertIn("stream lane", self.content) - def test_r7_cites_tropical_spmv_kernel(self): - """R-7 entry must now cite the actual kernel symbol.""" + def test_r7_cites_spmv_min_plus_method(self): + """ + R-7 entry must cite the corrected canon (audit 2026-07-16): the + shipped min-plus is the METHOD bgz17::ScalarCsr::spmv_min_plus; + the free-function path bgz17::scalar_sparse::tropical_spmv was + fabricated (audit findings #1/#2) and must not be cited + affirmatively. + """ self.assertIn( + "bgz17::ScalarCsr::spmv_min_plus", + self.content, + "R-7 must cite the real method bgz17::ScalarCsr::spmv_min_plus", + ) + self.assertNotIn( "bgz17::scalar_sparse::tropical_spmv", self.content, - "R-7 must cite the actual kernel location bgz17::scalar_sparse::tropical_spmv", + "The fabricated free-function path must not appear in the delta doc", + ) + self.assertIn( + "blasgraph", + self.content, + "R-7 must name blasgraph as the canonical kernel home", ) def test_r13_primitives_table_present(self): @@ -582,23 +600,35 @@ def test_r13_codebook_handle_trait_mentioned(self): """R-13 section must mention the CodebookHandle trait.""" self.assertIn("CodebookHandle", self.content) - def test_tropical_spmv_actual_kernel_home_section(self): + def test_spmv_min_plus_shipped_kernel_section(self): """ - New 'Actual kernel home (current)' section must correct the blasgraph - namespace to cite bgz17::scalar_sparse::tropical_spmv directly. + The corrected 'Shipped min-plus today' section (audit 2026-07-16, + findings #1-#4) must cite the real method + bgz17::ScalarCsr::spmv_min_plus and must NOT frame bgz17 as the + 'Actual kernel home' — that framing inverted the canon (blasgraph + is canonical and bit-exact; bgz17 is a lossy sibling). """ - self.assertIn( - "lance-graph::bgz17::scalar_sparse::tropical_spmv", + self.assertIn("Shipped min-plus today", self.content) + self.assertIn("bgz17::ScalarCsr::spmv_min_plus", self.content) + self.assertNotIn( + "Actual kernel home (current)", self.content, + "The inverted 'Actual kernel home (current)' framing must stay removed", ) - self.assertIn("Actual kernel home (current)", self.content) - def test_tropical_spmv_not_only_blasgraph(self): + def test_blasgraph_is_canonical_not_bgz17(self): """ - Doc must distinguish the current kernel home (bgz17) from the eventual - blasgraph abstraction. + Doc must present blasgraph as the CANONICAL kernel home and bgz17's + min-plus as a lossy sibling/prototype — never 'ndarray-codec depends + on bgz17 directly' as the sanctioned path (audit ground-truth #3/#5). """ - self.assertIn("bgz17 directly", self.content) + self.assertIn("canonical", self.content) + self.assertIn("lossy", self.content) + self.assertNotIn( + "ndarray-codec depends on\nbgz17 directly", + self.content, + "The bgz17-as-current-home dependency framing must stay removed", + ) def test_falsifiability_matrix_has_r14_pillar10_row(self): """Falsifiability matrix §9 must have an R-14 Pillar 10 row.""" @@ -938,7 +968,8 @@ class TestCrossDocumentConsistency(unittest.TestCase): Tests that validate consistency across multiple changed documents: - Gap IDs are consistently labelled and cross-referenced. - Resolution IDs R-14/R-15 appear in all docs that should mention them. - - Kernel symbol bgz17::scalar_sparse::tropical_spmv is consistent. + - Kernel canon is consistent: blasgraph canonical (kernel unwritten), + shipped min-plus = bgz17::ScalarCsr::spmv_min_plus (audit 2026-07-16). - Polyfill terminology replaces dispatch where updated. """ @@ -966,18 +997,27 @@ def test_gap_g2_owned_by_bgz_jc_doc(self): self.assertIn("Gap **G-2**", bgz_jc, "bgz-jc doc must define G-2") self.assertIn("bgz-jc G-2", cam_pq, "cam-pq doc must cross-ref as bgz-jc G-2") - def test_tropical_spmv_kernel_consistent_across_docs(self): + def test_min_plus_kernel_canon_consistent_across_docs(self): """ - The tropical-GEMM kernel symbol must be cited consistently across - canon-resolutions-delta and substrate-canon-resolutions. + The corrected kernel canon (audit 2026-07-16) must be cited + consistently across canon-resolutions-delta and + substrate-canon-resolutions: the shipped min-plus is the method + bgz17::ScalarCsr::spmv_min_plus; the fabricated free-function path + must not be cited affirmatively in the delta doc (the substrate doc + retains one explicitly-negated mention as the audit trail). """ - kernel = "bgz17::scalar_sparse::tropical_spmv" + kernel = "bgz17::ScalarCsr::spmv_min_plus" delta = self._read("pr-x12-canon-resolutions-delta.md") substrate = self._read("pr-x12-substrate-canon-resolutions.md") - self.assertIn(kernel, delta, "canon-resolutions-delta must cite tropical_spmv") + self.assertIn(kernel, delta, "canon-resolutions-delta must cite spmv_min_plus") self.assertIn( - kernel, substrate, "substrate-canon-resolutions must cite tropical_spmv" + kernel, substrate, "substrate-canon-resolutions must cite spmv_min_plus" + ) + self.assertNotIn( + "bgz17::scalar_sparse::tropical_spmv", + delta, + "The fabricated free-function path must not appear in the delta doc", ) def test_r14_r15_cited_in_both_canon_docs(self):