Lane-intrarect r1 charter (rect intra predictor)
Browse files at this commit66b5de364be25c4cc35c222bb1797d702cf17b55Parent: 6632737- docs
- lane-intrarect r1 charter (rect intra predictor)
1 changed file +63 -0
lanes/intrarect-r1.charter.mdadded+63 -0
| @@ -0,0 +1,63 @@ | |||
| 1 | +# lane-intrarect r1 charter — rectangular INTRA prediction (predictor + edges only) | ||
| 2 | + | ||
| 3 | +Worktree /home/user/Documents/Code/Rust/edith_codecs-intrarect, branch lane-intrarect @ daa0e4b. | ||
| 4 | +Build/test ONLY: `env CARGO_TARGET_DIR=$HOME/.cache/cargo-target-intrarect CARGO_BUILD_JOBS=4 nice -n 19 cargo test -p ec-av1 --release --lib <name> -- --nocapture` | ||
| 5 | +FOREGROUND. Never push; never touch other worktrees (lane-gm is live in a sibling dir); fixtures/ is a symlink. | ||
| 6 | +BUDGET ~55 calls: WIP COMMIT after every green milestone; commit + report by call 45. | ||
| 7 | +libaom oracle source: ~/.cache/aom-oracle/src (NOT /tmp). | ||
| 8 | + | ||
| 9 | +## Why this lane | ||
| 10 | +The free-partition and AB gates refuse 17/40 attempts on INTRA-frame rect/AB | ||
| 11 | +partitions (`unsupported: AV1 tile (a partition type this encoder never writes | ||
| 12 | +(value=1|2|4|5|6|7))` raised from the KEY-frame dispatch, decode.rs ~3624/~3841). | ||
| 13 | +The inter side already decodes those partitions (HORZ/VERT/HORZ_A/VERT_A/VERT_B); | ||
| 14 | +the intra side cannot, because the predictor itself is square-only. | ||
| 15 | + | ||
| 16 | +## The blocker, precisely | ||
| 17 | +`crates/ec-av1/src/intra.rs::predict` takes ONE `side: usize` and asserts | ||
| 18 | +`dst.len() == side * side`; `Edges::build` extends each edge to `side * 2`. | ||
| 19 | +A 32x16 intra block needs `bw != bh` everywhere: DC's average over | ||
| 20 | +`bw + bh` samples, the directional walk's separate x/y extents, SMOOTH's two | ||
| 21 | +different weight tables, PAETH, and the edge extension to `bw + bh` (not | ||
| 22 | +`2*side`). | ||
| 23 | + | ||
| 24 | +## Scope — THE PREDICTOR ONLY. Do not touch the tile dispatch this round. | ||
| 25 | +1. Widen `Edges::build` and `predict` to `(bw, bh)`. Every existing caller | ||
| 26 | + (21 call sites across the crate) passes `(side, side)` — zero behavior | ||
| 27 | + change there, and that is the main thing the gates below prove. | ||
| 28 | +2. Port each mode's rect behaviour from ~/.cache/aom-oracle/src: | ||
| 29 | + - `aom_dsp/intrapred.c`: dc_predictor / dc_left / dc_top / dc_128 variants | ||
| 30 | + (`dc_predictor_rect` has the `bw + bh` sum with its expN/multiplier | ||
| 31 | + rounding -- transcribe the exact table use, do not re-derive it), | ||
| 32 | + `smooth_predictor` (`sm_weight_arrays` indexed separately by bw and bh), | ||
| 33 | + `paeth_predictor`, `v_/h_predictor`. | ||
| 34 | + - `av1/common/reconintra.c`: `av1_dr_prediction_z1/z2/z3` (the three | ||
| 35 | + directional zones take `bw`/`bh` separately, `dx`/`dy` from | ||
| 36 | + `av1_get_dr_intra_derivative`), `av1_filter_intra_edge`, | ||
| 37 | + `av1_upsample_intra_edge`, and `get_filt_type`/`intra_edge_filter_strength` | ||
| 38 | + which are indexed by `bw + bh` -- the blkWh term is where a square-only | ||
| 39 | + port silently diverges first (class decision-at-wrong-granularity). | ||
| 40 | +3. Unit tests: for a handful of (mode, angle_delta, bw, bh) combinations with | ||
| 41 | + bw != bh, assert the produced block against values you TRANSCRIBE from the | ||
| 42 | + C code by hand-running it in the test comment (show the arithmetic), OR | ||
| 43 | + better: build a tiny C harness under lanes/ that links the oracle's | ||
| 44 | + intrapred and dumps reference blocks, and check a checksum per case -- | ||
| 45 | + that is what lane-wedge did for its codebook (lanes/wedge_dump.c is the | ||
| 46 | + pattern to copy; the independent-oracle proof is what makes it landable). | ||
| 47 | + | ||
| 48 | +## Gate ladder | ||
| 49 | +(a) full lib suite (`-- --skip a_real_aomenc_stream_with_interintra_wedge`) -- | ||
| 50 | + every square path must be BIT-IDENTICAL; this is the real proof of item 1; | ||
| 51 | +(b) 14-pin default list; | ||
| 52 | +(c) the intra gates by name (filter_intra, directional_chroma, tx_select, | ||
| 53 | + intra_with_deblocking) -- run them, they exercise the predictor hardest. | ||
| 54 | +NOTE: the aomenc oracle now lives at ~/.cache/aom-oracle/build/aomenc; export | ||
| 55 | +`EC_AV1_REQUIRE_AOMENC=1` on gate runs so a missing oracle FAILS instead of | ||
| 56 | +silently skipping. | ||
| 57 | + | ||
| 58 | +## Done criteria | ||
| 59 | +1. `predict`/`Edges` are rect-capable and C-verified for bw != bh; all square | ||
| 60 | + behaviour bit-identical (suite green); the tile dispatch still refuses | ||
| 61 | + (next lane flips it). | ||
| 62 | +2. WIP commits; REPORT lanes/intrarect-r1.report.md, verdict FIRST line, | ||
| 63 | + naming exactly which modes are C-verified vs transcribed-only. | ||