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+94 -37
@@ -9114,6 +9114,22 @@ pub(crate) mod tests {
91149114 /// the machine's scratchpad is reaped -- three gates sat at `rc=0` having
91159115 /// tested nothing for exactly that reason (lane-av1pins). Falls back to
91169116 /// `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+
91179133 fn crate_pin(name: &str) -> std::path::PathBuf {
91189134 let in_crate = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
91199135 .join("fixtures")
@@ -23727,22 +23743,22 @@ pub(crate) mod tests {
2372723743 /// `EC_AV1_GATE_DUMP=$SP/golden4-pin.obu` off
2372823744 /// [`a_real_aomenc_inter_sequence_with_cdf_forwarding_decodes_pixel_exact`]
2372923745 /// (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.
2373123755 #[test]
23732- #[ignore = "reads a pinned fixture path outside the repo; run manually"]
2373323756 fn pinned_golden4_stream_decodes_pixel_exact() {
2373423757 use crate::decode::non_last_ref_hits;
2373523758 let path = std::env::var("EC_AV1_GATE_DUMP_PIN")
2373623759 .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");
2374623762 if !have_ffmpeg() {
2374723763 eprintln!("SKIP pinned_golden4_stream_decodes_pixel_exact: no ffmpeg");
2374823764 return;
@@ -23765,15 +23781,22 @@ pub(crate) mod tests {
2376523781 /// by the forwarding gate once film grain is out of the way (1/20 real
2376623782 /// aomenc streams, frame 3 luma, apply_grain=false, `non_last_ref_hits`
2376723783 /// 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).
2376823793 #[test]
23769- #[ignore = "reads a pinned fixture path outside the repo; run manually"]
2377023794 fn pinned_golden7_stream_decodes_pixel_exact() {
2377123795 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");
2377723800 if !have_ffmpeg() {
2377823801 eprintln!("SKIP pinned_golden7_stream_decodes_pixel_exact: no ffmpeg");
2377923802 return;
@@ -30268,10 +30291,23 @@ pub(crate) mod tests {
3026830291 /// to get the real window on stderr, call-uniquely keyed to `xqd ==
3026930292 /// [-16,-32]` rather than any coordinate.
3027030293 #[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"]
3027230306 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");
3027530311 let pics = decode_stream(&stream).expect("pinned lr-sgr-r7.obu must decode");
3027630312 if have_ffmpeg() {
3027730313 let reference = ffmpeg_decode_sequence(&stream, 192, 128, pics.len());
@@ -33203,11 +33239,19 @@ pub(crate) mod tests {
3320333239 eprintln!("SKIP a_real_aomenc_stream_with_film_grain_decodes_pixel_exact: no ffmpeg");
3320433240 return;
3320533241 }
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+ );
3321133255 // Truncate right after the first `Frame` OBU (the key frame): every
3321233256 // byte up to there is sequence header + frame-0, which is a complete,
3321333257 // independently decodable single-frame stream.
@@ -46333,9 +46377,8 @@ pub(crate) mod tests {
4633346377 h + v
4633446378 };
4633546379 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}"));
4633946382 let own_chroma = crate::decode::rect4_inter_own_chroma444_hits();
4634046383 let strips = {
4634146384 let (h, v, _, _) = crate::decode::inter16_rect4_counters();
@@ -46747,8 +46790,9 @@ pub(crate) mod tests {
4674746790 let _guard = lock_gate_counters();
4674846791 let before_sr = crate::superres::superres_hits();
4674946792 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+ });
4675246796 let scaled_up = crate::superres::superres_hits() - before_sr;
4675346797 let scaled_mc = crate::mc::predict_scaled_hits() - before_scaled;
4675446798 assert!(
@@ -46914,9 +46958,21 @@ pub(crate) mod tests {
4691446958 }
4691546959 let y4m = Command::new("ffmpeg")
4691646960 .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+ "-",
4692046976 ])
4692146977 .stdin(Stdio::null())
4692246978 .stdout(Stdio::piped())
@@ -46928,10 +46984,11 @@ pub(crate) mod tests {
4692846984 "{NAME}: ffmpeg refused to generate the y4m source: {}",
4692946985 String::from_utf8_lossy(&y4m.stderr)
4693046986 );
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");
4693546992 for extra in [
4693646993 vec![],
4693746994 vec!["--superres-denominator=9"],