Lane-t900 r4 handoff -- rect interintra cherry-pick and the split-half edge-filter neighbour fix take frame 1 to a chroma-only residue
Browse files at this commite3f5bae9201327b8a35c2c27d911e311e165526bParent: 4438a11- docs
- lane-t900 r4 handoff -- rect interintra cherry-pick and the split-half edge-filter neighbour fix take frame 1 to a chroma-only residue
1 changed file +117 -0
- lanes/t900-r4.handoff.md +117 -0
lanes/t900-r4.handoff.mdadded+117 -0
| @@ -0,0 +1,117 @@ | |||
| 1 | +# lane-t900 r4 handoff -- two reconstruction root causes closed; frame 1 is now a chroma-only +/-1 residue | ||
| 2 | + | ||
| 3 | +Branch `lane-t900`, tip `d068c94`. Worktree `edith_codecs-t900`. | ||
| 4 | +`CARGO_TARGET_DIR=$HOME/.cache/cargo-target-t900-b` carried the release | ||
| 5 | +`decode_probe` this round. Reproduction still needs BOTH | ||
| 6 | +`EC_INTRA128_IN_INTER=1` and `EC_INTRA16X4_DECODE=1`. | ||
| 7 | + | ||
| 8 | +## STEP 0 -- `git cherry-pick 43e9909` (lane-midcut r1, rect interintra) | ||
| 9 | + | ||
| 10 | +Clean, no conflicts (`decode_probe.rs`, `decode.rs`, `stream.rs`), commit | ||
| 11 | +`5d323a6`. `cargo build -p ec-av1 --release --example decode_probe` clean. | ||
| 12 | + | ||
| 13 | +Effect on the 2-frame 10-bit 1920x792 128-SB cut | ||
| 14 | +`~/.cache/inter128intra-tmp/t900_2.obu`, decode-order compare | ||
| 15 | +(`~/.cache/t900-tmp/cmp.sh`, both decoders under `EC_AV1_FINAL_DUMP`): | ||
| 16 | + | ||
| 17 | +| | f0 | f1 differing bytes | | ||
| 18 | +|---|---|---| | ||
| 19 | +| r3 tip `f9720de` | EXACT | 114374 | | ||
| 20 | +| after `5d323a6` | EXACT | **1549** | | ||
| 21 | +| after `d068c94` | EXACT | **258** (chroma only) | | ||
| 22 | + | ||
| 23 | +So the r3 "next residue" (mi(24,248) 32x16 skip NEARESTMV ref1=INTRA_FRAME, | ||
| 24 | +all 512 px off by -2) WAS the square-only interintra blend: it is gone. | ||
| 25 | + | ||
| 26 | +## ROOT CAUSE 2 (fixed, `d068c94`) -- edge-filter neighbours of the FIRST half | ||
| 27 | + | ||
| 28 | +`Neighbours::modes_above_left(r, c)` (decode.rs:5677) derives its mi-exact | ||
| 29 | +lookup key from the coarse 16x16 cell: `mi_r = r * 4`, `mi_c = c * 4`. The | ||
| 30 | +rect intra-in-inter site (decode.rs:7668) called it for BOTH 8x16 halves of a | ||
| 31 | +PARTITION_VERT 16x16, so the second half asked for the neighbours of the | ||
| 32 | +first. libaom's `above_mbmi`/`left_mbmi` are the block's own | ||
| 33 | +(`mi[-mi_stride]`/`mi[-1]`), so `get_intra_edge_filter_type` | ||
| 34 | +(reconintra.c:974) came out 0 where libaom has 1, and every directional half | ||
| 35 | +whose real above/left neighbour was SMOOTH* filtered its edge at the wrong | ||
| 36 | +strength. | ||
| 37 | + | ||
| 38 | +Witness, decode-order frame 1, block mi(104,234) = px(936,416), 8x16, | ||
| 39 | +mode 5 (D113_PRED) angle_delta -1 -> p_angle 110, tx 8x16: | ||
| 40 | + | ||
| 41 | +* aomdec `EC_PRED ... ft=1`, `EC_PREDOUT sum=43066->41767 row0=325,321,316,...` | ||
| 42 | +* ours `OUR_PRED ... ft=0 sum=41742 row0=[325,320,316,...]` | ||
| 43 | +* re-running the spec walk in python from the (exact) neighbours with | ||
| 44 | + filter type 1 reproduces 41767 exactly, with type 0 reproduces 41742. | ||
| 45 | +* the smoking gun (temporary `EC_FT` rung, removed): | ||
| 46 | + `mi_r=104 mi_c=232 ... above=11 mie=(11,0)` / `mi_r=104 mi_c=234 ... | ||
| 47 | + above=0 coarse=(0,0) mie=(9,0)` -- the mi-exact pair for the block's OWN | ||
| 48 | + mi is SMOOTH_PRED(9), the coarse-cell one is DC. | ||
| 49 | +* the above neighbours are the two 8x32 strips at mi(96,232) SMOOTH_H(11) | ||
| 50 | + and mi(96,234) SMOOTH(9) -- aomdec prints them as `EC_PREDND` (the | ||
| 51 | + non-directional early-return), which is why they are missing from an | ||
| 52 | + `EC_PRED`-only grep. | ||
| 53 | + | ||
| 54 | +Fix: `modes_above_left_mi(mi_r, mi_c, modes_above_left(r, c))` at | ||
| 55 | +decode.rs:7668 -- the same wrapping decode.rs:26106 and `decode_leaf8` | ||
| 56 | +already use. Luma frame-1 residue 1269 px -> 0. | ||
| 57 | + | ||
| 58 | +`OUR_PRED` now also prints `ft=` so the filter type can be diffed against | ||
| 59 | +aomdec's `EC_PRED ... ft=` directly. | ||
| 60 | + | ||
| 61 | +## SIBLING SITES NOT SWEPT (do this first next round) | ||
| 62 | + | ||
| 63 | +`modes_above_left(r, c)` has 8 more callers: decode.rs 7813, 9656, 11178, | ||
| 64 | +11839, 12162, 13059, 22499, 23664. 12162 already wraps with | ||
| 65 | +`modes_above_left_mi(leaf_mi..)`; **13059 has `leaf_mi` in scope and does | ||
| 66 | +NOT** -- same shape, sub-8 4x8/8x4 leaves. CAUTION: at 7813 and 13059 the | ||
| 67 | +pair also feeds the intra-mode CDF row, so changing it moves the ENTROPY | ||
| 68 | +stream -- re-run the ladder, not just the pixels. | ||
| 69 | + | ||
| 70 | +## CURRENT FIRST-BAD BLOCK (decode order) -- chroma only | ||
| 71 | + | ||
| 72 | +Pre-loop-filter compare `~/.cache/t900-tmp/pf.sh` (both under | ||
| 73 | +`EC_AV1_PREFILT_DUMP16`), analysis `sb.py`/`px.py`/`reg.py` in the same dir: | ||
| 74 | +f0 EXACT, f1 Y **0 px**, U 98 px, V 62 px, deltas -2..+3, spread over 11 | ||
| 75 | +superblocks, no luma anywhere. | ||
| 76 | + | ||
| 77 | +First in decode order: SB(0,5), first differing chroma sample (365,48) = | ||
| 78 | +luma px(730,96) => mi(24,182). | ||
| 79 | + | ||
| 80 | +* `EC_MODE mi_row=24 mi_col=182 rng=64328 is_inter=1 skip=0 side=16`, | ||
| 81 | + `EC_MODE_VAL mode=14 (NEARMV) ref0=1 ref1=-1 mv0=(22,-44) stack=3 | ||
| 82 | + rng=64888`; the block is 8x16 luma (mi cols 182..183) => **4x8 chroma**, | ||
| 83 | + i.e. the `w <= 4` narrow-kernel branch. `motion_mode`/`interp` were not | ||
| 84 | + captured for it this round. | ||
| 85 | +* Signature: luma bit-exact, chroma +/-1 (a few +/-2) scattered -- the | ||
| 86 | + memory class `narrow-block-sharp-kernel` (chroma-only +/-1..3 where the | ||
| 87 | + chroma width is 4). | ||
| 88 | +* NOT captured yet: an `EC_PRED`-style per-stage split for INTER blocks. | ||
| 89 | + The r4 EC_PRED capture covers intra prediction only (`EC_PRED` / | ||
| 90 | + `EC_PREDND` / `EC_PREDOUT` are all in `reconintra.c`); it showed the intra | ||
| 91 | + stage, not the inter one, and it is what closed root cause 2. | ||
| 92 | + | ||
| 93 | +## EXACT NEXT STEP | ||
| 94 | + | ||
| 95 | +1. `mc.rs:413/418` already picks `h_narrow`/`v_narrow` on `kern_w <= 4` / | ||
| 96 | + `kern_h <= 4`; libaom | ||
| 97 | + (`av1_get_interp_filter_params_with_block_size`) tests the X filter | ||
| 98 | + against `w` and the Y filter against `h`, REGULAR and SHARP both mapping | ||
| 99 | + to `av1_interp_4tap[0]` and SMOOTH to `[1]`. Check what `kern_w`/`kern_h` | ||
| 100 | + the CHROMA call passes for an 8x16 luma block (decode.rs ~30542 is the | ||
| 101 | + test helper; find the real chroma `mc::predict` call) -- if it passes the | ||
| 102 | + LUMA dims, every 4-wide chroma block uses the 8-tap. | ||
| 103 | +2. If that is not it, instrument the chroma convolve on both sides | ||
| 104 | + (aomdec `av1_convolve_2d_sr_c` / `av1_highbd_...`) and diff the | ||
| 105 | + intermediate row for mi(24,182) plane 1. | ||
| 106 | +3. Then STEP 1 of the r4 charter (the four 2 s cuts | ||
| 107 | + `~/.cache/rectres-tmp/t900/t5400/t6300/t8100.obu`, both env switches, | ||
| 108 | + `cmp.sh`), STEP 2 (pin the witness fixture), STEP 3 (named gates + suite). | ||
| 109 | + NONE of those ran this round. | ||
| 110 | + | ||
| 111 | +## Artifacts | ||
| 112 | + | ||
| 113 | +`~/.cache/t900-tmp/`: `cmp.sh` (final dumps), `pf.sh` (NEW, prefilter | ||
| 114 | +dumps), `px.py` (per-plane diff histogram), `sb.py` (per-superblock | ||
| 115 | +decode-order first-bad table), `reg.py` (row-by-row diff span), | ||
| 116 | +`a5.pred`/`o6.pred` (aomdec `EC_PRED` and our `OUR_PRED`, both frames), | ||
| 117 | +`a4.mode`/`o4.mode` (mode traces), `pf_t900_2/`, `d_t900_2/`. | ||