From 4d29711a415595575f2e4a66b686cc987243d81a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Fri, 28 Aug 2026 13:33:19 +0300 Subject: [PATCH] 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.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index 3d887c08..fdcc5626 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -1784,9 +1784,16 @@ mod tests { let ffmpeg_frames = ffmpeg_decode_sequence(&stream, width, height, frame_count); assert_eq!(frames.len(), frame_count); for (i, (got, want)) in frames.iter().zip(&ffmpeg_frames).enumerate() { - assert_eq!(got.y, want.y, "frame {i} luma vs ffmpeg"); - assert_eq!(got.u, want.u, "frame {i} U vs ffmpeg"); - assert_eq!(got.v, want.v, "frame {i} V vs ffmpeg"); + // gradients' colors ignore its seed, so this gate encodes fresh + // content every run -- a mismatch here may never reproduce. + // Self-pin the stream before panicking so the failure is + // bisectable (replay: EC_AV1_PIN on scratch_isolate_pinned_mismatch). + let ok = got.y == want.y && got.u == want.u && got.v == want.v; + if !ok { + let pin = std::env::temp_dir().join("ec-av1-deblocking-gate-fail.obu"); + let _ = std::fs::write(&pin, &stream); + panic!("frame {i} mismatch vs ffmpeg -- stream pinned at {}", pin.display()); + } } } @@ -1814,7 +1821,8 @@ mod tests { return; } let (width, height, frame_count) = (64usize, 64usize, 4usize); - // aomenc's RD is nondeterministic run to run even on a fixed fixture: + // The fixture's content varies run to run (lavfi gradients ignores its + // seed option for the c0..c7 colors -- they default to "random"), so: // most encodes of this recipe trip one of the decoder's NAMED round-2 // refusals (a reference other than LAST_FRAME, a sub-16 partition -- // genuine coverage gaps, separately documented), and only some produce