forge
Explore
Log in

Don't you dare go Hollow

stream: pin the restoration sweep and edge32_gate, whose spec is a parameter

Browse files at this commit

ae84402d7b36747c4cd21b47ce3b63f0b0eec43eAhmet Kaan GümüşParent: f9d88f7
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.rsmodified+20 -0
@@ -30759,6 +30759,12 @@ pub(crate) mod tests {
3075930759 // r4: the pixel filters are wired -- every `uses_lr`
3076030760 // frame must now decode Ok AND match an independent
3076130761 // decoder pixel-exact, not just refuse cleanly.
30762+ // The ENCODE's frame count: every `EC_FISTRIP_SRC` branch
30763+ // and the `gradients_source` default (30568-30573) render at
30764+ // `rate=25` with a 1-frame `duration=0.04`, and aomenc runs
30765+ // with no `--limit` (30590) -- so each attempt's stream codes
30766+ // exactly 1 frame. Asserted ABOVE the oracle call.
30767+ assert_eq!(pics.len(), 1, "{NAME}: seed {seed} key frame");
3076230768 let reference = ffmpeg_decode_sequence(&stream, width, height, pics.len());
3076330769 let mismatched = pics
3076430770 .iter()
@@ -38337,6 +38343,20 @@ pub(crate) mod tests {
3833738343 };
3833838344 let after = crate::decode::edge32_hits();
3833938345 let delta: Vec<usize> = (0..8).map(|i| after[i] - before[i]).collect();
38346+ // The ENCODE's frame count, and it is PER ARM: the arm tuple's
38347+ // `frame_count` field is what the y4m is built from
38348+ // (`duration = frame_count / 25.0`, 38085, rendered with
38349+ // `-t {duration}` at 38131) and this gate's aomenc carries no
38350+ // `--limit` and no `--lag-in-frames`, so the stream codes exactly
38351+ // `frame_count` frames (1 for the intra arms, 5 for the
38352+ // inter/straddling ones). Asserted ABOVE the oracle call, so a
38353+ // decode that dropped one reds naming the encode.
38354+ assert_eq!(
38355+ decoded.len(),
38356+ frame_count,
38357+ "{name}: {tag}: the encode codes {frame_count} frame(s), the decode showed {}",
38358+ decoded.len()
38359+ );
3834038360 let reference = if ten_bit {
3834138361 ffmpeg_decode_sequence_10bit(&stream, width, height, decoded.len())
3834238362 } else {