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
review: address codex + coderabbit on the HEVC amortization map (#234)
- codex P2 (R-5 crossover): the tile path is NOT unconditional per block. Carry
the R-5 dispatch rule — per-block WHT butterflies win below the batch crossover
(~400× for a 32×32 DCT), batched BF16 tile GEMM only wins above it; crossover
per-arch (SPR=64, ICX=32, Zen4=96, Apple M=256, Graviton=128). Ship both,
dispatch on N. Removes the misleading "every block pays a tile op".
- coderabbit (status vocab): add SHIPPED + PARTIAL to the legend so the table's
tags match the declared taxonomy.
- coderabbit (palette proposal vs contract): label the palette-index entropy
layer as SHIPPED module / PROPOSED codec wiring — the shipped codec uses
hpc::codec::ans static rANS over the 4 CellMode tags today. Fix the "fully
parallel end to end" vs "light rANS" tension: the substrate has no
context-adaptive serial stage; an optional non-adaptive order-0 rANS over the
packed indices is interleavable, not a CABAC dependency chain.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MLBnPuScZy6w9di2QEjsXM
|**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 |
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. |
54
+
|**Entropy — palette-pack module** (parallel, small-alphabet) | small alphabet (≤256 basin/centroid indices) → **variable-width SIMD palette pack** (VPSHUFB, 16 idx/cycle) |**[SHIPPED module / PROPOSED codec wiring]**`ndarray::palette_codec` (Pumpkin/Minecraft port, 28 tests): `pack_indices_simd`/`unpack_indices_simd` bit-exact all 1–8 widths; `transcode` = per-block bit-width; `nibble`+`byte_scan` complete the byte layer. **Not yet wired as the codec's entropy stage** — the shipped codec (`hpc::codec::ans`) currently does static per-block rANS over the 4 `CellMode` tags. Using palette-index packing *as* the codec's entropy layer is the proposed change.|
55
+
|**CABAC entropy** (context-adaptive binary arithmetic — `.265` compat only) | serial, bit-level, data-dependent arithmetic coding |**[DOESN'T FIT — and the substrate can route around 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). The substrate quantises to a small palette, so its entropy need is met by the SIMD-parallel palette-pack row above (SHIPPED module; PROPOSED as the codec's stage) — with, at most, a light static-rANS pass over the packed indices for the last few %. So "route around CABAC" = replace context-adaptive arithmetic coding with parallel palette-pack (+ optional non-adaptive rANS), NOT "zero entropy coding." The boundary is `.265`-compat, not the substrate's own entropy needs. |
54
56
55
57
## What amortizes, precisely
56
58
57
59
-**Build once, reuse per block.** The transform basis (WHT ±1 sign matrix), the
58
60
interpolation taps, the Morton pyramid, the palette/centroid codebooks, and the
59
61
golden-spiral place template are **deterministic** — computed once, never
60
-
stored per-block (helix principle). Every block pays only: a gather + 1–2 tile
61
-
ops + a residue magnitude. The 64×64 gridlake = 4×4 = **16 tile ops**.
62
-
-**One kernel, many stages.** ME, inverse transform, intra prediction, sub-pel,
63
-
and covariance all route through `bf16_tile_gemm_16x16`. The substrate is the
64
-
zero-FP cognitive shader (gather + tile ops), so "the codec IS the substrate"
0 commit comments