forge
Explore
Log in

Don't you dare go Hollow

ec-av1: both live fixture-pin shape violations closed in stream.rs

Browse files at this commit

58044e9f59d8b4d0a3954ba2abbd5c3d2edfa6bcAhmet Kaan GümüşParent: b628d0d
The preflight named two sites in this crate.

1. The lr-sgr-r7 gate already read through crate_pin at HEAD; the
   remaining invariant-1 hit was a DOC COMMENT in
   pinned_golden7_stream_decodes_pixel_exact quoting the forbidden
   concat!(CARGO_MANIFEST_DIR, "/../../fixtures/...") shape verbatim to
   explain what had been fixed. The grep cannot see a comment, so the
   crate carried a live violation that was pure prose. Reworded to
   describe the shape without reproducing the literal; the history the
   comment exists to keep is unchanged.

2. pinned_warp_stream_decodes_pixel_exact bound one gitignored root
   directory literal and formatted 14 runtime names against it, so no
   committed tree could satisfy it and the gate skipped GREEN having
   read nothing. All fourteen pins are present in the runner library:
   they are committed under crates/ec-av1/fixtures/ byte-for-byte
   (warp-mismatch, warp-flake-5/7, ii-flake-1/2/3/5/6/7/8/9,
   rect-flake-1/2/3) and each is named by a string literal through
   crate_pin, the spelling pinned_golden3/4/7 and pinned_sbpart
   already use. The helper now takes a Path and reads through
   require_pin, so an absent pin is a hard failure naming the crate-local
   path rather than a raw io panic.

With the pins committed the gate is un-#[ignore]d: a plain run decodes
all fourteen and carries warp_selected_hits 0 -> 113, so it is a real
gate rather than a no-op with a better excuse. Costs 1.8s plus ffmpeg,
which have_ffmpeg() already gates.

Preflight, EC_FIXTURE_SHAPE_STRICT=1: no invariant-1 and no
invariant-4 FAIL, census uncommitted=0 (was 14).
crates/ec-av1/fixtures/ii-flake-1.obuadded+0 -0

Binary file changed

crates/ec-av1/fixtures/ii-flake-2.obuadded+0 -0

Binary file changed

crates/ec-av1/fixtures/ii-flake-3.obuadded+0 -0

Binary file changed

crates/ec-av1/fixtures/ii-flake-5.obuadded+0 -0

Binary file changed

crates/ec-av1/fixtures/ii-flake-6.obuadded+0 -0

Binary file changed

crates/ec-av1/fixtures/ii-flake-7.obuadded+0 -0

Binary file changed

crates/ec-av1/fixtures/ii-flake-8.obuadded+0 -0

Binary file changed

crates/ec-av1/fixtures/ii-flake-9.obuadded+0 -0

Binary file changed

crates/ec-av1/fixtures/rect-flake-1.obuadded+0 -0

Binary file changed

crates/ec-av1/fixtures/rect-flake-2.obuadded+0 -0

Binary file changed

crates/ec-av1/fixtures/rect-flake-3.obuadded+0 -0

Binary file changed

crates/ec-av1/fixtures/warp-flake-5.obuadded+0 -0

Binary file changed

crates/ec-av1/fixtures/warp-flake-7.obuadded+0 -0

Binary file changed

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

Binary file changed

