Skip to content

Knowledge: HEVC/H.265 amortization map onto the BF16 16×16 AMX tile substrate#234

Merged
AdaWorldAPI merged 3 commits into
masterfrom
claude/hevc-amortization-map
Jul 4, 2026
Merged

Knowledge: HEVC/H.265 amortization map onto the BF16 16×16 AMX tile substrate#234
AdaWorldAPI merged 3 commits into
masterfrom
claude/hevc-amortization-map

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Jul 4, 2026

Copy link
Copy Markdown
Owner

What

The durable ledger for the thesis — use the BF16 16×16 AMX GEMM / blasgraph neighborhood / Morton-tile pyramid / perturbation-shader cascade to amortize H.265/HEVC. It maps every HEVC DSP stage to the substrate primitive (gather + one TDPBF16PS tile op over a deterministic pyramid built once), with every row tagged MEASURED / MECHANISM-unmeasured / DOESN'T-FIT — no unmarked conjecture.

The map

HEVC stage reduces to status
Motion est./comp. i8/bf16 GEMM + gather MEASURED #230
Inverse transform separable tile GEMM; WHT no-op MEASURED #232
Intra / covariance field-coupling tile op MEASURED shape #233
Sub-pel (8-tap) separable tile GEMM MECHANISM — probe subpel_tap_tile
CTU quad-tree Morton/HHTL cascade MECHANISM — shipped
Deblock/SAO masked tile op + LUT PARTIAL — the "AMX masking"
CABAC entropy serial arithmetic coding DOESN'T FIT

