Skip to content

Commit 52e44f5

Browse files
committed
feat(codec): PR-X12 v1 — λ-RDO mode selection + rANS entropy coder
Completes the x265-shaped cognitive codec to a usable v1 by adding the two stages the board tracked as missing (RDO + ANS): - `codec::rdo` (A6) — λ-rate-distortion mode selection: scores all four modes by `(rate << 8) + λ_q8·distortion` and picks the minimum. The soft, cost-weighted generalization of `predict_intra`'s hard tree. Uses an integer fixed-point λ (λ × 256) rather than the design's f32, for deterministic, cross-platform-bit-exact decisions consistent with the substrate's no-float discipline. - `codec::ans` (A7) — static-table rANS over the 4-symbol mode alphabet (Skip/Merge/Delta/Escape). Self-contained stream (count + normalized freq table + payload); bit-exact round-trip. Chosen over CABAC per the design's open-Q1 ruling. Grounded against the existing integer-only LeafCu/CellMode/MergeDir and the 2/3/3/6-byte wire format; transform (A4) stays deferred to v2 per design Q2, stream (A8) is the remaining follow-on. 81 lib tests + 20 doctests green; clippy -D warnings clean. https://claude.ai/code/session_01HbqooFZHAjaUtFEzhA1R2u
1 parent d67b6d4 commit 52e44f5

4 files changed

Lines changed: 1007 additions & 5 deletions

File tree

.claude/blackboard.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@
3434
## Consolidation-sprint debt (PR-X program; ground-truthed `ls src/hpc/` 2026-05-27)
3535
> Shipped-state vs `pr-master-consolidation.md`. Landed: ✅ **PR-X10** `linalg/`,
3636
> **PR-X11** `pillar/`, ✅ **PR-X13** `ogit_bridge/`, ✅ **PR-X3** `blocked_grid/`.
37-
- **PR-X12 codec ⚠️ PARTIAL**`src/hpc/codec/` has `ctu/mode/predict/mod` only;
38-
**RDO + ANS entropy stages missing**. Doc-canon merged (#198/#205), kernel half-built.
37+
- **PR-X12 codec ⚠️ v1 NEAR-COMPLETE**`ctu/mode/predict` + now **`rdo` (A6, λ-RDO,
38+
integer fixed-point λ_q8 — no float) + `ans` (A7, static-table rANS over the 4-symbol
39+
mode alphabet, bit-exact round-trip)**. Remaining: `transform` (A4, deferred to v2 per
40+
design Q2) + `stream` (A8, framing over `ans`). 81 lib + 20 doctests green, clippy clean.
3941
- **PR-X4 splat4d ❌ OUTSTANDING** — no `src/hpc/splat4d/`. Unbuilt.
4042
- **PR-X9 cognitive ❌ OUTSTANDING** — no `src/hpc/cognitive/`. Unbuilt; must **consume**
4143
`lance-graph-contract::splat::CamPlaneSplat` (q8), never redefine it (contract is sacred).

0 commit comments

Comments
 (0)