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
Browse files at this commit45881e7ddc08fc862df04235e44e3a1faf9633d5Parent: 59edf7d3 changed files +422 -0
- crates/ec-av1/fixtures/420_oddheight_320x232.obu +0 -0
- crates/ec-av1/src/stream.rs +161 -0
- lanes/av1422anom.report.md +261 -0
crates/ec-av1/fixtures/420_oddheight_320x232.obuadded+0 -0
Binary file changed
crates/ec-av1/src/stream.rsmodified+161 -0
| @@ -10295,6 +10295,167 @@ pub(crate) mod tests { | |||
| 10295 | (oracle_frames, hidden) | 10295 | (oracle_frames, hidden) |
| 10296 | } | 10296 | } |
| 10297 | 10297 | ||
| 10298 | + /// lane-av1422anom: a COUNTING oracle comparison. | ||
| 10299 | + /// | ||
| 10300 | + /// [`assert_rawvideo_matches`] is the right tool for "these must be equal" | ||
| 10301 | + /// and the wrong tool for a lane that has to classify many cells: it | ||
| 10302 | + /// panics on the first differing byte, so it answers one cell per process | ||
| 10303 | + /// and cannot report a magnitude. This returns the count instead. | ||
| 10304 | + /// | ||
| 10305 | + /// It exists because the previous lane's per-cell counter was tautological: | ||
| 10306 | + /// it packed our own decoded samples into `ours` and then compared `ours` | ||
| 10307 | + /// against the same samples, never touching the oracle's bytes, so it | ||
| 10308 | + /// reported "0 wrong" on every cell including one that differs from | ||
| 10309 | + /// `aomdec` in 1612 samples. [`the_counting_oracle_diff_reports_a_real_difference`] | ||
| 10310 | + /// below is the test that keeps that mistake from recurring. | ||
| 10311 | + /// | ||
| 10312 | + /// Returns `(wrong_y, wrong_u, wrong_v, frames_total, frames_exact)`, or | ||
| 10313 | + /// `None` when the two sides are not byte-comparable at all (a size | ||
| 10314 | + /// mismatch, which is a different failure and must not read as "exact"). | ||
| 10315 | + fn count_rawvideo_diffs( | ||
| 10316 | + stream: &[u8], | ||
| 10317 | + name: &str, | ||
| 10318 | + ) -> Option<(usize, usize, usize, usize, usize)> { | ||
| 10319 | + let dir = std::env::temp_dir().join(format!("ec-av1-{name}-{}", std::process::id())); | ||
| 10320 | + let _ = std::fs::remove_dir_all(&dir); | ||
| 10321 | + std::fs::create_dir_all(&dir).expect("scratch dir"); | ||
| 10322 | + let obu = dir.join("in.obu"); | ||
| 10323 | + std::fs::write(&obu, stream).expect("writing the stream"); | ||
| 10324 | + let raw = dir.join("aomdec.raw"); | ||
| 10325 | + let out = Command::new(aomdec_path()) | ||
| 10326 | + .args(["--codec=av1", "--rawvideo", "-o"]) | ||
| 10327 | + .arg(&raw) | ||
| 10328 | + .arg(&obu) | ||
| 10329 | + .stdin(Stdio::null()) | ||
| 10330 | + .stdout(Stdio::piped()) | ||
| 10331 | + .stderr(Stdio::piped()) | ||
| 10332 | + .output() | ||
| 10333 | + .expect("aomdec failed to run"); | ||
| 10334 | + assert!( | ||
| 10335 | + out.status.success(), | ||
| 10336 | + "{name}: the oracle aomdec refused the stream: {}", | ||
| 10337 | + String::from_utf8_lossy(&out.stderr) | ||
| 10338 | + ); | ||
| 10339 | + let want = std::fs::read(&raw).expect("aomdec rawvideo output"); | ||
| 10340 | + let _ = std::fs::remove_dir_all(&dir); | ||
| 10341 | + let bit_depth = stream_bit_depth(stream, name); | ||
| 10342 | + let decoded = decode_stream(stream).expect("decode for comparison"); | ||
| 10343 | + let ours = pack_rawvideo(&decoded, bit_depth, name); | ||
| 10344 | + if ours.len() != want.len() { | ||
| 10345 | + return None; | ||
| 10346 | + } | ||
| 10347 | + let bpp = if bit_depth == 8 { 1 } else { 2 }; | ||
| 10348 | + // The plane split comes from the FIRST decoded picture, not from a | ||
| 10349 | + // formula: a 4:2:0 picture's chroma is a quarter of the luma, a | ||
| 10350 | + // 4:2:2/4:4:4 chroma is not, and a wrong split silently attributes | ||
| 10351 | + // every wrong sample to the wrong plane. | ||
| 10352 | + let f0 = decoded.first().expect("a decoded picture"); | ||
| 10353 | + let (w, h) = (f0.width, f0.height); | ||
| 10354 | + let (ys, us) = (w * h * bpp, f0.u.len() * bpp); | ||
| 10355 | + let mut wrong = [0usize; 3]; | ||
| 10356 | + for (i, (&a, &b)) in ours.iter().zip(&want).enumerate() { | ||
| 10357 | + if a == b { | ||
| 10358 | + continue; | ||
| 10359 | + } | ||
| 10360 | + let pi = if i < ys { | ||
| 10361 | + 0 | ||
| 10362 | + } else if i < ys + us { | ||
| 10363 | + 1 | ||
| 10364 | + } else { | ||
| 10365 | + 2 | ||
| 10366 | + }; | ||
| 10367 | + wrong[pi] += 1; | ||
| 10368 | + } | ||
| 10369 | + let per = ys + 2 * us; | ||
| 10370 | + let frames = decoded.len(); | ||
| 10371 | + let exact = (0..frames) | ||
| 10372 | + .filter(|k| ours[k * per..(k + 1) * per] == want[k * per..(k + 1) * per]) | ||
| 10373 | + .count(); | ||
| 10374 | + Some((wrong[0], wrong[1], wrong[2], frames, exact)) | ||
| 10375 | + } | ||
| 10376 | + | ||
| 10377 | + /// lane-av1422anom: the non-vacuity test for [`count_rawvideo_diffs`]. | ||
| 10378 | + /// | ||
| 10379 | + /// A cell-classifying counter that cannot report a difference is worse | ||
| 10380 | + /// than no counter, because it reports "exact" for everything. This | ||
| 10381 | + /// proves the counting path fires: it decodes the pinned odd-height 4:2:0 | ||
| 10382 | + /// witness, which is KNOWN to differ from the oracle, and asserts a | ||
| 10383 | + /// non-zero per-plane count. If a future edit makes the helper return | ||
| 10384 | + /// zeros for a stream that really does differ, this goes red by name. | ||
| 10385 | + #[test] | ||
| 10386 | + fn the_counting_oracle_diff_reports_a_real_difference() { | ||
| 10387 | + const NAME: &str = "the_counting_oracle_diff_reports_a_real_difference"; | ||
| 10388 | + let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) | ||
| 10389 | + .join("fixtures") | ||
| 10390 | + .join("420_oddheight_320x232.obu"); | ||
| 10391 | + let data = std::fs::read(&path).expect("the pinned witness is missing"); | ||
| 10392 | + let (wy, wu, wv, frames, exact) = | ||
| 10393 | + count_rawvideo_diffs(&data, NAME).expect("the two sides must be byte-comparable"); | ||
| 10394 | + assert!( | ||
| 10395 | + wy + wu + wv > 0, | ||
| 10396 | + "{NAME}: the pinned witness differs from `aomdec --rawvideo`, so a correct \ | ||
| 10397 | + comparison MUST report a non-zero count -- reporting zero here means the \ | ||
| 10398 | + comparison stopped reading the oracle's bytes" | ||
| 10399 | + ); | ||
| 10400 | + assert!( | ||
| 10401 | + exact < frames, | ||
| 10402 | + "{NAME}: at least one frame of the pinned witness is not byte-identical to \ | ||
| 10403 | + the oracle, so frames_exact must be below the frame count" | ||
| 10404 | + ); | ||
| 10405 | + eprintln!("{NAME}: witness reports Y={wy} U={wu} V={wv}, frames_exact={exact}/{frames}"); | ||
| 10406 | + } | ||
| 10407 | + | ||
| 10408 | + /// lane-av1422anom: the odd-frame-HEIGHT 4:2:0 reconstruction defect, | ||
| 10409 | + /// pinned and ratcheted. | ||
| 10410 | + /// | ||
| 10411 | + /// This is NOT a 4:2:2 cell and needs no bypass -- it is ordinary 4:2:0, | ||
| 10412 | + /// reachable by any user today. The 320x232 stream (luma height 232, i.e. | ||
| 10413 | + /// not the 240 that every existing 4:2:0 fixture happens to use) | ||
| 10414 | + /// reconstructs 17658 chroma samples wrongly out of 593920, in 3 of 16 | ||
| 10415 | + /// shown frames, and the wrong samples are present in the decoder's own | ||
| 10416 | + /// `EC_AV1_PREFILT_DUMP` -- the post-reconstruction, PRE-loop-filter | ||
| 10417 | + /// stage -- so deblock, CDEF and loop restoration are all exonerated. | ||
| 10418 | + /// The 4:2:0 controls at heights 240 and 242 are byte-exact, so it is the | ||
| 10419 | + /// height, not the width, and not "odd" in the mod-2 sense (232 and 248 | ||
| 10420 | + /// are both even and both fail). | ||
| 10421 | + /// | ||
| 10422 | + /// The gate is a RATCHET, not an exactness gate: it pins the measured | ||
| 10423 | + /// wrong-sample counts, so the defect cannot change silently, and whoever | ||
| 10424 | + /// fixes it is forced to update these numbers deliberately. An exactness | ||
| 10425 | + /// gate cannot be written until the fix lands. | ||
| 10426 | + #[test] | ||
| 10427 | + fn the_pinned_420_oddheight_witness_is_pinned_and_ratchets_its_reconstruction_defect() { | ||
| 10428 | + const NAME: &str = | ||
| 10429 | + "the_pinned_420_oddheight_witness_is_pinned_and_ratchets_its_reconstruction_defect"; | ||
| 10430 | + const FILE: &str = "420_oddheight_320x232.obu"; | ||
| 10431 | + const BYTES: usize = 15773; | ||
| 10432 | + // sha256 6832c3cd867f5fc491b45fd67f77c38453db0ca6d461e7d225e6276f4d0784c8, | ||
| 10433 | + // recorded in `lanes/av1422anom.report.md`. The tree pins fixture | ||
| 10434 | + // identity by fnv1a64, asserted below. A `const SHA256` compared | ||
| 10435 | + // against itself would be a tautology -- the exact bug this lane | ||
| 10436 | + // exists to kill -- so it is not written. | ||
| 10437 | + const FNV1A64: u64 = 0x37877f15307c3b; | ||
| 10438 | + let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) | ||
| 10439 | + .join("fixtures") | ||
| 10440 | + .join(FILE); | ||
| 10441 | + let data = std::fs::read(&path) | ||
| 10442 | + .unwrap_or_else(|e| panic!("{NAME}: pinned witness {FILE} is missing ({e})")); | ||
| 10443 | + assert_eq!(data.len(), BYTES, "{NAME}: {FILE} size drifted"); | ||
| 10444 | + assert_eq!(fnv1a64(&data), FNV1A64, "{NAME}: {FILE} bytes drifted"); | ||
| 10445 | + let (wy, wu, wv, frames, exact) = | ||
| 10446 | + count_rawvideo_diffs(&data, NAME).expect("the two sides must be byte-comparable"); | ||
| 10447 | + assert_eq!( | ||
| 10448 | + (wy, wu, wv), | ||
| 10449 | + (0, 200, 17658), | ||
| 10450 | + "{NAME}: the measured defect moved. If this is now EXACT the \ | ||
| 10451 | + reconstruction defect is FIXED -- update this gate to assert \ | ||
| 10452 | + (0, 0, 0) and delete the ratchet comment, and say so in the \ | ||
| 10453 | + report. Any other value is a change nobody has accounted for." | ||
| 10454 | + ); | ||
| 10455 | + assert_eq!(frames, 16, "{NAME}: shown frame count"); | ||
| 10456 | + assert_eq!(exact, 0, "{NAME}: byte-exact shown frames"); | ||
| 10457 | + } | ||
| 10458 | + | ||
| 10298 | /// lane-hidden r2: the `--arnr-maxframes=0` SECOND ARM of an existing | 10459 | /// lane-hidden r2: the `--arnr-maxframes=0` SECOND ARM of an existing |
| 10299 | /// gate -- the gate's own recipe is never changed, this re-encodes the | 10460 | /// gate -- the gate's own recipe is never changed, this re-encodes the |
| 10300 | /// same fixture with libaom's temporal alt-ref filter switched off and | 10461 | /// same fixture with libaom's temporal alt-ref filter switched off and |
lanes/av1422anom.report.mdadded+261 -0
| @@ -0,0 +1,261 @@ | |||
| 1 | +# 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 | ||
| 2 | + | ||
| 3 | +Base `11d366b1`, worktree `~/.cache/wt/av1422anom`, branch `lane-av1422anom`. | ||
| 4 | + | ||
| 5 | +## Verdict | ||
| 6 | + | ||
| 7 | +**Answer to the question I refused to answer last lane: (b) — the decoder is | ||
| 8 | +wrong, and it is wrong far more widely than 4:2:2.** | ||
| 9 | + | ||
| 10 | +Three findings, in descending order of importance: | ||
| 11 | + | ||
| 12 | +1. **The previous lane's headline "18/18 cells byte-exact, 0 wrong samples on Y, | ||
| 13 | + U and V" was produced by a comparator that could not report a difference.** | ||
| 14 | + It packed our own decoded samples into a buffer and then compared that | ||
| 15 | + buffer against the same samples; the oracle's bytes were never read. It | ||
| 16 | + reported 0 wrong on every cell, including cells that differ from | ||
| 17 | + `aomdec --rawvideo` in tens of thousands of samples. **That result is | ||
| 18 | + retracted.** The corrected table is below. | ||
| 19 | +2. **Corrected, the defect is not a 4:2:2 matter at all. It is an ordinary | ||
| 20 | + 4:2:0 odd-frame-HEIGHT reconstruction defect**, reachable today with no | ||
| 21 | + bypass and no refusal involved: a 320x232 4:2:0 stream decodes with **17 658 | ||
| 22 | + wrong chroma samples out of 593 920, in all 16 frames including the | ||
| 23 | + keyframe**. Two more heights fail. Two pass. It is present on both | ||
| 24 | + `6d564cd6` and `11d366b1` with identical numbers. | ||
| 25 | +3. **The anomaly itself is exonerated of being 4:2:2-specific.** The original | ||
| 26 | + `O_odd322x242` observation (odd-width 4:2:2) reproduces and is real, but it | ||
| 27 | + is one instance of the height-driven 4:2:0 defect, and the same shape at | ||
| 28 | + 4:2:0 (height 242) happens to pass while height 232 does not. | ||
| 29 | + | ||
| 30 | +The 4:2:2 refusal is untouched, as instructed. **This lane does not recommend | ||
| 31 | +lifting it**, and the new evidence argues against lifting: a cell family the | ||
| 32 | +refusal was standing in for is broken. | ||
| 33 | + | ||
| 34 | +## 1. What the rung captures, and whether it can be the returned object | ||
| 35 | + | ||
| 36 | +`decode_frame` (`crates/ec-av1/src/stream.rs`) takes the dump prefix as a | ||
| 37 | +parameter, not a thread-local, and the `EC_AV1_FINAL_DUMP` block is the last | ||
| 38 | +statement before `Ok(FrameOutput { picture, .. })`, built from `picture.y`, | ||
| 39 | +`picture.u`, `picture.v` — the same `Picture` value it returns. There is no | ||
| 40 | +later write inside `decode_frame`, and the caller wraps that value in an `Arc` | ||
| 41 | +and only clones it. | ||
| 42 | + | ||
| 43 | +I measured it rather than reading it, with three capture points in one | ||
| 44 | +process, on both the odd-width 4:2:2 cell and its 4:2:0 control: | ||
| 45 | + | ||
| 46 | +| comparison | `O_odd322x242` (4:2:2) | `P_odd420_322x242` (4:2:0) | | ||
| 47 | +|---|---|---| | ||
| 48 | +| P0 (in `decode_frame`) vs P1 (caller, immediately after return) | **0 of 17 frames differ** | **0 of 17 differ** | | ||
| 49 | +| P0 vs the oracle's rung-12 dump | **17 of 17 frames differ** | 0 of 17 differ | | ||
| 50 | + | ||
| 51 | +So the rung is **not** mis-timed and **not** mis-strided: it and the returned | ||
| 52 | +picture are the same object, byte for byte, at the same instant. The reading | ||
| 53 | +that was wrong last lane was mine — I concluded "presented output is exact" | ||
| 54 | +from a counter that never compared against the oracle. Verdict (b): the stored | ||
| 55 | +reference really differs, and the presented output differs too. | ||
| 56 | + | ||
| 57 | +## 2. The discriminating measurement | ||
| 58 | + | ||
| 59 | +Both readings come from the same `picture`, so there is nothing to reconcile — | ||
| 60 | +the earlier "exact presented, differing decode-order" contradiction was an | ||
| 61 | +artefact of the broken comparator. With a comparator that actually reads the | ||
| 62 | +oracle's bytes: | ||
| 63 | + | ||
| 64 | +- `O_odd322x242` (322x242 → chroma 161x242): **1612 wrong samples** (U 32, | ||
| 65 | + V 1580), 13/16 frames exact, differing in all 16. | ||
| 66 | + | ||
| 67 | +### The trigger is HEIGHT, not width | ||
| 68 | + | ||
| 69 | +Same source, same encoder recipe (`--profile=2`, `--cq-level=45`, | ||
| 70 | +`--cpu-used=0`), varying one dimension: | ||
| 71 | + | ||
| 72 | +| cell | shape | chroma | wrong Y | wrong U | wrong V | total | verdict | | ||
| 73 | +|---|---|---|---|---|---|---|---| | ||
| 74 | +| `T_422_322x240` | 322x240 | 161x240 | 0 | 0 | 0 | **0** | EXACT | | ||
| 75 | +| `S_422_320x242` | 320x242 | 160x242 | 0 | 422 | 22566 | 22988 | DIVERGES | | ||
| 76 | +| `R_422_324x242` | 324x242 | 162x242 | 0 | 712 | 25489 | 26201 | DIVERGES | | ||
| 77 | +| `X_422_320x232` | 320x232 | 160x232 | 0 | 1042 | 106342 | 107384 | DIVERGES | | ||
| 78 | +| `X_422_320x248` | 320x248 | 160x248 | 0 | 32 | 2185 | 2217 | DIVERGES | | ||
| 79 | + | ||
| 80 | +Odd chroma width is not the trigger: `T` has chroma width 161 (odd) and is | ||
| 81 | +exact, while `S`/`R` have even chroma widths and fail. 320, 322 and 324 all | ||
| 82 | +fail at height 242, so width parity is irrelevant. | ||
| 83 | + | ||
| 84 | +### It is not a 4:2:2 defect either | ||
| 85 | + | ||
| 86 | +The 4:2:0 controls, same recipe at `--profile=0`: | ||
| 87 | + | ||
| 88 | +| cell | shape | wrong Y | wrong U | wrong V | total | verdict | | ||
| 89 | +|---|---|---|---|---|---|---| | ||
| 90 | +| `Y_420_320x232` | 320x**232** | 0 | 200 | 17658 | **17858** | DIVERGES | | ||
| 91 | +| `Y_420_320x242` | 320x**242** | 0 | 0 | 0 | **0** | EXACT | | ||
| 92 | +| `Y_420_320x248` | 320x**248** | 0 | 717 | 29936 | **30653** | DIVERGES | | ||
| 93 | +| `P_odd420_322x242` | 322x242 | 0 | 0 | 0 | 0 | EXACT | | ||
| 94 | +| `Q_oddh420_320x242` | 320x242 | 0 | 0 | 0 | 0 | EXACT | | ||
| 95 | + | ||
| 96 | +**4:2:0 fails at heights 232 and 248 and passes at 240 and 242.** The passing | ||
| 97 | +heights are not the multiples of 8 (232 and 248 are both multiples of 8 and | ||
| 98 | +both fail), so this is not a simple alignment rule. 4:2:0 needs no bypass and | ||
| 99 | +no refusal: **this is reachable by any user decoding ordinary 4:2:0 today.** | ||
| 100 | + | ||
| 101 | +### The error is in RECONSTRUCTION, before every loop filter | ||
| 102 | + | ||
| 103 | +For `R_422_324x242` frame 0, comparing the decoder's own stage dumps (cropped | ||
| 104 | +from their padded extents) against the oracle's final frame: | ||
| 105 | + | ||
| 106 | +| stage | differing samples vs oracle final | | ||
| 107 | +|---|---| | ||
| 108 | +| `EC_AV1_PREFILT_DUMP` (post-reconstruction, **pre**-deblock) | **1424** (U 712, V 712) | | ||
| 109 | +| `EC_AV1_POSTDEBLOCK_DUMP` | 1424 (identical region) | | ||
| 110 | +| `EC_AV1_POSTCDEF_DUMP` | 1424 (identical region) | | ||
| 111 | + | ||
| 112 | +The wrong region is already present at `PREFILT` and unchanged through deblock, | ||
| 113 | +CDEF and loop restoration, so **all three filters are exonerated**. Two further | ||
| 114 | +checks agree: a `--enable-restoration=0` encode of the same shape still fails | ||
| 115 | +(20 232 wrong), and the wrong samples are present in the **keyframe**, which | ||
| 116 | +has no inter prediction at all — so motion compensation is exonerated too. | ||
| 117 | +The defect is in block reconstruction / residual / transform. | ||
| 118 | + | ||
| 119 | +The region for `R_422_324x242` frame 0 is chroma cols 108–127, rows 134–161 in | ||
| 120 | +both U and V; for `O_odd322x242` it is chroma cols ~107–133, rows ~102–143. | ||
| 121 | +Interior, not an edge. | ||
| 122 | + | ||
| 123 | +### It reproduces on both bases | ||
| 124 | + | ||
| 125 | +Re-measured on `6d564cd6` (a separate worktree at that exact commit, the same | ||
| 126 | +comparator): `O_odd322x242` 1612, `X_422_320x232` 107384, `X_422_320x248` 2217, | ||
| 127 | +`Y_420_320x232` 17858, `Y_420_320x248` 30653, and `P_odd420_322x242` / | ||
| 128 | +`Y_420_320x242` 0 — **identical to the `11d366b1` numbers.** Not a regression | ||
| 129 | +from `lane-av1odd440`; present on both. | ||
| 130 | + | ||
| 131 | +## 3. The corrected cell table | ||
| 132 | + | ||
| 133 | +Every cell below, measured with a comparator that reads the oracle's bytes. | ||
| 134 | +`R` = REFUSED at the sequence header on committed code, `P` = PANIC, | ||
| 135 | +`D` = DIVERGES, `E` = EXACT. "wrong" is per-plane differing samples over all | ||
| 136 | +shown frames. | ||
| 137 | + | ||
| 138 | +### Committed 4:2:2 fixtures (all still refuse; all still exact) | ||
| 139 | + | ||
| 140 | +| cell | class | wrong Y | wrong U | wrong V | frames exact | | ||
| 141 | +|---|---|---|---|---|---| | ||
| 142 | +| `422_allskip_2f.obu` | R → E | 0 | 0 | 0 | 2/2 | | ||
| 143 | +| `422_sb128_3f.obu` | R → E | 0 | 0 | 0 | 3/3 | | ||
| 144 | +| `422_intrabc_sb128_strip.obu` | R → E | 0 | 0 | 0 | 5/5 | | ||
| 145 | +| `422_intrabc_sb128_strip_notxsearch.obu` | R → E | 0 | 0 | 0 | 5/5 | | ||
| 146 | +| `422_residual_compound_warp_16f.obu` | R → E | 0 | 0 | 0 | 16/16 | | ||
| 147 | +| `422_residual_compound_warp_nolr_16f.obu` | R → E | 0 | 0 | 0 | 16/16 | | ||
| 148 | + | ||
| 149 | +**The six committed 4:2:2 pins are genuinely byte-exact.** That part of the | ||
| 150 | +previous lane's result stands. | ||
| 151 | + | ||
| 152 | +### Fresh cells — the retraction | ||
| 153 | + | ||
| 154 | +| cell | recipe delta | class | wrong Y | wrong U | wrong V | total | frames exact | | ||
| 155 | +|---|---|---|---|---|---|---|---| | ||
| 156 | +| `A_testsrc2_cpu0` | testsrc2 320x240, cq 24 | R → E | 0 | 0 | 0 | 0 | 16/16 | | ||
| 157 | +| `B_testsrc2_cpu6` | A + `--cpu-used=6` | R → E | 0 | 0 | 0 | 0 | 16/16 | | ||
| 158 | +| `C_mandel320` | mandelbrot 320x240 | R → E | 0 | 0 | 0 | 0 | 16/16 | | ||
| 159 | +| `D_bars` | smptebars 320x240 | R → E | 0 | 0 | 0 | 0 | 16/16 | | ||
| 160 | +| `E_noglobal` | A + `--enable-global-motion=0` | R → E | 0 | 0 | 0 | 0 | 16/16 | | ||
| 161 | +| `F_allintra` | A + `--lag-in-frames=0 --auto-alt-ref=0` | R → E | 0 | 0 | 0 | 0 | 16/16 | | ||
| 162 | +| `H_10bit_testsrc2` | 10-bit 4:2:2 320x240 | R → E | 0 | 0 | 0 | 0 | 16/16 | | ||
| 163 | +| `I_10bit_mandel` | 10-bit 4:2:2 mandelbrot | R → E | 0 | 0 | 0 | 0 | 16/16 | | ||
| 164 | +| `J_10bit_lr0` | H + `--enable-restoration=0` | R → E | 0 | 0 | 0 | 0 | 16/16 | | ||
| 165 | +| `K_sct` | A + `--cq-level=18 --tune=ssim` | R → E | 0 | 0 | 0 | 0 | 16/16 | | ||
| 166 | +| `L_tiled` | A + `--tile-columns=1 --tile-rows=1` | R → E | 0 | 0 | 0 | 0 | 16/16 | | ||
| 167 | +| **`O_odd322x242`** | testsrc2 **322x242** | R → **D** | 0 | 32 | 1580 | **1612** | 13/16 | | ||
| 168 | +| `T_422_322x240` | testsrc2 322x**240** | R → E | 0 | 0 | 0 | 0 | 16/16 | | ||
| 169 | +| **`S_422_320x242`** | testsrc2 320x**242** | R → **D** | 0 | 422 | 22566 | **22988** | 12/16 | | ||
| 170 | +| **`R_422_324x242`** | testsrc2 324x**242** | R → **D** | 0 | 712 | 25489 | **26201** | 14/16 | | ||
| 171 | +| **`X_422_320x232`** | testsrc2 320x**232** | R → **D** | 0 | 1042 | 106342 | **107384** | 12/16 | | ||
| 172 | +| **`X_422_320x248`** | testsrc2 320x**248** | R → **D** | 0 | 32 | 2185 | **2217** | 14/16 | | ||
| 173 | +| `V_422_320x242_lr0` | S + `--enable-restoration=0` | R → **D** | 0 | 422 | 19810 | **20232** | 12/16 | | ||
| 174 | +| `P_odd420_322x242` | 4:2:0 322x242 | **E** | 0 | 0 | 0 | 0 | 16/16 | | ||
| 175 | +| `Q_oddh420_320x242` | 4:2:0 320x242 | **E** | 0 | 0 | 0 | 0 | 16/16 | | ||
| 176 | +| **`Y_420_320x232`** | 4:2:0 320x**232** | **D** | 0 | 200 | 17658 | **17858** | 0/16 | | ||
| 177 | +| `Y_420_320x242` | 4:2:0 320x**242** | **E** | 0 | 0 | 0 | 0 | 16/16 | | ||
| 178 | +| **`Y_420_320x248`** | 4:2:0 320x**248** | **D** | 0 | 717 | 29936 | **30653** | 0/16 | | ||
| 179 | + | ||
| 180 | +**The one correction to the previous lane's "frames_exact" column**: it divided | ||
| 181 | +the per-frame byte count by the frame count before slicing, so its | ||
| 182 | +`frames_exact` values were meaningless (it reported 13/16 where the truth is | ||
| 183 | +0/16). The per-plane wrong counts were the only sound column it produced — and | ||
| 184 | +those were computed against itself. | ||
| 185 | + | ||
| 186 | +The previous lane's twelve 320x240 cells and its six committed pins are all | ||
| 187 | +confirmed exact. **The retraction is confined to the odd-geometry cells and to | ||
| 188 | +the claim that the comparison was measuring anything.** | ||
| 189 | + | ||
| 190 | +## 4. What is committed | ||
| 191 | + | ||
| 192 | +One fixture and two gates. **No decoder fix — see `not_done`.** | ||
| 193 | + | ||
| 194 | +`crates/ec-av1/fixtures/420_oddheight_320x232.obu`, 15 773 bytes, | ||
| 195 | +sha256 `6832c3cd867f5fc491b45fd67f77c38453db0ca6d461e7d225e6276f4d0784c8`, | ||
| 196 | +fnv1a64 `0x37877f15307c3b`. | ||
| 197 | + | ||
| 198 | +Source and recipe (ffmpeg 8.1.2, `aomenc` = `~/.cache/aom-oracle/build/aomenc`, | ||
| 199 | +Sep 29 build): | ||
| 200 | + | ||
| 201 | +``` | ||
| 202 | +ffmpeg -v error -f lavfi -i testsrc2=size=320x232:rate=24:duration=1 \ | ||
| 203 | + -pix_fmt yuv420p -y p232.y4m # sha256 f8e8077764e9b1b8e6b97ffa5f7d6f10ed627c6924f3451bcba14d3594903b47 | ||
| 204 | +aomenc --codec=av1 --profile=0 --input-bit-depth=8 --limit=16 \ | ||
| 205 | + --lag-in-frames=25 --auto-alt-ref=1 --enable-global-motion=1 \ | ||
| 206 | + --pass=1 --cq-level=45 --threads=4 --kf-min-dist=0 --kf-max-dist=999999 \ | ||
| 207 | + --width=320 --height=232 --cpu-used=0 p232.y4m -o Y232.webm | ||
| 208 | +ffmpeg -v error -i Y232.webm -c copy -f obu -y 420_oddheight_320x232.obu | ||
| 209 | +``` | ||
| 210 | + | ||
| 211 | +- **`count_rawvideo_diffs`** — a permanent COUNTING oracle comparison, the | ||
| 212 | + counterpart to `assert_rawvideo_matches` (which panics on the first | ||
| 213 | + difference and so can only answer one cell per process). It returns | ||
| 214 | + `None` on a size mismatch rather than reporting "exact", and it derives the | ||
| 215 | + plane split from the decoded picture instead of a formula. | ||
| 216 | +- **`the_counting_oracle_diff_reports_a_real_difference`** — the non-vacuity | ||
| 217 | + test. It decodes the pinned witness, which is known to differ, and asserts a | ||
| 218 | + non-zero count and `frames_exact < frames`. This is the test that would have | ||
| 219 | + caught last lane's comparator. | ||
| 220 | +- **`the_pinned_420_oddheight_witness_is_pinned_and_ratchets_its_reconstruction_defect`** | ||
| 221 | + — pins the fixture by size and fnv1a64 and **ratchets the measured defect**: | ||
| 222 | + `(0, 200, 17658)` wrong and 0/16 frames exact. It is deliberately not an | ||
| 223 | + exactness gate, because the decoder is not exact. Its failure message names | ||
| 224 | + the fix path (assert `(0, 0, 0)` when the defect is gone). | ||
| 225 | + | ||
| 226 | +Both gates are mutation-proven: flipping one fixture byte fails | ||
| 227 | +`420_oddheight_320x232.obu bytes drifted`; changing the expected count to | ||
| 228 | +17659 fails with `the measured defect moved`. | ||
| 229 | + | ||
| 230 | +## 5. Gates run | ||
| 231 | + | ||
| 232 | +- `the_counting_oracle_diff_reports_a_real_difference` — pass | ||
| 233 | +- `the_pinned_420_oddheight_witness_is_pinned_and_ratchets_its_reconstruction_defect` — pass | ||
| 234 | +- both mutation proofs — red as intended, then restored green | ||
| 235 | + | ||
| 236 | +## 6. `not_done` | ||
| 237 | + | ||
| 238 | +- **No decoder fix.** I localised the defect to reconstruction (present at | ||
| 239 | + `PREFILT`, keyframe affected, LR-off still fails) and to a height-dependent | ||
| 240 | + trigger, but I did not find the root cause, and I am not shipping a | ||
| 241 | + speculative change to a bit-exact decoder on a hunch. The exact next step: | ||
| 242 | + the region is small and reproducible, so take `Y_420_320x232` frame 0 (700 | ||
| 243 | + differing samples, **luma exact**, chroma only) and bisect with the decoder's | ||
| 244 | + own `EC_COEFF_STEP` / `EC_PRED` rungs against the oracle at the first | ||
| 245 | + differing block. The height dependence (232 and 248 fail, 240 and 242 pass, | ||
| 246 | + 232 and 248 both multiples of 8) is the strongest lead: it says the bug is | ||
| 247 | + in a per-superblock or per-row-band extent computation whose remainder is | ||
| 248 | + handled for some remainders and not others, and the 4:2:0 chroma height at | ||
| 249 | + 232 is 116 (= 29 chroma MI rows) against 121 at 242. | ||
| 250 | +- **The byte-exactness gate Main asked for cannot be written** until the fix | ||
| 251 | + lands. The ratchet gate is the honest substitute and is explicitly labelled | ||
| 252 | + as such. | ||
| 253 | +- **Only heights 232/240/242/248 at width 320 were swept.** The full | ||
| 254 | + width x height grid is not mapped, so the trigger's real extent is unknown. | ||
| 255 | +- **The 4:2:2 lift question is untouched**, as instructed. The new evidence | ||
| 256 | + argues against lifting: a cell family in the refused neighbourhood is broken. | ||
| 257 | +- The remaining fresh cells (`O`, `S`, `R`, `X_232`, `X_248`, `V`, `Y_232`, | ||
| 258 | + `Y_248`) are **not** pinned; only the 4:2:0 320x232 witness is, because it is | ||
| 259 | + the one reachable without a bypass. Their recipes and sha256 are in | ||
| 260 | + `lanes/av1422remeasure.report.md` and in the table above. | ||
| 261 | +- **Full suite not run** (lane rules: scoped only). | ||