Lane-midcut r3 handoff -- dedup verdict, rect chroma warp guard, 126-sample residue
Browse files at this commit14963908646b5980ebefac0cb932a70432e59cbcParent: 30e3110- docs
- lane-midcut r3 handoff -- dedup verdict, rect chroma warp guard, 126-sample residue
1 changed file +112 -0
- lanes/midcut-r3.handoff.md +112 -0
lanes/midcut-r3.handoff.mdadded+112 -0
| @@ -0,0 +1,112 @@ | ||
| 1 | +# lane-midcut r3 handoff -- dedup done, the rect chroma WARP guard was the residue's bulk | |
| 2 | + | |
| 3 | +Branch `lane-midcut`, worktree `edith_codecs-midcut`, | |
| 4 | +`CARGO_TARGET_DIR=$HOME/.cache/cargo-target-midcut`. Tip: `d93a149b`. | |
| 5 | +Reproduction of every cut here needs `EC_INTRA16X4_DECODE=1`. | |
| 6 | + | |
| 7 | +## STEP 0 -- merge + DEDUP VERDICT: my override was redundant, dropped | |
| 8 | + | |
| 9 | +`git merge 75b3a1d` (lane-t900 r3 tip, already containing main `243f125`): | |
| 10 | +clean auto-merge (decode.rs / stream.rs / decode_probe.rs). | |
| 11 | + | |
| 12 | +lane-t900 r2 switched EVERY rect intra reader's own call site to | |
| 13 | +`tx_size_context_txfm_rect` under `INTRA_IN_INTER_MODE`, so after the merge my | |
| 14 | +`cde8893` branch INSIDE `tx_size_context_rect` was unreachable: all seven | |
| 15 | +remaining `tx_size_context_rect` calls sit in the `else` arm of exactly that | |
| 16 | +condition (grep `tx_size_context_txfm_rect|tx_size_context_rect` in decode.rs). | |
| 17 | +Removed it (`d41cbc51`); kept the counter by moving | |
| 18 | +`intra_rect_in_inter_txctx_override_hits` INTO `tx_size_context_txfm_rect`, | |
| 19 | +where it still counts only blocks whose CDF row the deblock-grid approximation | |
| 20 | +would have read differently. Kept the r1 interintra rect blend (`43e9909`). | |
| 21 | + | |
| 22 | +Verification with t900's fix alone (no override anywhere): the 2-frame cut | |
| 23 | +`~/.cache/midcut-tmp/h2400.t2.obu`, decode-order PREFILT16 compare vs | |
| 24 | +instrumented aomdec -- frame 0 EXACT, frame 1 wrong-sample count 1317 | |
| 25 | +(Y 115, U 342, V 860), i.e. bit-identical to what my own override produced. | |
| 26 | +No site needs both. | |
| 27 | + | |
| 28 | +## STEP 1 -- ROOT CAUSE of the chroma residue (fixed, `8043ad54`) | |
| 29 | + | |
| 30 | +`decode_inter_block` allocates a SQUARE prediction buffer and gated the warp | |
| 31 | +per plane on `chroma_side >= 8` -- the BUFFER's side. libaom | |
| 32 | +`av1_init_warp_params` bails per PLANE at `block_width < 8 || block_height < 8` | |
| 33 | +on the BLOCK's dims, so the 8x4 / 4x8 chroma of a 16x8 / 8x16 luma block keeps | |
| 34 | +the translational prediction. Every rect block with a local or global warp | |
| 35 | +warped its chroma where libaom does not. Guards are now `warp_chroma_ok = | |
| 36 | +write_chroma_w >= 8 && write_chroma_h >= 8` (5 sites: 4 compound + 1 | |
| 37 | +single-ref) and `warp_luma_ok = write_w >= 8 && write_h >= 8` (3 luma sites). | |
| 38 | +Class: rectchroma2 / narrow-block-sharp-kernel (dims read off the enclosing | |
| 39 | +square buffer). The 8x8-leaf reader (`CHROMA_SIDE >= 8`, const-generic) was | |
| 40 | +already correct and is untouched. | |
| 41 | + | |
| 42 | +Frame 1 of the 2-frame cut: **1317 -> 126 wrong samples (Y 115, U 11, V 0)**. | |
| 43 | + | |
| 44 | +## RESIDUE STATE (126 samples, exact coordinates -- do not re-bisect) | |
| 45 | + | |
| 46 | +Three luma clusters + one chroma cluster, all in decode-order frame 1 of | |
| 47 | +`~/.cache/midcut-tmp/h2400.t2.obu` (dumps kept at `~/.cache/midcut-tmp/d2/`): | |
| 48 | + | |
| 49 | +| cluster | px | n | shape | | |
| 50 | +|---|---|---|---| | |
| 51 | +| SB(8,15) | y 552..559, x 960..969 | 18 | dithered +-1 | | |
| 52 | +| SB(9,7) | y 576..607, x 484..500 | 79 | a DIAGONAL +-1/+-2 band | | |
| 53 | +| SB(24,10) | y 1549..1552, x 647..658 | 18 | +1/+2 wedge | | |
| 54 | +| U | rows 800..803, cols 1216..1219 | 11 | -1..-2 | | |
| 55 | + | |
| 56 | +Every one of those blocks is an INTRA block inside the INTER frame, and every | |
| 57 | +one is RECT (`EC_TRACE_MODE_STEP` at those mi): | |
| 58 | +* SB(8,15) -> mi(136,240) `fn=rect bw=16 bh=32`, `mode=9` (SMOOTH), tx_depth 0. | |
| 59 | +* SB(9,7) -> mi(144,120) `fn=rect bw=8 bh=16` mode=4 angle_y=+2 (directional), | |
| 60 | + mi(144,122) `bw=8 bh=16` filter-intra, mi(144,124) `fn=sq side=16` mode=6 | |
| 61 | + angle_y=-2. | |
| 62 | +The diagonal band under a directional mode plus a dithered edge under SMOOTH is | |
| 63 | +the signature of ONE wrong edge sample, not a wrong predictor: suspect the | |
| 64 | +edge availability / reach for a RECT intra block inside an inter frame | |
| 65 | +(`n_top`/`n_left`, has-top-right, or the intra edge filter strength/upsample | |
| 66 | +computed from the square side rather than `bw x bh` -- `intra.rs:483 | |
| 67 | +directional`, `intra_edge_filter_strength`, `use_intra_edge_upsample`). | |
| 68 | +Classes to check first: reach-is-per-transform-unit, visit-order-changes- | |
| 69 | +availability, context-read-from-one-cell. | |
| 70 | + | |
| 71 | +## STEP 2 -- gate/counter wiring state | |
| 72 | + | |
| 73 | +* `intra_rect_in_inter_txctx_override_hits` compiles and counts in | |
| 74 | + `tx_size_context_txfm_rect`; it is **not yet printed by decode_probe and not | |
| 75 | + yet asserted by any gate** (turn cap). Next: print it next to | |
| 76 | + `interintra_rect:` in `crates/ec-av1/examples/decode_probe.rs:46` and assert a | |
| 77 | + positive delta in `intra_rect_in_inter_split_tx_gate` / `intra_rect_in_inter_gate`. | |
| 78 | +* `a_real_aomenc_stream_with_interintra_decodes_pixel_exact` was RED on this | |
| 79 | + branch: its recipe spells `--enable-rect-partitions=0 --min-partition-size=32`, | |
| 80 | + so r1's `interintra_rect_hits` delta assert was UNSATISFIABLE (40 pixel-exact | |
| 81 | + matches, counter 0). Fixed with a RECT ARM (`d93a149b`) that re-encodes the | |
| 82 | + same source with `--enable-rect-partitions=1 --min-partition-size=8 | |
| 83 | + --max-partition-size=64` APPENDED (last flag wins) and compares every | |
| 84 | + decode-order frame vs aomdec; seed 46's arm fires 4 rect interintra blocks. | |
| 85 | + Gate green (1 passed, 11.7 s). | |
| 86 | +* NO fixture pinned: frame 1 is still 126 samples off, so | |
| 87 | + `crates/ec-av1/fixtures/reelb_midcut_arf_witness.obu` and its decode-order gate | |
| 88 | + must wait for exactness. No refusal lifted; `refusal_inventory.rs` / | |
| 89 | + `gate_coverage.rs` untouched. | |
| 90 | + | |
| 91 | +## Gates run this round (per-name, systemd units) | |
| 92 | + | |
| 93 | +`$HOME/.cache/midcut-gates-r3.log` (at `d41cbc51`): `hidden_arf` 1 passed; | |
| 94 | +`rect64_corner_tus` 1 passed; `interintra` FAILED (the vacuous assert above, | |
| 95 | +now fixed); `1to4` / `refusal_inventory` / `gate_coverage` were still running at | |
| 96 | +the cap -- RE-RUN THEM at the tip. Full suite NOT run (coordinator: no suite). | |
| 97 | + | |
| 98 | +## 24-offset decode-order table (`~/.cache/midcut-tmp/cen/after_r3.tsv`) | |
| 99 | + | |
| 100 | +Written by `~/.cache/midcut-tmp/cen/run_r3.sh` (adds `EC_INTRA16X4_DECODE=1`, | |
| 101 | +which the r2 script lacked). Was still filling at the cap; through offset 4200 | |
| 102 | +every offset has frame 0 EXACT and frame 1 improved by 2-4 orders of magnitude | |
| 103 | +(e.g. 1800 s: 11612125 -> 1151; 2400 s: 11010633 -> 126; 3900 s frame 3: 495313 | |
| 104 | +-> 0). Only offset 0 is fully exact so far. Read the finished file before | |
| 105 | +quoting numbers. | |
| 106 | + | |
| 107 | +## Artifacts | |
| 108 | + | |
| 109 | +`~/.cache/midcut-tmp/`: `h2400.t2.obu` (2-frame cut, 4K 10-bit), | |
| 110 | +`d2/{aom,our}.f{0,1}` (PREFILT16 dumps both decoders, at the tip), | |
| 111 | +`m5.txt`/`m6.txt` (our `EC_TRACE_MODE`+`EC_TRACE_MODE_STEP` at the residue mi), | |
| 112 | +`cen/run_r3.sh`, `cen/after_r3.tsv`. |