From 6e9d8a0eda29027d10d9cd3a492fde1192d075a8 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:49 +0300 Subject: [PATCH] stream: hoist the narrow-kernel gate's FRAMES assert above its oracle call a_real_aomenc_rect_inter_block_predicts_chroma_with_the_narrow_kernel already had the right assert -- frames.len() == FRAMES, with 'const FRAMES: usize = 6' driving both '-vframes {FRAMES}' and '--limit={FRAMES}' -- but BELOW the call, so the oracle had already been handed frames.len(). Hoisted, not duplicated. The 'rect_narrow_kern_hits()' read stays where it was, above the call, so a mismatch report still says whether the arm fired; a first attempt at this edit moved the assert above that read and dropped the binding, which would have left the failure message unable to name the arm's hit count. count-vacuity sweep: 5 unpinned -> 4. --- crates/ec-av1/src/stream.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index 49077032..d62229d3 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -42959,6 +42959,18 @@ pub(crate) mod tests { } }; let narrow = crate::mc::rect_narrow_kern_hits(); + // The ENCODE's frame count, asserted ABOVE the oracle call, not + // our decode's length: `-vframes {FRAMES}` (42696) feeds aomenc + // exactly FRAMES frames and `--limit={FRAMES}` (42724) caps its + // output there. A decode that dropped a frame must red HERE, + // naming the encode, rather than hand the same short count to + // ffmpeg and let the helper's byte-length assert blame ffmpeg. + assert_eq!( + frames.len(), + FRAMES, + "{NAME}: not every coded frame was decoded ({width}x{height}, \ + depth={depth}, cq={cq})" + ); let ffmpeg_frames = if depth == 10 { ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()) } else { @@ -42969,12 +42981,6 @@ pub(crate) mod tests { frames.len(), "{NAME}: ffmpeg frame count ({width}x{height}, depth={depth}, cq={cq})" ); - assert_eq!( - frames.len(), - FRAMES, - "{NAME}: not every coded frame was decoded ({width}x{height}, \ - depth={depth}, cq={cq})" - ); for (i, (got, want)) in frames.iter().zip(&ffmpeg_frames).enumerate() { assert_eq!( got.y, want.y,