From ae84402d7b36747c4cd21b47ce3b63f0b0eec43e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 30 Sep 2026 01:20:47 +0300 Subject: [PATCH] stream: pin the restoration sweep and edge32_gate, whose spec is a parameter a_real_aomenc_stream_with_restoration_reads_lr_symbols_correctly: every EC_FISTRIP_SRC branch and the gradients_source default render at rate 25 with a 1-frame duration=0.04, and aomenc runs with no '--limit', so each attempt's stream codes 1 frame. This gate had NO frame-count assert at all -- not even the tautological one -- so its zip over pics and reference would have truncated silently on a short decode. edge32_gate's count is PER ARM: the arm tuple's frame_count field is what the y4m is built from (duration = frame_count / 25.0) and aomenc runs with neither '--limit' nor '--lag-in-frames', so 1 for the intra arms and 5 for the inter/straddling ones. Asserting against that field is a spec rather than a literal and is already in scope at the call, which is why this is a pin and not a hand-forward. count-vacuity sweep: 15 unpinned -> 13. --- crates/ec-av1/src/stream.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index cc67db55..469e489c 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -30759,6 +30759,12 @@ pub(crate) mod tests { // r4: the pixel filters are wired -- every `uses_lr` // frame must now decode Ok AND match an independent // decoder pixel-exact, not just refuse cleanly. + // The ENCODE's frame count: every `EC_FISTRIP_SRC` branch + // and the `gradients_source` default (30568-30573) render at + // `rate=25` with a 1-frame `duration=0.04`, and aomenc runs + // with no `--limit` (30590) -- so each attempt's stream codes + // exactly 1 frame. Asserted ABOVE the oracle call. + assert_eq!(pics.len(), 1, "{NAME}: seed {seed} key frame"); let reference = ffmpeg_decode_sequence(&stream, width, height, pics.len()); let mismatched = pics .iter() @@ -38337,6 +38343,20 @@ pub(crate) mod tests { }; let after = crate::decode::edge32_hits(); let delta: Vec = (0..8).map(|i| after[i] - before[i]).collect(); + // The ENCODE's frame count, and it is PER ARM: the arm tuple's + // `frame_count` field is what the y4m is built from + // (`duration = frame_count / 25.0`, 38085, rendered with + // `-t {duration}` at 38131) and this gate's aomenc carries no + // `--limit` and no `--lag-in-frames`, so the stream codes exactly + // `frame_count` frames (1 for the intra arms, 5 for the + // inter/straddling ones). Asserted ABOVE the oracle call, so a + // decode that dropped one reds naming the encode. + assert_eq!( + decoded.len(), + frame_count, + "{name}: {tag}: the encode codes {frame_count} frame(s), the decode showed {}", + decoded.len() + ); let reference = if ten_bit { ffmpeg_decode_sequence_10bit(&stream, width, height, decoded.len()) } else {