crates/ec-av1/src/stream.rsmodified+41 -33
@@ -23977,10 +23977,10 @@ pub(crate) mod tests {
2397723977 /// delta=2). `GOLDEN_FRAME` refuses by name until this decodes exact.
2397823978 ///
2397923979 /// LIVE since lane-av1pinslive r3. The old shape was the worst of the
23980- /// class: a `concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures/...")`
23981- /// literal, which points at the GITIGNORED root and can therefore never be
23982- /// satisfied by a committed pin, combined with a bare `.expect()`. The
23983- /// bytes are now committed at
23980+ /// class: a `concat!` of `CARGO_MANIFEST_DIR` with the GITIGNORED
23981+ /// repo-root `fixtures/` directory, which no committed pin can satisfy,
23982+ /// combined with a bare `.expect()`.
23983+ /// The bytes are now committed at
2398423984 /// `crates/ec-av1/fixtures/golden7-forwarding-mismatch.obu` (152 bytes;
2398523985 /// sha256 `81b3bf657a85e95085287b30d97dee93ba5aea0ed1db1e1f4fcd19a06afc17be`,
2398623986 /// recovered byte-for-byte from the runner library).
@@ -31379,59 +31379,67 @@ pub(crate) mod tests {
3137931379 /// clamping; ii-flake-1..8: interintra neighbours excluded from
3138031380 /// warp-sample gathering, ref_frame[1] == INTRA_FRAME in the mi grid).
3138131381 /// `EC_AV1_GATE_DUMP_PIN` overrides to a single stream.
31382- /// Deterministic and static -- `#[ignore]`d because the gitignored
31383- /// fixtures dir may be absent; run manually.
31382+ ///
31383+ /// Un-`#[ignore]`d with the pin shape fixed: the fourteen pins are COMMITTED
31384+ /// under `crates/ec-av1/fixtures/`, so the gate runs on a clean checkout
31385+ /// and carries `warp_selected_hits` 0 -> 113 over the set instead of
31386+ /// skipping GREEN having read nothing.
3138431387 #[test]
31385- #[ignore = "reads pinned fixture paths under the gitignored fixtures dir; run manually"]
3138631388 fn pinned_warp_stream_decodes_pixel_exact() {
3138731389 if !have_ffmpeg() {
3138831390 eprintln!("SKIP pinned_warp_stream_decodes_pixel_exact: no ffmpeg");
3138931391 return;
3139031392 }
31391- let fixtures = concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures");
31392- let paths: Vec<String> = match std::env::var("EC_AV1_GATE_DUMP_PIN") {
31393- Ok(p) => vec![p],
31394- Err(_) => [
31395- "warp-mismatch",
31396- "warp-flake-5",
31397- "warp-flake-7",
31398- "ii-flake-1",
31399- "ii-flake-2",
31400- "ii-flake-3",
31401- "ii-flake-5",
31402- "ii-flake-6",
31403- "ii-flake-7",
31404- "ii-flake-8",
31393+ // Every pin is COMMITTED under `crates/ec-av1/fixtures/` and named by a
31394+ // string literal, which is the convention every other pinned gate here
31395+ // uses and the only shape the pin census can resolve name-by-name. The
31396+ // old shape -- one GITIGNORED root directory literal plus a runtime
31397+ // name list formatted against it -- can never be satisfied by a
31398+ // committed tree, so this gate skipped GREEN having tested nothing.
31399+ let pins = match std::env::var("EC_AV1_GATE_DUMP_PIN") {
31400+ Ok(p) => vec![std::path::PathBuf::from(p)],
31401+ Err(_) => vec![
31402+ crate_pin("warp-mismatch.obu"),
31403+ crate_pin("warp-flake-5.obu"),
31404+ crate_pin("warp-flake-7.obu"),
31405+ crate_pin("ii-flake-1.obu"),
31406+ crate_pin("ii-flake-2.obu"),
31407+ crate_pin("ii-flake-3.obu"),
31408+ crate_pin("ii-flake-5.obu"),
31409+ crate_pin("ii-flake-6.obu"),
31410+ crate_pin("ii-flake-7.obu"),
31411+ crate_pin("ii-flake-8.obu"),
3140531412 // switchable_interp missing from reset_counts (counter
3140631413 // saturation slowed the adaptation rate) -- unrelated to
3140731414 // interintra, caught by the same gate.
31408- "ii-flake-9",
31415+ crate_pin("ii-flake-9.obu"),
3140931416 // lane-rect r2: HORZ strip rect defects (mvstack size_h,
3141031417 // warp sample/projection dims, OBMC overlap, deblock tx-h).
31411- "rect-flake-1",
31418+ crate_pin("rect-flake-1.obu"),
3141231419 // scan_row/scan_col weight `inc` min'd by the wrong candidate
3141331420 // axis (width vs height) -- ties reordered DRL entry 1 for a
3141431421 // block under a 32x16 strip, and suppressed the -5 extended
3141531422 // row scan.
31416- "rect-flake-2",
31423+ crate_pin("rect-flake-2.obu"),
3141731424 // overlappable_left stepped the vertical walk by the
3141831425 // neighbour's WIDTH: a 32x16 left strip swallowed the strip
3141931426 // below it, blending the wrong OBMC prediction there.
31420- "rect-flake-3",
31421- ]
31422- .iter()
31423- .map(|n| format!("{fixtures}/{n}.obu"))
31424- .collect(),
31427+ crate_pin("rect-flake-3.obu"),
31428+ ],
3142531429 };
31426- for path in paths {
31427- eprintln!("pin: {path}");
31430+ for path in pins {
31431+ eprintln!("pin: {}", path.display());
3142831432 check_pinned_warp_stream(&path);
3142931433 }
3143031434 }
3143131435
31432- fn check_pinned_warp_stream(path: &str) {
31436+ fn check_pinned_warp_stream(path: &std::path::Path) {
3143331437 use crate::decode::warp_selected_hits;
31434- let stream = std::fs::read(path).expect("reading pinned stream");
31438+ let name = path
31439+ .file_name()
31440+ .map(|n| n.to_string_lossy().into_owned())
31441+ .unwrap_or_default();
31442+ let stream = require_pin(path, &name);
3143531443 let before = warp_selected_hits();
3143631444 let frames = decode_stream(&stream).expect("pinned stream must decode");
3143731445 eprintln!(