R3 report + handoff -- prefilter stage attribution, EC_OBMC emitter diffs 325/325 clean, root cause = the 8x8 compound leaf's missing per-ref global warp, gate un-ignored
Browse files at this commit2dcf2ed787382113348f2aa7ddebda25f6af00beParent: 8ff77a4- docs
- r3 report + handoff -- prefilter stage attribution, EC_OBMC emitter diffs 325/325 clean, root cause = the 8x8 compound leaf's missing per-ref global warp, gate un-ignored
2 changed files +193 -0
- lanes/interp3-r3.handoff.md +87 -0
- lanes/interp3-r3.report.md +106 -0
lanes/interp3-r3.handoff.mdadded+87 -0
| @@ -0,0 +1,87 @@ | |||
| 1 | +# lane-interp3 r3 HANDOFF (turn cap) -- root cause FOUND and FIXED, suite still running | ||
| 2 | + | ||
| 3 | +Tip: `f36be26` on branch `lane-interp3` (fix) + this handoff/report commit. | ||
| 4 | + | ||
| 5 | +## Suite state | ||
| 6 | +- r2 suite (unit `interp3-suite-r2-1788327820.service`, log `$HOME/.cache/interp3-suite-r2.log`), | ||
| 7 | + armed at the r2 commit, FINISHED: | ||
| 8 | + `test result: ok. 378 passed; 0 failed; 34 ignored; 0 measured; 0 filtered out; finished in 742.50s` | ||
| 9 | +- r3 suite armed at f36be26: unit `interp3-suite-r3-1788328778.service`, | ||
| 10 | + log `$HOME/.cache/interp3-suite-r3.log`. At the cap it had 258 `... ok`, ZERO | ||
| 11 | + `FAILED`/`panicked`, no `test result:` line yet. READ THAT LINE, do not re-run | ||
| 12 | + blindly, then paste it into `lanes/interp3-r3.report.md` where | ||
| 13 | + `EVIDENCE: SUITE_LINE_PLACEHOLDER` sits. | ||
| 14 | + | ||
| 15 | +## Stage attribution of the frame-7 residue (done FIRST, as chartered) | ||
| 16 | +`EC_AV1_PREFILT_DUMP` on both decoders over the pinned 16-frame stream | ||
| 17 | +(`.../scratchpad/mm.obu`), byte compare per decode-order frame: | ||
| 18 | +frames 0-6 identical, frame 7 = 35 differing luma bytes, 8..15 grow to 224. | ||
| 19 | +=> PRE-FILTER, i.e. prediction/reconstruction, never the loop filter/CDEF/LR. | ||
| 20 | +All 35 sit in luma rows 42-47, cols 16-23, i.e. the block at mi (10,4); | ||
| 21 | +rows 40-41 of that same block are EXACT and the error grows downward. | ||
| 22 | + | ||
| 23 | +## What the OBMC comparison actually said (emitter built, class swept, CLEAN) | ||
| 24 | +Before writing the emitter, the hand comparison against libaom found NO mismatch: | ||
| 25 | +`overlappable_above`/`overlappable_left` stepping and `max_neighbor_obmc` | ||
| 26 | +(`{0,1,2,3,4,4}`, 8x8 -> 1 per pass) match `obmc.h:20-55`; overlap sizes | ||
| 27 | +(4 luma rows above / 4 luma cols left at 8x8, chroma 2) match | ||
| 28 | +`build_obmc_inter_pred_{above,left}`; `av1_skip_u4x4_pred_in_obmc` chroma-above | ||
| 29 | +skip matches; `obmc_mask_1/2/4/8/16/32` are byte-identical to | ||
| 30 | +`reconinter.c:752-765`; OBMC never warps (`if (!build_for_obmc) av1_init_warp_params`). | ||
| 31 | +One real divergence candidate was left un-ported and is still a documented | ||
| 32 | +corner-cut, not a defect on this content: `obmc.h`'s `mi_step == 1` 4-wide pair | ||
| 33 | +merge, and libaom's `op_mi_size = AOMMIN(xd->width, mi_step)` which can exceed | ||
| 34 | +the remaining span while ours clips with `.min(end_col - col)` (only reachable | ||
| 35 | +for a 2nd neighbour with a wide step). | ||
| 36 | + | ||
| 37 | +Emitter: `decode.rs:15806` `ec_obmc_bsize()` + `decode.rs:15828` `ec_obmc_trace()`, | ||
| 38 | +called at both passes in `obmc_blend`. Format is aomdec's own bytes: | ||
| 39 | +`EC_OBMC above|left mi=(r,c) wh=(WxH) rel=N op=N nbmv=(y,x) nbref=N nbbsize=N filt=N` | ||
| 40 | +(`filt` = packed `interp_filters.as_int` = `y | (x << 16)`). | ||
| 41 | +`diff` of the 325 oracle lines vs our 325: EMPTY. OBMC is exonerated. | ||
| 42 | + | ||
| 43 | +Also added `decode.rs:14682` + `:22658` `EC_PICT idx=` (decode-order frame | ||
| 44 | +marker under `EC_OBMC`/`EC_TRACE_MODE`). REQUIRED: the marker prints AFTER the | ||
| 45 | +frame's own trace lines, so `awk` must count markers seen, not read the value on | ||
| 46 | +the preceding line -- attributing by the preceding `EC_PICT` value is off by one | ||
| 47 | +and cost part of this round. | ||
| 48 | + | ||
| 49 | +## Hypotheses ruled out (each by measurement) | ||
| 50 | +- OBMC neighbour fields / masks / overlap: 325/325 identical lines (above). | ||
| 51 | +- Frame 7 has NO OBMC block at mi (10,4) at all -- it is COMPOUND | ||
| 52 | + (SIMPLE_TRANSLATION), so the r2 handoff's "OBMC over a compound neighbour" | ||
| 53 | + suspect could not have been it. | ||
| 54 | +- Residual/entropy: r2's range ladder is exact end to end; `EC_MCDUMP` (a | ||
| 55 | + temporary rung, removed before commit) showed aom_recon - our_residual | ||
| 56 | + reproduces our PREDICTION in rows 40-41 and diverges below => prediction. | ||
| 57 | +- Wrong dual-filter x/y assignment: a swap would err in every row, not only the | ||
| 58 | + lower ones. | ||
| 59 | + | ||
| 60 | +## Root cause (FIXED, gate GREEN) | ||
| 61 | +`decode_inter_block8`'s COMPOUND arm predicted BOTH taps translationally. | ||
| 62 | +libaom applies `allow_warp`'s GLOBAL branch to every `is_global_mv_block` | ||
| 63 | +reference slot -- compound included, independent of `motion_mode` | ||
| 64 | +(`av1_init_warp_params` inside `build_inter_predictors_8x8_and_bigger`'s per-`ref` | ||
| 65 | +loop; `reconinter.c:33-55`). `decode_inter_block`'s compound arm has done this | ||
| 66 | +since lane-cwarp r1 (`decode.rs:16691`). Third twin-functions-drift instance in | ||
| 67 | +this lane. Frame 7 mi (10,4): GLOBAL_GLOBALMV, ref0=GOLDEN mv (0,0), | ||
| 68 | +ref1=ALTREF mv (-3,4), comp_group_idx=1. | ||
| 69 | +Fix: `decode.rs:19513` (`leaf_compound_warp`, `warp0_c`/`warp1_c`), | ||
| 70 | +`decode.rs:19596`/`:19618` (`warp_affine_compound` per luma tap; chroma is 4x4, | ||
| 71 | +below `av1_init_warp_params`'s 8px per-plane bound, so it stays translational). | ||
| 72 | +Counter `COMPOUND_WARP_HITS_8` / `compound_warp_hits_8()` at `decode.rs:1786`. | ||
| 73 | +After the fix ALL 16 decode-order frames are byte-identical pre-filter. | ||
| 74 | + | ||
| 75 | +## Gate | ||
| 76 | +`a_real_aomenc_dual_filter_obmc_8x8_inter_sequence_decodes_pixel_exact` | ||
| 77 | +(`stream.rs:6332`) is UN-IGNORED and GREEN with four hard asserts (compound-8x8 | ||
| 78 | +filter read, differing dual-filter directions, 8x8 OBMC blend, 8x8 compound | ||
| 79 | +GLOBAL warp). `$HOME/.cache/interp3-gate-r3.log`: `1 passed; 0 failed`. | ||
| 80 | + | ||
| 81 | +## EXACT NEXT STEP | ||
| 82 | +1. Read the r3 suite `test result:` line, fill the placeholder in the report, | ||
| 83 | + commit. If any test failed, it is a sibling of the warp change: re-run it | ||
| 84 | + alone and bisect against f36be26^. | ||
| 85 | +2. Then the lane's open residue is only the two deferrals in the report | ||
| 86 | + (10-bit arm blocked by lane-inter8's 10-bit 8x8-leaf desync; `--tile-columns=1` | ||
| 87 | + arm blocked by the SB-level rect-partition refusal). | ||
lanes/interp3-r3.report.mdadded+106 -0
| @@ -0,0 +1,106 @@ | |||
| 1 | +# lane-interp3 r3 -- the 8x8 COMPOUND leaf never applied the per-ref GLOBAL warp; gate is GREEN and un-ignored | ||
| 2 | + | ||
| 3 | +Base: d06d93f (r2 handoff, already merged with main). | ||
| 4 | + | ||
| 5 | +## Root cause (one line) | ||
| 6 | + | ||
| 7 | +`decode_inter_block8`'s COMPOUND arm predicted **both** reference taps | ||
| 8 | +translationally, while libaom applies `allow_warp`'s GLOBAL branch to every | ||
| 9 | +`is_global_mv_block` reference slot -- compound included and independently of | ||
| 10 | +`motion_mode` (`av1_init_warp_params` is called inside | ||
| 11 | +`build_inter_predictors_8x8_and_bigger`'s per-`ref` loop, `reconinter.c:33-55` | ||
| 12 | +for `allow_warp` itself). The 16x16+ compound arm has done this since | ||
| 13 | +lane-cwarp r1 (`decode.rs:16691`); the 8x8 leaf is its twin and drifted. | ||
| 14 | +Third instance in this lane of the class **twin functions drift**. | ||
| 15 | + | ||
| 16 | +Effect on the pinned stream: the GLOBAL_GLOBALMV compound 8x8 leaf at | ||
| 17 | +mi (10,4) of decode-order frame 7 (ref0=GOLDEN mv (0,0), ref1=ALTREF mv | ||
| 18 | +(-3,4), `comp_group_idx=1` masked compound) was predicted with a pure | ||
| 19 | +translation, so its prediction error was 0 at the block's top rows and grew | ||
| 20 | +downward to |delta| 5 -- then propagated through every later frame. | ||
| 21 | + | ||
| 22 | +## It was NOT the OBMC blend (the r2 handoff's first suspect, disproved) | ||
| 23 | + | ||
| 24 | +An `EC_OBMC` emitter was added to both OBMC passes in `decode.rs`, printing the | ||
| 25 | +instrumented aomdec's own byte format | ||
| 26 | +(`EC_OBMC above|left mi=() wh=() rel= op= nbmv=() nbref= nbbsize= filt=`, | ||
| 27 | +`decodeframe.c` `dec_build_prediction_by_{above,left}_pred`). The two decoders | ||
| 28 | +emit **325 identical lines** on the pinned 16-frame stream -- neighbour | ||
| 29 | +position, span, mv, reference, bsize and packed dual-filter pair all agree at | ||
| 30 | +every OBMC call. The class sweep the charter asked for (neighbour-side fields | ||
| 31 | +used by OBMC: filter, ref, mv, scale) is therefore CLEAN by measurement, not by | ||
| 32 | +inspection; `obmc_mask_1/2/4/8/16/32` were also byte-compared against | ||
| 33 | +`reconinter.c:752-765` and match. | ||
| 34 | + | ||
| 35 | +Frame 7 has no OBMC block at mi (10,4) at all: it is a compound block, and | ||
| 36 | +compound blocks take SIMPLE_TRANSLATION. | ||
| 37 | + | ||
| 38 | +## Changed (path:line, this commit) | ||
| 39 | + | ||
| 40 | +- `crates/ec-av1/src/decode.rs:19513` -- `leaf_compound_warp` + | ||
| 41 | + `warp0_c`/`warp1_c`, the leaf's per-slot copy of `decode_inter_block`'s | ||
| 42 | + `compound_warp` (`force_integer_mv` short-circuit, `gm.invalid` guard). | ||
| 43 | +- `crates/ec-av1/src/decode.rs:19596,19618` -- `warp::warp_affine_compound` | ||
| 44 | + replaces each luma tap's translational intermediate, exactly as the 16x16+ | ||
| 45 | + arm does at 17130/17155. Chroma is 4x4 at an 8x8 leaf, below | ||
| 46 | + `av1_init_warp_params`'s own per-plane 8px bound, so chroma stays | ||
| 47 | + translational (same rule the leaf's single-ref arm already applied). | ||
| 48 | +- `crates/ec-av1/src/decode.rs:1786` -- `COMPOUND_WARP_HITS_8` + | ||
| 49 | + `compound_warp_hits_8()`: the gate's proof that the warp fired at an 8x8 | ||
| 50 | + LEAF specifically (`COMPOUND_WARP_HITS` alone cannot tell it from a 16x16+). | ||
| 51 | +- `crates/ec-av1/src/decode.rs:15806` (`ec_obmc_bsize`) and `15828` | ||
| 52 | + (`ec_obmc_trace`) + the two call sites in `obmc_blend` -- the `EC_OBMC` rung. | ||
| 53 | +- `crates/ec-av1/src/decode.rs:14682,22658` -- `EC_PICT idx=` decode-order | ||
| 54 | + frame marker (printed under `EC_OBMC`/`EC_TRACE_MODE`), so a trace line can be | ||
| 55 | + attributed to the frame whose `EC_AV1_PREFILT_DUMP` file mismatched. Without | ||
| 56 | + it the r2 hunt mis-attributed every trace line by one frame. | ||
| 57 | +- `crates/ec-av1/src/stream.rs:6332` -- the gate's `#[ignore]` removed, doc | ||
| 58 | + comment carries this round's measurement, and a third hard assert | ||
| 59 | + (`compound_warp_hits_8() > before`) added. | ||
| 60 | + | ||
| 61 | +## Class sweep | ||
| 62 | + | ||
| 63 | +Both inter block decoders are the only prediction sites | ||
| 64 | +(`decode_inter_block` 16309, `decode_inter_block8` 19032); all 12 | ||
| 65 | +`predict_compound_intermediate` calls were audited. Warp coverage is now: | ||
| 66 | +16x16+ single-ref (18235-18253), 16x16+ compound y/u/v x 2 refs | ||
| 67 | +(17130-17300), 8x8 leaf single-ref (20238-20253), 8x8 leaf compound luma x 2 | ||
| 68 | +refs (19596/19618, chroma correctly excluded). No third twin exists. | ||
| 69 | + | ||
| 70 | +## Gate: GREEN, un-ignored | ||
| 71 | + | ||
| 72 | +`a_real_aomenc_dual_filter_obmc_8x8_inter_sequence_decodes_pixel_exact` | ||
| 73 | +(`--enable-dual-filter=1 --enable-obmc=1 --enable-warped-motion=1 | ||
| 74 | +--enable-onesided-comp=1`, `--min-partition-size=8 --enable-ab-partitions=0 | ||
| 75 | +--enable-1to4-partitions=0`, 64x64, 16 frames). Four hard asserts now: | ||
| 76 | +compound 8x8 leaf reading its own switchable filter, a block whose two | ||
| 77 | +dual-filter directions DIFFER, an 8x8 OBMC blend, and an 8x8 compound leaf | ||
| 78 | +predicted through the per-ref GLOBAL warp. | ||
| 79 | + | ||
| 80 | +Command: | ||
| 81 | +`EC_NOMEMGUARD=1 EC_AV1_REQUIRE_AOMENC=1 CARGO_TARGET_DIR=$HOME/.cache/cargo-target-interp3 cargo test -p ec-av1 --lib a_real_aomenc_dual_filter_obmc_8x8_inter_sequence_decodes_pixel_exact` | ||
| 82 | +Result: `test result: ok. 1 passed; 0 failed` (log `$HOME/.cache/interp3-gate-r3.log`). | ||
| 83 | + | ||
| 84 | +## Refusals | ||
| 85 | + | ||
| 86 | +None lifted. The r1 refusal `an OBMC neighbour whose interp filter was never | ||
| 87 | +recorded` stays (it does not fire on this stream); `refusal_inventory.rs` and | ||
| 88 | +`gate_coverage.rs` unchanged. | ||
| 89 | + | ||
| 90 | +## EVIDENCE | ||
| 91 | + | ||
| 92 | +EVIDENCE: /tmp/claude-1000/-home-user-Documents-Code-Rust-edith-codecs/b6d8a07f-96a4-4bbb-b378-af9ae25cf7c9/scratchpad/{aom.obmc,ours.obmc} | `EC_OBMC=1 aomdec --rawvideo -o /dev/null mm.obu` vs `EC_OBMC=1 decode_probe mm.obu`, `diff` of every EC_OBMC line | 325 vs 325 lines, diff EMPTY -- OBMC neighbour selection/mv/ref/bsize/filter exonerated | ||
| 93 | +EVIDENCE: same dir, pf_a/f.f0..15 vs pf_o/f.f0..15 | `EC_AV1_PREFILT_DUMP` on both decoders, byte compare per decode-order frame BEFORE the fix | frames 0-6 identical, frame 7 35 bytes differ (all inside luma rows 42-47, cols 16-23 = the 8x8 leaf at mi (10,4)), growing to 224 at frame 15 | ||
| 94 | +EVIDENCE: same dir, pf_a vs pf_o2 | identical command AFTER the fix | all 16 decode-order frames byte-identical pre-filter (0 differing bytes) | ||
| 95 | +EVIDENCE: $HOME/.cache/interp3-gate-r3.log | `cargo test -p ec-av1 --lib a_real_aomenc_dual_filter_obmc_8x8_inter_sequence_decodes_pixel_exact -- --nocapture` | `test result: ok. 1 passed; 0 failed` with all four counter asserts live (the run would panic if `compound_warp_hits_8` had not moved) | ||
| 96 | +EVIDENCE: SUITE_LINE_PLACEHOLDER | ||
| 97 | + | ||
| 98 | +## Residue | ||
| 99 | + | ||
| 100 | +- deferred(lane-inter8's 10-bit 8x8-leaf desync) -- a 10-bit twin of this gate. | ||
| 101 | + Its sibling `a_real_aomenc_10bit_inter_sequence_with_an_8x8_leaf_split_...` | ||
| 102 | + is still `#[ignore]`d on an unrelated 10-bit desync (lane-inter8 r2), so a | ||
| 103 | + 10-bit arm of this recipe would go RED on that, not on interp3's own path. | ||
| 104 | +- deferred(needs a multi-tile recipe that reaches an 8x8 leaf) -- a | ||
| 105 | + `--tile-columns=1` arm. lane-inter8 r3 measured that the 128x64 multi-tile | ||
| 106 | + recipe stops at the SB-level rect-partition refusal before any 8x8 leaf. | ||