You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
knowledge: HEVC map — palette codec is the parallel entropy layer (routes around CABAC)
The Pumpkin/Minecraft palette ops (ndarray::palette_codec / nibble / byte_scan,
69 tests) complete the amortization: the substrate quantises to a small palette
(≤256 basin/centroid indices), so its native entropy layer is variable-width
SIMD palette packing (unpack_indices_simd, VPSHUFB, 16 idx/cycle; transcode =
per-block bit-width adaptivity) — fully parallel, not a serial arithmetic coder.
Refines the CABAC boundary: CABAC is still needed to decode an EXISTING .265
stream (M2 serial front-end), but a substrate-NATIVE codec doesn't need it —
the whole native encode+decode pipeline is parallel end to end:
gather + tile op + palette-pack, no serial stage. The boundary is .265
compatibility, not the substrate's own entropy needs. (Palette pack is a
rate/parallelism trade; a light rANS on the packed indices recovers the rest.)
Adds an entropy row to the stage map + the three-layer table, and updates the
honest-boundaries + anchors sections.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MLBnPuScZy6w9di2QEjsXM
Copy file name to clipboardExpand all lines: .claude/knowledge/hevc-amortization-map.md
+19-7Lines changed: 19 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,7 @@ HEVC kernels.
29
29
|**address (bit shift)**| integer motion / tile position / CTU quad-tree = pure addressing, zero arithmetic (`VPGATHERDD`) |`hpc::cascade` (Morton), blasgraph `heel_hip_twig_leaf` / `clam_neighborhood` (lance-graph) |
30
30
|**couple (tile op)**| a 16×16 BF16 GEMM `C = A·B` = one `TDPBF16PS` — every linear field coupling / transform / covariance projection |`hpc::bf16_tile_gemm::bf16_tile_gemm_16x16`, `hpc::splat3d::spd3::sandwich_x16`|
31
31
|**code (place/residue)**| deterministic pyramid PLACE (free) + coded RESIDUE magnitude; the perturbation phase IS the Walsh–Hadamard sign transform of the address tree |`hpc::splat3d::helix_orient`, `crates/helix` (lance-graph), OGAR `guid-prefix-shape-routing.md §4b`|
32
+
|**entropy (palette pack)**| small-alphabet indices → variable-width SIMD bit-pack (VPSHUFB, 16 idx/cycle) — the parallel entropy layer that replaces serial CABAC |`ndarray::palette_codec` / `nibble` / `byte_scan` (Pumpkin/Minecraft port; 28+23+18 tests) |
32
33
33
34
The perturbation-shader cascade and the codec transform are **the same object**:
34
35
OGAR canon states "the perturbation pyramid becomes the Walsh–Hadamard transform
@@ -48,7 +49,8 @@ matching the DCT within 2%. Same ±1 sign butterfly, two names.
|**Deblocking + SAO** (in-loop filters) | conditional edge filter + offset LUT — clip/branch-heavy, *not pure GEMM*|**[PARTIAL — AMX masking]** the operator's "AMX masking": the filter is a masked tile op (predicated add), SAO is a gather-LUT. Fits with masking, not plain GEMM. Unmeasured |
51
-
|**CABAC entropy** (context-adaptive binary arithmetic) | serial, bit-level, data-dependent arithmetic coding |**[DOESN'T FIT]** — a serial dependency chain, not a GEMM. AMX/tiles do not help. This is the M2 front-end and stays a separate serial layer. The honest boundary of the thesis. |
52
+
|**Entropy — substrate-native** (palettise, don't arithmetic-code) | small alphabet (≤256 basin/centroid indices) → **variable-width SIMD palette pack** (VPSHUFB, 16 idx/cycle) |**[SHIPPED]**`ndarray::palette_codec` (Pumpkin/Minecraft port, 28 tests): `pack_indices_simd`/`unpack_indices_simd` bit-exact all 1–8 bit widths; `transcode` = per-block bit-width adaptivity; `nibble` (4-bit) + `byte_scan` (NBT) complete the byte layer. Fully parallel — NO serial stage |
53
+
|**CABAC entropy** (context-adaptive binary arithmetic — `.265` compat only) | serial, bit-level, data-dependent arithmetic coding |**[DOESN'T FIT — but the substrate doesn't need it]** CABAC is a serial dependency chain, not a GEMM; AMX/tiles do not help. It is required ONLY to decode an *existing*`.265` bitstream (the M2 serial front-end). A substrate-**native** codec replaces it with the SIMD palette-pack row above (the codec already quantises to a small palette), so the native encode+decode pipeline is fully parallel end to end: `gather + tile op + palette-pack`. The boundary is `.265`-compat, not the substrate's own entropy needs. |
52
54
53
55
## What amortizes, precisely
54
56
@@ -68,10 +70,19 @@ matching the DCT within 2%. Same ±1 sign butterfly, two names.
68
70
69
71
## The two honest boundaries
70
72
71
-
1.**CABAC is not a GEMM.** Entropy (de)coding is inherently serial arithmetic
72
-
coding — the one HEVC stage the tile substrate does not amortize. A real
73
-
`.265` decoder needs it (M2). The thesis amortizes the **DSP**, not the
74
-
**entropy layer**.
73
+
1.**CABAC is not a GEMM — but the substrate routes around it.** CABAC entropy
74
+
(de)coding is inherently serial arithmetic coding; the tile substrate does not
75
+
amortize it, and a real `.265` decoder still needs it (the M2 serial
76
+
front-end). BUT the substrate does not *need* CABAC: it quantises to a small
77
+
palette (≤256 basin/centroid indices), so its native entropy layer is
78
+
**variable-width SIMD palette packing** (`ndarray::palette_codec`, the
79
+
Pumpkin/Minecraft port — `unpack_indices_simd`, VPSHUFB, 16 idx/cycle,
80
+
`transcode` for per-block bit-width). A substrate-native encode+decode is then
81
+
fully parallel end to end — `gather + tile op + palette-pack`, no serial stage.
82
+
The boundary is therefore `.265`*compatibility*, not the substrate's own
83
+
entropy needs. (Palette packing is a rate/parallelism trade vs an optimal
84
+
arithmetic coder — cheaper and parallel, near-optimal when the palette is
85
+
well-chosen; a light rANS pass on the packed indices recovers the rest.)
75
86
2.**The golden-spiral is for directional/sparse data, not dense scalars.** Per
76
87
#231 (measured negative), coding a *dense scalar* residual with sparse
77
88
golden-spiral anchors loses to local DPCM; the golden-spiral / helix codec
@@ -97,5 +108,6 @@ matching the DCT within 2%. Same ±1 sign butterfly, two names.
97
108
PRs #230 (ME=GEMM, MC bit-exact), #231 (residue upscaling — measured negative for
0 commit comments