forge
Explore
Log in

Don't you dare go Hollow

lane-av1422llintra: rename the 4:2:2 witness gate to what it asserts, and say what it does NOT cover

Browse files at this commit

20d10af69ba24d76f2b9644fc750392ba1f99b79Ahmet Kaan GümüşParent: 15ad394
the_pinned_422_lossless_inter_chroma_panics_refuse_by_name asserted the 4:2:2
HEADER refusal, which fires before any of the seven sites lane-av1422lpf fixed
is reachable and fires IDENTICALLY on the pre-fix tree (aef4fa67 prints the same
string). So with respect to that fix the gate was VACUOUS -- it passed before
and after. Its only real content is the three fixture pins.

Renamed to the_pinned_422_lossless_inter_witnesses_are_present_and_refuse_by_name,
doc rewritten to state that, and to state that no committed test can reach a
4:2:2 decode at all (the EC_AV1_ALLOW_422_PROBE bypass is a patch-run-restore
hack that must never be committed), so the panic fix's evidence is the bypassed
manual measurement in lanes/av1422lpf.report.md. The false 'Golomb tail refusal
at frame 2' claim, which does not reproduce, is named and retracted in the doc.

The sibling source-scan arm gets the same scope statement: it is a SPELLING
scan and proves nothing about pixels.

Also repairs collateral damage from 69a3a4df: that commit appended its own doc
block in the MIDDLE of the lane-av1422warp gate's doc comment, so the warp gate
(the_pinned_422_residual_compound_warp_witness_is_present_and_refuses_by_name)
had lost its documentation entirely and the two gates shared one comment. The
warp doc is moved back onto its own gate.

