From 6ff049e604464ca9fb41646e645e3feab13706b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 29 Sep 2026 04:55:42 +0300 Subject: [PATCH] test(av1): commit the four remaining untracked pins; three gates go live, one earns a factual ignore Same defect r2 closed, three gates deeper. Four pins lived only in the gitignored root `fixtures/` and reached the runners through a `fixtures -> ~/gates/library/ fixtures` symlink, so a clean checkout had no bytes at all. `.gitignore` on main now negates `crates/*/fixtures/**`, so all four commit with a plain `git add` (verified: `git check-ignore -q` returns 1, "not ignored", for each). golden4-pin.obu 137 B sha256 1754023e44e46edaebc2c05065bf1c65db1a41354577cbf71c0e8ebe737ae14a golden6-mismatch.obu 452 B sha256 c56909b98542192b03f3a945e153475aa57a58a1586bf166513297296cb225b3 golden7-forwarding-mismatch.obu 152 B sha256 81b3bf657a85e95085287b30d97dee93ba5aea0ed1db1e1f4fcd19a06afc17be lr-sgr-r7.obu 192 B sha256 6b95b20e3377430ffae0b2ce86fad9502e0dedf13cd6c38ab7f5af4a8b21f33d RECOVERED, NOT RE-ENCODED. I first reproduced golden4/golden7 from the cdf-forwarding recipe and captured golden6 from a throwaway harness built on the crate's own `panned_test_card`, then found the original bytes still on the runner libraries and fetched those instead -- they are the actual historical mismatch witnesses, which a re-encode is not. The originals also self-validate: golden7's committed doc records `non_last_ref_hits` delta=2 for this stream, and the recovered pin reproduces exactly 0->2. (The throwaway capture harness was deleted; `grep -c zz_throwaway` = 0.) THREE GATES GO LIVE, on the same bar r2 applied: pinned_golden4 1 passed 0.11s, prints "non_last_ref_hits before=0 after=1" pinned_golden7 1 passed 0.10s, prints "non_last_ref_hits before=0 after=2" a_real_aomenc_stream_with_film_grain_decodes_pixel_exact 1 passed 0.10s None touches a process-global, and the counter each reads is printed, never asserted. `#[ignore]` in stream.rs 41 -> 37. THE FILM-GRAIN GATE WAS THE WORST AND WAS ALREADY LIVE. It read its pin through a `concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures/...")` literal and `.unwrap()` -- the gitignored root, with no graceful skip -- so a clean checkout with no runner library would PANIC, not skip. That shape can never be satisfied by a committed pin at all, which is why it is now `crate_pin` + `require_pin`. `require_pin` is new and shared: a missing pin is a hard failure naming the path and the generator and pointing at EC_AV1_GATE_DUMP_PIN. Never a raw io panic, never a silent skip -- the two shapes this class has taken. ONE GATE STAYS IGNORED, ON FACTS. `pinned_lr_sgr_stream_call_unique_dump` asserts NOTHING: it `eprintln!`s per-frame mismatch counts and returns, so it cannot go red on a decode regression and un-ignoring it would add a test that reports pass unconditionally. Its pin is now committed too, so the old "reads a pinned fixture under the gitignored fixtures dir" reason was false and is replaced with the two reasons that are still true (asserts nothing; needs EC_LR_CALL_DUMP=1 for a window). What would close it: give it the pixel asserts its siblings have, then un-ignore. Measured plain run under --ignored for the record: 1 passed 0.10s, "frame 0: y_mismatch=false u_mismatch=false v_mismatch=false". Meta-gates after the change: gate_coverage 10 passed, refusal_inventory 15 passed. r2's two gates re-verified green. Tests only, no decoder change. --- crates/ec-av1/fixtures/golden4-pin.obu | Bin 0 -> 137 bytes crates/ec-av1/fixtures/golden6-mismatch.obu | Bin 0 -> 452 bytes .../fixtures/golden7-forwarding-mismatch.obu | Bin 0 -> 152 bytes crates/ec-av1/fixtures/lr-sgr-r7.obu | Bin 0 -> 192 bytes crates/ec-av1/src/stream.rs | 131 +++++++++++++----- 5 files changed, 94 insertions(+), 37 deletions(-) create mode 100644 crates/ec-av1/fixtures/golden4-pin.obu create mode 100644 crates/ec-av1/fixtures/golden6-mismatch.obu create mode 100644 crates/ec-av1/fixtures/golden7-forwarding-mismatch.obu create mode 100644 crates/ec-av1/fixtures/lr-sgr-r7.obu diff --git a/crates/ec-av1/fixtures/golden4-pin.obu b/crates/ec-av1/fixtures/golden4-pin.obu new file mode 100644 index 0000000000000000000000000000000000000000..4265cdf0cdf281fb443f95db9664b09ce63a490e GIT binary patch literal 137 zcmV;40CxWp0162J00087|ERD5GB*%gfDl0h5VkfqstZ5_cMb&pGMS*`JH5M5O|xHQ zY;i>iVFq_oWBQ(s!#!T=%WEt@3@#auKoS5l5HP?%0004~009I5KmgG~+!6pX6fj_b r0sui!000C40MJTgFfXji>=FPn6EI-}1OR0~0E7Sm006BD#lpB*PpK%E literal 0 HcmV?d00001 diff --git a/crates/ec-av1/fixtures/golden6-mismatch.obu b/crates/ec-av1/fixtures/golden6-mismatch.obu new file mode 100644 index 0000000000000000000000000000000000000000..df1fb4a8d3e399f3712cf678feddb0eebcbe0232 GIT binary patch literal 452 zcmWe);NoInU|?GRf5m+U38Op#hV2ZFEE-B(=L~on8&V|LTpAh7r)K^@Wzh3a&dM(tw_g(^@*je5F z($_{|mHv<1|9q5SE$GkN10jK~0 z2p~WJ(L&r305TOYV1NPuWk3J~Ab|h?&<~llaSk@%5&$w2Fku7)0A)Y`01yDJmbWA> GP(&wa127!` literal 0 HcmV?d00001 diff --git a/crates/ec-av1/fixtures/lr-sgr-r7.obu b/crates/ec-av1/fixtures/lr-sgr-r7.obu new file mode 100644 index 0000000000000000000000000000000000000000..8eb1461d3efa6bc491009b73cd2c09c8062440bf GIT binary patch literal 192 zcmV;x06+f{0165K000BE|M4B-0Wz-v6aXRM001NKi=hiEX0D;$Ql_!HC<)o2rz{K% zSSMn~4GmvQ*ywyQBqU(Iq7X4Lh?g|j>>I!cSbWGGlxV#~KFnxjGwaHbxLQ3Oc&(Qo zfdL9kU-GTtm8QZ~jijFP&p(8jjWEW+dI|62C;BK{9=;Db|r|790Z)aRnL47An9 u6?C$6fpnlhenl5uB}2~2F4ge?6FaVY=cq*k(e Vec { + std::fs::read(path).unwrap_or_else(|e| { + panic!( + "no pinned bytes at {} ({e}) -- set EC_AV1_GATE_DUMP_PIN to a freshly \ + captured stream, or restore the committed copy at \ + crates/ec-av1/fixtures/{name}", + path.display() + ) + }) + } + fn crate_pin(name: &str) -> std::path::PathBuf { let in_crate = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) .join("fixtures") @@ -23727,22 +23743,22 @@ pub(crate) mod tests { /// `EC_AV1_GATE_DUMP=$SP/golden4-pin.obu` off /// [`a_real_aomenc_inter_sequence_with_cdf_forwarding_decodes_pixel_exact`] /// (seed 43, frame 3 luma) the round the GOLDEN mask lifted. Deterministic - /// and static -- `#[ignore]`d, run manually. + /// and static. + /// + /// LIVE since lane-av1pinslive r3: the bytes are committed at + /// `crates/ec-av1/fixtures/golden4-pin.obu` (137 bytes; sha256 + /// `1754023e44e46edaebc2c05065bf1c65db1a41354577cbf71c0e8ebe737ae14a`, + /// recovered byte-for-byte from the runner library), so the old + /// "reads a pinned fixture path outside the repo" reason is false. Costs + /// ~0.10 s, touches no process-global, reads `non_last_ref_hits` for + /// diagnostic output only (never asserted), and calls no aomenc. #[test] - #[ignore = "reads a pinned fixture path outside the repo; run manually"] fn pinned_golden4_stream_decodes_pixel_exact() { use crate::decode::non_last_ref_hits; let path = std::env::var("EC_AV1_GATE_DUMP_PIN") .map(std::path::PathBuf::from) - .unwrap_or_else(|_| pin_dir().join("golden4-pin.obu")); - let Ok(stream) = std::fs::read(&path) else { - eprintln!( - "SKIP pinned_golden4_stream_decodes_pixel_exact: no pinned bytes at {} \ - -- re-capture with EC_AV1_GATE_DUMP off the cdf-forwarding gate", - path.display() - ); - return; - }; + .unwrap_or_else(|_| crate_pin("golden4-pin.obu")); + let stream = require_pin(&path, "golden4-pin.obu"); if !have_ffmpeg() { eprintln!("SKIP pinned_golden4_stream_decodes_pixel_exact: no ffmpeg"); return; @@ -23765,15 +23781,22 @@ pub(crate) mod tests { /// by the forwarding gate once film grain is out of the way (1/20 real /// aomenc streams, frame 3 luma, apply_grain=false, `non_last_ref_hits` /// delta=2). `GOLDEN_FRAME` refuses by name until this decodes exact. + /// + /// LIVE since lane-av1pinslive r3. The old shape was the worst of the + /// class: a `concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures/...")` + /// literal, which points at the GITIGNORED root and can therefore never be + /// satisfied by a committed pin, combined with a bare `.expect()`. The + /// bytes are now committed at + /// `crates/ec-av1/fixtures/golden7-forwarding-mismatch.obu` (152 bytes; + /// sha256 `81b3bf657a85e95085287b30d97dee93ba5aea0ed1db1e1f4fcd19a06afc17be`, + /// recovered byte-for-byte from the runner library). #[test] - #[ignore = "reads a pinned fixture path outside the repo; run manually"] fn pinned_golden7_stream_decodes_pixel_exact() { use crate::decode::non_last_ref_hits; - let path = concat!( - env!("CARGO_MANIFEST_DIR"), - "/../../fixtures/golden7-forwarding-mismatch.obu" - ); - let stream = std::fs::read(path).expect("reading pinned stream"); + let path = std::env::var("EC_AV1_GATE_DUMP_PIN") + .map(std::path::PathBuf::from) + .unwrap_or_else(|_| crate_pin("golden7-forwarding-mismatch.obu")); + let stream = require_pin(&path, "golden7-forwarding-mismatch.obu"); if !have_ffmpeg() { eprintln!("SKIP pinned_golden7_stream_decodes_pixel_exact: no ffmpeg"); return; @@ -30268,10 +30291,23 @@ pub(crate) mod tests { /// to get the real window on stderr, call-uniquely keyed to `xqd == /// [-16,-32]` rather than any coordinate. #[test] - #[ignore = "reads a pinned fixture under the gitignored fixtures dir; run manually with EC_LR_CALL_DUMP=1"] + // Stays `#[ignore]`d, and here are FACTS, not a judgement: (1) this gate + // asserts NOTHING -- it `eprintln!`s per-frame mismatch counts and returns, + // so it cannot go red on a decode regression and un-ignoring it would add a + // test that reports pass unconditionally; (2) its bytes ARE now committed + // at `crates/ec-av1/fixtures/lr-sgr-r7.obu` (192 bytes; sha256 + // `6b95b20e3377430ffae0b2ce86fad9502e0dedf13cd6c38ab7f5af4a8b21f33d`, + // recovered byte-for-byte from the runner library), so the old "reads a + // pinned fixture under the gitignored fixtures dir" reason is false; (3) it + // yields a window only with `EC_LR_CALL_DUMP=1`, a debugging session rather + // than a suite run. What would close it: give it the pixel asserts its + // siblings have, then un-ignore. + #[ignore = "diagnostic only -- asserts nothing, so it cannot fail on a decode regression; run with --ignored and EC_LR_CALL_DUMP=1 for the Sgrproj window"] fn pinned_lr_sgr_stream_call_unique_dump() { - let path = concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures/lr-sgr-r7.obu"); - let stream = std::fs::read(path).expect("reading pinned lr-sgr-r7.obu"); + let path = std::env::var("EC_AV1_GATE_DUMP_PIN") + .map(std::path::PathBuf::from) + .unwrap_or_else(|_| crate_pin("lr-sgr-r7.obu")); + let stream = require_pin(&path, "lr-sgr-r7.obu"); let pics = decode_stream(&stream).expect("pinned lr-sgr-r7.obu must decode"); if have_ffmpeg() { let reference = ffmpeg_decode_sequence(&stream, 192, 128, pics.len()); @@ -33203,11 +33239,19 @@ pub(crate) mod tests { eprintln!("SKIP a_real_aomenc_stream_with_film_grain_decodes_pixel_exact: no ffmpeg"); return; } - let data = std::fs::read(concat!( - env!("CARGO_MANIFEST_DIR"), - "/../../fixtures/golden6-mismatch.obu" - )) - .unwrap(); + // lane-av1pinslive r3: this gate was LIVE while reading a GITIGNORED + // pin through a `concat!` literal and `.unwrap()` -- a clean checkout + // with no runner library PANICKED here rather than skipping. The bytes + // are now committed at `crates/ec-av1/fixtures/golden6-mismatch.obu` + // (452 bytes; sha256 + // `c56909b98542192b03f3a945e153475aa57a58a1586bf166513297296cb225b3`, + // recovered byte-for-byte from the runner library). + let data = require_pin( + &std::env::var("EC_AV1_GATE_DUMP_PIN") + .map(std::path::PathBuf::from) + .unwrap_or_else(|_| crate_pin("golden6-mismatch.obu")), + "golden6-mismatch.obu", + ); // Truncate right after the first `Frame` OBU (the key frame): every // byte up to there is sequence header + frame-0, which is a complete, // independently decodable single-frame stream. @@ -46333,9 +46377,8 @@ pub(crate) mod tests { h + v }; crate::decode::reset_rect4_inter_own_chroma444_hits(); - let frames = decode_stream(&stream).unwrap_or_else(|e| { - panic!("{NAME}: {fixture} no longer decodes cleanly: {e}") - }); + let frames = decode_stream(&stream) + .unwrap_or_else(|e| panic!("{NAME}: {fixture} no longer decodes cleanly: {e}")); let own_chroma = crate::decode::rect4_inter_own_chroma444_hits(); let strips = { let (h, v, _, _) = crate::decode::inter16_rect4_counters(); @@ -46747,8 +46790,9 @@ pub(crate) mod tests { let _guard = lock_gate_counters(); let before_sr = crate::superres::superres_hits(); let before_scaled = crate::mc::predict_scaled_hits(); - let frames = decode_stream(&stream) - .unwrap_or_else(|e| panic!("{name}: the pinned 4:4:4 superres stream was refused: {e}")); + let frames = decode_stream(&stream).unwrap_or_else(|e| { + panic!("{name}: the pinned 4:4:4 superres stream was refused: {e}") + }); let scaled_up = crate::superres::superres_hits() - before_sr; let scaled_mc = crate::mc::predict_scaled_hits() - before_scaled; assert!( @@ -46914,9 +46958,21 @@ pub(crate) mod tests { } let y4m = Command::new("ffmpeg") .args([ - "-v", "error", "-f", "lavfi", "-i", "testsrc2=size=256x128:rate=25", - "-frames:v", "4", "-pix_fmt", "yuv444p", "-strict", "-1", "-f", - "yuv4mpegpipe", "-", + "-v", + "error", + "-f", + "lavfi", + "-i", + "testsrc2=size=256x128:rate=25", + "-frames:v", + "4", + "-pix_fmt", + "yuv444p", + "-strict", + "-1", + "-f", + "yuv4mpegpipe", + "-", ]) .stdin(Stdio::null()) .stdout(Stdio::piped()) @@ -46928,10 +46984,11 @@ pub(crate) mod tests { "{NAME}: ffmpeg refused to generate the y4m source: {}", String::from_utf8_lossy(&y4m.stderr) ); - let pinned = - std::fs::read(std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) - .join("fixtures/444_lossy_superres_mode2_256x128.obu")) - .expect("pinned fixture disappeared between the two reads"); + let pinned = std::fs::read( + std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("fixtures/444_lossy_superres_mode2_256x128.obu"), + ) + .expect("pinned fixture disappeared between the two reads"); for extra in [ vec![], vec!["--superres-denominator=9"],