R1+r2 report -- chroma edge filter type below 16x16, root cause + gate + suite totals
Browse files at this commitf3ecd38183e3fc7a97b58a1617f18e9bda2f844fParent: 6c2db9e- docs
- r1+r2 report -- chroma edge filter type below 16x16, root cause + gate + suite totals
1 changed file +87 -0
- lanes/cfl-r1.report.md +87 -0
lanes/cfl-r1.report.mdadded+87 -0
| @@ -0,0 +1,87 @@ | ||
| 1 | +# lane-cfl r1+r2 report — chroma intra-edge filter type below 16x16 | |
| 2 | + | |
| 3 | +Branch `lane-cfl` @ `7148dba` (off `lane-rectx` bb41f82; not rebased, per charter). | |
| 4 | +r1 and r2 were both killed at their turn/session cap; their work was preserved as WIP | |
| 5 | +commits 38d096e + 455a142 and is squashed into `7148dba` by this round. | |
| 6 | + | |
| 7 | +## Root cause | |
| 8 | + | |
| 9 | +libaom `get_filt_type` (reconintra.c) chooses the chroma intra-edge filter STRENGTH from | |
| 10 | +`chroma_above_mbmi`/`chroma_left_mbmi`'s `uv_mode` (smooth-family neighbour => filtered | |
| 11 | +edge). Two defects stacked on the sub-16x16 path: | |
| 12 | + | |
| 13 | +1. **Constant `false`.** `decode_leaf_rect` and `decode_leaf_8x8` passed a literal `false` | |
| 14 | + as `smooth_neighbor_uv` into every chroma `reconstruct_rect` call, so a chroma edge was | |
| 15 | + never smooth-filtered below 16x16 regardless of the neighbour. | |
| 16 | +2. **Neighbour map coarser than the block.** `above_uv_mode`/`left_uv_mode` are written in | |
| 17 | + `SUB` (16px) cells by `for cell in 0..w / SUB`, which iterates ZERO times for a block | |
| 18 | + narrower/shorter than 16. A sub-16 block therefore never *wrote* its uv_mode, and every | |
| 19 | + reader (including the 16x16-and-up ones) saw whatever the last 16x16-or-larger block had | |
| 20 | + left in that slot. Class: *context read from one cell* / neighbour map coarser than the | |
| 21 | + block, the chroma twin of lane-rectx r5's luma `mode_above_mi`/`mode_left_mi`. | |
| 22 | + | |
| 23 | +Observed symptom before the fix: the mandelbrot cq16 cell filtered a chroma left edge at | |
| 24 | +`ft=0` where the instrumented aomdec prints `ft=1` (left edge `95,59,30,28` vs `90,61,37,29`). | |
| 25 | + | |
| 26 | +## Files changed | |
| 27 | + | |
| 28 | +- `crates/ec-av1/src/decode.rs:1886,2015,2089,2349,2595` — `Neighbours::sub8_mode_col/row` | |
| 29 | + widened from `(pos, mode)` to `(pos, mode, uv_mode)`; every reset/init site updated. | |
| 30 | +- `crates/ec-av1/src/decode.rs:2622-2680` — `uv_mode_above_mi`/`uv_mode_left_mi` and | |
| 31 | + `uv_modes_above_left{,_mi}`: mi-exact chroma neighbour with the coarse `SUB` slot as | |
| 32 | + fallback; tile-edge guards (`mi_r > tile_row0_mi` / `mi_c > tile_col0_mi`) inherited from | |
| 33 | + the luma twin, per the COMMON neighbour-map rule. | |
| 34 | +- `crates/ec-av1/src/decode.rs:3422,3825,4001,5122,5552` — every `smooth_neighbor_uv` | |
| 35 | + derivation now goes through `uv_modes_above_left{,_mi}`; `decode_leaf_rect` (3825) and | |
| 36 | + `decode_leaf_8x8` (5552) previously had none at all. | |
| 37 | +- `crates/ec-av1/src/decode.rs:3854,3858,3910,3926, 5216..5428` — chroma reconstruct call | |
| 38 | + sites take the derived flag. **Sweep: `grep -c "None, false," decode.rs` = 0** — no | |
| 39 | + constant-false chroma edge-filter site remains. | |
| 40 | +- `crates/ec-av1/src/decode.rs:775-805,3294` — gate counters `uv_mode_mi_override_hits`, | |
| 41 | + `cfl_block_hits`, `uv_angle_delta_hits`. | |
| 42 | +- `crates/ec-av1/src/stream.rs:5597-5742` — the gate (below). | |
| 43 | + | |
| 44 | +No refusal string was lifted this lane (none in `refusal_inventory.rs` covered this path); | |
| 45 | +`gate_coverage.rs` unchanged. | |
| 46 | + | |
| 47 | +## Gate | |
| 48 | + | |
| 49 | +`a_real_aomenc_stream_whose_chroma_edge_filter_reads_a_sub16_neighbours_uv_mode_decodes_pixel_exact` | |
| 50 | +— real aomenc, `mandelbrot=size=64x64:start_x=-0.6`, `--cq-level=16 --cpu-used=4 | |
| 51 | +--sb-size=64 --enable-rect-partitions=1 --enable-filter-intra=1 --reduced-tx-type-set=1 | |
| 52 | +--min-partition-size=8 --max-partition-size=32`, aomenc output hashed twice for | |
| 53 | +reproducibility, pixel-compared against ffmpeg. Hard asserts `cfl_blocks > 0`, | |
| 54 | +`angle_blocks > 0`, `uv_overrides > 0`, and `compared > 0` (no vacuous pass). The 10-bit | |
| 55 | +arm is tolerated ONLY on a message containing "unsupported" and is then not compared. | |
| 56 | + | |
| 57 | +``` | |
| 58 | +EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib chroma_edge_filter_reads_a_sub16 -- --nocapture | |
| 59 | +``` | |
| 60 | + | |
| 61 | +EVIDENCE: $HOME/.cache/cfl-suite.log (gate line) | aomenc mandelbrot -0.6 64x64 cq16 rtx=1 filter-intra=1, decode_stream vs ffmpeg_decode_sequence, all three planes | pixel-exact at 8-bit, cfl_blocks=15 angle_delta_uv_blocks=19 uv_mi_overrides=52; test result ok 1 passed | |
| 62 | + | |
| 63 | +EVIDENCE: scratchpad/ours.yuv vs scratchpad/ff.yuv | `cargo run -p ec-av1 --example decode_probe -- cfl.obu ours.yuv` on the same aomenc stream; `ffmpeg -i cfl.obu -pix_fmt yuv420p -f rawvideo ff.yuv`; `cmp` | byte-identical, 6144 bytes, sha256 c8cfa9b332f9c6e8... | |
| 64 | + | |
| 65 | +## Suite | |
| 66 | + | |
| 67 | +`EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib` (log `$HOME/.cache/cfl-suite.log`): | |
| 68 | +**273 passed; 0 failed; 24 ignored; 0 filtered out** (963.81s), exit 0. | |
| 69 | + | |
| 70 | +Siblings re-run green in that suite (COMMON sibling-gate rule): `a_real_libaom_cfl_stream_decodes_pixel_exact`, | |
| 71 | +`a_real_aomenc_stream_whose_square_block_reads_a_sub16_neighbours_mode_decodes_pixel_exact`, | |
| 72 | +`a_real_aomenc_stream_with_a_coded_rect_strip_below_16x16_decodes_pixel_exact`, | |
| 73 | +`a_rect_strip_below_16x16_reads_its_own_filter_intra_cdf_row`, | |
| 74 | +`a_real_aomenc_filter_intra_stream_decodes_pixel_exact`, | |
| 75 | +`a_real_aomenc_stream_with_smooth_luma_neighbour_decodes_pixel_exact`, | |
| 76 | +`a_real_aomenc_stream_with_smooth_paeth_chroma_decodes_pixel_exact`, | |
| 77 | +`a_real_aomenc_stream_with_directional_chroma_decodes_pixel_exact`, | |
| 78 | +`rect_reach_tables_are_indexed_with_a_32_mi_row_stride`, plus all three | |
| 79 | +`refusal_inventory::tests::*` and both `gate_coverage::tests::*`. | |
| 80 | + | |
| 81 | +## Residue | |
| 82 | + | |
| 83 | +- deferred(lane owning sub-16 AB partitions): the 10-bit twin of this recipe stops at | |
| 84 | + `a HORZ_A/HORZ_B/VERT_A partition below 16x16` and is therefore never pixel-compared. | |
| 85 | + The gate records this explicitly rather than passing silently. | |
| 86 | +- accepted: no refusal string lifted — this round is a correctness fix behind existing | |
| 87 | + capability, not a capability claim. |