The three pins (W_intrabc.obu, X_intrabc_tiled.obu, Y_intrabc_10b.obu: size +
fnv1a64) are unchanged.
crates/ec-av1/src/stream.rsmodified+143 -97
@@ -2974,93 +2974,41 @@ pub(crate) mod tests {
2974 );2974 );
2975 }2975 }
2976 }2976 }
2977- /// lane-av1422warp: the SECOND 4:2:2 coverage witness -- the one2977+ /// lane-av1422lpf: the three 4:2:2 LOSSLESS INTER witness fixtures,
2978- /// `422_sb128_3f.obu` could not be, because that stream's inter content2978+ /// PINNED, and asserted to refuse at the SEQUENCE HEADER.
2979- /// is skip-heavy (see `lanes/av1422stripwrite.report.md`, which named a2979+ ///
2980- /// second fixture with real residuals, compound and warped motion above2980+ /// W/X/Y (`W_intrabc.obu`, `X_intrabc_tiled.obu`, `Y_intrabc_10b.obu`) are
2981- /// the vertical midpoint as the thing that would justify lifting the2981+ /// the streams on which lane-av1422lpf found the seven-site chroma-extent
2982- /// refusal). This is that fixture.2982+ /// PANIC family -- each site indexed a block's chroma PLANE BLOCK with
2983- ///2983+ /// the ENCLOSING SQUARE `max(side >> ss_x, side >> ss_y)` instead of the
2984- /// `422_residual_compound_warp_16f.obu` (38845 bytes), sha2562984+ /// PER-AXIS `(bw >> ss_x, bh >> ss_y)` -- so the pins keep the bytes that
2985- /// `d78e2afb43ce311d3d82335a945c6f80f62db4537966d881c1349a68b3aecb95`:2985+ /// witnessed it from silently changing under the gate.
2986- ///2986+ ///
2987- /// ```text2987+ /// WHAT THIS GATE DOES NOT COVER, measured rather than argued: the
2988- /// ffmpeg -f lavfi -i "mandelbrot=size=256x288:rate=24:maxiter=220:start_scale=3:end_scale=0.35:end_pts=300,rotate=a=0.10*t:c=none:ow=256:oh=288" \2988+ /// refusal it asserts is the HEADER refusal, which fires BEFORE any of
2989- /// -frames:v 24 -pix_fmt yuv422p -f yuv4mpegpipe src422.y4m2989+ /// the seven sites is reachable, and it fires IDENTICALLY on the pre-fix
2990- /// aomenc --codec=av1 --profile=2 --input-bit-depth=8 --limit=162990+ /// tree (commit `aef4fa67` prints the same string, built and run for
2991- /// --width=256 --height=288 --lag-in-frames=25 --auto-alt-ref=12991+ /// this correction). This gate is therefore VACUOUS with respect to the
2992- /// --enable-global-motion=1 --pass=12992+ /// seven-site fix -- it passes before and after the fix. Its only real
2993- /// --cq-level=24 --cpu-used=02993+ /// content is the three pins.
2994- /// --threads=4 --kf-min-dist=0 --kf-max-dist=999999 \2994+ ///
2995- /// src422.y4m -o a1.webm2995+ /// Nor can any committed gate witness that fix's DECODE behaviour: with
2996- /// ffmpeg -i a1.webm -c copy -f obu -y a1.obu2996+ /// the header refusal standing, no committed test reaches a 4:2:2 decode,
2997- /// ```2997+ /// because the `EC_AV1_ALLOW_422_PROBE` bypass is a patch-run-restore
2998- ///2998+ /// hack that must never be committed. The panic fix's evidence is the
2999- /// CORRECTED by lane-av1422lrless (reviewer P2). This doc previously2999+ /// BYPASSED manual measurement in `lanes/av1422lpf.report.md`; what is
3000- /// carried a different ffmpeg filter (`rotate=a=0.10`, no `*t`, no3000+ /// committed for the fix is the source-scan arm
3001- /// `:c=none:ow/oh`) and a `-n ffp --pass=2 --fpf=...` two-pass line.3001+ /// `the_422_lossless_inter_chroma_walk_sites_stay_per_axis`, which
3002- /// **Neither produced these bytes.** Re-encoding from the recorded3002+ /// proves the per-axis SPELLING and nothing about pixels.
3003- /// source `src422.y4m` (sha2563003+ ///
3004- /// `4d35eaf65d1a5541b3177e1183644c163b3868d8f141bed0ce9fdf833280ba9f`)3004+ /// CORRECTED by lane-av1422llintra: the name said `..._panics_refuse_
3005- /// was measured three ways: the two-pass form gives 38774 bytes3005+ /// by_name`, and lane-av1422lpf's report claimed W and X now REFUSE with
3006- /// (`e93c4ed7...`), and only adding `--pass=1` reproduces these 388453006+ /// `a Golomb tail longer than this decoder reads` at frame 2. That
3007- /// bytes byte for byte (`d78e2afb...`). `aomenc` DEFAULTS to two-pass,3007+ /// refusal DOES NOT REPRODUCE on this tip: with the bypass applied, all
3008- /// so the flag has to be stated to get back the pinned stream. The3008+ /// three cells DECODE 16/16 -- no panic and no second refusal.
3009- /// recipe above is the one that was actually run.3009+ #[test]
3010- ///3010+ fn the_pinned_422_lossless_inter_witnesses_are_present_and_refuse_by_name() {
3011- /// Measured on a patch-run-restore build (the `EC_AV1_ALLOW_422_PROBE`3011+ const NAME: &str = "the_pinned_422_lossless_inter_witnesses_are_present_and_refuse_by_name";
3012- /// bypass applied for the run, reverted after -- it is deliberately NOT
3013- /// committed, and the refusal below is what the committed tree asserts):
3014- ///
3015- /// - all 16 frames pixel-exact against `aomdec --rawvideo`, 2359296
3016- /// bytes each, sha256 `4bfc2395e5ca6ea178f606e6b1ced773e26fc2d85b
3017- /// c3a6cdb63a402939aeb203` on both sides;
3018- /// - the entropy stream pairs bit-for-bit against the instrumented
3019- /// oracle -- 246735 symbol reads each, no divergence anywhere in the
3020- /// stream, not merely at the window this lane spent nine rounds
3021- /// narrowing;
3022- /// - the arms this fixture exists to cover really fire ABOVE the
3023- /// vertical midpoint: 3 upper-half blocks on a non-`TRANSLATION`
3024- /// global-motion model (`top_half_warp_hits`, gated on libaom's
3025- /// `is_global_mv_block` per slot) and 3 upper-half
3026- /// `GLOBAL_GLOBALMV` compound blocks (`top_half_compound_hits`),
3027- /// alongside 25 compound-warp, 18 compound-warp-8x8-leaf, 84
3028- /// rotzoom global-warp, 22 Wiener and 10 SGRPROJ loop-restoration
3029- /// units frame-globally.
3030- ///
3031- /// The loop-restoration numbers are load-bearing twice over: decoding
3032- /// this stream is what exposed the per-axis `read_lr` corner bug
3033- /// (`restoration.rs`, `av1_loop_restoration_corners_in_sb`), whose fix
3034- /// is what made the whole sequence pair. 4:2:0 and 4:4:4 are unchanged
3035- /// by it -- byte-identical to their pre-lane decodes, with the LR gate
3036- /// family green.
3037- ///
3038- /// Like its two siblings, the committed assertion is the byte pin plus
3039- /// the refusal-by-name contract: with the header refusal standing,
3040- /// NO committed test can decode a 4:2:2 stream, because the bypass that
3041- /// would allow it must never be committed.
3042- /// lane-av1422lpf: the 4:2:2 lossless INTER chroma panic family -- SEVEN
3043- /// sites, each indexing a block's chroma PLANE BLOCK with the ENCLOSING
3044- /// SQUARE `max(side >> ss_x, side >> ss_y)`.
3045- ///
3046- /// libaom's chroma plane block is PER-AXIS, `(bw >> ss_x) x
3047- /// (bh >> ss_y)` (`av1_common_int.h`'s `av1_get_plane_block_size`, the
3048- /// `dec->uv_buffer` extent in decodeframe.c), and it is square only when
3049- /// `ss_x == ss_y`. The enclosing square is the same number at 4:2:0
3050- /// (`side >> 1`) and 4:4:4 (`side`) on a square block, so every site
3051- /// below is byte-identical there; at 4:2:2 the square is the LUMA side
3052- /// and each site walked off its own buffer.
3053- ///
3054- /// Committed code refuses 4:2:2 at the sequence header, so -- exactly
3055- /// like the witnesses above -- what this gate can assert in committed
3056- /// code is the byte pin, the refusal-by-name contract, and the arm below:
3057- /// that each site's PER-AXIS expression is still spelled per-axis and
3058- /// the square-cut expression it replaced is gone. The decode-level
3059- /// evidence is measured on the local `EC_AV1_ALLOW_422_PROBE`
3060- /// patch-run-restore build and is in `lanes/av1422lpf.report.md`.
3061- #[test]
3062- fn the_pinned_422_lossless_inter_chroma_panics_refuse_by_name() {
3063- const NAME: &str = "the_pinned_422_lossless_inter_chroma_panics_refuse_by_name";
3064 const REFUSAL: &str = "a chroma format of 4:2:2";3012 const REFUSAL: &str = "a chroma format of 4:2:2";
3065 for (file, bytes, fp) in [3013 for (file, bytes, fp) in [
3066 ("W_intrabc.obu", 130_320usize, 0xb6d5c4653a32567a_u64),3014 ("W_intrabc.obu", 130_320usize, 0xb6d5c4653a32567a_u64),
@@ -3095,6 +3043,12 @@ pub(crate) mod tests {
3095 /// `dead-matcher-positive-control` sense -- a scan that matched nothing3043 /// `dead-matcher-positive-control` sense -- a scan that matched nothing
3096 /// would fail it rather than pass silently.3044 /// would fail it rather than pass silently.
3097 ///3045 ///
3046+ /// WHAT IT DOES NOT COVER: this arm is a SPELLING scan. It cannot observe
3047+ /// a decode, so it cannot prove any cell decodes and cannot prove any
3048+ /// pixel -- the same limit as the witness gate above it, and stated here
3049+ /// because "one assertion per site, each with a mutation proof" reads
3050+ /// like more coverage than it is.
3051+ ///
3098 /// `strip_code` is the same comment-stripping the arms above use: the3052 /// `strip_code` is the same comment-stripping the arms above use: the
3099 /// fixes quote their own old expression to say what it was, and a prose3053 /// fixes quote their own old expression to say what it was, and a prose
3100 /// mention must neither read as a reintroduction nor mask one.3054 /// mention must neither read as a reintroduction nor mask one.
@@ -3303,6 +3257,71 @@ pub(crate) mod tests {
3303 gained a shape"3257 gained a shape"
3304 );3258 );
3305 }3259 }
3260+ /// lane-av1422warp: the SECOND 4:2:2 coverage witness -- the one
3261+ /// `422_sb128_3f.obu` could not be, because that stream's inter content
3262+ /// is skip-heavy (see `lanes/av1422stripwrite.report.md`, which named a
3263+ /// second fixture with real residuals, compound and warped motion above
3264+ /// the vertical midpoint as the thing that would justify lifting the
3265+ /// refusal). This is that fixture.
3266+ ///
3267+ /// `422_residual_compound_warp_16f.obu` (38845 bytes), sha256
3268+ /// `d78e2afb43ce311d3d82335a945c6f80f62db4537966d881c1349a68b3aecb95`:
3269+ ///
3270+ /// ```text
3271+ /// ffmpeg -f lavfi -i "mandelbrot=size=256x288:rate=24:maxiter=220:start_scale=3:end_scale=0.35:end_pts=300,rotate=a=0.10*t:c=none:ow=256:oh=288" \
3272+ /// -frames:v 24 -pix_fmt yuv422p -f yuv4mpegpipe src422.y4m
3273+ /// aomenc --codec=av1 --profile=2 --input-bit-depth=8 --limit=16
3274+ /// --width=256 --height=288 --lag-in-frames=25 --auto-alt-ref=1
3275+ /// --enable-global-motion=1 --pass=1
3276+ /// --cq-level=24 --cpu-used=0
3277+ /// --threads=4 --kf-min-dist=0 --kf-max-dist=999999 \
3278+ /// src422.y4m -o a1.webm
3279+ /// ffmpeg -i a1.webm -c copy -f obu -y a1.obu
3280+ /// ```
3281+ ///
3282+ /// CORRECTED by lane-av1422lrless (reviewer P2). This doc previously
3283+ /// carried a different ffmpeg filter (`rotate=a=0.10`, no `*t`, no
3284+ /// `:c=none:ow/oh`) and a `-n ffp --pass=2 --fpf=...` two-pass line.
3285+ /// **Neither produced these bytes.** Re-encoding from the recorded
3286+ /// source `src422.y4m` (sha256
3287+ /// `4d35eaf65d1a5541b3177e1183644c163b3868d8f141bed0ce9fdf833280ba9f`)
3288+ /// was measured three ways: the two-pass form gives 38774 bytes
3289+ /// (`e93c4ed7...`), and only adding `--pass=1` reproduces these 38845
3290+ /// bytes byte for byte (`d78e2afb...`). `aomenc` DEFAULTS to two-pass,
3291+ /// so the flag has to be stated to get back the pinned stream. The
3292+ /// recipe above is the one that was actually run.
3293+ ///
3294+ /// Measured on a patch-run-restore build (the `EC_AV1_ALLOW_422_PROBE`
3295+ /// bypass applied for the run, reverted after -- it is deliberately NOT
3296+ /// committed, and the refusal below is what the committed tree asserts):
3297+ ///
3298+ /// - all 16 frames pixel-exact against `aomdec --rawvideo`, 2359296
3299+ /// bytes each, sha256 `4bfc2395e5ca6ea178f606e6b1ced773e26fc2d85b
3300+ /// c3a6cdb63a402939aeb203` on both sides;
3301+ /// - the entropy stream pairs bit-for-bit against the instrumented
3302+ /// oracle -- 246735 symbol reads each, no divergence anywhere in the
3303+ /// stream, not merely at the window this lane spent nine rounds
3304+ /// narrowing;
3305+ /// - the arms this fixture exists to cover really fire ABOVE the
3306+ /// vertical midpoint: 3 upper-half blocks on a non-`TRANSLATION`
3307+ /// global-motion model (`top_half_warp_hits`, gated on libaom's
3308+ /// `is_global_mv_block` per slot) and 3 upper-half
3309+ /// `GLOBAL_GLOBALMV` compound blocks (`top_half_compound_hits`),
3310+ /// alongside 25 compound-warp, 18 compound-warp-8x8-leaf, 84
3311+ /// rotzoom global-warp, 22 Wiener and 10 SGRPROJ loop-restoration
3312+ /// units frame-globally.
3313+ ///
3314+ /// The loop-restoration numbers are load-bearing twice over: decoding
3315+ /// this stream is what exposed the per-axis `read_lr` corner bug
3316+ /// (`restoration.rs`, `av1_loop_restoration_corners_in_sb`), whose fix
3317+ /// is what made the whole sequence pair. 4:2:0 and 4:4:4 are unchanged
3318+ /// by it -- byte-identical to their pre-lane decodes, with the LR gate
3319+ /// family green.
3320+ ///
3321+ /// Like its two siblings, the committed assertion is the byte pin plus
3322+ /// the refusal-by-name contract: with the header refusal standing,
3323+ /// NO committed test can decode a 4:2:2 stream, because the bypass that
3324+ /// would allow it must never be committed.
3306 #[test]3325 #[test]
3307 fn the_pinned_422_residual_compound_warp_witness_is_present_and_refuses_by_name() {3326 fn the_pinned_422_residual_compound_warp_witness_is_present_and_refuses_by_name() {
3308 const NAME: &str =3327 const NAME: &str =
@@ -16298,7 +16317,11 @@ exit 0
16298 "{name}: the committed pin {pin} is {} bytes, this gate names {pin_len}",16317 "{name}: the committed pin {pin} is {} bytes, this gate names {pin_len}",
16299 stream.len()16318 stream.len()
16300 );16319 );
16301- assert_eq!(fnv1a64(&stream), pin_fnv, "{name}: the committed pin {pin} moved");16320+ assert_eq!(
16321+ fnv1a64(&stream),
16322+ pin_fnv,
16323+ "{name}: the committed pin {pin} moved"
16324+ );
16302 if have_aomenc() {16325 if have_aomenc() {
16303 assert_eq!(16326 assert_eq!(
16304 live.len(),16327 live.len(),
@@ -16364,8 +16387,9 @@ exit 0
16364 let _ = std::fs::remove_dir_all(&dir);16387 let _ = std::fs::remove_dir_all(&dir);
16365 // The +1 control (part 6): clean is all-zero, one flipped oracle16388 // The +1 control (part 6): clean is all-zero, one flipped oracle
16366 // byte is exactly +1 luma byte and one fewer exact frame.16389 // byte is exactly +1 luma byte and one fewer exact frame.
16367- let clean = count_rawvideo_diffs(&stream, name, None)16390+ let clean = count_rawvideo_diffs(&stream, name, None).unwrap_or_else(|| {
16368- .unwrap_or_else(|| panic!("{name}: our packed output and the oracle's rawvideo differ in SIZE"));16391+ panic!("{name}: our packed output and the oracle's rawvideo differ in SIZE")
16392+ });
16369 assert_eq!(16393 assert_eq!(
16370 clean,16394 clean,
16371 (0, 0, 0, frames, frames),16395 (0, 0, 0, frames, frames),
@@ -16445,8 +16469,7 @@ exit 0
16445 /// with screen content tools" blocked while decoding exactly.16469 /// with screen content tools" blocked while decoding exactly.
16446 #[test]16470 #[test]
16447 fn a_real_aomenc_12bit_screen_content_palette_stream_decodes_pixel_exact() {16471 fn a_real_aomenc_12bit_screen_content_palette_stream_decodes_pixel_exact() {
16448- const NAME: &str =16472+ const NAME: &str = "a_real_aomenc_12bit_screen_content_palette_stream_decodes_pixel_exact";
16449- "a_real_aomenc_12bit_screen_content_palette_stream_decodes_pixel_exact";
16450 const PIN: &str = "screen12_palette.obu";16473 const PIN: &str = "screen12_palette.obu";
16451 let _gate_lock = lock_gate_counters();16474 let _gate_lock = lock_gate_counters();
16452 if !have_ffmpeg() {16475 if !have_ffmpeg() {
@@ -16468,7 +16491,15 @@ exit 0
16468 Vec::new()16491 Vec::new()
16469 };16492 };
16470 assert_12bit_screen_content_arm(16493 assert_12bit_screen_content_arm(
16471- NAME, PIN, live, PIN_LEN_PALETTE, PIN_FNV_PALETTE, 2, 160, 128, false,16494+ NAME,
16495+ PIN,
16496+ live,
16497+ PIN_LEN_PALETTE,
16498+ PIN_FNV_PALETTE,
16499+ 2,
16500+ 160,
16501+ 128,
16502+ false,
16472 );16503 );
16473 }16504 }
16474 16505
@@ -16514,7 +16545,15 @@ exit 0
16514 Vec::new()16545 Vec::new()
16515 };16546 };
16516 assert_12bit_screen_content_arm(16547 assert_12bit_screen_content_arm(
16517- NAME, PIN, live, PIN_LEN_INTRABC, PIN_FNV_INTRABC, 1, 256, 192, true,16548+ NAME,
16549+ PIN,
16550+ live,
16551+ PIN_LEN_INTRABC,
16552+ PIN_FNV_INTRABC,
16553+ 1,
16554+ 256,
16555+ 192,
16556+ true,
16518 );16557 );
16519 }16558 }
16520 16559
@@ -16528,8 +16567,7 @@ exit 0
16528 /// `ec7942c96763593e6d8e4b3fb23c03930bba3bb743102d0cf552fe73ae11c203`).16567 /// `ec7942c96763593e6d8e4b3fb23c03930bba3bb743102d0cf552fe73ae11c203`).
16529 #[test]16568 #[test]
16530 fn a_real_aomenc_12bit_lossless_screen_content_stream_decodes_pixel_exact() {16569 fn a_real_aomenc_12bit_lossless_screen_content_stream_decodes_pixel_exact() {
16531- const NAME: &str =16570+ const NAME: &str = "a_real_aomenc_12bit_lossless_screen_content_stream_decodes_pixel_exact";
16532- "a_real_aomenc_12bit_lossless_screen_content_stream_decodes_pixel_exact";
16533 const PIN: &str = "screen12_lossless_palette.obu";16571 const PIN: &str = "screen12_lossless_palette.obu";
16534 let _gate_lock = lock_gate_counters();16572 let _gate_lock = lock_gate_counters();
16535 if !have_ffmpeg() {16573 if !have_ffmpeg() {
@@ -16552,7 +16590,15 @@ exit 0
16552 Vec::new()16590 Vec::new()
16553 };16591 };
16554 assert_12bit_screen_content_arm(16592 assert_12bit_screen_content_arm(
16555- NAME, PIN, live, PIN_LEN_LOSSLESS, PIN_FNV_LOSSLESS, 2, 160, 128, false,16593+ NAME,
16594+ PIN,
16595+ live,
16596+ PIN_LEN_LOSSLESS,
16597+ PIN_FNV_LOSSLESS,
16598+ 2,
16599+ 160,
16600+ 128,
16601+ false,
16556 );16602 );
16557 }16603 }
16558 16604