forge
Explore
Log in

Don't you dare go Hollow

Self-pin the deblocking gate's stream on mismatch

Browse files at this commit

4d29711a415595575f2e4a66b686cc987243d81aAhmet Kaan GümüşParent: 87eb5ee
  • test
    • self-pin the deblocking gate's stream on mismatch
    • correct the variance comment
Show full message
test(av1): self-pin the deblocking gate's stream on mismatch; correct the variance comment

The gate's content is fresh every run (gradients ignores seed for its
colors), so an unpinned failure may never reproduce. On mismatch the
stream is written to a stable temp path and the panic names it.
crates/ec-av1/src/stream.rsmodified+12 -4
@@ -1784,9 +1784,16 @@ mod tests {
1784 let ffmpeg_frames = ffmpeg_decode_sequence(&stream, width, height, frame_count);1784 let ffmpeg_frames = ffmpeg_decode_sequence(&stream, width, height, frame_count);
1785 assert_eq!(frames.len(), frame_count);1785 assert_eq!(frames.len(), frame_count);
1786 for (i, (got, want)) in frames.iter().zip(&ffmpeg_frames).enumerate() {1786 for (i, (got, want)) in frames.iter().zip(&ffmpeg_frames).enumerate() {
1787- assert_eq!(got.y, want.y, "frame {i} luma vs ffmpeg");1787+ // gradients' colors ignore its seed, so this gate encodes fresh
1788- assert_eq!(got.u, want.u, "frame {i} U vs ffmpeg");1788+ // content every run -- a mismatch here may never reproduce.
1789- assert_eq!(got.v, want.v, "frame {i} V vs ffmpeg");1789+ // Self-pin the stream before panicking so the failure is
1790+ // bisectable (replay: EC_AV1_PIN on scratch_isolate_pinned_mismatch).
1791+ let ok = got.y == want.y && got.u == want.u && got.v == want.v;
1792+ if !ok {
1793+ let pin = std::env::temp_dir().join("ec-av1-deblocking-gate-fail.obu");
1794+ let _ = std::fs::write(&pin, &stream);
1795+ panic!("frame {i} mismatch vs ffmpeg -- stream pinned at {}", pin.display());
1796+ }
1790 }1797 }
1791 }1798 }
1792 1799
@@ -1814,7 +1821,8 @@ mod tests {
1814 return;1821 return;
1815 }1822 }
1816 let (width, height, frame_count) = (64usize, 64usize, 4usize);1823 let (width, height, frame_count) = (64usize, 64usize, 4usize);
1817- // aomenc's RD is nondeterministic run to run even on a fixed fixture:1824+ // The fixture's content varies run to run (lavfi gradients ignores its
1825+ // seed option for the c0..c7 colors -- they default to "random"), so:
1818 // most encodes of this recipe trip one of the decoder's NAMED round-21826 // most encodes of this recipe trip one of the decoder's NAMED round-2
1819 // refusals (a reference other than LAST_FRAME, a sub-16 partition --1827 // refusals (a reference other than LAST_FRAME, a sub-16 partition --
1820 // genuine coverage gaps, separately documented), and only some produce1828 // genuine coverage gaps, separately documented), and only some produce