Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .claude/knowledge/pr-x12-h268-morton-wgpu-synergies.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ track (`pr-x12-x266-3dgs-spacetime-upscaling.md`).
| **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` |
| **wgpu in the workspace** — a2ui-paint only: **off-by-default** feature; the PRODUCTION path is still a constant-color quad pipeline with no textures/bind groups. **Updated (wave 3, PROBE-GPU-LUT):** a `#[cfg(test)]` probe (`gpu_lut_probe.rs`) now adds a texture + bind-group + R16Uint→R32Uint `textureLoad` path that COMPILES under wgpu 22 — so "no textures/bind groups" no longer holds for the TEST surface. Still-true negatives: wgpu's `webgl` cargo feature is NOT enabled (the wasm32 WebGL2 backend is unwired; the probe's WebGL2 claim is a shader-SURFACE property — integer texture + `textureLoad` are GLES3-core — not a wired wasm backend, and the HEADLESS probe cannot obtain a WebGL2 canvas adapter anyway: wgpu's WebGL backend requires a `compatible_surface` — codex P2), the path is **adapter-untested** (skips where no surface-less adapter), and the production render tier is unchanged. ndarray itself: **zero wgpu by design** ("no GPU, no wgpu", splat3d) | FINDING (negative, wave-3-amended) | a2ui-rs `a2ui-paint` manifest+src + `gpu_lut_probe.rs` (wave 3); 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)
Expand Down Expand Up @@ -107,7 +107,7 @@ any float-path GPU bit-exactness claim.

| 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-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 → **VERDICT (wave 3): HARNESS-REAL / CPU-primitive GREEN / GPU-exec COMPILED+SHIPPED (wgpu 22, WebGPU+WebGL2), execution-parity adapter-deferred; the KILL did not fire — see wave-3 sub-table** |
| 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 |
Expand All @@ -133,6 +133,18 @@ probes in lance-graph `helix`/`bgz-tensor`):**
| PROBE-SPRITE-REPLAY | PASS-AT-SIGNED360 (scoped) / ResidueEdge-24bit INSUFFICIENT; KILL did not fire | Signed360 mean/max 0.0; ResidueEdge mean 9.98 / max 42.4 (Pos 3.55, Neg 16.4); B bidir-delta 6.04 | One Signed360 (48-bit) code per sprite per P-frame reconstructs motion + B-frames exactly — but for helix-MANIFOLD motion (ground truth drawn from helix's own lift); proves capacity+round-trip+sign, not arbitrary-motion generality ([H], independent-GT probe named). ResidueEdge-24bit unusable: hemisphere-blind + 8-bit-rim rank-adjacency hazard → Signed360-only motion primitive |
| PROBE-WH-MAG-2 | UPGRADES the §10 WH-magnitude [H] leg: bare NOT-TRANSFERRING → pairing TRANSFERS on structured tiles | gradient+spike escB/A 0.815 + cenB/A 0.209 (both <0.9); heavy-tailed 0.998 / 1.232; noise 1.66 / 1.66; bareB/A 0.929/1.317/1.869 reproduced; esc_frac 0.098 | WH transfers ONLY paired with passthrough-escape + centroid-residual (the shipped row codec E-PALETTE-RESIDUAL-LADDER-1) and ONLY on structured tiles; NOT bare, NOT heavy-tailed (escape masks to parity; centroid hurts), NOT noise. escB/cenB are compound (no direct+escape/direct+centroid control) — transfer is a codec-pairing property, WH's isolated margin unmeasured; centroid is class-dependent |

**Wave 3 — PROBE-GPU-LUT on the a2ui-paint wgpu seam (2026-07-18,
main-thread-adjudicated; probe in a2ui-rs `a2ui-paint`
`src/gpu_lut_probe.rs`):**

The wgpu decode tier the sprite-replay plan (§Decode tiers c) and the
`a2ui N2` queue row gated on the "shared PROBE-GPU-LUT harness" — the
harness is now confirmed real and the LUT-gather is proven buildable.

| Probe | Verdict | Numbers | Consequence |
|---|---|---|---|
| PROBE-GPU-LUT | HARNESS-REAL / CPU-primitive GREEN / GPU-exec COMPILED+SHIPPED, execution-parity adapter-deferred; KILL did not fire | CPU-ref: 65536/65536 gather == row-major index, symmetric + zero-diagonal, deterministic, 256² u16 = 128 KiB (the §10(i) figure). GPU-exec: full 256×256 R16Uint→R32Uint `textureLoad` parity path compiles clean under wgpu 22 (GL backend via glow builds) and SKIPS-green here (measured: libvulkan loader present, **0 ICDs** → no adapter). `clippy --features wgpu -D warnings` clean; fmt clean | The bgz17 256²-u16 palette-distance table is **representable and COMPILES** through a real in-scope wgpu texture path (R16Uint sampled, `textureLoad`, integer render target — all WebGL2-core), so the GPU LUT lane is **not** abandoned; runtime gatherability + silicon parity stay deferred until actual GPU execution. Falsifiable core (the gather arithmetic) proven bit-exact; the GPU merely executes it. **Backend scope (codex P2, headless):** the probe requests a **surface-less** adapter, so its execution validates on **WebGPU** (native/browser) + native/software GL (lavapipe CI); the WGSL is WebGL2-**compatible** (GLES3-core), but wgpu's WebGL backend needs a canvas-bound `compatible_surface`, so the wasm32 WebGL2 backend is OUT OF SCOPE for this headless probe — "WebGL2" is a shader-surface property, not a validated execution backend here. This structurally un-gates §Decode tiers (c) + the `a2ui N2` row: harness capability proven; only runtime-execution parity awaits an adapter environment. **CAVEAT (honesty):** the GPU-exec *execution* was NOT run in this sandbox (no adapter) — "GPU-exec green" means COMPILES + SKIPS-cleanly, not that 65536 texels were compared on silicon here; the CPU-reference is the leg that actually ran. No bgz17 dep (harness-capability probe; the 256² table is built deterministically with bgz17's table STRUCTURE, keeping the a2ui-paint crate boundary clean) |

