Commit the four remaining untracked pins
Browse files at this commit6ff049e604464ca9fb41646e645e3feab13706b7Parent: 7e04950- test
- commit the four remaining untracked pins
- three gates go live, one earns a factual ignore
5 changed files +94 -37
- crates/ec-av1/fixtures/golden4-pin.obu +0 -0
- crates/ec-av1/fixtures/golden6-mismatch.obu +0 -0
- crates/ec-av1/fixtures/golden7-forwarding-mismatch.obu +0 -0
- crates/ec-av1/fixtures/lr-sgr-r7.obu +0 -0
- crates/ec-av1/src/stream.rs +94 -37
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+94 -37
| @@ -9114,6 +9114,22 @@ pub(crate) mod tests { | ||
| 9114 | 9114 | /// the machine's scratchpad is reaped -- three gates sat at `rc=0` having |
| 9115 | 9115 | /// tested nothing for exactly that reason (lane-av1pins). Falls back to |
| 9116 | 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 | 9133 | fn crate_pin(name: &str) -> std::path::PathBuf { |
| 9118 | 9134 | let in_crate = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) |
| 9119 | 9135 | .join("fixtures") |
| @@ -23727,22 +23743,22 @@ pub(crate) mod tests { | ||
| 23727 | 23743 | /// `EC_AV1_GATE_DUMP=$SP/golden4-pin.obu` off |
| 23728 | 23744 | /// [`a_real_aomenc_inter_sequence_with_cdf_forwarding_decodes_pixel_exact`] |
| 23729 | 23745 | /// (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 | 23755 | #[test] |
| 23732 | - #[ignore = "reads a pinned fixture path outside the repo; run manually"] | |
| 23733 | 23756 | fn pinned_golden4_stream_decodes_pixel_exact() { |
| 23734 | 23757 | use crate::decode::non_last_ref_hits; |
| 23735 | 23758 | let path = std::env::var("EC_AV1_GATE_DUMP_PIN") |
| 23736 | 23759 | .map(std::path::PathBuf::from) |
| 23737 | - .unwrap_or_else(|_| pin_dir().join("golden4-pin.obu")); | |
| 23738 | - let Ok(stream) = std::fs::read(&path) else { | |
| 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 | - }; | |
| 23760 | + .unwrap_or_else(|_| crate_pin("golden4-pin.obu")); | |
| 23761 | + let stream = require_pin(&path, "golden4-pin.obu"); | |
| 23746 | 23762 | if !have_ffmpeg() { |
| 23747 | 23763 | eprintln!("SKIP pinned_golden4_stream_decodes_pixel_exact: no ffmpeg"); |
| 23748 | 23764 | return; |
| @@ -23765,15 +23781,22 @@ pub(crate) mod tests { | ||
| 23765 | 23781 | /// by the forwarding gate once film grain is out of the way (1/20 real |
| 23766 | 23782 | /// aomenc streams, frame 3 luma, apply_grain=false, `non_last_ref_hits` |
| 23767 | 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 | 23793 | #[test] |
| 23769 | - #[ignore = "reads a pinned fixture path outside the repo; run manually"] | |
| 23770 | 23794 | fn pinned_golden7_stream_decodes_pixel_exact() { |
| 23771 | 23795 | use crate::decode::non_last_ref_hits; |
| 23772 | - let path = concat!( | |
| 23773 | - env!("CARGO_MANIFEST_DIR"), | |
| 23774 | - "/../../fixtures/golden7-forwarding-mismatch.obu" | |
| 23775 | - ); | |
| 23776 | - let stream = std::fs::read(path).expect("reading pinned stream"); | |
| 23796 | + let path = std::env::var("EC_AV1_GATE_DUMP_PIN") | |
| 23797 | + .map(std::path::PathBuf::from) | |
| 23798 | + .unwrap_or_else(|_| crate_pin("golden7-forwarding-mismatch.obu")); | |
| 23799 | + let stream = require_pin(&path, "golden7-forwarding-mismatch.obu"); | |
| 23777 | 23800 | if !have_ffmpeg() { |
| 23778 | 23801 | eprintln!("SKIP pinned_golden7_stream_decodes_pixel_exact: no ffmpeg"); |
| 23779 | 23802 | return; |
| @@ -30268,10 +30291,23 @@ pub(crate) mod tests { | ||
| 30268 | 30291 | /// to get the real window on stderr, call-uniquely keyed to `xqd == |
| 30269 | 30292 | /// [-16,-32]` rather than any coordinate. |
| 30270 | 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 | 30306 | fn pinned_lr_sgr_stream_call_unique_dump() { |
| 30273 | - let path = concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures/lr-sgr-r7.obu"); | |
| 30274 | - let stream = std::fs::read(path).expect("reading pinned lr-sgr-r7.obu"); | |
| 30307 | + let path = std::env::var("EC_AV1_GATE_DUMP_PIN") | |
| 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 | 30311 | let pics = decode_stream(&stream).expect("pinned lr-sgr-r7.obu must decode"); |
| 30276 | 30312 | if have_ffmpeg() { |
| 30277 | 30313 | let reference = ffmpeg_decode_sequence(&stream, 192, 128, pics.len()); |
| @@ -33203,11 +33239,19 @@ pub(crate) mod tests { | ||
| 33203 | 33239 | eprintln!("SKIP a_real_aomenc_stream_with_film_grain_decodes_pixel_exact: no ffmpeg"); |
| 33204 | 33240 | return; |
| 33205 | 33241 | } |
| 33206 | - let data = std::fs::read(concat!( | |
| 33207 | - env!("CARGO_MANIFEST_DIR"), | |
| 33208 | - "/../../fixtures/golden6-mismatch.obu" | |
| 33209 | - )) | |
| 33210 | - .unwrap(); | |
| 33242 | + // lane-av1pinslive r3: this gate was LIVE while reading a GITIGNORED | |
| 33243 | + // pin through a `concat!` literal and `.unwrap()` -- a clean checkout | |
| 33244 | + // with no runner library PANICKED here rather than skipping. The bytes | |
| 33245 | + // are now committed at `crates/ec-av1/fixtures/golden6-mismatch.obu` | |
| 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 | 33255 | // Truncate right after the first `Frame` OBU (the key frame): every |
| 33212 | 33256 | // byte up to there is sequence header + frame-0, which is a complete, |
| 33213 | 33257 | // independently decodable single-frame stream. |
| @@ -46333,9 +46377,8 @@ pub(crate) mod tests { | ||
| 46333 | 46377 | h + v |
| 46334 | 46378 | }; |
| 46335 | 46379 | crate::decode::reset_rect4_inter_own_chroma444_hits(); |
| 46336 | - let frames = decode_stream(&stream).unwrap_or_else(|e| { | |
| 46337 | - panic!("{NAME}: {fixture} no longer decodes cleanly: {e}") | |
| 46338 | - }); | |
| 46380 | + let frames = decode_stream(&stream) | |
| 46381 | + .unwrap_or_else(|e| panic!("{NAME}: {fixture} no longer decodes cleanly: {e}")); | |
| 46339 | 46382 | let own_chroma = crate::decode::rect4_inter_own_chroma444_hits(); |
| 46340 | 46383 | let strips = { |
| 46341 | 46384 | let (h, v, _, _) = crate::decode::inter16_rect4_counters(); |
| @@ -46747,8 +46790,9 @@ pub(crate) mod tests { | ||
| 46747 | 46790 | let _guard = lock_gate_counters(); |
| 46748 | 46791 | let before_sr = crate::superres::superres_hits(); |
| 46749 | 46792 | let before_scaled = crate::mc::predict_scaled_hits(); |
| 46750 | - let frames = decode_stream(&stream) | |
| 46751 | - .unwrap_or_else(|e| panic!("{name}: the pinned 4:4:4 superres stream was refused: {e}")); | |
| 46793 | + let frames = decode_stream(&stream).unwrap_or_else(|e| { | |
| 46794 | + panic!("{name}: the pinned 4:4:4 superres stream was refused: {e}") | |
| 46795 | + }); | |
| 46752 | 46796 | let scaled_up = crate::superres::superres_hits() - before_sr; |
| 46753 | 46797 | let scaled_mc = crate::mc::predict_scaled_hits() - before_scaled; |
| 46754 | 46798 | assert!( |
| @@ -46914,9 +46958,21 @@ pub(crate) mod tests { | ||
| 46914 | 46958 | } |
| 46915 | 46959 | let y4m = Command::new("ffmpeg") |
| 46916 | 46960 | .args([ |
| 46917 | - "-v", "error", "-f", "lavfi", "-i", "testsrc2=size=256x128:rate=25", | |
| 46918 | - "-frames:v", "4", "-pix_fmt", "yuv444p", "-strict", "-1", "-f", | |
| 46919 | - "yuv4mpegpipe", "-", | |
| 46961 | + "-v", | |
| 46962 | + "error", | |
| 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 | 46977 | .stdin(Stdio::null()) |
| 46922 | 46978 | .stdout(Stdio::piped()) |
| @@ -46928,10 +46984,11 @@ pub(crate) mod tests { | ||
| 46928 | 46984 | "{NAME}: ffmpeg refused to generate the y4m source: {}", |
| 46929 | 46985 | String::from_utf8_lossy(&y4m.stderr) |
| 46930 | 46986 | ); |
| 46931 | - let pinned = | |
| 46932 | - std::fs::read(std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) | |
| 46933 | - .join("fixtures/444_lossy_superres_mode2_256x128.obu")) | |
| 46934 | - .expect("pinned fixture disappeared between the two reads"); | |
| 46987 | + let pinned = std::fs::read( | |
| 46988 | + std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) | |
| 46989 | + .join("fixtures/444_lossy_superres_mode2_256x128.obu"), | |
| 46990 | + ) | |
| 46991 | + .expect("pinned fixture disappeared between the two reads"); | |
| 46935 | 46992 | for extra in [ |
| 46936 | 46993 | vec![], |
| 46937 | 46994 | vec!["--superres-denominator=9"], |