ec-av1: both live fixture-pin shape violations closed in stream.rs
Browse files at this commit58044e9f59d8b4d0a3954ba2abbd5c3d2edfa6bcParent: b628d0d15 changed files +41 -33
- crates/ec-av1/fixtures/ii-flake-1.obu +0 -0
- crates/ec-av1/fixtures/ii-flake-2.obu +0 -0
- crates/ec-av1/fixtures/ii-flake-3.obu +0 -0
- crates/ec-av1/fixtures/ii-flake-5.obu +0 -0
- crates/ec-av1/fixtures/ii-flake-6.obu +0 -0
- crates/ec-av1/fixtures/ii-flake-7.obu +0 -0
- crates/ec-av1/fixtures/ii-flake-8.obu +0 -0
- crates/ec-av1/fixtures/ii-flake-9.obu +0 -0
- crates/ec-av1/fixtures/rect-flake-1.obu +0 -0
- crates/ec-av1/fixtures/rect-flake-2.obu +0 -0
- crates/ec-av1/fixtures/rect-flake-3.obu +0 -0
- crates/ec-av1/fixtures/warp-flake-5.obu +0 -0
- crates/ec-av1/fixtures/warp-flake-7.obu +0 -0
- crates/ec-av1/fixtures/warp-mismatch.obu +0 -0
- crates/ec-av1/src/stream.rs +41 -33
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 { | ||
| 23977 | 23977 | /// delta=2). `GOLDEN_FRAME` refuses by name until this decodes exact. |
| 23978 | 23978 | /// |
| 23979 | 23979 | /// 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 | |
| 23984 | 23984 | /// `crates/ec-av1/fixtures/golden7-forwarding-mismatch.obu` (152 bytes; |
| 23985 | 23985 | /// sha256 `81b3bf657a85e95085287b30d97dee93ba5aea0ed1db1e1f4fcd19a06afc17be`, |
| 23986 | 23986 | /// recovered byte-for-byte from the runner library). |
| @@ -31379,59 +31379,67 @@ pub(crate) mod tests { | ||
| 31379 | 31379 | /// clamping; ii-flake-1..8: interintra neighbours excluded from |
| 31380 | 31380 | /// warp-sample gathering, ref_frame[1] == INTRA_FRAME in the mi grid). |
| 31381 | 31381 | /// `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. | |
| 31384 | 31387 | #[test] |
| 31385 | - #[ignore = "reads pinned fixture paths under the gitignored fixtures dir; run manually"] | |
| 31386 | 31388 | fn pinned_warp_stream_decodes_pixel_exact() { |
| 31387 | 31389 | if !have_ffmpeg() { |
| 31388 | 31390 | eprintln!("SKIP pinned_warp_stream_decodes_pixel_exact: no ffmpeg"); |
| 31389 | 31391 | return; |
| 31390 | 31392 | } |
| 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"), | |
| 31405 | 31412 | // switchable_interp missing from reset_counts (counter |
| 31406 | 31413 | // saturation slowed the adaptation rate) -- unrelated to |
| 31407 | 31414 | // interintra, caught by the same gate. |
| 31408 | - "ii-flake-9", | |
| 31415 | + crate_pin("ii-flake-9.obu"), | |
| 31409 | 31416 | // lane-rect r2: HORZ strip rect defects (mvstack size_h, |
| 31410 | 31417 | // warp sample/projection dims, OBMC overlap, deblock tx-h). |
| 31411 | - "rect-flake-1", | |
| 31418 | + crate_pin("rect-flake-1.obu"), | |
| 31412 | 31419 | // scan_row/scan_col weight `inc` min'd by the wrong candidate |
| 31413 | 31420 | // axis (width vs height) -- ties reordered DRL entry 1 for a |
| 31414 | 31421 | // block under a 32x16 strip, and suppressed the -5 extended |
| 31415 | 31422 | // row scan. |
| 31416 | - "rect-flake-2", | |
| 31423 | + crate_pin("rect-flake-2.obu"), | |
| 31417 | 31424 | // overlappable_left stepped the vertical walk by the |
| 31418 | 31425 | // neighbour's WIDTH: a 32x16 left strip swallowed the strip |
| 31419 | 31426 | // 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 | + ], | |
| 31425 | 31429 | }; |
| 31426 | - for path in paths { | |
| 31427 | - eprintln!("pin: {path}"); | |
| 31430 | + for path in pins { | |
| 31431 | + eprintln!("pin: {}", path.display()); | |
| 31428 | 31432 | check_pinned_warp_stream(&path); |
| 31429 | 31433 | } |
| 31430 | 31434 | } |
| 31431 | 31435 | |
| 31432 | - fn check_pinned_warp_stream(path: &str) { | |
| 31436 | + fn check_pinned_warp_stream(path: &std::path::Path) { | |
| 31433 | 31437 | 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); | |
| 31435 | 31443 | let before = warp_selected_hits(); |
| 31436 | 31444 | let frames = decode_stream(&stream).expect("pinned stream must decode"); |
| 31437 | 31445 | eprintln!( |