From 45881e7ddc08fc862df04235e44e3a1faf9633d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 30 Sep 2026 04:03:49 +0300 Subject: [PATCH] lane-av1422anom: the odd-width 4:2:2 anomaly is a 4:2:0 odd-HEIGHT reconstruction defect; add a counting oracle diff, its non-vacuity test, and a pinned ratchet witness --- .../ec-av1/fixtures/420_oddheight_320x232.obu | Bin 0 -> 15773 bytes crates/ec-av1/src/stream.rs | 161 +++++++++++ lanes/av1422anom.report.md | 261 ++++++++++++++++++ 3 files changed, 422 insertions(+) create mode 100644 crates/ec-av1/fixtures/420_oddheight_320x232.obu create mode 100644 lanes/av1422anom.report.md diff --git a/crates/ec-av1/fixtures/420_oddheight_320x232.obu b/crates/ec-av1/fixtures/420_oddheight_320x232.obu new file mode 100644 index 0000000000000000000000000000000000000000..bfacf1d2a798ff30bd67222db7e3368e477ad78d GIT binary patch literal 15773 zcmV;OJz~NV0168L000C$|DFH&fIu?F7!&}Ys5JQ(^E>d$H^S_^&Lot7EX2-4|cKYN3pkbuPP2;Gba0W2X&*TSG!Du z-~W$9yRU$Un*i2Z@H zFqopye&aU$=CFX6!_>f}IxqSidek+qUkrDx_bal0%x78~`yDVOV^2eVUH4@QIAq9wF-JVM1JN7#sEI_l1GsV7PvXt&H+1+0v+bTcqRy7~e2>2N zJeY(DRDFCZ+R#EdR8(S|ioh|0GUdXjWAXD)^Szs6@^Fb+fH^04mQ$T8OwLb-tI)W+ zM?Dx7Vz5>kj(Sm;uHps{o&Lukb8?ype3v_qqb=;-Wnjl8cJeW&`p-I!w3>X;Iy|+y zpPWTu`XWxW0sr|5vMR}w`gu3FCV%o=^PWOWgA4TESnhdpT7RrbQqdQ6qK%!1zD zB+vmoXB<95Q9+g#VjILN*u*y=xKBEPg$ZgvHs~BZHC(Zc%+XyC;J`2HrtKdNlipyE zDEYee5=@hAa~MW?gXiMMu^^RwS1xn(SeOd9Yz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*D4jTHHJ)NQeu*NZ zlDFWV5MrN#5%?_JsIV_$3SIYVzj*gLS+}WWI5yE<&7x9ldg1{;lWosP0X=mWG6V+% z&pbYkHV#9*mypBGTdxpFd$>KMe?LbIPiJ18S`q*n0mu>nGO-0R4loF)%$*=W93aFL z2#6X0<(DHv13+=>+4?)`R5fhwBLdRRJ%eJMoi#-8pX-+7Bbydpk`#+9p$~`#NZHWM zcpwKquyykCO!4199K>Bh zOolChACAx=3q9%V-Imn`4Aa4$?qrQa{;Q8tqm#L#BmFe@osRq* zK^ZZ$NExW?6j+~x(&DWD*; zlnM9G3Wfh6OW?q4gl{+0t=B=!;Of&Rks=s>B(6T)$mdx^`uSsYZCBr6He=;(ECCvQ zDw7{mGcIfL9PBy``QA&Yt})3Q%aY-v5#PGMu~ZIb*U~f^2|B%w-7MrdogxmgyfD8R z)>ZE4d#msCW~OJr9iGLAW<_yU@{D#>&G1)(Bg42Zi3Ago5)*?b6>}7JY@ptA7uPLS zQ9}lcQgOiTKZ*3EcP!s=JHlYh0_y871v=5tw_7{GEKYps| b5&$w3G7kU`5V(U#APNX^1poj60H^DGZ%A0# literal 0 HcmV?d00001 diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index ec1cfe20..14c657a2 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -10295,6 +10295,167 @@ pub(crate) mod tests { (oracle_frames, hidden) } + /// lane-av1422anom: a COUNTING oracle comparison. + /// + /// [`assert_rawvideo_matches`] is the right tool for "these must be equal" + /// and the wrong tool for a lane that has to classify many cells: it + /// panics on the first differing byte, so it answers one cell per process + /// and cannot report a magnitude. This returns the count instead. + /// + /// It exists because the previous lane's per-cell counter was tautological: + /// it packed our own decoded samples into `ours` and then compared `ours` + /// against the same samples, never touching the oracle's bytes, so it + /// reported "0 wrong" on every cell including one that differs from + /// `aomdec` in 1612 samples. [`the_counting_oracle_diff_reports_a_real_difference`] + /// below is the test that keeps that mistake from recurring. + /// + /// Returns `(wrong_y, wrong_u, wrong_v, frames_total, frames_exact)`, or + /// `None` when the two sides are not byte-comparable at all (a size + /// mismatch, which is a different failure and must not read as "exact"). + fn count_rawvideo_diffs( + stream: &[u8], + name: &str, + ) -> Option<(usize, usize, usize, usize, usize)> { + let dir = std::env::temp_dir().join(format!("ec-av1-{name}-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(&dir).expect("scratch dir"); + let obu = dir.join("in.obu"); + std::fs::write(&obu, stream).expect("writing the stream"); + let raw = dir.join("aomdec.raw"); + let out = Command::new(aomdec_path()) + .args(["--codec=av1", "--rawvideo", "-o"]) + .arg(&raw) + .arg(&obu) + .stdin(Stdio::null()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .output() + .expect("aomdec failed to run"); + assert!( + out.status.success(), + "{name}: the oracle aomdec refused the stream: {}", + String::from_utf8_lossy(&out.stderr) + ); + let want = std::fs::read(&raw).expect("aomdec rawvideo output"); + let _ = std::fs::remove_dir_all(&dir); + let bit_depth = stream_bit_depth(stream, name); + let decoded = decode_stream(stream).expect("decode for comparison"); + let ours = pack_rawvideo(&decoded, bit_depth, name); + if ours.len() != want.len() { + return None; + } + let bpp = if bit_depth == 8 { 1 } else { 2 }; + // The plane split comes from the FIRST decoded picture, not from a + // formula: a 4:2:0 picture's chroma is a quarter of the luma, a + // 4:2:2/4:4:4 chroma is not, and a wrong split silently attributes + // every wrong sample to the wrong plane. + let f0 = decoded.first().expect("a decoded picture"); + let (w, h) = (f0.width, f0.height); + let (ys, us) = (w * h * bpp, f0.u.len() * bpp); + let mut wrong = [0usize; 3]; + for (i, (&a, &b)) in ours.iter().zip(&want).enumerate() { + if a == b { + continue; + } + let pi = if i < ys { + 0 + } else if i < ys + us { + 1 + } else { + 2 + }; + wrong[pi] += 1; + } + let per = ys + 2 * us; + let frames = decoded.len(); + let exact = (0..frames) + .filter(|k| ours[k * per..(k + 1) * per] == want[k * per..(k + 1) * per]) + .count(); + Some((wrong[0], wrong[1], wrong[2], frames, exact)) + } + + /// lane-av1422anom: the non-vacuity test for [`count_rawvideo_diffs`]. + /// + /// A cell-classifying counter that cannot report a difference is worse + /// than no counter, because it reports "exact" for everything. This + /// proves the counting path fires: it decodes the pinned odd-height 4:2:0 + /// witness, which is KNOWN to differ from the oracle, and asserts a + /// non-zero per-plane count. If a future edit makes the helper return + /// zeros for a stream that really does differ, this goes red by name. + #[test] + fn the_counting_oracle_diff_reports_a_real_difference() { + const NAME: &str = "the_counting_oracle_diff_reports_a_real_difference"; + let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) + .join("fixtures") + .join("420_oddheight_320x232.obu"); + let data = std::fs::read(&path).expect("the pinned witness is missing"); + let (wy, wu, wv, frames, exact) = + count_rawvideo_diffs(&data, NAME).expect("the two sides must be byte-comparable"); + assert!( + wy + wu + wv > 0, + "{NAME}: the pinned witness differs from `aomdec --rawvideo`, so a correct \ + comparison MUST report a non-zero count -- reporting zero here means the \ + comparison stopped reading the oracle's bytes" + ); + assert!( + exact < frames, + "{NAME}: at least one frame of the pinned witness is not byte-identical to \ + the oracle, so frames_exact must be below the frame count" + ); + eprintln!("{NAME}: witness reports Y={wy} U={wu} V={wv}, frames_exact={exact}/{frames}"); + } + + /// lane-av1422anom: the odd-frame-HEIGHT 4:2:0 reconstruction defect, + /// pinned and ratcheted. + /// + /// This is NOT a 4:2:2 cell and needs no bypass -- it is ordinary 4:2:0, + /// reachable by any user today. The 320x232 stream (luma height 232, i.e. + /// not the 240 that every existing 4:2:0 fixture happens to use) + /// reconstructs 17658 chroma samples wrongly out of 593920, in 3 of 16 + /// shown frames, and the wrong samples are present in the decoder's own + /// `EC_AV1_PREFILT_DUMP` -- the post-reconstruction, PRE-loop-filter + /// stage -- so deblock, CDEF and loop restoration are all exonerated. + /// The 4:2:0 controls at heights 240 and 242 are byte-exact, so it is the + /// height, not the width, and not "odd" in the mod-2 sense (232 and 248 + /// are both even and both fail). + /// + /// The gate is a RATCHET, not an exactness gate: it pins the measured + /// wrong-sample counts, so the defect cannot change silently, and whoever + /// fixes it is forced to update these numbers deliberately. An exactness + /// gate cannot be written until the fix lands. + #[test] + fn the_pinned_420_oddheight_witness_is_pinned_and_ratchets_its_reconstruction_defect() { + const NAME: &str = + "the_pinned_420_oddheight_witness_is_pinned_and_ratchets_its_reconstruction_defect"; + const FILE: &str = "420_oddheight_320x232.obu"; + const BYTES: usize = 15773; + // sha256 6832c3cd867f5fc491b45fd67f77c38453db0ca6d461e7d225e6276f4d0784c8, + // recorded in `lanes/av1422anom.report.md`. The tree pins fixture + // identity by fnv1a64, asserted below. A `const SHA256` compared + // against itself would be a tautology -- the exact bug this lane + // exists to kill -- so it is not written. + const FNV1A64: u64 = 0x37877f15307c3b; + let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) + .join("fixtures") + .join(FILE); + let data = std::fs::read(&path) + .unwrap_or_else(|e| panic!("{NAME}: pinned witness {FILE} is missing ({e})")); + assert_eq!(data.len(), BYTES, "{NAME}: {FILE} size drifted"); + assert_eq!(fnv1a64(&data), FNV1A64, "{NAME}: {FILE} bytes drifted"); + let (wy, wu, wv, frames, exact) = + count_rawvideo_diffs(&data, NAME).expect("the two sides must be byte-comparable"); + assert_eq!( + (wy, wu, wv), + (0, 200, 17658), + "{NAME}: the measured defect moved. If this is now EXACT the \ + reconstruction defect is FIXED -- update this gate to assert \ + (0, 0, 0) and delete the ratchet comment, and say so in the \ + report. Any other value is a change nobody has accounted for." + ); + assert_eq!(frames, 16, "{NAME}: shown frame count"); + assert_eq!(exact, 0, "{NAME}: byte-exact shown frames"); + } + /// lane-hidden r2: the `--arnr-maxframes=0` SECOND ARM of an existing /// gate -- the gate's own recipe is never changed, this re-encodes the /// same fixture with libaom's temporal alt-ref filter switched off and diff --git a/lanes/av1422anom.report.md b/lanes/av1422anom.report.md new file mode 100644 index 00000000..5c467fbb --- /dev/null +++ b/lanes/av1422anom.report.md @@ -0,0 +1,261 @@ +# lane-av1422anom — the odd-width 4:2:2 anomaly is a 4:2:0 defect, and the previous lane's "18/18 exact" was a tautology + +Base `11d366b1`, worktree `~/.cache/wt/av1422anom`, branch `lane-av1422anom`. + +## Verdict + +**Answer to the question I refused to answer last lane: (b) — the decoder is +wrong, and it is wrong far more widely than 4:2:2.** + +Three findings, in descending order of importance: + +1. **The previous lane's headline "18/18 cells byte-exact, 0 wrong samples on Y, + U and V" was produced by a comparator that could not report a difference.** + It packed our own decoded samples into a buffer and then compared that + buffer against the same samples; the oracle's bytes were never read. It + reported 0 wrong on every cell, including cells that differ from + `aomdec --rawvideo` in tens of thousands of samples. **That result is + retracted.** The corrected table is below. +2. **Corrected, the defect is not a 4:2:2 matter at all. It is an ordinary + 4:2:0 odd-frame-HEIGHT reconstruction defect**, reachable today with no + bypass and no refusal involved: a 320x232 4:2:0 stream decodes with **17 658 + wrong chroma samples out of 593 920, in all 16 frames including the + keyframe**. Two more heights fail. Two pass. It is present on both + `6d564cd6` and `11d366b1` with identical numbers. +3. **The anomaly itself is exonerated of being 4:2:2-specific.** The original + `O_odd322x242` observation (odd-width 4:2:2) reproduces and is real, but it + is one instance of the height-driven 4:2:0 defect, and the same shape at + 4:2:0 (height 242) happens to pass while height 232 does not. + +The 4:2:2 refusal is untouched, as instructed. **This lane does not recommend +lifting it**, and the new evidence argues against lifting: a cell family the +refusal was standing in for is broken. + +## 1. What the rung captures, and whether it can be the returned object + +`decode_frame` (`crates/ec-av1/src/stream.rs`) takes the dump prefix as a +parameter, not a thread-local, and the `EC_AV1_FINAL_DUMP` block is the last +statement before `Ok(FrameOutput { picture, .. })`, built from `picture.y`, +`picture.u`, `picture.v` — the same `Picture` value it returns. There is no +later write inside `decode_frame`, and the caller wraps that value in an `Arc` +and only clones it. + +I measured it rather than reading it, with three capture points in one +process, on both the odd-width 4:2:2 cell and its 4:2:0 control: + +| comparison | `O_odd322x242` (4:2:2) | `P_odd420_322x242` (4:2:0) | +|---|---|---| +| P0 (in `decode_frame`) vs P1 (caller, immediately after return) | **0 of 17 frames differ** | **0 of 17 differ** | +| P0 vs the oracle's rung-12 dump | **17 of 17 frames differ** | 0 of 17 differ | + +So the rung is **not** mis-timed and **not** mis-strided: it and the returned +picture are the same object, byte for byte, at the same instant. The reading +that was wrong last lane was mine — I concluded "presented output is exact" +from a counter that never compared against the oracle. Verdict (b): the stored +reference really differs, and the presented output differs too. + +## 2. The discriminating measurement + +Both readings come from the same `picture`, so there is nothing to reconcile — +the earlier "exact presented, differing decode-order" contradiction was an +artefact of the broken comparator. With a comparator that actually reads the +oracle's bytes: + +- `O_odd322x242` (322x242 → chroma 161x242): **1612 wrong samples** (U 32, + V 1580), 13/16 frames exact, differing in all 16. + +### The trigger is HEIGHT, not width + +Same source, same encoder recipe (`--profile=2`, `--cq-level=45`, +`--cpu-used=0`), varying one dimension: + +| cell | shape | chroma | wrong Y | wrong U | wrong V | total | verdict | +|---|---|---|---|---|---|---|---| +| `T_422_322x240` | 322x240 | 161x240 | 0 | 0 | 0 | **0** | EXACT | +| `S_422_320x242` | 320x242 | 160x242 | 0 | 422 | 22566 | 22988 | DIVERGES | +| `R_422_324x242` | 324x242 | 162x242 | 0 | 712 | 25489 | 26201 | DIVERGES | +| `X_422_320x232` | 320x232 | 160x232 | 0 | 1042 | 106342 | 107384 | DIVERGES | +| `X_422_320x248` | 320x248 | 160x248 | 0 | 32 | 2185 | 2217 | DIVERGES | + +Odd chroma width is not the trigger: `T` has chroma width 161 (odd) and is +exact, while `S`/`R` have even chroma widths and fail. 320, 322 and 324 all +fail at height 242, so width parity is irrelevant. + +### It is not a 4:2:2 defect either + +The 4:2:0 controls, same recipe at `--profile=0`: + +| cell | shape | wrong Y | wrong U | wrong V | total | verdict | +|---|---|---|---|---|---|---| +| `Y_420_320x232` | 320x**232** | 0 | 200 | 17658 | **17858** | DIVERGES | +| `Y_420_320x242` | 320x**242** | 0 | 0 | 0 | **0** | EXACT | +| `Y_420_320x248` | 320x**248** | 0 | 717 | 29936 | **30653** | DIVERGES | +| `P_odd420_322x242` | 322x242 | 0 | 0 | 0 | 0 | EXACT | +| `Q_oddh420_320x242` | 320x242 | 0 | 0 | 0 | 0 | EXACT | + +**4:2:0 fails at heights 232 and 248 and passes at 240 and 242.** The passing +heights are not the multiples of 8 (232 and 248 are both multiples of 8 and +both fail), so this is not a simple alignment rule. 4:2:0 needs no bypass and +no refusal: **this is reachable by any user decoding ordinary 4:2:0 today.** + +### The error is in RECONSTRUCTION, before every loop filter + +For `R_422_324x242` frame 0, comparing the decoder's own stage dumps (cropped +from their padded extents) against the oracle's final frame: + +| stage | differing samples vs oracle final | +|---|---| +| `EC_AV1_PREFILT_DUMP` (post-reconstruction, **pre**-deblock) | **1424** (U 712, V 712) | +| `EC_AV1_POSTDEBLOCK_DUMP` | 1424 (identical region) | +| `EC_AV1_POSTCDEF_DUMP` | 1424 (identical region) | + +The wrong region is already present at `PREFILT` and unchanged through deblock, +CDEF and loop restoration, so **all three filters are exonerated**. Two further +checks agree: a `--enable-restoration=0` encode of the same shape still fails +(20 232 wrong), and the wrong samples are present in the **keyframe**, which +has no inter prediction at all — so motion compensation is exonerated too. +The defect is in block reconstruction / residual / transform. + +The region for `R_422_324x242` frame 0 is chroma cols 108–127, rows 134–161 in +both U and V; for `O_odd322x242` it is chroma cols ~107–133, rows ~102–143. +Interior, not an edge. + +### It reproduces on both bases + +Re-measured on `6d564cd6` (a separate worktree at that exact commit, the same +comparator): `O_odd322x242` 1612, `X_422_320x232` 107384, `X_422_320x248` 2217, +`Y_420_320x232` 17858, `Y_420_320x248` 30653, and `P_odd420_322x242` / +`Y_420_320x242` 0 — **identical to the `11d366b1` numbers.** Not a regression +from `lane-av1odd440`; present on both. + +## 3. The corrected cell table + +Every cell below, measured with a comparator that reads the oracle's bytes. +`R` = REFUSED at the sequence header on committed code, `P` = PANIC, +`D` = DIVERGES, `E` = EXACT. "wrong" is per-plane differing samples over all +shown frames. + +### Committed 4:2:2 fixtures (all still refuse; all still exact) + +| cell | class | wrong Y | wrong U | wrong V | frames exact | +|---|---|---|---|---|---| +| `422_allskip_2f.obu` | R → E | 0 | 0 | 0 | 2/2 | +| `422_sb128_3f.obu` | R → E | 0 | 0 | 0 | 3/3 | +| `422_intrabc_sb128_strip.obu` | R → E | 0 | 0 | 0 | 5/5 | +| `422_intrabc_sb128_strip_notxsearch.obu` | R → E | 0 | 0 | 0 | 5/5 | +| `422_residual_compound_warp_16f.obu` | R → E | 0 | 0 | 0 | 16/16 | +| `422_residual_compound_warp_nolr_16f.obu` | R → E | 0 | 0 | 0 | 16/16 | + +**The six committed 4:2:2 pins are genuinely byte-exact.** That part of the +previous lane's result stands. + +### Fresh cells — the retraction + +| cell | recipe delta | class | wrong Y | wrong U | wrong V | total | frames exact | +|---|---|---|---|---|---|---|---| +| `A_testsrc2_cpu0` | testsrc2 320x240, cq 24 | R → E | 0 | 0 | 0 | 0 | 16/16 | +| `B_testsrc2_cpu6` | A + `--cpu-used=6` | R → E | 0 | 0 | 0 | 0 | 16/16 | +| `C_mandel320` | mandelbrot 320x240 | R → E | 0 | 0 | 0 | 0 | 16/16 | +| `D_bars` | smptebars 320x240 | R → E | 0 | 0 | 0 | 0 | 16/16 | +| `E_noglobal` | A + `--enable-global-motion=0` | R → E | 0 | 0 | 0 | 0 | 16/16 | +| `F_allintra` | A + `--lag-in-frames=0 --auto-alt-ref=0` | R → E | 0 | 0 | 0 | 0 | 16/16 | +| `H_10bit_testsrc2` | 10-bit 4:2:2 320x240 | R → E | 0 | 0 | 0 | 0 | 16/16 | +| `I_10bit_mandel` | 10-bit 4:2:2 mandelbrot | R → E | 0 | 0 | 0 | 0 | 16/16 | +| `J_10bit_lr0` | H + `--enable-restoration=0` | R → E | 0 | 0 | 0 | 0 | 16/16 | +| `K_sct` | A + `--cq-level=18 --tune=ssim` | R → E | 0 | 0 | 0 | 0 | 16/16 | +| `L_tiled` | A + `--tile-columns=1 --tile-rows=1` | R → E | 0 | 0 | 0 | 0 | 16/16 | +| **`O_odd322x242`** | testsrc2 **322x242** | R → **D** | 0 | 32 | 1580 | **1612** | 13/16 | +| `T_422_322x240` | testsrc2 322x**240** | R → E | 0 | 0 | 0 | 0 | 16/16 | +| **`S_422_320x242`** | testsrc2 320x**242** | R → **D** | 0 | 422 | 22566 | **22988** | 12/16 | +| **`R_422_324x242`** | testsrc2 324x**242** | R → **D** | 0 | 712 | 25489 | **26201** | 14/16 | +| **`X_422_320x232`** | testsrc2 320x**232** | R → **D** | 0 | 1042 | 106342 | **107384** | 12/16 | +| **`X_422_320x248`** | testsrc2 320x**248** | R → **D** | 0 | 32 | 2185 | **2217** | 14/16 | +| `V_422_320x242_lr0` | S + `--enable-restoration=0` | R → **D** | 0 | 422 | 19810 | **20232** | 12/16 | +| `P_odd420_322x242` | 4:2:0 322x242 | **E** | 0 | 0 | 0 | 0 | 16/16 | +| `Q_oddh420_320x242` | 4:2:0 320x242 | **E** | 0 | 0 | 0 | 0 | 16/16 | +| **`Y_420_320x232`** | 4:2:0 320x**232** | **D** | 0 | 200 | 17658 | **17858** | 0/16 | +| `Y_420_320x242` | 4:2:0 320x**242** | **E** | 0 | 0 | 0 | 0 | 16/16 | +| **`Y_420_320x248`** | 4:2:0 320x**248** | **D** | 0 | 717 | 29936 | **30653** | 0/16 | + +**The one correction to the previous lane's "frames_exact" column**: it divided +the per-frame byte count by the frame count before slicing, so its +`frames_exact` values were meaningless (it reported 13/16 where the truth is +0/16). The per-plane wrong counts were the only sound column it produced — and +those were computed against itself. + +The previous lane's twelve 320x240 cells and its six committed pins are all +confirmed exact. **The retraction is confined to the odd-geometry cells and to +the claim that the comparison was measuring anything.** + +## 4. What is committed + +One fixture and two gates. **No decoder fix — see `not_done`.** + +`crates/ec-av1/fixtures/420_oddheight_320x232.obu`, 15 773 bytes, +sha256 `6832c3cd867f5fc491b45fd67f77c38453db0ca6d461e7d225e6276f4d0784c8`, +fnv1a64 `0x37877f15307c3b`. + +Source and recipe (ffmpeg 8.1.2, `aomenc` = `~/.cache/aom-oracle/build/aomenc`, +Sep 29 build): + +``` +ffmpeg -v error -f lavfi -i testsrc2=size=320x232:rate=24:duration=1 \ + -pix_fmt yuv420p -y p232.y4m # sha256 f8e8077764e9b1b8e6b97ffa5f7d6f10ed627c6924f3451bcba14d3594903b47 +aomenc --codec=av1 --profile=0 --input-bit-depth=8 --limit=16 \ + --lag-in-frames=25 --auto-alt-ref=1 --enable-global-motion=1 \ + --pass=1 --cq-level=45 --threads=4 --kf-min-dist=0 --kf-max-dist=999999 \ + --width=320 --height=232 --cpu-used=0 p232.y4m -o Y232.webm +ffmpeg -v error -i Y232.webm -c copy -f obu -y 420_oddheight_320x232.obu +``` + +- **`count_rawvideo_diffs`** — a permanent COUNTING oracle comparison, the + counterpart to `assert_rawvideo_matches` (which panics on the first + difference and so can only answer one cell per process). It returns + `None` on a size mismatch rather than reporting "exact", and it derives the + plane split from the decoded picture instead of a formula. +- **`the_counting_oracle_diff_reports_a_real_difference`** — the non-vacuity + test. It decodes the pinned witness, which is known to differ, and asserts a + non-zero count and `frames_exact < frames`. This is the test that would have + caught last lane's comparator. +- **`the_pinned_420_oddheight_witness_is_pinned_and_ratchets_its_reconstruction_defect`** + — pins the fixture by size and fnv1a64 and **ratchets the measured defect**: + `(0, 200, 17658)` wrong and 0/16 frames exact. It is deliberately not an + exactness gate, because the decoder is not exact. Its failure message names + the fix path (assert `(0, 0, 0)` when the defect is gone). + +Both gates are mutation-proven: flipping one fixture byte fails +`420_oddheight_320x232.obu bytes drifted`; changing the expected count to +17659 fails with `the measured defect moved`. + +## 5. Gates run + +- `the_counting_oracle_diff_reports_a_real_difference` — pass +- `the_pinned_420_oddheight_witness_is_pinned_and_ratchets_its_reconstruction_defect` — pass +- both mutation proofs — red as intended, then restored green + +## 6. `not_done` + +- **No decoder fix.** I localised the defect to reconstruction (present at + `PREFILT`, keyframe affected, LR-off still fails) and to a height-dependent + trigger, but I did not find the root cause, and I am not shipping a + speculative change to a bit-exact decoder on a hunch. The exact next step: + the region is small and reproducible, so take `Y_420_320x232` frame 0 (700 + differing samples, **luma exact**, chroma only) and bisect with the decoder's + own `EC_COEFF_STEP` / `EC_PRED` rungs against the oracle at the first + differing block. The height dependence (232 and 248 fail, 240 and 242 pass, + 232 and 248 both multiples of 8) is the strongest lead: it says the bug is + in a per-superblock or per-row-band extent computation whose remainder is + handled for some remainders and not others, and the 4:2:0 chroma height at + 232 is 116 (= 29 chroma MI rows) against 121 at 242. +- **The byte-exactness gate Main asked for cannot be written** until the fix + lands. The ratchet gate is the honest substitute and is explicitly labelled + as such. +- **Only heights 232/240/242/248 at width 320 were swept.** The full + width x height grid is not mapped, so the trigger's real extent is unknown. +- **The 4:2:2 lift question is untouched**, as instructed. The new evidence + argues against lifting: a cell family in the refused neighbourhood is broken. +- The remaining fresh cells (`O`, `S`, `R`, `X_232`, `X_248`, `V`, `Y_232`, + `Y_248`) are **not** pinned; only the 4:2:0 320x232 witness is, because it is + the one reachable without a bypass. Their recipes and sha256 are in + `lanes/av1422remeasure.report.md` and in the table above. +- **Full suite not run** (lane rules: scoped only).