forge
Explore
Log in

Don't you dare go Hollow

R4 report -- deblock root cause, cdef claim disproved, frame-5 residue

Browse files at this commit

1fd22e3f2bcfa6ac2b4102a24ace394adcd84884Ahmet Kaan GümüşParent: a176458
  • docs
    • r4 report -- deblock root cause, cdef claim disproved, frame-5 residue
Show full message
docs(sb128c): r4 report -- deblock root cause, cdef claim disproved, frame-5 residue
lanes/sb128c-r4.report.mdadded+132 -0
@@ -0,0 +1,132 @@
1+# lane-sb128c r4 report
2+
3+Tip `lane-sb128c` @ `6226c27` (worktree `edith_codecs-sb128c`,
4+`CARGO_TARGET_DIR=$HOME/.cache/cargo-target-sb128c`).
5+
6+## VERDICT: RED
7+
8+The r3 residue is CLOSED at its root cause (deblock), but the gate stream has a
9+SECOND, independent defect one decode-order frame later, in reconstruction.
10+
11+## (0) r3 suite result line
12+
13+`sb128c-suite-r3-1788327685.service`, `$HOME/.cache/sb128c-suite-r3.log`:
14+`test result: FAILED. 371 passed; 1 failed; 32 ignored; 0 measured; 0 filtered
15+out; finished in 797.36s`. The one failure is r3's own known-RED gate
16+`a_real_aomenc_inter_128x128_none_root_decodes_pixel_exact`.
17+
18+## (1) The x=64 band -- ROOT CAUSE FOUND AND FIXED
19+
20+Method: stage bisection with the aomdec instrumentation rungs, decode order.
21+
22+| decode-order frame | pre-filter | post-deblock | final (CDEF+LR) |
23+|---|---|---|---|
24+| 0..3 | exact | exact | exact |
25+| 4 | **exact** | **98 Y px, 274 C** | 98 Y / 274 C |
26+| 5..8 | wrong | wrong | wrong |
27+
28+Pre-filter exact + post-deblock wrong on the SAME frame => the loop filter, not
29+a symbol. The decisive measurement: against `EC_AV1_PREFILT_DUMP`, aomdec's own
30+post-deblock dump changes **ZERO** pixels in luma columns 50..78 of that frame,
31+while ours changes 98 (peak 26 at column 63, footprint 58..66 = the 14-tap
32+vertical filter at x=64). libaom does not filter that edge at all.
33+
34+Why: libaom `av1_loopfilter.c:set_one_param_for_line_luma` (and `_chroma`)
35+
36+```c
37+const int32_t pu_edge = mi_prev != mbmi;
38+if (!pu_edge) curr_skipped = mbmi->skip_txfm && is_inter_block(mbmi);
39+if ((pu_edge || !curr_skipped) && level) { params->filter_length = ...; }
40+```
41+
42+`get_transform_size` still reports TX_64X64 for a SKIP 128x128 inter block, so
43+the transform-unit edge at x=64 exists -- it is simply suppressed because it is
44+not a prediction-unit edge and the block is skipped. Every 128 block in this
45+stream is `is_inter=1 skip=1`.
46+
47+Fix (`crates/ec-av1/src/decode.rs`, commit `6226c27`):
48+- the per-leaf `fill_lf_grid_rect` loop (the var-tx leaf publication, ~line
49+ 19256) is gated on `!(skip && is_inter)`. The block-level publication of
50+ `write_w = 128` stays, which IS the suppression. The 128 root is the only
51+ block that reaches that loop skipped: `read_block_tx_size`'s
52+ `TX_MODE_LARGEST` branch hands back four TX_64X64 leaves for `side > 64`
53+ regardless of `skip`, while every `side <= 64` skip inter block gets `None`.
54+- `fill_lf_grid_rect`'s uv extent (~line 4186) drops its `.min(32)` cap. The
55+ cap was INERT for every block up to 64 wide (`64/2 == 32`) and wrong for a
56+ 128-sided one, where it published an internal chroma TU edge every 32 chroma
57+ px. A non-skip 128 block still gets uv 32, through its own per-leaf calls
58+ (`w_mi * MI == 64`).
59+- `dump_stage` now indexes its file per decode-order picture. It wrote a fixed
60+ `.f0` every frame, so `EC_AV1_POSTDEBLOCK_DUMP` only ever held the LAST
61+ picture and could not be compared against aomdec's indexed rung -- that is
62+ the instrument this root cause needed.
63+
64+Result on `$HOME/.cache/sb128c-work/g-61-8-0.obu`: decode-order frames 0..4 are
65+now exact at pre-filter, post-deblock AND final (`EC_AV1_FINAL_DUMP`, hidden
66+frames included). Before the fix frame 4 was wrong at post-deblock.
67+
68+## (1b) CDEF for a 128 root -- the charter's suspicion is WRONG, verified
69+
70+`read_cdef` (`av1/decoder/decodemv.c`) reads at most one literal PER CALL, and
71+is called once per BLOCK. For a `PARTITION_NONE` 128 root there is exactly one
72+block in the superblock, so exactly ONE `cdef_idx` symbol is read
73+(`index = cdef_unit_col_in_sb + 2 * cdef_unit_row_in_sb` = 0), and it is stored
74+into the block's own `MB_MODE_INFO`, which every mi cell of all four 64x64 CDEF
75+units points at. r1's "replicated over 4 quadrants" is CORRECT; no change made.
76+(Four symbols are read only when the 128 root SPLITs into four non-skip 64s.)
77+
78+## (2) The NEW frontier: decode-order frame 5, reconstruction
79+
80+Every reference of frame 5 is now pixel-exact at every stage, and frame 5 is
81+already wrong at PRE-FILTER, so this is not filter propagation:
82+
83+```
84+decode-order 5 pre-filter: Y 19609 px rows 128..255 cols 0..255 maxd 33
85+ C 5207 px
86+per-64x64-quadrant Y diff: [0,0,0,0] [0,0,0,0] [3707,844,3137,3889] [183,177,3844,3828]
87+first bad pixel: (128, 0)
88+```
89+
90+The whole BOTTOM superblock row, both 128x128 superblocks, from its very first
91+pixel; rows 0..127 exact. Our own mode trace for that picture lists the bottom
92+row as two `side=128 is_inter=1 skip=1` blocks. A skipped inter block's
93+reconstruction is pure motion compensation, the entropy stream stays in sync
94+for all 9 frames, and the quadrant diff is content-dependent (flat quadrants
95+mostly match, detailed ones mostly do not) -- the signature of a slightly wrong
96+predictor, i.e. mv / reference / interp filter / OBMC, NOT of a wrong write
97+geometry. Frame 4's own `(32,0)` 128 skip block decodes exact, so 128-wide MC
98+per se works.
99+
100+fix-now for r5; it is the only thing between this gate and GREEN.
101+
102+## (3) 128-level HORZ/VERT + AB -- NOT STARTED
103+
104+deferred: 128-level HORZ/VERT (128x64, 64x128) and AB on key and inter paths --
105+r4's budget went to (0)/(1) and the stage bisection that found the root cause;
106+unblocked by nothing, it is r5 work. It remains the FRONTIER for his 10-bit AV1
107+film.
108+
109+## ReelC re-probe (unchanged, as expected -- (3) was not started)
110+
111+Both `$HOME/.cache/sb128c-work/reelc2s.obu` and `$HOME/.cache/reelc-head.obu`
112+(1428 bytes each, `use_128x128_superblock=true bit_depth=10`) stop at
113+`a 128x128 superblock HORZ/VERT or AB partition (only SPLIT and NONE are
114+decoded at the 128 root)` with `EC_AV1_FINAL_DUMP` count **1**. That one frame
115+is **byte-identical** to ffmpeg's `yuv420p10le` decode of the same extract
116+(4561920 bytes, `cmp` clean).
117+
118+## EVIDENCE
119+
120+```
121+EVIDENCE: $HOME/.cache/sb128c-work/{pf-o,pf-m}.f0..f8, {pd-o,pd-m}.f* | aomdec EC_AV1_PREFILT_DUMP/EC_AV1_POSTDEBLOCK_DUMP vs ours, per decode-order frame | decode-order 0-4 pre-filter exact; frame 4 post-deblock 98 Y + 274 C before the fix
122+EVIDENCE: $HOME/.cache/sb128c-work/pd-o.f4 vs pf-o.f4 | aomdec's own post-deblock minus pre-filter, luma cols 50..78 | 0 pixels changed by libaom; ours changed 98 (peak 26 at col 63)
123+EVIDENCE: $HOME/.cache/sb128c-work/{fo,fm}.f0..f8 | EC_AV1_FINAL_DUMP (post CDEF+LR, decode order, hidden frames included) after the fix | frames 0-4 exact, first divergence decode-order 5
124+EVIDENCE: $HOME/.cache/sb128c-work/pf-m.f5 vs pf-o.f5 | per-64x64 quadrant diff map | rows 128..255 only, first bad pixel (128,0), maxd 33
125+EVIDENCE: $HOME/.cache/sb128c-work/{td.f0,ff.yuv} | decode_probe EC_AV1_FINAL_DUMP vs ffmpeg -pix_fmt yuv420p10le on reelc2s.obu | cmp IDENTICAL, 4561920 bytes
126+EVIDENCE: $HOME/.cache/sb128c-suite-r3.log | full lib suite on the r3 tip | 371 passed; 1 failed; 32 ignored
127+```
128+
129+## Suite
130+
131+`$HOME/.cache/sb128c-suite-r4.log` (unit `sb128c-suite-r4-1788328542.service`),
132+totals in the handoff. One KNOWN RED expected: the gate above.