forge
Explore
Log in

Don't you dare go Hollow

Commit the four remaining untracked pins

Browse files at this commit

6ff049e604464ca9fb41646e645e3feab13706b7Ahmet Kaan GümüşParent: 7e04950
  • test
    • commit the four remaining untracked pins
    • three gates go live, one earns a factual ignore
Show full message
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.obuadded+0 -0

Binary file changed

crates/ec-av1/fixtures/golden6-mismatch.obuadded+0 -0

Binary file changed

crates/ec-av1/fixtures/golden7-forwarding-mismatch.obuadded+0 -0

Binary file changed

crates/ec-av1/fixtures/lr-sgr-r7.obuadded+0 -0

Binary file changed

crates/ec-av1/src/stream.rsmodified+93 -36
@@ -9114,6 +9114,22 @@ pub(crate) mod tests {
9114 /// the machine's scratchpad is reaped -- three gates sat at `rc=0` having9114 /// the machine's scratchpad is reaped -- three gates sat at `rc=0` having
9115 /// tested nothing for exactly that reason (lane-av1pins). Falls back to9115 /// tested nothing for exactly that reason (lane-av1pins). Falls back to
9116 /// `pin_dir()` so a locally re-captured stream still overrides.9116 /// `pin_dir()` so a locally re-captured stream still overrides.
9117+ /// Read a pin that a gate cannot proceed without. A missing pin is a
9118+ /// HARD failure naming the path and the generator, never a raw io panic
9119+ /// and never a silent skip: `EC_AV1_GATE_DUMP_PIN` points the gate at a
9120+ /// freshly captured stream, and a runner without the committed copy must
9121+ /// say so instead of reporting green having tested nothing.
9122+ fn require_pin(path: &std::path::Path, name: &str) -> Vec<u8> {
9123+ std::fs::read(path).unwrap_or_else(|e| {
9124+ panic!(
9125+ "no pinned bytes at {} ({e}) -- set EC_AV1_GATE_DUMP_PIN to a freshly \
9126+ captured stream, or restore the committed copy at \
9127+ crates/ec-av1/fixtures/{name}",
9128+ path.display()
9129+ )
9130+ })
9131+ }
9132+
9117 fn crate_pin(name: &str) -> std::path::PathBuf {9133 fn crate_pin(name: &str) -> std::path::PathBuf {
9118 let in_crate = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))9134 let in_crate = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
9119 .join("fixtures")9135 .join("fixtures")
@@ -23727,22 +23743,22 @@ pub(crate) mod tests {
23727 /// `EC_AV1_GATE_DUMP=$SP/golden4-pin.obu` off23743 /// `EC_AV1_GATE_DUMP=$SP/golden4-pin.obu` off
23728 /// [`a_real_aomenc_inter_sequence_with_cdf_forwarding_decodes_pixel_exact`]23744 /// [`a_real_aomenc_inter_sequence_with_cdf_forwarding_decodes_pixel_exact`]
23729 /// (seed 43, frame 3 luma) the round the GOLDEN mask lifted. Deterministic23745 /// (seed 43, frame 3 luma) the round the GOLDEN mask lifted. Deterministic
23730- /// and static -- `#[ignore]`d, run manually.23746+ /// and static.
23747+ ///
23748+ /// LIVE since lane-av1pinslive r3: the bytes are committed at
23749+ /// `crates/ec-av1/fixtures/golden4-pin.obu` (137 bytes; sha256
23750+ /// `1754023e44e46edaebc2c05065bf1c65db1a41354577cbf71c0e8ebe737ae14a`,
23751+ /// recovered byte-for-byte from the runner library), so the old
23752+ /// "reads a pinned fixture path outside the repo" reason is false. Costs
23753+ /// ~0.10 s, touches no process-global, reads `non_last_ref_hits` for
23754+ /// diagnostic output only (never asserted), and calls no aomenc.
23731 #[test]23755 #[test]
23732- #[ignore = "reads a pinned fixture path outside the repo; run manually"]
23733 fn pinned_golden4_stream_decodes_pixel_exact() {23756 fn pinned_golden4_stream_decodes_pixel_exact() {
23734 use crate::decode::non_last_ref_hits;23757 use crate::decode::non_last_ref_hits;
23735 let path = std::env::var("EC_AV1_GATE_DUMP_PIN")23758 let path = std::env::var("EC_AV1_GATE_DUMP_PIN")
23736 .map(std::path::PathBuf::from)23759 .map(std::path::PathBuf::from)
23737- .unwrap_or_else(|_| pin_dir().join("golden4-pin.obu"));23760+ .unwrap_or_else(|_| crate_pin("golden4-pin.obu"));
23738- let Ok(stream) = std::fs::read(&path) else {23761+ let stream = require_pin(&path, "golden4-pin.obu");
23739- eprintln!(
23740- "SKIP pinned_golden4_stream_decodes_pixel_exact: no pinned bytes at {} \
23741- -- re-capture with EC_AV1_GATE_DUMP off the cdf-forwarding gate",
23742- path.display()
23743- );
23744- return;
23745- };
23746 if !have_ffmpeg() {23762 if !have_ffmpeg() {
23747 eprintln!("SKIP pinned_golden4_stream_decodes_pixel_exact: no ffmpeg");23763 eprintln!("SKIP pinned_golden4_stream_decodes_pixel_exact: no ffmpeg");
23748 return;23764 return;
@@ -23765,15 +23781,22 @@ pub(crate) mod tests {
23765 /// by the forwarding gate once film grain is out of the way (1/20 real23781 /// by the forwarding gate once film grain is out of the way (1/20 real
23766 /// aomenc streams, frame 3 luma, apply_grain=false, `non_last_ref_hits`23782 /// aomenc streams, frame 3 luma, apply_grain=false, `non_last_ref_hits`
23767 /// delta=2). `GOLDEN_FRAME` refuses by name until this decodes exact.23783 /// delta=2). `GOLDEN_FRAME` refuses by name until this decodes exact.
23784+ ///
23785+ /// LIVE since lane-av1pinslive r3. The old shape was the worst of the
23786+ /// class: a `concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures/...")`
23787+ /// literal, which points at the GITIGNORED root and can therefore never be
23788+ /// satisfied by a committed pin, combined with a bare `.expect()`. The
23789+ /// bytes are now committed at
23790+ /// `crates/ec-av1/fixtures/golden7-forwarding-mismatch.obu` (152 bytes;
23791+ /// sha256 `81b3bf657a85e95085287b30d97dee93ba5aea0ed1db1e1f4fcd19a06afc17be`,
23792+ /// recovered byte-for-byte from the runner library).
23768 #[test]23793 #[test]
23769- #[ignore = "reads a pinned fixture path outside the repo; run manually"]
23770 fn pinned_golden7_stream_decodes_pixel_exact() {23794 fn pinned_golden7_stream_decodes_pixel_exact() {
23771 use crate::decode::non_last_ref_hits;23795 use crate::decode::non_last_ref_hits;
23772- let path = concat!(23796+ let path = std::env::var("EC_AV1_GATE_DUMP_PIN")
23773- env!("CARGO_MANIFEST_DIR"),23797+ .map(std::path::PathBuf::from)
23774- "/../../fixtures/golden7-forwarding-mismatch.obu"23798+ .unwrap_or_else(|_| crate_pin("golden7-forwarding-mismatch.obu"));
23775- );23799+ let stream = require_pin(&path, "golden7-forwarding-mismatch.obu");
23776- let stream = std::fs::read(path).expect("reading pinned stream");
23777 if !have_ffmpeg() {23800 if !have_ffmpeg() {
23778 eprintln!("SKIP pinned_golden7_stream_decodes_pixel_exact: no ffmpeg");23801 eprintln!("SKIP pinned_golden7_stream_decodes_pixel_exact: no ffmpeg");
23779 return;23802 return;
@@ -30268,10 +30291,23 @@ pub(crate) mod tests {
30268 /// to get the real window on stderr, call-uniquely keyed to `xqd ==30291 /// to get the real window on stderr, call-uniquely keyed to `xqd ==
30269 /// [-16,-32]` rather than any coordinate.30292 /// [-16,-32]` rather than any coordinate.
30270 #[test]30293 #[test]
30271- #[ignore = "reads a pinned fixture under the gitignored fixtures dir; run manually with EC_LR_CALL_DUMP=1"]30294+ // Stays `#[ignore]`d, and here are FACTS, not a judgement: (1) this gate
30295+ // asserts NOTHING -- it `eprintln!`s per-frame mismatch counts and returns,
30296+ // so it cannot go red on a decode regression and un-ignoring it would add a
30297+ // test that reports pass unconditionally; (2) its bytes ARE now committed
30298+ // at `crates/ec-av1/fixtures/lr-sgr-r7.obu` (192 bytes; sha256
30299+ // `6b95b20e3377430ffae0b2ce86fad9502e0dedf13cd6c38ab7f5af4a8b21f33d`,
30300+ // recovered byte-for-byte from the runner library), so the old "reads a
30301+ // pinned fixture under the gitignored fixtures dir" reason is false; (3) it
30302+ // yields a window only with `EC_LR_CALL_DUMP=1`, a debugging session rather
30303+ // than a suite run. What would close it: give it the pixel asserts its
30304+ // siblings have, then un-ignore.
30305+ #[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"]
30272 fn pinned_lr_sgr_stream_call_unique_dump() {30306 fn pinned_lr_sgr_stream_call_unique_dump() {
30273- let path = concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures/lr-sgr-r7.obu");30307+ let path = std::env::var("EC_AV1_GATE_DUMP_PIN")
30274- let stream = std::fs::read(path).expect("reading pinned lr-sgr-r7.obu");30308+ .map(std::path::PathBuf::from)
30309+ .unwrap_or_else(|_| crate_pin("lr-sgr-r7.obu"));
30310+ let stream = require_pin(&path, "lr-sgr-r7.obu");
30275 let pics = decode_stream(&stream).expect("pinned lr-sgr-r7.obu must decode");30311 let pics = decode_stream(&stream).expect("pinned lr-sgr-r7.obu must decode");
30276 if have_ffmpeg() {30312 if have_ffmpeg() {
30277 let reference = ffmpeg_decode_sequence(&stream, 192, 128, pics.len());30313 let reference = ffmpeg_decode_sequence(&stream, 192, 128, pics.len());
@@ -33203,11 +33239,19 @@ pub(crate) mod tests {
33203 eprintln!("SKIP a_real_aomenc_stream_with_film_grain_decodes_pixel_exact: no ffmpeg");33239 eprintln!("SKIP a_real_aomenc_stream_with_film_grain_decodes_pixel_exact: no ffmpeg");
33204 return;33240 return;
33205 }33241 }
33206- let data = std::fs::read(concat!(33242+ // lane-av1pinslive r3: this gate was LIVE while reading a GITIGNORED
33207- env!("CARGO_MANIFEST_DIR"),33243+ // pin through a `concat!` literal and `.unwrap()` -- a clean checkout
33208- "/../../fixtures/golden6-mismatch.obu"33244+ // with no runner library PANICKED here rather than skipping. The bytes
33209- ))33245+ // are now committed at `crates/ec-av1/fixtures/golden6-mismatch.obu`
33210- .unwrap();33246+ // (452 bytes; sha256
33247+ // `c56909b98542192b03f3a945e153475aa57a58a1586bf166513297296cb225b3`,
33248+ // recovered byte-for-byte from the runner library).
33249+ let data = require_pin(
33250+ &std::env::var("EC_AV1_GATE_DUMP_PIN")
33251+ .map(std::path::PathBuf::from)
33252+ .unwrap_or_else(|_| crate_pin("golden6-mismatch.obu")),
33253+ "golden6-mismatch.obu",
33254+ );
33211 // Truncate right after the first `Frame` OBU (the key frame): every33255 // Truncate right after the first `Frame` OBU (the key frame): every
33212 // byte up to there is sequence header + frame-0, which is a complete,33256 // byte up to there is sequence header + frame-0, which is a complete,
33213 // independently decodable single-frame stream.33257 // independently decodable single-frame stream.
@@ -46333,9 +46377,8 @@ pub(crate) mod tests {
46333 h + v46377 h + v
46334 };46378 };
46335 crate::decode::reset_rect4_inter_own_chroma444_hits();46379 crate::decode::reset_rect4_inter_own_chroma444_hits();
46336- let frames = decode_stream(&stream).unwrap_or_else(|e| {46380+ let frames = decode_stream(&stream)
46337- panic!("{NAME}: {fixture} no longer decodes cleanly: {e}")46381+ .unwrap_or_else(|e| panic!("{NAME}: {fixture} no longer decodes cleanly: {e}"));
46338- });
46339 let own_chroma = crate::decode::rect4_inter_own_chroma444_hits();46382 let own_chroma = crate::decode::rect4_inter_own_chroma444_hits();
46340 let strips = {46383 let strips = {
46341 let (h, v, _, _) = crate::decode::inter16_rect4_counters();46384 let (h, v, _, _) = crate::decode::inter16_rect4_counters();
@@ -46747,8 +46790,9 @@ pub(crate) mod tests {
46747 let _guard = lock_gate_counters();46790 let _guard = lock_gate_counters();
46748 let before_sr = crate::superres::superres_hits();46791 let before_sr = crate::superres::superres_hits();
46749 let before_scaled = crate::mc::predict_scaled_hits();46792 let before_scaled = crate::mc::predict_scaled_hits();
46750- let frames = decode_stream(&stream)46793+ let frames = decode_stream(&stream).unwrap_or_else(|e| {
46751- .unwrap_or_else(|e| panic!("{name}: the pinned 4:4:4 superres stream was refused: {e}"));46794+ panic!("{name}: the pinned 4:4:4 superres stream was refused: {e}")
46795+ });
46752 let scaled_up = crate::superres::superres_hits() - before_sr;46796 let scaled_up = crate::superres::superres_hits() - before_sr;
46753 let scaled_mc = crate::mc::predict_scaled_hits() - before_scaled;46797 let scaled_mc = crate::mc::predict_scaled_hits() - before_scaled;
46754 assert!(46798 assert!(
@@ -46914,9 +46958,21 @@ pub(crate) mod tests {
46914 }46958 }
46915 let y4m = Command::new("ffmpeg")46959 let y4m = Command::new("ffmpeg")
46916 .args([46960 .args([
46917- "-v", "error", "-f", "lavfi", "-i", "testsrc2=size=256x128:rate=25",46961+ "-v",
46918- "-frames:v", "4", "-pix_fmt", "yuv444p", "-strict", "-1", "-f",46962+ "error",
46919- "yuv4mpegpipe", "-",46963+ "-f",
46964+ "lavfi",
46965+ "-i",
46966+ "testsrc2=size=256x128:rate=25",
46967+ "-frames:v",
46968+ "4",
46969+ "-pix_fmt",
46970+ "yuv444p",
46971+ "-strict",
46972+ "-1",
46973+ "-f",
46974+ "yuv4mpegpipe",
46975+ "-",
46920 ])46976 ])
46921 .stdin(Stdio::null())46977 .stdin(Stdio::null())
46922 .stdout(Stdio::piped())46978 .stdout(Stdio::piped())
@@ -46928,9 +46984,10 @@ pub(crate) mod tests {
46928 "{NAME}: ffmpeg refused to generate the y4m source: {}",46984 "{NAME}: ffmpeg refused to generate the y4m source: {}",
46929 String::from_utf8_lossy(&y4m.stderr)46985 String::from_utf8_lossy(&y4m.stderr)
46930 );46986 );
46931- let pinned =46987+ let pinned = std::fs::read(
46932- std::fs::read(std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))46988+ std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
46933- .join("fixtures/444_lossy_superres_mode2_256x128.obu"))46989+ .join("fixtures/444_lossy_superres_mode2_256x128.obu"),
46990+ )
46934 .expect("pinned fixture disappeared between the two reads");46991 .expect("pinned fixture disappeared between the two reads");
46935 for extra in [46992 for extra in [
46936 vec![],46993 vec![],