## 7. Comma closure — the replayable irrational (constants correction folded in)

The Pythagorean comma is the residue of a stack of pure fifths that never
Expand Down
88 changes: 86 additions & 2 deletions .claude/plans/x265-sprite-replay-probe-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,89 @@ guard); N=8 sprites, TOTAL=240, 6 anchors (I+5P), GOP `I B B P ...`. Determinist

**Follow-up (named, deferred):** an arbitrary-independent-ground-truth motion
probe (a captured 3-D trajectory the encoder did not generate) to promote the
helix-manifold [proven] result toward arbitrary-motion [H]. The wgpu/wasm decode
tiers (plan §Decode tiers b/c) remain deferred on the shared PROBE-GPU-LUT harness.
helix-manifold [proven] result toward arbitrary-motion [H].

## Results (2026-07-18 — PROBE-GPU-LUT, the shared wgpu decode-tier harness, main-thread-adjudicated)

**Verdict: HARNESS-REAL / CPU-primitive GREEN / GPU-exec COMPILED+SHIPPED, execution-parity adapter-deferred. The KILL ("GPU lane abandoned for LUTs") did NOT fire.**

Probe: `a2ui-rs crates/a2ui-paint/src/gpu_lut_probe.rs`. The wgpu decode tier
(§Decode tiers c, the `a2ui N2` queue row) was gated on a "shared PROBE-GPU-LUT
harness" — operator ruling this session pinned that harness to a2ui-paint's real
`wgpu = "22"` seam (WebGPU + WebGL2), the one in-scope GPU path (q2 `sculpt` +
ndarray `splat3d` both deliberately opt OUT of GPU; measured this session).

