Merge 84cf3a56 (ecmcb) — suite green: ecmcb 623/0
Browse files at this commit2 changed files +78 -13
- crates/ec-av1/src/decode.rs +16 -13
- lanes/av1ecmcb.report.md +62 -0
crates/ec-av1/src/decode.rsmodified+16 -13
| @@ -32146,7 +32146,8 @@ pub(crate) fn obmc_run( | ||
| 32146 | 32146 | let (mut tmp_y, mut tmp_u, mut tmp_v) = (Vec::new(), Vec::new(), Vec::new()); |
| 32147 | 32147 | |
| 32148 | 32148 | // lane-t900 r13 rung: EC_MCB="<plane>:<px>:<py>[:<frame>]" (chroma plane |
| 32149 | - // 1 only) prints this block's chroma prediction rows before and after the | |
| 32149 | + // 1 only; <px>:<py> are chroma-plane pixels, the oracle's own dump | |
| 32150 | + // window) prints this block's chroma prediction rows before and after the | |
| 32150 | 32151 | // OBMC blend, matching the instrumented aomdec's EC_MCB dump. |
| 32151 | 32152 | let ec_mcb: Option<(usize, usize, i64)> = crate::envflags::env_flag!("EC_MCB") |
| 32152 | 32153 | .then(|| crate::envflags::var("EC_MCB").ok()) |
| @@ -32159,22 +32160,23 @@ pub(crate) fn obmc_run( | ||
| 32159 | 32160 | let (x, y) = (f[1].parse::<usize>().ok()?, f[2].parse::<usize>().ok()?); |
| 32160 | 32161 | let fr = f.get(3).and_then(|s| s.parse::<i64>().ok()).unwrap_or(-1); |
| 32161 | 32162 | let idx = PREFILT_PICTURE_IDX.load(std::sync::atomic::Ordering::SeqCst) as i64; |
| 32162 | - if x >= cpx && x < cpx + write_w / 2 && y >= cpy && y < cpy + write_h / 2 | |
| 32163 | - && (fr < 0 || fr == idx) | |
| 32164 | - { | |
| 32163 | + // lane-av1ecmcb: the window is the CHROMA plane's own write region -- | |
| 32164 | + // the oracle's EC_MCB spans are plane pixels, and at 4:4:4 (ss 0/0) | |
| 32165 | + // the chroma block is full-size, so nothing halves. The old | |
| 32166 | + // `write_w / 2` was a 4:2:0-era assumption that quartered the window | |
| 32167 | + // (and the dumps below) at ss 0/0. | |
| 32168 | + let (cw, ch) = (write_w >> ss_x(fctx), write_h >> ss_y(fctx)); | |
| 32169 | + if x >= cpx && x < cpx + cw && y >= cpy && y < cpy + ch && (fr < 0 || fr == idx) { | |
| 32165 | 32170 | Some((x, y, idx)) |
| 32166 | 32171 | } else { |
| 32167 | 32172 | None |
| 32168 | 32173 | } |
| 32169 | 32174 | }); |
| 32170 | 32175 | if let Some((_, _, idx)) = ec_mcb { |
| 32171 | - eprintln!( | |
| 32172 | - "OUR_MCB pre f={idx} cpx={cpx} cpy={cpy} cw={} ch={}", | |
| 32173 | - write_w / 2, | |
| 32174 | - write_h / 2 | |
| 32175 | - ); | |
| 32176 | - for r in 0..write_h / 2 { | |
| 32177 | - let row: Vec<u16> = (0..write_w / 2).map(|c| pred_u[r * chroma_side + c]).collect(); | |
| 32176 | + let (cw, ch) = (write_w >> ss_x(fctx), write_h >> ss_y(fctx)); | |
| 32177 | + eprintln!("OUR_MCB pre f={idx} cpx={cpx} cpy={cpy} cw={cw} ch={ch}"); | |
| 32178 | + for r in 0..ch { | |
| 32179 | + let row: Vec<u16> = (0..cw).map(|c| pred_u[r * chroma_side + c]).collect(); | |
| 32178 | 32180 | eprintln!("OUR_MCB prerow{r}: {row:?}"); |
| 32179 | 32181 | } |
| 32180 | 32182 | } |
| @@ -32230,8 +32232,9 @@ pub(crate) fn obmc_run( | ||
| 32230 | 32232 | obmc_blend_h(pred_v, chroma_side, 0, coy, cbw, ch, &tmp_v); |
| 32231 | 32233 | } |
| 32232 | 32234 | if let Some((_, _, idx)) = ec_mcb { |
| 32233 | - for r in 0..write_h / 2 { | |
| 32234 | - let row: Vec<u16> = (0..write_w / 2).map(|c| pred_u[r * chroma_side + c]).collect(); | |
| 32235 | + let (cw, ch) = (write_w >> ss_x(fctx), write_h >> ss_y(fctx)); | |
| 32236 | + for r in 0..ch { | |
| 32237 | + let row: Vec<u16> = (0..cw).map(|c| pred_u[r * chroma_side + c]).collect(); | |
| 32235 | 32238 | eprintln!("OUR_MCB post f={idx} row{r}: {row:?}"); |
| 32236 | 32239 | } |
| 32237 | 32240 | } |
lanes/av1ecmcb.report.mdadded+62 -0
| @@ -0,0 +1,62 @@ | ||
| 1 | +# lane-av1ecmcb report -- the EC_MCB rung's halved window | |
| 2 | + | |
| 3 | +Branch `lane-av1-ecmcb`, base `fe3e8418`. Single item: close the deferred | |
| 4 | +`EC_MCB`-rung coordinate defect named in `lanes/av1llpred.report.md` ("still | |
| 5 | +windows its own dump with `write_w / 2` -- fix-now(deferred to whoever next | |
| 6 | +touches that rung)"). | |
| 7 | + | |
| 8 | +## Verdict: defect REAL, fixed (instrumentation only) | |
| 9 | + | |
| 10 | +`decode.rs::obmc_run`'s rung filtered the `EC_MCB="<plane>:<px>:<py>[:<frame>]"` | |
| 11 | +window and dumped the pre/post-blend chroma rows with `write_w / 2` / | |
| 12 | +`write_h / 2`. `write_w`/`write_h` are the block's LUMA write dims | |
| 13 | +(`decode_inter_block` ~30346: `cpx = px >> ss_x`), so the `/2` is correct only | |
| 14 | +at 4:2:0; at 4:4:4 (`ss 0/0`, decoded by this tree -- refusal inventory names | |
| 15 | +only 4:2:2) the chroma block is full-size and the old rung quartered both its | |
| 16 | +window and its row dumps. | |
| 17 | + | |
| 18 | +Oracle semantics (r13/r14 ground truth): aomdec's private `EC_MCB` printed | |
| 19 | +every `dec_build_inter_predictors` call whose PLANE-pixel span covers the | |
| 20 | +pixel. The saved pairing dumps still pin this: | |
| 21 | +`~/.cache/t900-tmp/aom_mcb41b.txt` prints `bw=16 bh=16` + 16x16 rows for the | |
| 22 | +32x32-luma block at mi(176,192) -- plane pixels -- and `our_mcb41.txt` matched | |
| 23 | +1:1 at 4:2:0. Plane pixels at `ss 0/0` are luma-sized, so the fix is | |
| 24 | +`write_w >> ss_x(fctx)` / `write_h >> ss_y(fctx)` in the window check and both | |
| 25 | +row dumps (bit-identical at 4:2:0: dims are even, `>>1 == /2`). | |
| 26 | + | |
| 27 | +Note: the oracle's private `EC_MCB` patch is no longer in | |
| 28 | +`~/.cache/aom-oracle/src` (t900-era tree reverted to pristine); the saved r13 | |
| 29 | +dumps are the surviving oracle ground truth and are what this closure pairs | |
| 30 | +against. | |
| 31 | + | |
| 32 | +## Verification | |
| 33 | + | |
| 34 | +* 4:2:0 pairing unchanged: `EC_MCB=1:353:395:41` on the pinned | |
| 35 | + `~/.cache/t900-tmp/c900_62.obu` (release `decode_probe`), block | |
| 36 | + `cpx=352 cpy=384 cw=16 ch=16` -- all 16 prerows byte-equal to the saved | |
| 37 | + oracle rows AND to the pre-fix `our_mcb41.txt` rows. | |
| 38 | +* 4:4:4 fail-before / pass-after: `aomenc --profile=1 --enable-obmc=1` gate | |
| 39 | + recipe (obmc gate's exact flags, `gradients` seed 43, 64x64, 25 frames, | |
| 40 | + `/tmp/ecmcb/s43.obu`, 444). `EC_MCB=1:48:48`: pre-fix binary fires 0 blocks | |
| 41 | + (48 is outside `cpy..cpy+16` for the `cpx=32 cpy=32` block); post-fix fires | |
| 42 | + `OUR_MCB pre f=5 cpx=32 cpy=32 cw=32 ch=32` with full 32-wide rows. | |
| 43 | +* Decode behavior unchanged: the diff touches only `env_flag!("EC_MCB")`-gated | |
| 44 | + lines (the closure is `.then`-gated, so with the env unset nothing new | |
| 45 | + runs). Gate `a_real_aomenc_stream_with_obmc_decodes_pixel_exact`: | |
| 46 | + `ok. 1 passed` (pixel-exact vs ffmpeg), genuinely ran (no SKIP). | |
| 47 | +* `cargo check -p ec-av1` (`CARGO_TARGET_DIR=$HOME/.cache/cargo-target-av1ecmcb`): | |
| 48 | + 0 warnings. | |
| 49 | + | |
| 50 | +## EVIDENCE | |
| 51 | + | |
| 52 | +EVIDENCE: ~/.cache/t900-tmp/aom_mcb41b.txt + /tmp/ecmcb/our_now_block.txt | EC_MCB=1:353:395:41 both decoders on c900_62.obu, block cpx=352 cpy=384 | 16/16 prerow values equal to the oracle's saved plane-pixel rows (post-fix) | |
| 53 | +EVIDENCE: /tmp/ecmcb/s43.obu + /tmp/ecmcb/post48.txt | aomenc --profile=1 --enable-obmc=1 (obmc-gate recipe, seed 43) + EC_MCB=1:48:48 | pre-fix 0 fires, post-fix `cw=32 ch=32` full-block dump at 4:4:4 | |
| 54 | +EVIDENCE: cargo test -p ec-av1 --lib a_real_aomenc_stream_with_obmc_decodes_pixel_exact | ok. 1 passed; 0 failed (decode path untouched) | |
| 55 | + | |
| 56 | +## Disposition | |
| 57 | + | |
| 58 | +fix-now (the deferred item): the rung is ss-aware and pairs at both chroma | |
| 59 | +shapes. No decode-behavior change shipped. The left-pass `OUR_MCB left` tmp | |
| 60 | +dump still prints the BLEND's own `cbw/cbh` (which reflect the blend's | |
| 61 | +per-axis halves) -- that is the rung instrumenting real decode geometry, not a | |
| 62 | +rung-side assumption, and stays as-is. |