Self-pin the deblocking gate's stream on mismatch
Browse files at this commit4d29711a415595575f2e4a66b686cc987243d81aParent: 87eb5ee- test
- self-pin the deblocking gate's stream on mismatch
- correct the variance comment
1 changed file +12 -4
- crates/ec-av1/src/stream.rs +12 -4
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-2 | 1826 | // 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 produce | 1828 | // genuine coverage gaps, separately documented), and only some produce |