diff --git a/crates/ec-av1/fixtures/420_oddheight_320x236_diverging.obu b/crates/ec-av1/fixtures/420_oddheight_320x236_diverging.obu new file mode 100644 index 0000000000000000000000000000000000000000..76550610c08eb3e3c92c19cd82835b8bdb6784a7 GIT binary patch literal 16562 zcmV()K;OR-0168L000C$|E>S|fIu?V8WaGas5JR!b9xdUJ_JA!^Zz#GEd57(1VLb@ z6!NW%5`_;BkAA@5_&xjvAO|3vH~jasOA7w>05>Knm#a;#q3aA~w?L7KOZ+QC$huWwLV@yHP=Uc_76b~Q>H;H{&O0>NCP)PxPwSSapv-gxX2 z;!`>XJq9Rjq{r{rI}tV@$AjR6)rC3ZxSI*z9^hI|X~3d>kIlvJquQ$U8yNCd!j&Yw zLup>*)Yle(fm-8+2xB>pcvAoo+JflsW!<~O#lsYG9R=2n)VW4>I)CH`m zn1IEFUKpj7iUo(WE?l8~;x!O5*wtqwlNGvNx*AdLs%1|JbJ7S8BVwEJ^ z_@b)_>8!N698BF(ueId69RYv}{G)IM04W2=d%_eq-*19(-_J0B2io^rD4D)QVCbRX z`f69U(FIt61@Fv{<4SoLKV~M^f*QHlB5)oe$L~^kLA`%ipY*_A*BIdU>UY;1V+>2B z`fwr?j5B=|IpoT;C} zWyJn|1(-z@v*fmLDm!IwgN3H?sPF@9!u!hj5qEGHI+hM91svfEn4wP?Qz!0DmXxg? zb!3kt(hCPDSG0sN7b6fR{lyg@+kzXNYamC%DOP?Rans^s?0D~ir>@)aQ2i-WK(QDV zClY;6wTe_kM^^J`Z+|e*a^eSydGoJr$}u?2wJPveT7d59&=Btuf}=Ha}%Wl9qQvUUsVudzzLJ|6P7wD_@lm z01^nx$RlMvkZxiG5qNu~~75Scd6zk+Do zwbg*ZPDX~L|fmrO6>LVdipcp&Gm?v0z*R&#of`(Q&o5EkOToA@pZAJ zOuSc)5u#6IjWTQIv1|T5Rfe@ct0lnkOxUJ8b8w<%#Ot0=1#=1vgKM*r+m-uU96xMd zDYpLqn*D~6wj3Rdv`5VCxi<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ZT>geXn7BU@e1n`>MeHw`*=RZF?N|JWmaxDEg^ix> z)PMluRpQ*m@hay&LpqUgzR9W!zTkJqsyB+co$Dyh`h-OM6c{@_veb8MN340Dhi{DQ zM`XEvB&-AFO>&%jZV2OO(8I+h z7I!wsMS!{DJ-#Dbl#g&UD>zs2q&Ow5OMIn4$f8N5+)pnoZNywy>N3))jI-;NL_(81 zDeAFv6U);1|Exa7%SyEs9Z^rx>TKr9>RM=&7*nR&KFo27F~iFBjOIn_u?nHQIzE?UIMCft{bc44lVWK<@P#x<@807}-*HwkmyL{= z)bH?nf!_$p2)xBSM#E^q@2k6yASp=glSx3{qw|nMg2?Q1F0(Zl513h?b*eUBj?W^) z^hdJiuLZAaxu{N1YO^+Ybcfo-dm+MzzuSt&T%VAexa?@Y?ybgfGXW9+8Ue@>05ahP zG7c~ZsLY)pfCMoJ6aY9L0PRO>MqCj+u)|@<3&-^#@!L`mFVy$ozB!8((}T7P{SIv~ z3TPfWGi~%-o}ZhVyrvDG5aM@U0Izo7fA|6|%cfD`u;O6nf zAmzRFg00s1iMgVy=1@mz2DFPXvNsWaQBR5yx6Ltt7FEH_4RCibmACyeT1`>9lHQEu=bmb;_*J@|RT= z>X7ZyTrzjrn5a1qc}Y=`>+X*0Z|vSysa_0n9|;r!tV*iZ3}JkeQ3t0yk^%fhx|=RE z7D$@nNlzR}haVD;n#y#)f*MuX@4hu#M0ygAUId0Gq!y|>BR1T8YuS5tepS{rPn-u%(u0TEr=Jp zmy4O!!Z(reo%i(4TJ4$+Qb|_!%^++ZaqG~77!riG= pVa$u!Ql5VUlH1nEEPxUKG88fo01ptjgGe9%3_%3|0097~h = Vec::with_capacity(decoded.len()); + let mut off = 0usize; + for f in &decoded { + let (y, u, v) = (f.y.len() * bpp, f.u.len() * bpp, f.v.len() * bpp); + spans.push([off, off + y, off + y + u, off + y + u + v]); + off += y + u + v; + } + assert_eq!( + off, + ours.len(), + "{name}: the per-frame plane table covers {off} bytes but the packed output is {}", + ours.len() + ); let mut wrong = [0usize; 3]; + let mut frame = 0usize; for (i, (&a, &b)) in ours.iter().zip(&want).enumerate() { + while frame + 1 < spans.len() && i >= spans[frame][3] { + frame += 1; + } if a == b { continue; } - let pi = if i < ys { + let s = spans[frame]; + let pi = if i < s[1] { 0 - } else if i < ys + us { + } else if i < s[2] { 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]) + let exact = spans + .iter() + .filter(|s| ours[s[0]..s[3]] == want[s[0]..s[3]]) .count(); Some((wrong[0], wrong[1], wrong[2], frames, exact)) } @@ -10499,6 +10527,177 @@ pub(crate) mod tests { eprintln!("{NAME}: baseline exact, each flipped oracle byte reported as exactly 1"); } + /// lane-av1cmpframe: the control for the class + /// `comparator-that-attributes-the-wrong-plane`. + /// + /// [`count_rawvideo_diffs`] used to derive its plane split from the FIRST + /// decoded picture and compare every byte index against those frame-0 + /// thresholds. On a multi-frame stream that attributes every sample after + /// frame 0's luma to the LAST plane: on the pinned 320x236 stream below + /// (16 frames of 320x236 4:2:0, 113 280 bytes per frame, so plane V holds + /// 302 080 bytes in total) it reported `wrong_v = 330 673` -- more wrong V + /// bytes than exist. The per-frame totals and the frame-exact count were + /// sound, so the defect was invisible to every gate that only asserted + /// zeros; it corrupted exactly the numbers a per-plane report exists to + /// give. + /// + /// Three arms, each of which the old attribution FAILS: + /// + /// 1. **Arithmetic.** Each plane's count must be at most that plane's own + /// byte capacity summed over frames, and the three must sum to the + /// independently computed total. The old code reported 330 673 wrong V + /// bytes in a 302 080-byte plane. + /// 2. **A later frame's U.** Flipping one byte inside frame 5's U plane + /// must move U by exactly one and leave Y and V at their baseline. + /// The old code has no frame-5 U at all -- byte 600 000 is past every + /// frame-0 threshold, so it landed in V. + /// 3. **Frame attribution.** `frames_exact` must equal the number of + /// frames this test counts itself, per frame, from the decoded + /// pictures' own plane lengths. + /// + /// The pin is asserted only for IDENTITY (bytes + fnv1a64) and for + /// comparability. Whether the stream currently diverges is deliberately + /// NOT asserted: this is a control for the INSTRUMENT, and it must keep + /// biting after the odd-height entropy fork is fixed. + #[test] + fn the_counting_oracle_diff_attributes_planes_per_frame() { + const NAME: &str = "the_counting_oracle_diff_attributes_planes_per_frame"; + let _gate_lock = lock_gate_counters(); + const FILE: &str = "420_oddheight_320x236_diverging.obu"; + const BYTES: usize = 16562; + // sha256 84e4d1ab56620af1c5b78e1aa3d2d67496a492f2e127198c82dd1d68b01c6200. + // The tree pins fixture identity by fnv1a64; a `const SHA256` + // compared against itself would be the tautology this lane exists to + // kill, so it is not written. + const FNV1A64: u64 = 521889434652397870; + let data = crate_pin(FILE); + let data = std::fs::read(&data) + .unwrap_or_else(|e| panic!("{NAME}: the committed pin {FILE} is missing ({e})")); + assert_eq!(data.len(), BYTES, "{NAME}: {FILE} size drifted"); + assert_eq!(fnv1a64(&data), FNV1A64, "{NAME}: {FILE} bytes drifted"); + let bit_depth = stream_bit_depth(&data, NAME); + let bpp = if bit_depth == 8 { 1 } else { 2 }; + + // ---- this test's own reading of the oracle, from scratch --------- + 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, &data).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 decoded = decode_stream(&data).expect("the pinned stream decodes"); + let ours = pack_rawvideo(&decoded, bit_depth, NAME); + assert_eq!(ours.len(), want.len(), "{NAME}: the two sides differ in size"); + + // The per-frame plane table, built from each decoded picture's OWN + // plane lengths -- the same source `pack_rawvideo` lays the bytes out + // from, and never a formula. + let mut spans: Vec<[usize; 4]> = Vec::with_capacity(decoded.len()); + let mut capacity = [0usize; 3]; + let mut off = 0usize; + for f in &decoded { + let (y, u, v) = (f.y.len() * bpp, f.u.len() * bpp, f.v.len() * bpp); + spans.push([off, off + y, off + y + u, off + y + u + v]); + capacity[0] += y; + capacity[1] += u; + capacity[2] += v; + off += y + u + v; + } + assert_eq!(off, ours.len(), "{NAME}: the plane table covers the buffer"); + + // The truth, counted here with no help from the helper under test. + let mut truth = [0usize; 3]; + let mut truth_exact = 0usize; + for s in &spans { + let mut frame_exact = true; + for (p, a, b) in [(0usize, s[0], s[1]), (1, s[1], s[2]), (2, s[2], s[3])] { + let n = ours[a..b] + .iter() + .zip(&want[a..b]) + .filter(|(x, y)| x != y) + .count(); + truth[p] += n; + frame_exact &= n == 0; + } + truth_exact += usize::from(frame_exact); + } + + let (wy, wu, wv, frames, exact) = + count_rawvideo_diffs(&data, NAME, None).expect("the two sides must be byte-comparable"); + eprintln!( + "{NAME}: pinned {FILE} as wrongY={wy} wrongU={wu} wrongV={wv} over {frames} frames, \ + {exact} exact; this test's own count {truth:?} with {truth_exact} exact frames; \ + plane capacities {capacity:?}" + ); + assert_eq!(frames, decoded.len(), "{NAME}: frame count"); + assert_eq!( + [wy, wu, wv], + truth, + "{NAME}: the helper's per-plane split must equal an independent per-frame count" + ); + assert_eq!(exact, truth_exact, "{NAME}: frames_exact"); + for p in 0..3 { + assert!( + truth[p] <= capacity[p], + "{NAME}: plane {p} counts {} wrong bytes but holds only {}", + truth[p], + capacity[p] + ); + } + + // ---- arm 2: a byte inside a LATER frame's U plane. -------------- + // Frame 5's U plane's first byte. The old first-picture attribution + // has no frame-5 U at all: that byte is past every frame-0 threshold, + // so it landed in V. + let u5 = spans[5][1]; + let (fy, fu, fv, fframes, fexact) = count_rawvideo_diffs(&data, NAME, Some(u5)) + .expect("the two sides must be byte-comparable"); + let flipped = [fy, fu, fv]; + assert_eq!(fframes, frames, "{NAME}: frame count under the flip"); + assert_eq!( + flipped.iter().sum::(), + truth.iter().sum::() + 1, + "{NAME}: flipping one byte inside frame 5's U plane must add exactly one wrong \ + byte -- got {flipped:?} against this test's own count {truth:?}" + ); + assert_eq!( + flipped[1], + truth[1] + 1, + "{NAME}: byte {u5} is inside frame 5's U plane" + ); + assert_eq!(flipped[0], truth[0], "{NAME}: byte {u5} is not in luma"); + assert_eq!( + flipped[2], truth[2], + "{NAME}: byte {u5} must NOT be attributed to V -- the first-picture attribution \ + puts every byte past frame 0's luma in V" + ); + let want_exact = if truth_exact < frames { + truth_exact + } else { + frames - 1 + }; + assert_eq!( + fexact, want_exact, + "{NAME}: one flipped byte inside frame 5 leaves frames_exact at {want_exact}" + ); + } + /// lane-av1cmpaudit2: the permanent CONTROL for the class /// `comparator-that-never-reads-the-oracle`. /// @@ -51611,4 +51810,5 @@ exit 0 } let _ = std::fs::remove_dir_all(&dir); } + } diff --git a/lanes/av1cmpframe.report.md b/lanes/av1cmpframe.report.md new file mode 100644 index 00000000..902e2a62 --- /dev/null +++ b/lanes/av1cmpframe.report.md @@ -0,0 +1,186 @@ +# lane-av1cmpframe — `count_rawvideo_diffs` attributed planes by the FIRST picture + +Base `6c3d079c` (merge of `lane-av1gapremeasure`), branch `lane-av1cmpframe`. +**This is an INSTRUMENT fix.** No decoder behaviour is touched: the diff is one +test-module helper plus one new gate and one committed fixture. + +## 1. The defect + +`count_rawvideo_diffs` (`crates/ec-av1/src/stream.rs:10374`) packed our decoded +pictures frame by frame — `pack_rawvideo` walks `decoded` and lays out each +frame's own `y`/`u`/`v` lengths — and then attributed every differing byte with +**frame 0's thresholds, forever**: + +```rust +let f0 = decoded.first().expect("a decoded picture"); +let (ys, us) = (w * h * bpp, f0.u.len() * bpp); +let pi = if i < ys { 0 } else if i < ys + us { 1 } else { 2 }; +``` + +On a multi-frame stream that is wrong for every byte after frame 0's luma: all of +it lands in plane V. The totals and `frames_exact` stayed sound (they were +computed from `per` = one frame's size applied uniformly, which is right for the +uniform-size streams in the corpus), so **every gate that only asserted zeros +could not see it** — and the per-plane split is the only reason a per-plane +report exists. + +The symptom that exposed it: on the pinned 320x236 stream it reported +`wrongV = 330 673` when plane V holds **302 080** bytes across the 16 frames. A +count larger than its own plane is not a plausible measurement. + +## 2. The fix + +The plane table is now built **per frame from each decoded picture's own plane +lengths** — the same source `pack_rawvideo` lays the bytes out from, and not a +formula, not `width * height`, not the first picture: + +```rust +let mut spans: Vec<[usize; 4]> = Vec::with_capacity(decoded.len()); +let mut off = 0usize; +for f in &decoded { + let (y, u, v) = (f.y.len() * bpp, f.u.len() * bpp, f.v.len() * bpp); + spans.push([off, off + y, off + y + u, off + y + u + v]); + off += y + u + v; +} +assert_eq!(off, ours.len(), ...); +``` + +then a monotone cursor walks `spans` as the byte index advances, and +`frames_exact` compares each frame's own span instead of a fixed stride. A +stream whose frames differ in size is now attributed correctly as well — the old +code could not express that case at all. The signature is unchanged, so no caller +changed. + +## 3. The control, and the mutation that proves it bites + +New gate `the_counting_oracle_diff_attributes_planes_per_frame` on a new +committed pin `420_oddheight_320x236_diverging.obu` (16562 B, sha256 +`84e4d1ab56620af1c5b78e1aa3d2d67496a492f2e127198c82dd1d68b01c6200`, fnv1a64 +`521889434652397870`; the recipe and the one-flag bisect that reaches it are in +`lanes/av1gapremeasure.report.md` §5). + +It counts the truth **itself** — running `aomdec --rawvideo` again, packing our +pictures, and walking its own per-frame plane table — and then asserts the +helper agrees with it, on three axes: + +1. **per-plane split** equals the independent per-frame count, and +2. `frames_exact` equals the independently counted exact frames, and +3. **a byte inside frame 5's U plane** (`spans[5][1]`, i.e. a byte ~5 frames in) + moves **U** by exactly one and leaves Y and V at their baseline values. This + is the arm the old code cannot pass: that byte is past every frame-0 + threshold, so the old attribution put it in V. + +Measured on the fixed tree: + +``` +pinned 420_oddheight_320x236_diverging.obu as wrongY=234349 wrongU=56957 +wrongV=52981 over 16 frames, 0 exact; this test's own count +[234349, 56957, 52981] with 0 exact frames; plane capacities +[1208320, 302080, 302080] +``` + +**Mutation (the fix reverted to the first-picture form, one hunk):** + +``` +left: [11198, 2416, 330673] +right: [234349, 56957, 52981] +``` + +with the named message `the helper's per-plane split must equal an independent +per-frame count`. The old numbers are reproduced digit for digit, including the +impossible `V > capacity`. + +The gate deliberately does **not** assert that the stream diverges: it is a +control for the instrument and must keep biting after the odd-height entropy fork +is fixed. The flip arm's expected `frames_exact` is written to accept either +case (`truth_exact` when the frame is already wrong, `frames - 1` when it was +exact). + +## 4. Caller sweep — who else attributes planes, and are they frame-aware + +| site | how it splits planes | verdict | +|---|---|---| +| `count_rawvideo_diffs` (`stream.rs:10374`) | was frame 0's `width*height` / `u.len()`, applied to every byte | **FIXED here** | +| `oracle_plane_diffs` (`stream.rs:49951`) | reads ONE `EC_AV1_FINAL_DUMP` file per decode-order frame and splits that frame with the caller's `plane_samples` | already frame-aware | +| the 10-bit film arm of `every_ffmpeg_comparator_reds_on_a_one_sample_wrong_ffmpeg` (`count10`, `stream.rs:11008`) | `for (a, b) in our_10bit.iter().zip(theirs)` then per-plane over each pair's own `y`/`u`/`v` | already frame-aware | +| the 8-bit arm of the same control (`count8`, `stream.rs:10975`) | `our_8bit[0]` / `theirs[0]` — **frame 0 only** | not a mis-attribution: the arm's subject is one 320x240 frame and it is documented as such | +| `assert_rawvideo_matches` / `decode_all_frames_vs_oracle` | byte-equality per decode-order frame, no plane attribution at all | not applicable | +| the `320x240` offset arithmetic in the ffmpeg shim control (`stream.rs:10805`) | asserts its own geometry (`ys == 76800`, `cs == 19200`) for a single even-sized frame | correct by assertion | + +So `count_rawvideo_diffs` was the only site with the defect. + +## 5. Re-measured numbers for the two open cells (now attributed) + +With the fixed comparator, live `aomdec --rawvideo`, and a `flip` byte-0 control +on each cell: + +| cell | bytes | wrong Y | wrong U | wrong V | frames exact | flip-0 control | +|---|---|---|---|---|---|---| +| `320x236` (the committed pin, sha256 `84e4d1ab…`) | 16562 | **234349** | **56957** | **52981** | 0/16 | Y 234349 → 234350 | +| `322x248` (sha256 `9e8c9c6c…`) | 16131 | **36286** | **13359** | **13001** | 0/16 | Y 36286 → 36287 | +| `320x232` (the committed pin, sha256 `6832c3cd…`) | 15773 | 0 | 0 | 0 | 16/16 | Y 0 → 1, exact 16 → 15 | +| `320x248` (sha256 `e4a4f71d…`) | 16440 | 0 | 0 | 0 | 16/16 | Y 0 → 1 | +| `324x236` (sha256 `11687cc7…`) | 16683 | 0 | 0 | 0 | 16/16 | Y 0 → 1 | + +**These are the debt's own numbers, reproduced by the crate's own instrument.** +The debt line reads "`320x236` (Y 234349, U 56957, V 52981) and `322x248` (Y +36286, U 13359, V 13001)" — the fixed helper now emits exactly those figures. +The earlier lane that recorded them used a different, frame-aware comparator; +the helper was the broken one, and the debt was right. + +## 6. Earlier reports whose headline number was a mis-attributed split + +- **`lanes/av1422anom.report.md:90` and `:176`** — the `Y_420_320x232` row, + "`0 | 200 | 17658`", and its total "17858". Produced by this helper on a + 16-frame stream, so the U and V columns are not that cell's U and V: only + frame 0's chroma could reach U, and frames 1–15's chroma was all counted as V. + **What it should now read:** the totals (17858 differing bytes, 0/16 frames + exact) stand; the per-plane split does not, and no corrected split is + recoverable because the cell is byte-exact on main today. The conclusion the + row supports — a real 320x232 chroma divergence, since fixed by + lane-av1422chrtx — is unaffected, because the divergence was non-zero either + way. +- **`lanes/av1422h232.report.md:31-35`** — the red-before table + (`420_oddheight_320x232.obu` "0 | 5772 | 12086", and the same from an + independent re-encode). Same defect, same conclusion: the totals and 0/16 are + sound, the U/V split is not. +- **`lanes/av1cmpaudit2.report.md:71`** — quotes "17658 wrong chroma of 593920" + from the same measurement to argue `count_rawvideo_diffs` is a LIVE comparator. + The liveness argument survives (the count is non-zero and comes from the + oracle's real bytes); the "of 593920" denominator does not describe a plane. + +No other report quotes a non-zero per-plane split from this helper. Every +zero-valued result in the corpus is unchanged by the fix, because a zero is a +zero under any attribution. + +## 7. What was run + +Scoped, on this branch, with `EC_NOMEMGUARD=1 EC_AV1_REQUIRE_AOMDEC=1 +EC_AV1_REQUIRE_AOMENC=1 EC_AV1_REQUIRE_FFMPEG=1`: + +- `the_counting_oracle_diff_attributes_planes_per_frame` — new, green. +- `the_counting_oracle_diff_detects_one_flipped_oracle_byte` — the pre-existing + non-vacuity control, green. +- `the_pinned_420_oddheight_witness_is_pinned_and_decodes_byte_exact` — the + pre-existing caller that asserts `(0, 0, 0, exact == frames)`, green. +- `every_oracle_comparator_reds_on_a_one_byte_wrong_oracle` — the control for + the whole comparator family, green. +- the mutation of §3, red with the named message. + +Full-suite validation is the orchestrator's; the diff is one helper, one gate, +one fixture. + +## 8. `not_done` + +- The odd-height entropy fork itself (`320x236`, `322x248`) is **not** touched: + no decoder behaviour changed here, and the fix is an instrument fix. +- No second pin was added for `322x248`; its numbers in §5 come from a live + encode with the recipe in `lanes/av1gapremeasure.report.md` §5. Committing a + fixture nothing gates would be dead weight; if the fork's owning lane wants a + witness, it should commit the pin together with the ratchet gate it needs. +- The mis-attributed U/V splits in the three reports of §6 are **not** + retro-corrected in those files. The debt is Main's to update and this lane was + told not to touch it; the corrected figures for the still-diverging cells are + in §5 for whoever writes the debt text. +- `count8` in the ffmpeg control still scores frame 0 only. That is the arm's + declared scope, not a defect, so it was left alone.