- **CPU-reference leg (ran here, PASS):** the 256²-u16 palette-distance LUT
texture-gather (`textureLoad(lut,(q,k)).r` == row-major `lut[q*256+k]`) is
bit-exact over all 65536 entries; table is symmetric + zero-diagonal +
deterministic (SplitMix64); 256² u16 = 128 KiB (the §10(i) materialized-table
figure). **This is the falsifiable core** — the arithmetic is what could be
wrong; the GPU only executes it.
- **GPU-exec leg (COMPILED + SHIPPED, adapter-deferred):** the full
R16Uint-LUT → fragment `textureLoad` → R32Uint target → readback →
full-table-parity path compiles clean under wgpu 22 (WebGPU + WebGL2 via
`glow`; `clippy --features wgpu -D warnings` clean, fmt clean) and
**SKIPS-green** in this sandbox — measured: `libvulkan` loader present but
**0 ICDs** installed → `request_adapter()` returns `None`. It runs the real
65536/65536 parity wherever a WebGPU/WebGL2 adapter exists (lavapipe CI, a
browser). Integer sampled texture + `textureLoad` + integer render target are
all WebGL2-core, so the one shader covers both backends.
- **KILL did not fire** (§Decode tiers c / `a2ui N2`): the bgz17 256²-u16 table
IS gatherable through a real in-scope wgpu texture, so the GPU LUT lane is not
abandoned — the harness capability is proven buildable.
- **HONEST CAVEAT:** the GPU-exec *execution* was NOT run on silicon here (no
adapter). "GPU-exec green" = COMPILES + SKIPS-cleanly + is the shipped WGSL,
NOT "65536 texels compared on a GPU in this session." The CPU-reference is the
leg that actually ran. Runtime-execution parity is the one piece that awaits an
adapter environment (the `a2ui N2` render-parity-headless-vs-browser bar).
- **Boundary kept clean:** no bgz17 dep in a2ui-paint (charter: no consumer
crate deps) — the 256² table is built deterministically with bgz17's table
STRUCTURE (symmetric u16, zero diagonal); this is a HARNESS-CAPABILITY probe,
not a bgz17 integration. Test-only `pollster` dev-dep for the async block.

**Consequence (scoped — corrected per codex P2 on ndarray #249):** only §Decode
tiers **(c) the wgpu harness** is structurally un-gated — the shared harness it
waited on is real and the LUT-gather compiles + CPU-proves. The remaining
deferral is narrow: run the GPU-exec parity in an adapter environment (lavapipe
CI or browser) to close the `a2ui N2` render-parity bar on silicon.

**Tier (b) — the wasm tier — is NOT un-gated by this wave.** Its gate is a
distinct check: **CPU-native vs wasm32 replay-determinism** of the decoded
sprite states (plan §4). PROBE-GPU-LUT recorded only a CPU-reference run + an
adapter-skipped GPU leg — **no wasm result**. Tier (b) still requires its own
CPU-vs-wasm parity run before it can be called un-gated; PROBE-GPU-LUT does not
touch it.

## Results (2026-07-18 — HEVC external anchor, §5 optional context, RUN + VISUAL)

The plan §5 optional anchor ("run actual x265 over the CPU raster sequence;
report bits/frame + PSNR") is now RUN — and made visual.

- **Scene:** 8 gaussian sprites tracing φ-spiral (golden-angle hemisphere)
paths, alternating hemispheres by index parity — the sprite-replay scene
(NUM_SPRITES=8, TOTAL=240) rendered to pixels. 320×240, 240 frames, a faint
panning background so P/B-frames have global motion to track.
- **Encoder:** x265 3.5, preset medium, `--psnr`. x265 ran its OWN I/P/B GOP
over our moving scene (the arc's "replay x265's GOP grammar" made literal):
1 I, 56 P, 183 B, up to 5 consecutive B-frames.
- **Numbers:** raw Y4M 27,649,483 B → HEVC 43,115 B = **641×**; **1437.2
bits/frame** (180 B/frame); Global **PSNR 60.94 dB** (Y 47.5–52.0 by
slice-type; chroma neutral). Encode 316 fps. (Re-run after the CodeRabbit #738
fix: the reproducer now uses `sprite_replay`'s canonical draw sequence +
signed-z hemisphere projection; the earlier 578×/60.79 dB figures were the
pre-fix scene where `sign` was inert.)
- **Roundtrip visual:** frames decoded back OUT of the `.265` bitstream (ffmpeg)
into a 5-frame motion montage + animated GIF — the sprites visibly at
different positions/sizes across time.
- **Reproducer:** `lance-graph crates/helix/examples/hevc_moving_scene.rs`
(std-only, deterministic SplitMix64) → Y4M; `x265 --input scene.y4m --y4m
--preset medium --psnr -o scene.265`; `ffmpeg -i scene.265 … montage/gif`.

**Reading (honest):** this is an EXTERNAL ANCHOR (plan §5, explicitly "not a
gate"), NOT a claim about our codec. The 578× / 60.79 dB are **x265's** numbers
on a smooth-gaussian synthetic scene that compresses easily — they anchor "what
a stock HEVC encoder does with this content," not "our primitives beat x265."
The arc's own sprite-replay motion coding (E-SPRITE-IPB-HELIX-1: one Signed360
code per sprite per P-frame) is the thing being contextualized; the
bitrate-comparison study (our object-level motion codes vs x265's per-block MV
field on the SAME scene) is a NAMED follow-up, not done here.
Loading