Two honest boundaries (recorded, not glossed)

  1. CABAC is not a GEMM — the entropy layer is the M2 serial front-end the tile substrate does not amortize. The thesis amortizes the DSP, not the entropy.
  2. The golden-spiral codec is for directional/sparse data, not dense scalar residuals (Probe: residue upscaling — the anatomy 2000→4M technique on a codec residual (measured, honest-negative for scalar-dense) #231, measured negative — use DPCM/WHT there).

Grounding

Cross-repo tie confirmed in code: OGAR's perturbation pyramid is the Walsh–Hadamard transform of the address tree (OGAR/CLAUDE.md, Bipolar-phase pyramid) = the same WHT #232 measured as the codec transform. The perturbation-shader cascade and the codec transform are one object.

Anchors: PRs #230#233 (all measured, #233 on real TDPBF16PS); hpc::bf16_tile_gemm, hpc::splat3d::spd3, hpc::cascade, hpc::codec; lance-graph blasgraph HHTL. Includes a probe queue for the unmeasured stages.

Docs-only; no code change.

🤖 Generated with Claude Code


Generated by Claude Code

Summary by CodeRabbit

  • Documentation
    • Added a new technical knowledge note outlining an HEVC/H.265 acceleration approach on BF16 AMX tiles.
    • Summarizes how codec work can be grouped into reusable primitive layers, with coverage of major pipeline stages and what can or cannot be amortized.
    • Includes a prioritized list of follow-up measurements, boundary conditions, and reference anchors for related work.

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@AdaWorldAPI, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 30 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7ea68091-1e71-4cf2-903e-3a733cce2f2f

📥 Commits

Reviewing files that changed from the base of the PR and between 6c7352a and af72945.

📒 Files selected for processing (1)
  • .claude/knowledge/hevc-amortization-map.md
📝 Walkthrough

Walkthrough

Adds a new knowledge document .claude/knowledge/hevc-amortization-map.md outlining a proposed mapping of HEVC/H.265 codec stages onto a BF16 16×16 AMX tile substrate, describing addressing, tile-op coupling, entropy layer, amortization scope, boundaries, and a probe queue. No code or public API changes.

Changes

HEVC Amortization Knowledge Document

Layer / File(s) Summary
Core thesis and primitive model
.claude/knowledge/hevc-amortization-map.md
Introduces the gather/bit-shift plus BF16 AMX tile-op thesis and the "one primitive, three layers" model, including the SIMD palette-packing entropy approach replacing CABAC.
Stage mapping and amortization scope
.claude/knowledge/hevc-amortization-map.md
Maps HEVC stages (motion estimation, transforms, intra prediction, deblocking, entropy, etc.) to substrate primitives with status tags, and describes what amortizes via build-once reuse and shared tile GEMM routing.
Boundaries and future work
.claude/knowledge/hevc-amortization-map.md
Documents two boundaries (CABAC compatibility vs. palette entropy; golden-spiral scope), a prioritized probe queue for future measurements, and anchor references to prior PRs/shipped components.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

A rabbit hops through tiles of BF16,
Mapping codecs in a substrate so keen,
Gather, shift, and GEMM in a row,
Boundaries marked so probes know where to go,
Hop, hop, hooray—the knowledge doc's set to glow! 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the doc-only change and summarizes the main HEVC/H.265 amortization map addition.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 496bc458e4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +58 to +59
stored per-block (helix principle). Every block pays only: a gather + 1–2 tile
ops + a residue magnitude. The 64×64 gridlake = 4×4 = **16 tile ops**.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the DCT/GEMM batch crossover

When the transform stage has fewer than 64 contiguous blocks, this unconditional per-block tile-cost claim contradicts the companion plan’s R-5 rule: .claude/knowledge/pr-x12-codec-cognitive-substrate-mapping.md:188-194 says per-block butterflies win and GEMM only wins above the batch crossover, and pr-x12-substrate-canon-resolutions.md:411-418 pins the dispatch at N < 64 butterfly / N >= 64 batched GEMM. Leaving this ledger as “every block pays” 1–2 tile ops can steer small-CTU or low-latency experiments to the BF16 tile path and invalidate the measurements; please carry the R-5 threshold into this summary.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/knowledge/hevc-amortization-map.md:
- Around line 6-7: The status ledger in the hevc-amortization-map table uses
inconsistent vocabulary: the legend only defines MEASURED, MECHANISM, and
DOESN'T FIT, but later rows use SHIPPED and MECHANISM — shipped. Update the
taxonomy so it is internally consistent by either adding SHIPPED to the legend
or remapping those rows to one of the existing status symbols, and make the same
fix anywhere the table entries use the inconsistent labels.
- Around line 32-33: The palette-based entropy layer is being presented as if it
is already part of the current codec contract, but the existing
`src/hpc/codec/mod.rs` and `src/hpc/codec/ans.rs` docs still describe the
shipped x265-shaped taxonomy and static per-block rANS path. Update the affected
sections by clearly labeling `ndarray::palette_codec` / `nibble` / `byte_scan`
as proposal or future work, and tighten the wording so it does not claim a fully
parallel end-to-end replacement while later describing a light rANS pass.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4b2c58f3-8530-4748-8a41-14c3252c7ee9

📥 Commits

Reviewing files that changed from the base of the PR and between 93cc06c and 6c7352a.

📒 Files selected for processing (1)
  • .claude/knowledge/hevc-amortization-map.md

Comment thread .claude/knowledge/hevc-amortization-map.md Outdated
Comment thread .claude/knowledge/hevc-amortization-map.md
AdaWorldAPI pushed a commit that referenced this pull request Jul 4, 2026
- 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
AdaWorldAPI pushed a commit that referenced this pull request Jul 4, 2026
- 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
@AdaWorldAPI AdaWorldAPI force-pushed the claude/hevc-amortization-map branch from a2b5974 to 651e14b Compare July 4, 2026 10:55
claude added 3 commits July 4, 2026 10:58
…ubstrate

The durable ledger for the operator's thesis: use the BF16 16×16 AMX GEMM /
blasgraph neighborhood / Morton-tile pyramid / perturbation-shader cascade to
amortize H.265/HEVC — the per-block cost collapsing to a gather (bit shift) +
one TDPBF16PS tile op over a deterministic pyramid built once.

Maps every HEVC DSP stage to the substrate primitive, each row tagged
MEASURED (#PR) / MECHANISM-unmeasured (probe named) / DOESN'T-FIT:

  - Motion estimation/compensation → i8/bf16 GEMM + gather   [MEASURED #230]
  - Inverse transform → separable tile GEMM; WHT no-op        [MEASURED #232]
  - Intra prediction / covariance → field-coupling tile op    [MEASURED shape #233]
  - Sub-pel interpolation (8-tap) → separable tile GEMM        [MECHANISM — probe]
  - CTU quad-tree → Morton/HHTL cascade                        [MECHANISM — shipped]
  - Deblock/SAO → masked tile op + LUT (the "AMX masking")     [PARTIAL — masking]
  - CABAC entropy → serial arithmetic coding                   [DOESN'T FIT]

Two honest boundaries recorded: (1) CABAC is not a GEMM — the entropy layer is
the M2 serial front-end the tile substrate does not amortize; (2) the
golden-spiral codec is for directional/sparse data, not dense scalar residuals
(#231, measured negative). Cross-repo tie grounded: OGAR's perturbation pyramid
IS the Walsh-Hadamard transform of the address tree = the same WHT #232 measured
as the codec transform.

Includes a probe queue (subpel_tap_tile, intra_angular_tile, deblock_masked_tile,
CTU routing parity, M2 CABAC). Anchors: PRs #230#233; hpc::bf16_tile_gemm,
splat3d::spd3, cascade, codec; blasgraph HHTL; OGAR perturbation pyramid.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MLBnPuScZy6w9di2QEjsXM
…utes 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
- 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
@AdaWorldAPI AdaWorldAPI force-pushed the claude/hevc-amortization-map branch from 651e14b to af72945 Compare July 4, 2026 10:58
@AdaWorldAPI AdaWorldAPI merged commit bbca88e into master Jul 4, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants