diff --git a/crates/ec-aac/tests/oracle.rs b/crates/ec-aac/tests/oracle.rs index 79b3070f..1c051d72 100644 --- a/crates/ec-aac/tests/oracle.rs +++ b/crates/ec-aac/tests/oracle.rs @@ -19,6 +19,30 @@ fn have_ffmpeg() -> bool { .unwrap_or(false) } +/// Fixture-presence probe for the committed `fixtures/audio` media this file +/// decodes. Returns whether the fixture is present, but never silently: under +/// `EC_REQUIRE_FIXTURES=1` an absent fixture is a hard failure naming the path +/// and the script that regenerates it, so a host whose fixture library drifted +/// reports RED instead of a green SKIP (class: gate-skips-on-its-own-failure; +/// model `have_ffmpeg` in crates/ec-av1/src/stream.rs, which was silently +/// short-circuited because the probe ran first in a compound `if`). +/// +/// Order is load-bearing: probe, assert, return. Never merge the probe into +/// the same `if` as the escape. +fn require_fixture(path: &Path, generator: &str) -> bool { + let present = path.exists(); + assert!( + present || std::env::var_os("EC_REQUIRE_FIXTURES").is_none(), + "EC_REQUIRE_FIXTURES=1 but fixture {} is absent -- regenerate with: {}", + path.display(), + generator + ); + if !present { + eprintln!("SKIP: fixture {} absent", path.display()); + } + present +} + /// ffmpeg's decode of a file, as planar-by-channel `f32`. fn ffmpeg_decode(path: &Path, channels: usize) -> Vec> { let out = Command::new("ffmpeg") @@ -128,8 +152,7 @@ fn adts_fixtures_match_ffmpeg_per_channel() { "aac-adts-5.1-48000.aac", ] { let path = dir.join(name); - if !path.exists() { - eprintln!("SKIP {name}: fixture missing"); + if !require_fixture(&path, "scripts/gen-fixtures.sh") { continue; } let corr = compare(&path); @@ -164,8 +187,7 @@ fn mp4_fixtures_match_ffmpeg_per_channel() { "aac-mp4-5.1-48000.mp4", ] { let path = dir.join(name); - if !path.exists() { - eprintln!("SKIP {name}: fixture missing"); + if !require_fixture(&path, "scripts/gen-fixtures.sh") { continue; } // The mp4 side of the family is another slice; the elementary stream @@ -209,8 +231,7 @@ fn aac_coding_tools_match_ffmpeg_in_isolation() { for tool in ["pns", "is", "ms", "tns", "all"] { let name = format!("aac-tool-{tool}-mp4-stereo-48000.m4a"); let path = dir.join(&name); - if !path.exists() { - eprintln!("SKIP {name}: fixture missing"); + if !require_fixture(&path, "scripts/gen-fixtures.sh") { continue; } let adts = tmp.join(format!("{name}.aac")); @@ -421,8 +442,7 @@ fn encoder_beats_the_incumbent_bar() { let mut checked = 0; for (name, channels, kbps, bar) in INCUMBENT_BAR { let src = dir.join(format!("flac-{name}-48000.flac")); - if !src.exists() { - eprintln!("SKIP {name}: fixture missing"); + if !require_fixture(&src, "scripts/gen-fixtures.sh") { continue; } let source = ffmpeg_decode(&src, *channels); @@ -811,8 +831,7 @@ fn aac_stream(path: &Path) -> Option<(usize, usize, String)> { #[test] fn five_one_decodes_faster_than_realtime() { let path = fixtures().join("audio/aac-adts-5.1-48000.aac"); - if !path.exists() { - eprintln!("SKIP: 5.1 fixture missing"); + if !require_fixture(&path, "scripts/gen-fixtures.sh") { return; } let data = std::fs::read(&path).expect("fixture readable"); diff --git a/crates/ec-aac/tests/sbr_real_library.rs b/crates/ec-aac/tests/sbr_real_library.rs index edc3dc85..b38dac59 100644 --- a/crates/ec-aac/tests/sbr_real_library.rs +++ b/crates/ec-aac/tests/sbr_real_library.rs @@ -38,6 +38,33 @@ fn have_ffmpeg() -> bool { .unwrap_or(false) } +/// Fixture-presence probe for the generated HE-AAC matrix under +/// `/.cache/heaac-fixtures` (`scripts/aac-tables/make-heaac-fixtures.sh`). +/// Returns whether the fixture is present, but never silently: under +/// `EC_REQUIRE_FIXTURES=1` an absent fixture is a hard failure naming the path +/// and the script that regenerates it, so a host whose fixture library drifted +/// reports RED instead of a green SKIP (class: gate-skips-on-its-own-failure; +/// model `have_ffmpeg` in crates/ec-av1/src/stream.rs, which was silently +/// short-circuited because the probe ran first in a compound `if`). +/// +/// Order is load-bearing: probe, assert, return. Never merge the probe into +/// the same `if` as the escape. The `~/Music` / `~/Downloads` / `~/Videos` +/// scans in this file are host corpora, not the committed fixture library, and +/// keep their plain skip. +fn require_fixture(path: &Path, generator: &str) -> bool { + let present = path.exists(); + assert!( + present || std::env::var_os("EC_REQUIRE_FIXTURES").is_none(), + "EC_REQUIRE_FIXTURES=1 but fixture {} is absent -- regenerate with: {}", + path.display(), + generator + ); + if !present { + eprintln!("SKIP: fixture {} absent", path.display()); + } + present +} + /// A film's audio track is hours long; the correlation only needs a bounded /// window near the start, so both sides cap how much they ever decode. const MAX_SAMPLES: usize = 1_000_000; @@ -2444,11 +2471,7 @@ fn synthetic_heaac_matrix() { let dir = std::env::var("EC_AAC_HEAAC_FIXTURES") .unwrap_or_else(|_| format!("{}/../../.cache/heaac-fixtures", env!("CARGO_MANIFEST_DIR"))); let dir = PathBuf::from(dir); - if !dir.is_dir() { - eprintln!( - "SKIP: {} absent -- run scripts/aac-tables/make-heaac-fixtures.sh first", - dir.display() - ); + if !require_fixture(&dir, "scripts/aac-tables/make-heaac-fixtures.sh") { return; } unsafe { @@ -2477,6 +2500,10 @@ fn synthetic_heaac_matrix() { // samples at the doubled/full output rate) both land well inside it, // not right at the edge the way the plain (LAG_MAX=4000) search did. const WIDE_LAG_MAX: i64 = 20_000; + // Floor: the matrix is 2 rates x 4 bitrates x 2 profiles. Without a count + // the whole test is green having probed nothing, which is the same + // false-green this file's `require_fixture` exists to kill. + let mut probed = 0usize; for rate in [48_000u32, 44_100] { for br in ["32k", "48k", "64k", "96k"] { // LC first: its winning lag is the pure container/decoder @@ -2485,10 +2512,10 @@ fn synthetic_heaac_matrix() { let mut lc_lag: Option = None; for (profile, prefix) in [("LC", "lc"), ("HE", "heaac")] { let path = dir.join(format!("{prefix}_{rate}_{br}.m4a")); - if !path.exists() { - eprintln!("SKIP {}: missing", path.display()); + if !require_fixture(&path, "scripts/aac-tables/make-heaac-fixtures.sh") { continue; } + probed += 1; let before = ec_aac::sbr_sideinfo_log().len(); let Some((ours, _sbr, our_rate)) = our_decode(&path, 0) else { eprintln!("SKIP {}: could not decode", path.display()); @@ -2733,6 +2760,11 @@ fn synthetic_heaac_matrix() { } } } + assert!( + probed >= 16, + "only {probed} of 16 HE-AAC matrix fixtures were present -- rerun \ + scripts/aac-tables/make-heaac-fixtures.sh" + ); } fn candidates() -> Vec { @@ -3756,11 +3788,11 @@ fn sbr_header_feature_table() { let fixtures = std::env::var("EC_AAC_HEAAC_FIXTURES") .unwrap_or_else(|_| format!("{}/../../.cache/heaac-fixtures", env!("CARGO_MANIFEST_DIR"))); let fixtures = PathBuf::from(fixtures); - if fixtures.is_dir() { + if require_fixture(&fixtures, "scripts/aac-tables/make-heaac-fixtures.sh") { for rate in [48_000u32, 44_100] { for br in ["32k", "48k", "64k", "96k"] { let p = fixtures.join(format!("heaac_{rate}_{br}.m4a")); - if p.exists() { + if require_fixture(&p, "scripts/aac-tables/make-heaac-fixtures.sh") { rows.push(Row { label: format!("synth-{rate}-{br}"), path: p, @@ -3770,11 +3802,6 @@ fn sbr_header_feature_table() { } } } - } else { - eprintln!( - "SKIP synthetic rows: {} absent -- run scripts/aac-tables/make-heaac-fixtures.sh first", - fixtures.display() - ); } if rows.is_empty() { eprintln!("SKIP: no real HE-AAC files and no synthetic fixtures found"); @@ -4044,10 +4071,8 @@ fn per_au_low_band_divergence() { let dir = std::env::var("EC_AAC_HEAAC_FIXTURES") .unwrap_or_else(|_| format!("{}/../../.cache/heaac-fixtures", env!("CARGO_MANIFEST_DIR"))); let failing = PathBuf::from(&dir).join("heaac_44100_48k.m4a"); - if failing.exists() { + if require_fixture(&failing, "scripts/aac-tables/make-heaac-fixtures.sh") { per_au_low_band_probe("synthetic 44100 48k (failing)", &failing, 0); - } else { - eprintln!("SKIP synthetic 44100 48k: {} absent", failing.display()); } } @@ -4094,7 +4119,20 @@ fn probe_explicit_config_and_wide_lag() { (planes, rate) } - for (label, path, aac_stream, ffmpeg_stream, core_sf_index, core_rate, ext_rate, channels) in [ + // `synthetic` marks the case as coming from the committed fixture library + // (`scripts/aac-tables/make-heaac-fixtures.sh`); the FMJ row is a + // `~/Downloads` host corpus and keeps its plain skip. + for ( + label, + path, + aac_stream, + ffmpeg_stream, + core_sf_index, + core_rate, + ext_rate, + channels, + synthetic, + ) in [ ( "FMJ", format!( @@ -4107,6 +4145,7 @@ fn probe_explicit_config_and_wide_lag() { 24_000u32, 48_000u32, 2u16, + false, ), ( "heaac_44100_48k", @@ -4120,10 +4159,15 @@ fn probe_explicit_config_and_wide_lag() { 44_100, 0, // filled below from parsed cfg's own extension_sample_rate 2, + true, ), ] { let path = PathBuf::from(path); - if !path.exists() { + if synthetic { + if !require_fixture(&path, "scripts/aac-tables/make-heaac-fixtures.sh") { + continue; + } + } else if !path.exists() { eprintln!("SKIP {label}: {} absent", path.display()); continue; } @@ -4334,8 +4378,7 @@ fn coupled_cpe_channel_swap_probe() { let dir = std::env::var("EC_AAC_HEAAC_FIXTURES") .unwrap_or_else(|_| format!("{}/../../.cache/heaac-fixtures", env!("CARGO_MANIFEST_DIR"))); let path = PathBuf::from(&dir).join("heaac_44100_48k.m4a"); - if !path.exists() { - eprintln!("SKIP: {} absent", path.display()); + if !require_fixture(&path, "scripts/aac-tables/make-heaac-fixtures.sh") { return; } let Some((ours, sbr, out_rate)) = our_decode(&path, 0) else { @@ -4682,11 +4725,15 @@ fn sbr441_family_sample_drift_probe() { let dir = std::env::var("EC_AAC_HEAAC_FIXTURES") .unwrap_or_else(|_| format!("{}/../../.cache/heaac-fixtures", env!("CARGO_MANIFEST_DIR"))); let home = std::env::var("HOME").unwrap_or_default(); - let cases: [(&str, PathBuf, i64); 3] = [ + // `synthetic` marks the rows served by the committed fixture library + // (`scripts/aac-tables/make-heaac-fixtures.sh`); the reeln control is + // a `~/Music` host corpus and keeps its plain skip. + let cases: [(&str, PathBuf, i64, bool); 3] = [ ( "heaac_44100_48k (FAIL family)", PathBuf::from(&dir).join("heaac_44100_48k.m4a"), -4674, + true, ), ( "heaac_48000_48k (48k control)", @@ -4695,6 +4742,7 @@ fn sbr441_family_sample_drift_probe() { // (below) -- 0 was a bad guess, true fixed lag is -4673, same // as the failing family's. -4673, + true, ), ( "reeln (44.1k control)", @@ -4704,11 +4752,16 @@ fn sbr441_family_sample_drift_probe() { // from an earlier probe, not its full-chain-vs-ffmpeg-reference // lag, which is +385. 385, + false, ), ]; - for (label, path, seed_lag) in cases { + for (label, path, seed_lag, synthetic) in cases { println!("\n=== {label}: {} ===", path.display()); - if !path.exists() { + if synthetic { + if !require_fixture(&path, "scripts/aac-tables/make-heaac-fixtures.sh") { + continue; + } + } else if !path.exists() { eprintln!("SKIP {label}: {} absent", path.display()); continue; } @@ -4802,8 +4855,7 @@ fn sbr_hf_window_band_probe() { let dir = std::env::var("EC_AAC_HEAAC_FIXTURES") .unwrap_or_else(|_| format!("{}/../../.cache/heaac-fixtures", env!("CARGO_MANIFEST_DIR"))); let path = PathBuf::from(&dir).join("heaac_48000_64k.m4a"); - if !path.exists() { - eprintln!("SKIP: {} absent", path.display()); + if !require_fixture(&path, "scripts/aac-tables/make-heaac-fixtures.sh") { return; } const LAG: i64 = -4673; diff --git a/crates/ec-av1/fixtures/ii-flake-1.obu b/crates/ec-av1/fixtures/ii-flake-1.obu new file mode 100644 index 0000000000000000000000000000000000000000..b796d23af1ab6dd41f818b8360e18c1c2ffb3d0b GIT binary patch literal 579 zcmWe);NoInU|?GRf9-n)4kJeahRqBLO&kha=Kl2gxa_!)f%u!h!5dtDJuR(X#i_VE z=7jU-$clxJqH3hY4zI48u`gnkRtn?vlPAAU2#TLm_+g2&5QCAR0rPpDKm^aVH-H5>Sa=2CD$fdh1q*U<2rh7d zX+M3&K#0Lez<@_U%%FpHHAMTV8(@We3Q`9yvMy(EWMOb&I4LF|#9$<3Ab4PYpcGg) zgA2n2&K-PUr9zDILCUO4A=;1mYk&nsn7AM5z|1_l4&)>O12GofB2(5?5S2$Az-CHt z2rjZ?T?r98xPbYJ5Q7oFfs}xlkvQvmi0EOkW*G&kLsG08AwoOtz{=#nR&Rlb?H6J& zk~UBTS?rn*5xVHSch{tyo6Z&AxXKQ4f|!Q*0oBhUO(z%>Sy+@9&KKvd{CsJ(m64!^ zFca%%6Q#2aiYzSZ40{p}7zr9EpWuGZ!McXQiG#zB;lhpsU{|OJh?aA(u7wE-F-S3< z07+C~lzO`QZW3vokNC&;|+DVWEjnQ(M+=S%@5treYKr+ z+L6VlZwi?RTY;aAWE9N`Kc=-s?cmkpWW?A9Rpf|$)OmD<6pVSvD>~@1sEm;@gT=58 z*2LZSE}1YkcUwK3i37TN(%`JeAzhJB%`JUqX65%%`BZgP?~CaTwILFZc@1mfn?)pS znna~|wq@W(jdW5Wi>w{9%DIG14`RA0Egex;3anB+f?dGklse8tJ&RnUx=nm}{ yy{QPRE~Knwbs&kCl8IC%)K%I^=2dc2pJ;5`f3AP$gIeW?BZ!T58_QxPIJFJU)R2$> literal 0 HcmV?d00001 diff --git a/crates/ec-av1/fixtures/ii-flake-3.obu b/crates/ec-av1/fixtures/ii-flake-3.obu new file mode 100644 index 0000000000000000000000000000000000000000..729f887746e41584164d22747f54092b26ef3ae8 GIT binary patch literal 670 zcmWe);NoInU|?GRf9-n)4x%p} z?L4L@#%FkKNutG-O+Iz3;o64MOhzw#Z~X||YG?ZBd7)MNp_KG5$pw+Y1!ZU7XIRBu z>QDczSoQGs+K7V>Wt5J03G7tPFfb_X2U)Jf zaDkoY&Qz1kjq`bv!jgg=R%Yz06hDC=Onm82H87}NNU?iZy)X2c#&~z3i zWF%<7e1w7FBI_1L76Au8kRl-lDaIW_3`PP5Y#w|JjjWqtG9ZZ+APEgN57vl=ri)NR z78nT_a3yeUTnIO00Z8c!uo-+V(hDQu5)L4V8DQu0C35cMn)Q#VOQE5I;p~l@4<~L@ zSeD%994h7=qI`(8!AL-ZTZMBcXVbxkMI9jLI~WNV2r&v5JG0JWbOpKfJSZIa4MY^U zlAT#MK*c~7+yIM91c)zEW?c;tKL-|)Vv+hJ%(?|G1o5bfhIoSJY8jYY&b4TpFy4Fb z{7UGU1N&cox8LV(xcqf664DTI=v-~Xw2uMooHHNuUm5Xh2u$Ey?V@xFB6i-0-$0H- zSo{L(dWaQgK(6@#wpuAb?pO!Rm0)pDQ1WYtII-?FVYfG$wA9sJ9i%AUHJ-k$3nd>%pt#>T%G0szmk7N~9FH~M! zYED}^ge(zhSIOWaz111neEaKssT`}Qy=E$EnDaQwO3yZj#~KSuj!t9^%(gZ>+I|w4 zuBz`9g1)hScjC-;!EESf_58h!@&yc{SPFbZ-S=Y((^gP1SmDX$kNbySs~hSX~PZTxQSK-gt1su zWCTYtV}(LPFoC%mm(gJ_nd^(BV Y>{LTab(3rqROPs?qtTt9LJ8Xc0e}wBhX4Qo literal 0 HcmV?d00001 diff --git a/crates/ec-av1/fixtures/ii-flake-6.obu b/crates/ec-av1/fixtures/ii-flake-6.obu new file mode 100644 index 0000000000000000000000000000000000000000..1cd806c7096d96b50002ab10da4ff7d98d0f3b64 GIT binary patch literal 632 zcmWe);NoInU|?GRf9-n)4x?-VhK&shEgA}2=AF{MG41)EW4lGP_q>pH$y~*JNaLnP zj;7>wyVrjn+8v!ooAxHtqCIIy-rL{HxXtK<<7Gw5KQ!@vkqc}j&5WT=n&h@q9^`528jwA z2p*UpD8)JpB6?x({FE(V7YH%R2Pv~ogeu;)0IXJoiTjZb>tu*shwpy31Q{V zG?W-F?qi?*vu~S`kcKc5>t_?DQy^h=hKsHm4~zs2luvL!=U`pU;N%hD$8cc>$aw+= zDgvVA9IRVlfZj3+=68lnQ6t2LNzFn~>1D`6yHpy4PSeu8x^ROtec(jQWlfwAgOQ*C^MM8i z2G?2!M-B%Uh6`L(LJUSi1}uy$3=FKZAcE%$a~i-(*_b#Q7+7aQM9)nL5@IkCHsE04 z6<}cPfe4;e(|rk1%f%tMz=3r>MEH#61tA6_0RtWZF@p})*$}}~Enxk83Q`9yvQB`A zop6g-djjkN!2|OHrC29IgfHx!5e7Cuh*3UBnRPKl^tb?6r3e%EBOTU>3=SPCE)2&H zwB~@_D#pTFWXjsh;Mk($!f^0t4_Lbdhu|VRkoFFc-~zCADFHDfan=P4jvY2G3`ZGj z9l+XU6r>JGv95=R?sQK8YnKDtz6Bz<`+yLGk&1yL$oA4bjBJXA0t^>l9rAeNvLfHx z<(qeRdWj(x*bu)t_SpNc$(jQJy@ literal 0 HcmV?d00001 diff --git a/crates/ec-av1/fixtures/ii-flake-8.obu b/crates/ec-av1/fixtures/ii-flake-8.obu new file mode 100644 index 0000000000000000000000000000000000000000..bf08733e2f5cc8c2735b05b4ece78e69378bd671 GIT binary patch literal 635 zcmWe);NoInU|?GRf9-n)4x=0ahII@IEdmN#=3SUIGq-T{#hXUUikCz$Hojo~T)5(q zW3;ch>v>LAkE0tBivFm2E#TWMrhc+_^0c1r4YCEwHd}n8zZFLCFfF?f9J_V@*7g_5ehMq`Y*#@#p z*g){W{6HzzX$(#vV=wGou>|BaAp;>s`5}5)d;IXI;(U1QI+F09GiYAazKJbt6P< z=Z=M7g>qoqw?Irh1oFS6fg;H6(gTbf3JV1oF1|YSX8-Re|BHWFf+RJ>52$_?X*$xN z$fBaeaPde&$G!E&J*UHMj081=nOHxYC|v?csWa@B%rO!)P(H!^oP%{egA<2`AH#(m zAoB$bR0KrJIlvA93koqvF`fWPXow1MuGV0>$pAKBdxVjIfrg`S_zBicQ2h%)N`HXO S(D9IUD*(G2WQGGsq5}Zx#8(eZ~f`ayBN81_ss!i13<80b%|Q zLJUTt1{^HB0t}{a7�M3NWlNPmC`+4w4Wu;NlQm;J`W`qT!gk9LRJ*10De}gAUfk z5YZz^r@>136r>JZH0ywvaqyt;0uM0M3}fA>6qC-1SjQr&-P0-N-F8O339!Vffx&Kk*Qe%M0V$0 z#{*zd2@b(Uc4j#c(QT7nH-JT@1jLNQ&1xW`$B%RrfkkB$qz*}$Er5t_2;MXY>=Ze$ zQ!YS6*ItYgVlYxQPy{)JwUWV!$H9eRi>Ln&C^78i-YnX8ViI@iqQghITsx2L+-D@DAXbs zl^cu%4U|uCKj&aw$lxU6;Ky)b2goY|1}Xxg literal 0 HcmV?d00001 diff --git a/crates/ec-av1/fixtures/rect-flake-1.obu b/crates/ec-av1/fixtures/rect-flake-1.obu new file mode 100644 index 0000000000000000000000000000000000000000..40a0e8f61f1e88997bfd91e40b28a338822e3fef GIT binary patch literal 607 zcmXxfQAiX~6b9h4Vg#1Q?-f4c#rGZf=w5o#zR#Fjd^1eL8CAS{O_Hz3%!ANMPgsIJyQF81*oD z*Q=${uu%HG8nyB8Q|nKOR}9mL7;N5(x>ndTg=&&=dk4yJdz|B_;|PnQI~=ne9){?8 zLw}~DK8{a(+Tb70avCMTG+OSRKK(TSU|}fk`W8**>zXdg1lT$=>Q*g=o#(dUXcaJh z@XXYFd8}d2mSdSQrkJXL7Hfo8wqa|VV8n45rtw_qCkfpL5Eq~@?EM>}mALGzg!)&E tfF8(sZkFNIeWoxAAf(`<%|g_))WbQH<-uMrxa2RW-W^M({(Hjn^gnodsnq}g literal 0 HcmV?d00001 diff --git a/crates/ec-av1/fixtures/rect-flake-2.obu b/crates/ec-av1/fixtures/rect-flake-2.obu new file mode 100644 index 0000000000000000000000000000000000000000..e727407a96118cdd04cfc64b12f3abf7d8270530 GIT binary patch literal 601 zcmX}oO=uHA7zW@so1L(xNu8afNm#V5MrkNPhe3~)6jv!8N?V13Q1K*)_=DCeSYe|c zL_CNdJoSfy7Ohy*28@TmDk|GHY9dk;5v6Jc6^rEJMUEp{Iro@n<*&t)+^pYov$-F|90&04PV?+Fru*jYy5{t6R*UA~;qmAXg}5VBbO@<1I@qDk5k*v5r*(^1 z)SULoB03mM8xae|d*k)<`||z$-s7+=0LIk6=j))- zXPAVWqwef&>sj0QLUZ4`d(w7?OND{+LuW58j?Pat9Q=jQpRNx*dK3Q0tkwT^b!EPM zdU)i)iyM_pkwY@EDaZoH1_9GY)%vK-jF|w*Yg@hSYHKiP7Gzl4yRmK#X$xvLF_1gj zCQdB}95OB}Y8U+tTz<h!D0ISccqloS0#~Nh0hdhq#wWeKq`%Fah9MTbKz4m5Avz6^__pi)d z3O3gThfI2{!QL>Lt7KV@wqrG3TRGG(nU^p~xW9cx={|hDE^X0KZu~~cIMOD1QJqtl zGO>rX3{WzGw8<25II*%i!)sw%N}ll{YJDY{@Ol#G%4B*YSyahCx}x*M&f{0fjQYi1 JRDCtb{|Co5luZBt literal 0 HcmV?d00001 diff --git a/crates/ec-av1/fixtures/warp-flake-5.obu b/crates/ec-av1/fixtures/warp-flake-5.obu new file mode 100644 index 0000000000000000000000000000000000000000..1ea57620a51a86018506edb8f42fc06e4d5185c0 GIT binary patch literal 602 zcmXw$Pe>F|9LIn2+?S6roj0>>*&y4Dh(4lXdX=Z3X;?@*j0qh(7kMxO z0I8ywcR?jr;5tJ|05`P~C=#7YbKPku0aWoEAVPhSGQd=F25{=^>1lx^ezrT2jL=vi ziD&98Bf?W+z#7N#)NtxO$Ytd*PMy7prv6Vj3!W@?Mf8{KpkCab#xvj%@S!a3qB#c9 z3R(Q3&P4XU0sJ7NSJj%1-h_9|mlD;!dyNSzk>QjzyLW3*RNq)BaLw5tiEWSI=i$aR z+1qLv3nO?o^j+K4)tol3sdx;}htX9Tjg#h^ol=4N0-4G;1Gvc!3>@BQORai6+u#tG;fNM^>6`Lja5qLm-SeC^dN<2^S0-!oF70FplA+JxO kb+CbSL6vI`>(TEl3n>73Hv9<9IWo|)dO?^8UJ+*L|C!jJ(*OVf literal 0 HcmV?d00001 diff --git a/crates/ec-av1/fixtures/warp-flake-7.obu b/crates/ec-av1/fixtures/warp-flake-7.obu new file mode 100644 index 0000000000000000000000000000000000000000..d70ae41c5e2b8779743900ea20f998ba5350fd52 GIT binary patch literal 723 zcmY+AZAep59Ebn5-L~$`dv;TY)9j|{t|fRneJC{QDzi63XOUtdDOr}Gy^5BGw<*3v z(WIbgR$KMKMe4+*8IKqx>SFVuq5Ri{5!ks0HvaP-8f3YvbNvUal56Ycw7rIg2$N!w~~NX^9W@#2DC zvjc`N+UXMdo}c>8aI=qu@Cu&@V8)W@E_j*(zRw*CeHy#<8VTZM*8v2hSJcud3cLpl zwbqbsqQLF7Nkg4WN;0#WmnQjsGVhe3S<>0oe| zNDx-$1iY!I9RIf#Y5QYQ;;#?2+mKOfrl}YTjR|8Zk&2btWAQ<`4!4>ou*571Hv4;N~|5s`BA;LfX~pYrS#U-PqX?mk@|U*6t;Gg_)H z+ovi^Wo=0rZEnRtM=8N0)^W)wQ&eYjY$U{6Jc<)e#4>LXp?-}v*%je|( zbr$)BzjFPu^0y7=A(olXer+lfo9r!C9&+$>b?-cW*#-8}6Bxx0nW-^O@=urVy&|Mr zC2b$}bLsjow+{$07)fgIJaAxOU^>a5(4wHku*>zWa?D?W?H|n@j082<9yBm8G@WD+ zXi-pSxUl1Zk$?tsBLjm&(@6#fh>($>0rL?ChKsDL85lVn{6LC?7>ooASU3b2F0!tG z2?{YtG423Ma0KujXk=Z)pa@pI04&C(AbDXS>uRW&14!`-kc0+j6YGbPrb`S4V9OR5 z2^jEsa6gn}UBi$F(tf@{h{1^8K!8cK(2#WlR1Bp11Xx@oK=8s&*7Xqab6_Dc1u4To z)-7-$DaIK>3`Tky;tBl=`DQ(1I3%#3gJExHP{ZUC*9+sl>la-4oO+5uW<$u8;GpxV zCgCA^pB^U~31|qq@GsgRST`~x za@hDWoPmV^zkyr;U$GPG28INvxDmgBf`a5>C)SM+p%WmbH$cwS5Lv|ik(cR01K67L zM*IdUPU4T5Sl2?#g!ocTfbTOCI7DpxAbKI F1psz@w2}Y- literal 0 HcmV?d00001 diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index 07a2430d..a61a9485 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -31540,59 +31540,67 @@ pub(crate) mod tests { /// clamping; ii-flake-1..8: interintra neighbours excluded from /// warp-sample gathering, ref_frame[1] == INTRA_FRAME in the mi grid). /// `EC_AV1_GATE_DUMP_PIN` overrides to a single stream. - /// Deterministic and static -- `#[ignore]`d because the gitignored - /// fixtures dir may be absent; run manually. + /// + /// Un-`#[ignore]`d with the pin shape fixed: the fourteen pins are COMMITTED + /// under `crates/ec-av1/fixtures/`, so the gate runs on a clean checkout + /// and carries `warp_selected_hits` 0 -> 113 over the set instead of + /// skipping GREEN having read nothing. #[test] - #[ignore = "reads pinned fixture paths under the gitignored fixtures dir; run manually"] fn pinned_warp_stream_decodes_pixel_exact() { if !have_ffmpeg() { eprintln!("SKIP pinned_warp_stream_decodes_pixel_exact: no ffmpeg"); return; } - let fixtures = concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures"); - let paths: Vec = match std::env::var("EC_AV1_GATE_DUMP_PIN") { - Ok(p) => vec![p], - Err(_) => [ - "warp-mismatch", - "warp-flake-5", - "warp-flake-7", - "ii-flake-1", - "ii-flake-2", - "ii-flake-3", - "ii-flake-5", - "ii-flake-6", - "ii-flake-7", - "ii-flake-8", + // Every pin is COMMITTED under `crates/ec-av1/fixtures/` and named by a + // string literal, which is the convention every other pinned gate here + // uses and the only shape the pin census can resolve name-by-name. The + // old shape -- one GITIGNORED root directory literal plus a runtime + // name list formatted against it -- can never be satisfied by a + // committed tree, so this gate skipped GREEN having tested nothing. + let pins = match std::env::var("EC_AV1_GATE_DUMP_PIN") { + Ok(p) => vec![std::path::PathBuf::from(p)], + Err(_) => vec![ + crate_pin("warp-mismatch.obu"), + crate_pin("warp-flake-5.obu"), + crate_pin("warp-flake-7.obu"), + crate_pin("ii-flake-1.obu"), + crate_pin("ii-flake-2.obu"), + crate_pin("ii-flake-3.obu"), + crate_pin("ii-flake-5.obu"), + crate_pin("ii-flake-6.obu"), + crate_pin("ii-flake-7.obu"), + crate_pin("ii-flake-8.obu"), // switchable_interp missing from reset_counts (counter // saturation slowed the adaptation rate) -- unrelated to // interintra, caught by the same gate. - "ii-flake-9", + crate_pin("ii-flake-9.obu"), // lane-rect r2: HORZ strip rect defects (mvstack size_h, // warp sample/projection dims, OBMC overlap, deblock tx-h). - "rect-flake-1", + crate_pin("rect-flake-1.obu"), // scan_row/scan_col weight `inc` min'd by the wrong candidate // axis (width vs height) -- ties reordered DRL entry 1 for a // block under a 32x16 strip, and suppressed the -5 extended // row scan. - "rect-flake-2", + crate_pin("rect-flake-2.obu"), // overlappable_left stepped the vertical walk by the // neighbour's WIDTH: a 32x16 left strip swallowed the strip // below it, blending the wrong OBMC prediction there. - "rect-flake-3", - ] - .iter() - .map(|n| format!("{fixtures}/{n}.obu")) - .collect(), + crate_pin("rect-flake-3.obu"), + ], }; - for path in paths { - eprintln!("pin: {path}"); + for path in pins { + eprintln!("pin: {}", path.display()); check_pinned_warp_stream(&path); } } - fn check_pinned_warp_stream(path: &str) { + fn check_pinned_warp_stream(path: &std::path::Path) { use crate::decode::warp_selected_hits; - let stream = std::fs::read(path).expect("reading pinned stream"); + let name = path + .file_name() + .map(|n| n.to_string_lossy().into_owned()) + .unwrap_or_default(); + let stream = require_pin(path, &name); let before = warp_selected_hits(); let frames = decode_stream(&stream).expect("pinned stream must decode"); eprintln!( diff --git a/crates/ec-flac/tests/encode_matrix.rs b/crates/ec-flac/tests/encode_matrix.rs index 8eebeabf..24a3180c 100644 --- a/crates/ec-flac/tests/encode_matrix.rs +++ b/crates/ec-flac/tests/encode_matrix.rs @@ -20,6 +20,30 @@ struct Source { bits: u32, } +/// Fixture-presence probe for the encoder matrix corpus. +/// Returns whether the fixture is present, but never silently: under +/// `EC_REQUIRE_FIXTURES=1` an absent fixture is a hard failure naming the path +/// and the script that regenerates it, so a host whose fixture library drifted +/// reports RED instead of a green SKIP (class: gate-skips-on-its-own-failure; +/// model `have_ffmpeg` in crates/ec-av1/src/stream.rs, which was silently +/// short-circuited because the probe ran first in a compound `if`). +/// +/// Order is load-bearing: probe, assert, return. Never merge the probe into +/// the same `if` as the escape. +fn require_fixture(path: &Path, generator: &str) -> bool { + let present = path.exists(); + assert!( + present || std::env::var_os("EC_REQUIRE_FIXTURES").is_none(), + "EC_REQUIRE_FIXTURES=1 but fixture {} is absent -- regenerate with: {}", + path.display(), + generator + ); + if !present { + eprintln!("SKIP: fixture {} absent", path.display()); + } + present +} + fn fixtures() -> PathBuf { Path::new(env!("CARGO_MANIFEST_DIR")).join("../../fixtures") } @@ -124,7 +148,12 @@ fn matrix() -> Vec { let audio = fixtures().join("audio"); let vectors = fixtures().join("vectors/flac-xiph/flac-test-files-main/subset"); let mut paths: Vec = Vec::new(); - if let Ok(entries) = std::fs::read_dir(&audio) { + // Probe first, assert inside the helper, and only then take the empty-list + // branch: under EC_REQUIRE_FIXTURES the assert fires instead of a silent + // skip that leaves every loop below running zero times. + if require_fixture(&audio, "scripts/gen-fixtures.sh") { + let entries = std::fs::read_dir(&audio) + .unwrap_or_else(|e| panic!("read fixture dir {}: {e}", audio.display())); let mut found: Vec = entries .filter_map(|e| e.ok().map(|e| e.path())) .filter(|p| { @@ -136,13 +165,15 @@ fn matrix() -> Vec { paths.append(&mut found); } // Depth coverage the generated fixtures do not have: 24- and 20-bit. - for name in [ - "28 - high resolution audio, default settings.flac", - "37 - 20 bit per sample.flac", - ] { - let p = vectors.join(name); - if p.exists() { - paths.push(p); + if require_fixture(&vectors, "scripts/fetch-vectors.sh") { + for name in [ + "28 - high resolution audio, default settings.flac", + "37 - 20 bit per sample.flac", + ] { + let p = vectors.join(name); + if p.exists() { + paths.push(p); + } } } paths.iter().filter_map(|p| probe(p)).collect() @@ -155,6 +186,12 @@ fn encoded_streams_decode_back_bit_exact_through_ffmpeg() { eprintln!("skipped: fixtures not generated"); return; } + // Non-empty floor: the loop below must run, not zero times. + assert!( + sources.len() >= 5, + "encoder matrix holds {} usable sources, expected at least 5", + sources.len() + ); let dir = workdir("roundtrip"); let config = EncoderConfig::default(); let mut failures = Vec::new(); @@ -227,10 +264,18 @@ fn encoded_streams_decode_back_bit_exact_through_ffmpeg() { #[test] fn our_streams_survive_a_probe_and_state_their_shape() { - let Some(source) = matrix().into_iter().find(|s| s.channels == 6) else { - eprintln!("skipped: no 5.1 fixture"); + // The 5.1 source this test needs is a named fixture, not a shape we hope the + // matrix happens to contain: probe it first so EC_REQUIRE_FIXTURES fails on + // a drifted library instead of skipping. + let surround = fixtures().join("audio/flac-5.1-44100.flac"); + if !require_fixture(&surround, "scripts/gen-fixtures.sh") { return; - }; + } + let source = matrix() + .into_iter() + .find(|s| s.channels == 6) + .or_else(|| probe(&surround)) + .expect("5.1 source in the encoder matrix"); let dir = workdir("probe"); let pcm = ffmpeg_pcm(&source.path, source.bits); let samples = samples_from_pcm(&pcm, source.bits); diff --git a/crates/ec-h264/tests/encode.rs b/crates/ec-h264/tests/encode.rs index 6e82eae0..54472a26 100644 --- a/crates/ec-h264/tests/encode.rs +++ b/crates/ec-h264/tests/encode.rs @@ -435,6 +435,30 @@ fn have_ffmpeg() -> bool { .is_ok_and(|s| s.success()) } +/// Fixture-presence probe for ``. +/// Returns whether the fixture is present, but never silently: under +/// `EC_REQUIRE_FIXTURES=1` an absent fixture is a hard failure naming the path +/// and the script that regenerates it, so a host whose fixture library drifted +/// reports RED instead of a green SKIP (class: gate-skips-on-its-own-failure; +/// model `have_ffmpeg` in crates/ec-av1/src/stream.rs, which was silently +/// short-circuited because the probe ran first in a compound `if`). +/// +/// Order is load-bearing: probe, assert, return. Never merge the probe into +/// the same `if` as the escape. +fn require_fixture(path: &std::path::Path, generator: &str) -> bool { + let present = path.exists(); + assert!( + present || std::env::var_os("EC_REQUIRE_FIXTURES").is_none(), + "EC_REQUIRE_FIXTURES=1 but fixture {} is absent -- regenerate with: {}", + path.display(), + generator + ); + if !present { + eprintln!("SKIP: fixture {} absent", path.display()); + } + present +} + /// Decode an Annex B stream with ffmpeg, returning one I420 triple per picture. fn ffmpeg_decode(stream: &[u8], w: usize, h: usize, extra: &[&str]) -> Option> { // Distinct per call, not per process: several #[test]s in this binary @@ -702,10 +726,10 @@ fn real_library_frames_encode_and_decode_exactly() { } let manifest = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) .join("../../fixtures/real-library-manifest.tsv"); - let Ok(text) = std::fs::read_to_string(&manifest) else { - eprintln!("SKIP real_library_frames: {} missing", manifest.display()); + if !require_fixture(&manifest, "scripts/scan-real-library.sh") { return; - }; + } + let text = std::fs::read_to_string(&manifest).expect("manifest reads"); // The first 8-bit 4:2:0 H.264 mp4 of at least 720p in the manifest. let mut source = None; for line in text.lines().skip(1) { @@ -726,6 +750,14 @@ fn real_library_frames_encode_and_decode_exactly() { break; } let Some((path, w, h)) = source else { + // A manifest with no qualifying row is a corpus that drifted, not a + // reason to report PASS for a sweep that never ran. + assert!( + std::env::var_os("EC_REQUIRE_FIXTURES").is_none(), + "EC_REQUIRE_FIXTURES=1 but {} lists no H.264 4:2:0 mp4 of at least \ + 720p -- regenerate with: scripts/scan-real-library.sh", + manifest.display() + ); eprintln!("SKIP real_library_frames: no H.264 4:2:0 mp4 in the manifest"); return; }; diff --git a/crates/ec-mp3/tests/encode_matrix.rs b/crates/ec-mp3/tests/encode_matrix.rs index 0342de24..73a45b25 100644 --- a/crates/ec-mp3/tests/encode_matrix.rs +++ b/crates/ec-mp3/tests/encode_matrix.rs @@ -45,6 +45,30 @@ fn fixtures() -> PathBuf { Path::new(env!("CARGO_MANIFEST_DIR")).join("../../fixtures") } +/// Fixture-presence probe for the encoder matrix corpus. +/// Returns whether the fixture is present, but never silently: under +/// `EC_REQUIRE_FIXTURES=1` an absent fixture is a hard failure naming the path +/// and the script that regenerates it, so a host whose fixture library drifted +/// reports RED instead of a green SKIP (class: gate-skips-on-its-own-failure; +/// model `have_ffmpeg` in crates/ec-av1/src/stream.rs, which was silently +/// short-circuited because the probe ran first in a compound `if`). +/// +/// Order is load-bearing: probe, assert, return. Never merge the probe into +/// the same `if` as the escape. +fn require_fixture(path: &Path, generator: &str) -> bool { + let present = path.exists(); + assert!( + present || std::env::var_os("EC_REQUIRE_FIXTURES").is_none(), + "EC_REQUIRE_FIXTURES=1 but fixture {} is absent -- regenerate with: {}", + path.display(), + generator + ); + if !present { + eprintln!("SKIP: fixture {} absent", path.display()); + } + present +} + fn workdir(test: &str) -> PathBuf { let dir = std::env::temp_dir().join(format!("ec-mp3-{}-{test}", std::process::id())); std::fs::create_dir_all(&dir).expect("create work dir"); @@ -360,11 +384,15 @@ fn vbr_mean_bitrate_tracks_quality_on_music() { #[test] fn encodes_above_the_incumbent_bar() { let dir = fixtures().join("audio"); + // Probe first, assert inside the helper, and only then take the empty-list + // branch: under EC_REQUIRE_FIXTURES the assert fires instead of a silent + // skip that leaves every row below running zero times. + if !require_fixture(&dir, "scripts/gen-fixtures.sh") { + return; + } let mut sources: Vec = std::fs::read_dir(&dir) - .into_iter() - .flatten() - .flatten() - .map(|e| e.path()) + .unwrap_or_else(|e| panic!("read fixture dir {}: {e}", dir.display())) + .filter_map(|e| e.ok().map(|e| e.path())) .filter(|p| { let name = p.file_name().map(|n| n.to_string_lossy().to_string()); name.is_some_and(|n| n.starts_with("wav16-") || n.starts_with("mp3src-")) @@ -376,10 +404,17 @@ fn encodes_above_the_incumbent_bar() { let name = p.file_name().unwrap().to_string_lossy().to_string(); name.contains("mono") || name.contains("stereo") }); - if sources.is_empty() { - eprintln!("no WAV fixtures: run scripts/gen-fixtures.sh"); - return; - } + // The corpus is eight committed WAVs (four `mp3src-*`, four `wav16-*`), + // all produced by `scripts/gen-fixtures.sh`. Fewer than all eight means + // the library drifted, not that the rows passed. + assert!( + sources.len() >= 8, + "only {} of the 8 mp3 encoder-matrix WAV fixtures are present in {} -- \ + regenerate with: scripts/gen-fixtures.sh", + sources.len(), + dir.display() + ); + let mut decoded_rows = 0usize; let work = workdir("encode"); println!( "{:<30} {:>5} {:>6} {:>3} {:>9} {:>8} {:>9}", @@ -390,6 +425,7 @@ fn encodes_above_the_incumbent_bar() { let Some((pcm, rate, channels)) = read_wav(source) else { continue; }; + decoded_rows += 1; for kbps in BITRATES { let bar = bar_for(&source.file_name().unwrap().to_string_lossy(), kbps); let bytes = encode(&pcm, rate, channels, kbps); @@ -455,6 +491,14 @@ fn encodes_above_the_incumbent_bar() { } } } + // A present-but-unreadable WAV takes the `read_wav` skip above, so the + // corpus count alone would leave this green having measured nothing. + assert!( + decoded_rows == sources.len(), + "only {decoded_rows} of {} fixtures decoded; a present fixture that \ + ffmpeg cannot read is a broken fixture, not a passing row", + sources.len() + ); assert!(failures.is_empty(), "{failures:#?}"); } diff --git a/crates/ec-vorbis/tests/oracle.rs b/crates/ec-vorbis/tests/oracle.rs index c112af42..bc0f4de5 100644 --- a/crates/ec-vorbis/tests/oracle.rs +++ b/crates/ec-vorbis/tests/oracle.rs @@ -603,7 +603,11 @@ fn onset_after_silence_has_no_pre_echo() { // last few hundred samples before it cannot hide behind a guard band, and // the peak is barred too. let amp = 0.7f64; - for (rate, layouts) in [(44_100u32, &[1usize, 2][..]), (48_000, &[1, 2, 6]), (96_000, &[6])] { + for (rate, layouts) in [ + (44_100u32, &[1usize, 2][..]), + (48_000, &[1, 2, 6]), + (96_000, &[6]), + ] { let grid = 16 * 1024usize; let onsets = [0.3333f64, 0.5, 0.7321, 0.9137, 1.0] .into_iter() @@ -618,7 +622,8 @@ fn onset_after_silence_has_no_pre_echo() { let start = onset + 11 * c; for i in 0..tone_len { let t = i as f64 / f64::from(rate); - plane[start + i] = (amp * (2.0 * std::f64::consts::PI * hz * t).sin()) as f32; + plane[start + i] = + (amp * (2.0 * std::f64::consts::PI * hz * t).sin()) as f32; } } let name = format!("onset-{rate}-{channels}ch-{onset}.ogg"); @@ -650,7 +655,10 @@ fn onset_after_silence_has_no_pre_echo() { gap_rms <= 0.002 * tone_rms, "{name}/{label} ch{c}: gap RMS {gap_rms:.6} vs tone RMS {tone_rms:.6}" ); - assert!(f64::from(peak) <= 0.01 * amp, "{name}/{label} ch{c}: gap peak {peak:.4}"); + assert!( + f64::from(peak) <= 0.01 * amp, + "{name}/{label} ch{c}: gap peak {peak:.4}" + ); } }; let (ours, _) = our_decode(&path); @@ -717,8 +725,8 @@ fn the_rate_loop_tracks_the_target_bitrate() { fn quiet_content_reaches_the_target_or_is_transparent() { let rate = 48_000u32; let samples = rate as usize * 3; - let fixture = ffmpeg_decode(&fixtures().join("audio/wav16-stereo-48000.wav")) - .expect("fixture decodes"); + let fixture = + ffmpeg_decode(&fixtures().join("audio/wav16-stereo-48000.wav")).expect("fixture decodes"); assert_eq!(fixture.1, rate); let attenuate = |mut source: Vec>| { for channel in source.iter_mut() { @@ -740,7 +748,10 @@ fn quiet_content_reaches_the_target_or_is_transparent() { .fold(1.0f64, f64::min) }; let loud = busy(2, rate, samples); - let loud_corr = corr_at(&encode_to_file(&loud, rate, 128_000, "loud-128k.ogg"), &loud); + let loud_corr = corr_at( + &encode_to_file(&loud, rate, 128_000, "loud-128k.ogg"), + &loud, + ); let quiet_noise = attenuate(loud); let mut quiet_tones = attenuate(tones(2, rate, samples)); for (channel, noise) in quiet_tones.iter_mut().zip(busy(2, rate, samples)) { @@ -757,11 +768,19 @@ fn quiet_content_reaches_the_target_or_is_transparent() { let mut measured = Vec::new(); let mut spent = Vec::new(); for target in [96_000i32, 128_000, 192_000] { - let path = encode_to_file(source, rate, target, &format!("{name}-{}k.ogg", target / 1000)); + let path = encode_to_file( + source, + rate, + target, + &format!("{name}-{}k.ogg", target / 1000), + ); let bytes = std::fs::metadata(&path).expect("file").len(); let kbps = bytes as f64 * 8.0 * f64::from(rate) / source[0].len() as f64 / 1000.0; let corr = corr_at(&path, source); - println!("{name}: target {} kbps -> {kbps:.0} kbps, corr {corr:.4}", target / 1000); + println!( + "{name}: target {} kbps -> {kbps:.0} kbps, corr {corr:.4}", + target / 1000 + ); let target_kbps = f64::from(target) / 1000.0; let within_25pct = (kbps - target_kbps).abs() / target_kbps < 0.25; let transparent_undershoot = kbps < target_kbps && corr >= 0.999; @@ -776,7 +795,10 @@ fn quiet_content_reaches_the_target_or_is_transparent() { } } if spent.iter().all(|&s| s) { - assert!(measured[0] < measured[1] && measured[1] < measured[2], "{name}: {measured:?}"); + assert!( + measured[0] < measured[1] && measured[1] < measured[2], + "{name}: {measured:?}" + ); } } } @@ -800,7 +822,10 @@ fn residue_histogram_vs_reference() { ("reell", "~/Music/reell.mp4"), ("reelm", "~/Music/reelm.wav"), ("dl8a", "~/Downloads/8a3b6d1d19.mp3"), - ("hein", "~/Downloads/reelm.mp3"), + ( + "hein", + "~/Downloads/reelm.mp3", + ), ]; let bitrate = 128_000i32; let rate = 48_000u32; @@ -812,11 +837,17 @@ fn residue_histogram_vs_reference() { std::fs::create_dir_all(&out_dir).expect("out dir"); let mut report = String::new(); report.push_str("# Residue histogram: ours vs libvorbis reference\n\n"); - report.push_str(&format!("Bitrate: {} kbps, {} Hz, {}ch, {} s max\n\n", - bitrate / 1000, rate, channels, max_samples / rate as usize)); + report.push_str(&format!( + "Bitrate: {} kbps, {} Hz, {}ch, {} s max\n\n", + bitrate / 1000, + rate, + channels, + max_samples / rate as usize + )); let mut total_ours_bytes = 0u64; let mut total_ref_bytes = 0u64; + let mut rows = 0usize; for &(name, src_path) in sources { let expanded = shellexpand(src_path); let src = PathBuf::from(&expanded); @@ -824,6 +855,7 @@ fn residue_histogram_vs_reference() { report.push_str(&format!("## {name}: SKIP (file not found: {expanded})\n\n")); continue; } + rows += 1; // Decode source with ffmpeg, limit duration. let Some((source_pcm, src_rate)) = ffmpeg_decode_limited(&src, rate, max_samples) else { report.push_str(&format!("## {name}: SKIP (ffmpeg decode failed)\n\n")); @@ -856,9 +888,19 @@ fn residue_histogram_vs_reference() { // target; audio-only input encodes at the requested rate. .args(["-y", "-v", "error", "-i"]) .arg(&src) - .args(["-vn", "-t", &format!("{}", max_samples / rate as usize), - "-ac", "2", "-ar", "48000", - "-c:a", "libvorbis", "-b:a", "128k"]) + .args([ + "-vn", + "-t", + &format!("{}", max_samples / rate as usize), + "-ac", + "2", + "-ar", + "48000", + "-c:a", + "libvorbis", + "-b:a", + "128k", + ]) .arg(&ref_ogg) .status(); let (ref_residue, ref_split) = match ref_status { @@ -919,11 +961,27 @@ fn residue_histogram_vs_reference() { let r_spend: u64 = r[1..].iter().sum(); let ratio = if r_spend > 0 { o_spend as f64 / r_spend as f64 - } else { f64::INFINITY }; + } else { + f64::INFINITY + }; report.push_str(&format!( "| {} | {}/{} | {}/{} | {}/{} | {}/{} | {}/{} | {}/{} | {}/{} | {:.2} |\n", - band, o[0], r[0], o[1], r[1], o[2], r[2], o[3], r[3], o[4], r[4], o[5], r[5], - o_total, r_total, ratio, + band, + o[0], + r[0], + o[1], + r[1], + o[2], + r[2], + o[3], + r[3], + o[4], + r[4], + o[5], + r[5], + o_total, + r_total, + ratio, )); } @@ -967,18 +1025,26 @@ fn residue_histogram_vs_reference() { report.push_str(&format!( "\nshape Bark 3-22: max dist {max_d:.3}, bands >= 0.15: {over}/{} — {}\n", in_scope.len(), - if over == 0 { "SHAPE PASS" } else { "shape fail" }, + if over == 0 { + "SHAPE PASS" + } else { + "shape fail" + }, )); } report.push_str("\n"); } + // The seven sources are the user's own library, so each may be absent on a + // given host -- but a run that encoded none of them is a measurement of + // nothing, and the report it writes looks the same as a real one. + assert!(rows > 0, "no library sources were readable"); report.push_str(&format!( "\nTotal bytes: ours {total_ours_bytes} vs ref {total_ref_bytes} ({:.2}x)\n", total_ours_bytes as f64 / total_ref_bytes as f64, )); - let report_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) - .join("../../lanes/vorbis-psy-r1.histogram.txt"); + let report_path = + PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../lanes/vorbis-psy-r1.histogram.txt"); let mut f = File::create(&report_path).expect("create report"); f.write_all(report.as_bytes()).expect("write report"); println!("Histogram report: {}", report_path.display()); @@ -1028,7 +1094,10 @@ fn decode_capture(path: &Path) -> Vec<(usize, Vec>)> { /// Bit split summed over the stream: (floor bits, residue bits, packet bits, /// non-zero residue count) — bits per coded value is the coding-efficiency oracle. -fn bit_split_summary(split: &[(u64, u64, u64)], residue: &[(usize, Vec>)]) -> (u64, u64, u64, u64) { +fn bit_split_summary( + split: &[(u64, u64, u64)], + residue: &[(usize, Vec>)], +) -> (u64, u64, u64, u64) { let (mut f, mut r, mut p) = (0u64, 0u64, 0u64); for &(a, b, c) in split { f += a; @@ -1037,7 +1106,11 @@ fn bit_split_summary(split: &[(u64, u64, u64)], residue: &[(usize, Vec> } let nz: u64 = residue .iter() - .map(|(_, chs)| chs.iter().map(|c| c.iter().filter(|&&v| v != 0).count() as u64).sum::()) + .map(|(_, chs)| { + chs.iter() + .map(|c| c.iter().filter(|&&v| v != 0).count() as u64) + .sum::() + }) .sum(); (f, r, p, nz) } @@ -1100,25 +1173,45 @@ fn compare_captures( } } if diffs.is_empty() { - (true, format!("identical histograms ({} vs {} blocks)", a.len(), b.len())) + ( + true, + format!("identical histograms ({} vs {} blocks)", a.len(), b.len()), + ) } else { - (false, format!( - "{} vs {} blocks; first diffs: {}", - a.len(), - b.len(), - diffs.iter().take(5).cloned().collect::>().join("; ") - )) + ( + false, + format!( + "{} vs {} blocks; first diffs: {}", + a.len(), + b.len(), + diffs.iter().take(5).cloned().collect::>().join("; ") + ), + ) } } /// Decode with ffmpeg into planar f32, resampled to `rate`, limited to `max_samples`. -fn ffmpeg_decode_limited(path: &Path, rate: u32, max_samples: usize) -> Option<(Vec>, u32)> { +fn ffmpeg_decode_limited( + path: &Path, + rate: u32, + max_samples: usize, +) -> Option<(Vec>, u32)> { let out = Command::new("ffmpeg") .args(["-v", "error", "-i"]) .arg(path) - .args(["-t", &format!("{}", max_samples / rate as usize), - "-ac", "2", "-ar", &rate.to_string(), - "-f", "f32le", "-acodec", "pcm_f32le", "-"]) + .args([ + "-t", + &format!("{}", max_samples / rate as usize), + "-ac", + "2", + "-ar", + &rate.to_string(), + "-f", + "f32le", + "-acodec", + "pcm_f32le", + "-", + ]) .output() .expect("ffmpeg runs"); if !out.stderr.is_empty() { @@ -1179,7 +1272,6 @@ fn shellexpand(path: &str) -> String { } } - /// Full-file sweep over the user's library at the two managed rates: ours /// encoded at the size libvorbis actually produced (ffmpeg's -b:a is /// unmanaged VBR, 10-30% under nominal on real music), bytes within ±3% of @@ -1196,19 +1288,28 @@ fn real_library_sweep_vs_reference() { ("reell", "~/Music/reell.mp4"), ("reelm", "~/Music/reelm.wav"), ("dl8a", "~/Downloads/8a3b6d1d19.mp3"), - ("hein", "~/Downloads/reelm.mp3"), + ( + "hein", + "~/Downloads/reelm.mp3", + ), ]; let rate = 48_000u32; let max_samples = rate as usize * 600; let out_dir = scratch().join("vorbis7-sweep"); std::fs::create_dir_all(&out_dir).expect("out dir"); - let mut table = String::from("source kbps ours_kbps ref_kbps rate% corr_ours corr_ref gap minsec_o minsec_r drops verdict\n"); + let mut table = String::from( + "source kbps ours_kbps ref_kbps rate% corr_ours corr_ref gap minsec_o minsec_r drops verdict\n", + ); let mut failures = Vec::new(); let only = std::env::var("SWEEP_ONLY").ok(); let dump_drops = std::env::var("DROPS_DUMP").is_ok(); let mut drops = String::new(); + let mut rows = 0usize; for &(name, src_path) in sources { - if only.as_deref().is_some_and(|o| !o.split(',').any(|n| n == name)) { + if only + .as_deref() + .is_some_and(|o| !o.split(',').any(|n| n == name)) + { continue; } let src = PathBuf::from(shellexpand(src_path)); @@ -1216,6 +1317,7 @@ fn real_library_sweep_vs_reference() { table.push_str(&format!("{name:<7} - SKIP (missing)\n")); continue; } + rows += 1; let Some((source_pcm, _)) = ffmpeg_decode_limited(&src, rate, max_samples) else { table.push_str(&format!("{name:<7} - SKIP (decode)\n")); continue; @@ -1229,14 +1331,31 @@ fn real_library_sweep_vs_reference() { let status = Command::new("ffmpeg") .args(["-y", "-v", "error", "-i"]) .arg(&src) - .args(["-vn", "-t", "600", "-ac", "2", "-ar", "48000", "-c:a", "libvorbis", "-b:a", &format!("{kbps}k")]) + .args([ + "-vn", + "-t", + "600", + "-ac", + "2", + "-ar", + "48000", + "-c:a", + "libvorbis", + "-b:a", + &format!("{kbps}k"), + ]) .arg(&reference) .status() .expect("ffmpeg runs"); assert!(status.success(), "libvorbis encode of {name} at {kbps}k"); let bytes = |p: &Path| std::fs::metadata(p).expect("size").len() as f64; let ref_kbps = bytes(&reference) * 8.0 / seconds / 1000.0; - let (ours, block_log) = encode_to_file_with_log(&source_pcm, rate, (ref_kbps * 1000.0).round() as i32, &format!("vorbis7-sweep/ours-{name}-{kbps}k.ogg")); + let (ours, block_log) = encode_to_file_with_log( + &source_pcm, + rate, + (ref_kbps * 1000.0).round() as i32, + &format!("vorbis7-sweep/ours-{name}-{kbps}k.ogg"), + ); let ours_kbps = bytes(&ours) * 8.0 / seconds / 1000.0; let rate_pct = (ours_kbps / ref_kbps - 1.0) * 100.0; // Whole-file corr plus a per-second trace: a dropout (the @@ -1246,12 +1365,18 @@ fn real_library_sweep_vs_reference() { let corr_of = |p: &Path| -> (f64, Vec) { let (pcm, _) = our_decode(p); let n = pcm[0].len().min(source_pcm[0].len()); - let mean = (0..2).map(|c| correlation(&pcm[c][..n], &source_pcm[c][..n])).sum::() / 2.0; + let mean = (0..2) + .map(|c| correlation(&pcm[c][..n], &source_pcm[c][..n])) + .sum::() + / 2.0; let step = rate as usize; let per_second = (0..n / step) .map(|s| { let r = s * step..(s + 1) * step; - (0..2).map(|c| correlation(&pcm[c][r.clone()], &source_pcm[c][r.clone()])).sum::() / 2.0 + (0..2) + .map(|c| correlation(&pcm[c][r.clone()], &source_pcm[c][r.clone()])) + .sum::() + / 2.0 }) .collect(); (mean, per_second) @@ -1275,7 +1400,9 @@ fn real_library_sweep_vs_reference() { .collect(); let pass = rate_pct.abs() <= 3.0 && gap <= 0.005 && dropouts == 0; if !pass { - failures.push(format!("{name}@{kbps}k rate {rate_pct:+.2}% gap {gap:.4} dropouts {dropouts}")); + failures.push(format!( + "{name}@{kbps}k rate {rate_pct:+.2}% gap {gap:.4} dropouts {dropouts}" + )); } table.push_str(&format!( "{name:<7} {kbps:<6} {ours_kbps:<9.1} {ref_kbps:<8.1} {rate_pct:+6.2} {corr_ours:<9.4} {corr_ref:<8.4} {gap:<7.4} {min_ours:<8.3} {min_ref:<7.3} {dropouts:<5} {}\n", @@ -1326,6 +1453,7 @@ fn real_library_sweep_vs_reference() { Path::new(env!("CARGO_MANIFEST_DIR")).join("../../lanes/vorbis-psy-r1.sweep.txt"), &table, ); + assert!(rows > 0, "no library sources were readable"); assert!(failures.is_empty(), "sweep failures: {failures:?}"); } @@ -1385,7 +1513,10 @@ fn band_error_vs_reference() { ("reell", "~/Music/reell.mp4"), ("reelm", "~/Music/reelm.wav"), ("dl8a", "~/Downloads/8a3b6d1d19.mp3"), - ("hein", "~/Downloads/reelm.mp3"), + ( + "hein", + "~/Downloads/reelm.mp3", + ), ]; let rate = 48_000u32; let max_samples = rate as usize * 600; @@ -1412,8 +1543,12 @@ fn band_error_vs_reference() { let mut bands = String::from("# Band error: ours vs libvorbis, both via our decoder\n\n"); let mut bits = String::from("# Bit split over full sources, same rows as the band error\n\n"); let only = std::env::var("SWEEP_ONLY").ok(); + let mut rows = 0usize; for &(name, src_path) in sources { - if only.as_deref().is_some_and(|o| !o.split(',').any(|n| n == name)) { + if only + .as_deref() + .is_some_and(|o| !o.split(',').any(|n| n == name)) + { continue; } let src = PathBuf::from(shellexpand(src_path)); @@ -1421,6 +1556,7 @@ fn band_error_vs_reference() { bands.push_str(&format!("## {name}: SKIP (missing)\n\n")); continue; } + rows += 1; let Some((source_pcm, _)) = ffmpeg_decode_limited(&src, rate, max_samples) else { bands.push_str(&format!("## {name}: SKIP (decode)\n\n")); continue; @@ -1433,7 +1569,19 @@ fn band_error_vs_reference() { let status = Command::new("ffmpeg") .args(["-y", "-v", "error", "-i"]) .arg(&src) - .args(["-vn", "-t", "600", "-ac", "2", "-ar", "48000", "-c:a", "libvorbis", "-b:a", &format!("{kbps}k")]) + .args([ + "-vn", + "-t", + "600", + "-ac", + "2", + "-ar", + "48000", + "-c:a", + "libvorbis", + "-b:a", + &format!("{kbps}k"), + ]) .arg(&reference) .status() .expect("ffmpeg runs"); @@ -1457,7 +1605,10 @@ fn band_error_vs_reference() { }; let (ref_pcm, ref_split) = { let (residue, split) = decode_capture_with_bits(&reference); - (our_decode(&reference).0, bit_split_summary(&split, &residue)) + ( + our_decode(&reference).0, + bit_split_summary(&split, &residue), + ) }; // Bit-split block: (floor, residue, packet, non-zero) per stream. @@ -1494,8 +1645,9 @@ fn band_error_vs_reference() { let (mut e_src, mut e_ours, mut e_ref) = (vec![0f64; nb], vec![0f64; nb], vec![0f64; nb]); let (mut err_ours, mut err_ref) = (vec![0f64; nb], vec![0f64; nb]); - let mut spec: Vec<(Vec, Vec)> = - (0..3).map(|_| (vec![0.0; FRAME], vec![0.0; FRAME])).collect(); + let mut spec: Vec<(Vec, Vec)> = (0..3) + .map(|_| (vec![0.0; FRAME], vec![0.0; FRAME])) + .collect(); let mut start = 0; while start + FRAME <= n { for ch in 0..2 { @@ -1523,7 +1675,13 @@ fn band_error_vs_reference() { } start += HOP; } - let db = |e: f64, s: f64| if s > 0.0 { 10.0 * (e / s).log10() } else { f64::NAN }; + let db = |e: f64, s: f64| { + if s > 0.0 { + 10.0 * (e / s).log10() + } else { + f64::NAN + } + }; bands.push_str(&format!( "## {name} @ {kbps}k (ours {ours_kbps:.1} vs ref {ref_kbps:.1} kbps)\n" )); @@ -1560,13 +1718,16 @@ fn band_error_vs_reference() { ); } } + // Both report files above are written unconditionally, so a run that + // measured no source writes a report indistinguishable from a real one. + assert!(rows > 0, "no library sources were readable"); for (text, file) in [ (&bands, "vorbis-psy-r1.bands.txt"), (&bits, "vorbis-psy-r1.bits.txt"), ] { let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) .join("../../lanes") - .join(file); + .join(file); let mut f = File::create(&path).expect("create report"); f.write_all(text.as_bytes()).expect("write report"); println!("{file}: {}", path.display()); diff --git a/crates/ec-vp9/tests/hbd_exact.rs b/crates/ec-vp9/tests/hbd_exact.rs index bcd4d984..893180f8 100644 --- a/crates/ec-vp9/tests/hbd_exact.rs +++ b/crates/ec-vp9/tests/hbd_exact.rs @@ -3,21 +3,47 @@ //! yuv420p10le -`). Pre-fix the decoder refuses `profile 2` by name, so this //! test fails at the first frame; post-fix every shown frame matches. //! -//! Media-gated: the 10-bit corpus streams are gitignored, so the test skips -//! by name when the fixture is absent (set the fixture tree up per the lane -//! notes). The 4:4:4 and 12-bit shapes are covered by `subsampling_exact.rs`. +//! Media-gated: the 10-bit corpus streams are gitignored, so the test prints +//! SKIP when the fixture is absent (set the fixture tree up per the lane +//! notes) -- and goes RED instead under `EC_REQUIRE_FIXTURES=1`, so a drifted +//! fixture library can never read as a pass. The 4:4:4 and 12-bit shapes are +//! covered by `subsampling_exact.rs`. mod ivf; use ec_vp9::decode::Decoder; use std::path::{Path, PathBuf}; -fn fixture(name: &str) -> Option { +/// Fixture-presence probe for the 10-bit corpus IVF `profile2_10bit_is_byte_exact` +/// decodes and compares against ffmpeg. +/// Returns whether the fixture is present, but never silently: under +/// `EC_REQUIRE_FIXTURES=1` an absent fixture is a hard failure naming the path +/// and the script that regenerates it, so a host whose fixture library drifted +/// reports RED instead of a green SKIP (class: gate-skips-on-its-own-failure; +/// model `have_ffmpeg` in crates/ec-av1/src/stream.rs, which was silently +/// short-circuited because the probe ran first in a compound `if`). +/// +/// Order is load-bearing: probe, assert, return. Never merge the probe into +/// the same `if` as the escape. +fn require_fixture(path: &std::path::Path, generator: &str) -> bool { + let present = path.exists(); + assert!( + present || std::env::var_os("EC_REQUIRE_FIXTURES").is_none(), + "EC_REQUIRE_FIXTURES=1 but fixture {} is absent -- regenerate with: {}", + path.display(), + generator + ); + if !present { + eprintln!("SKIP: fixture {} absent", path.display()); + } + present +} + +fn fixture(name: &str) -> PathBuf { let mut p = PathBuf::from(env!("CARGO_MANIFEST_DIR")); p.pop(); p.pop(); - p = p.join("fixtures/bitstreams").join(name); - p.exists().then_some(p) + p.join("fixtures/bitstreams").join(name) } /// ffmpeg's rawvideo `yuv420p10le` bytes (little-endian u16 samples, @@ -56,10 +82,10 @@ fn decode_all(path: &Path) -> (Vec>, u8) { /// produces, sample for sample. #[test] fn profile2_10bit_is_byte_exact() { - let Some(a) = fixture("vp9-1080p-23.976-10bit.ivf") else { - eprintln!("SKIP profile2_10bit_is_byte_exact: 10-bit fixture absent"); + let a = fixture("vp9-1080p-23.976-10bit.ivf"); + if !require_fixture(&a, "scripts/gen-bitstream-fixtures.sh") { return; - }; + } let (ours, bd) = decode_all(&a); assert_eq!(bd, 10, "the fixture must decode at 10 bits"); let want = ffmpeg_raw_yuv10(&a); diff --git a/crates/ec-vp9/tests/inter_pixels_exact.rs b/crates/ec-vp9/tests/inter_pixels_exact.rs index 689beed4..795d4c16 100644 --- a/crates/ec-vp9/tests/inter_pixels_exact.rs +++ b/crates/ec-vp9/tests/inter_pixels_exact.rs @@ -9,6 +9,30 @@ mod ivf; use ec_vp9::decode::Decoder; +/// Fixture-presence probe for the 120-frame 1080p corpus IVF +/// `corpus_1080p_60fps_matches_ffmpeg_past_frame_72` decodes. +/// Returns whether the fixture is present, but never silently: under +/// `EC_REQUIRE_FIXTURES=1` an absent fixture is a hard failure naming the path +/// and the script that regenerates it, so a host whose fixture library drifted +/// reports RED instead of a green SKIP (class: gate-skips-on-its-own-failure; +/// model `have_ffmpeg` in crates/ec-av1/src/stream.rs, which was silently +/// short-circuited because the probe ran first in a compound `if`). +/// +/// Order is load-bearing: probe, assert, return. Never merge the probe into +/// the same `if` as the escape. +fn require_fixture(path: &std::path::Path, generator: &str) -> bool { + let present = path.exists(); + assert!( + present || std::env::var_os("EC_REQUIRE_FIXTURES").is_none(), + "EC_REQUIRE_FIXTURES=1 but fixture {} is absent -- regenerate with: {}", + path.display(), + generator + ); + if !present { + eprintln!("SKIP: fixture {} absent", path.display()); + } + present +} /// Generate a GOP fixture with libvpx: 6 frames of testsrc2 at 320x240, /// `-g 10` so frames 1..5 are inter frames. @@ -137,17 +161,14 @@ fn inter_gop_with_tile_columns_matches_ffmpeg() { /// TAIL slot set (`write_tx_context`), and the next row of blocks read it /// as an entropy context. Every shown frame must match ffmpeg. /// -/// Media-gated: the corpus fixture is not versioned, so the witness skips -/// when `fixtures/bitstreams/vp9-1080p-60-8bit.ivf` is absent. +/// Media-gated: the corpus fixture is not versioned, so the witness prints +/// SKIP when `fixtures/bitstreams/vp9-1080p-60-8bit.ivf` is absent -- and goes +/// RED instead under `EC_REQUIRE_FIXTURES=1`. #[test] fn corpus_1080p_60fps_matches_ffmpeg_past_frame_72() { - let Some(dir) = ivf::fixture_dir() else { - println!("SKIP: fixtures/bitstreams absent (media-gated witness)"); - return; - }; - let path = dir.join("vp9-1080p-60-8bit.ivf"); - if !path.exists() { - println!("SKIP: {} absent (media-gated witness)", path.display()); + let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) + .join("../../fixtures/bitstreams/vp9-1080p-60-8bit.ivf"); + if !require_fixture(&path, "scripts/gen-bitstream-fixtures.sh") { return; } let shown = compare(&path); diff --git a/crates/ec-vp9/tests/scratch_interdump.rs b/crates/ec-vp9/tests/scratch_interdump.rs index 7eca0835..08c31aab 100644 --- a/crates/ec-vp9/tests/scratch_interdump.rs +++ b/crates/ec-vp9/tests/scratch_interdump.rs @@ -27,6 +27,30 @@ mod ivf; use ec_vp9::decode::Decoder; +/// Fixture-presence probe for the inter-frame IVF this gate parses (the +/// `INTER_IVF` path, or its generated `/tmp/inter1.ivf` default). +/// Returns whether the fixture is present, but never silently: under +/// `EC_REQUIRE_FIXTURES=1` an absent fixture is a hard failure naming the path +/// and how to regenerate it, so a host whose fixture library drifted reports +/// RED instead of a green SKIP (class: gate-skips-on-its-own-failure; model +/// `have_ffmpeg` in crates/ec-av1/src/stream.rs, which was silently +/// short-circuited because the probe ran first in a compound `if`). +/// +/// Order is load-bearing: probe, assert, return. Never merge the probe into +/// the same `if` as the escape. +fn require_fixture(path: &std::path::Path, generator: &str) -> bool { + let present = path.exists(); + assert!( + present || std::env::var_os("EC_REQUIRE_FIXTURES").is_none(), + "EC_REQUIRE_FIXTURES=1 but fixture {} is absent -- regenerate with: {}", + path.display(), + generator + ); + if !present { + eprintln!("SKIP: fixture {} absent", path.display()); + } + present +} #[test] fn inter_syntax_dump() { @@ -43,17 +67,25 @@ fn inter_syntax_dump() { } else { expect_raw .split(',') - .map(|t| t.trim().parse().expect("INTER_EXPECT entries are block counts")) + .map(|t| { + t.trim() + .parse() + .expect("INTER_EXPECT entries are block counts") + }) .collect() }; - let Ok(bytes) = std::fs::read(&path) else { + if !require_fixture( + std::path::Path::new(&path), + "INTER_IVF=; the default is generated, not committed \ + (ffmpeg -f lavfi -i testsrc2=... -c:v libvpx-vp9 -f ivf)", + ) { assert!( explicit.is_none(), "INTER_IVF={path} was set explicitly but the file does not exist" ); - println!("SKIP: fixture {path} not found - set INTER_IVF= to run"); return; - }; + } + let bytes = std::fs::read(&path).expect("fixture presence was just probed"); let (_fourcc, w, h, frames) = ivf::parse_ivf(&bytes); println!("IVF {w}x{h} frames={}", frames.len()); let mut dec = Decoder::new(); diff --git a/crates/ec-vp9/tests/subsampling_exact.rs b/crates/ec-vp9/tests/subsampling_exact.rs index 348a4aa7..49ad3fe3 100644 --- a/crates/ec-vp9/tests/subsampling_exact.rs +++ b/crates/ec-vp9/tests/subsampling_exact.rs @@ -5,7 +5,9 @@ //! Every fixture under `tests/data/` is committed (see the lane report for //! the exact generator commands), so these cases always run; the two //! `corpus_*` cases additionally cover the media-gated 4:4:4 corpus streams -//! and skip by name when the fixture tree is absent. +//! and print SKIP when the fixture is absent -- RED instead under +//! `EC_REQUIRE_FIXTURES=1`, so a drifted fixture library can never read as a +//! pass. //! //! The comparison is the whole flattened plane stream (u16 samples) against //! ffmpeg's `rawvideo` output for the matching `pix_fmt` — full-resolution @@ -17,18 +19,42 @@ mod ivf; use ec_vp9::decode::Decoder; use std::path::{Path, PathBuf}; +/// Fixture-presence probe for the media-gated 4:4:4 corpus IVFs the `corpus_*` +/// cases decode (`corpus()` below, and any path a `scripts/*` generator makes). +/// Returns whether the fixture is present, but never silently: under +/// `EC_REQUIRE_FIXTURES=1` an absent fixture is a hard failure naming the path +/// and the script that regenerates it, so a host whose fixture library drifted +/// reports RED instead of a green SKIP (class: gate-skips-on-its-own-failure; +/// model `have_ffmpeg` in crates/ec-av1/src/stream.rs, which was silently +/// short-circuited because the probe ran first in a compound `if`). +/// +/// Order is load-bearing: probe, assert, return. Never merge the probe into +/// the same `if` as the escape. +fn require_fixture(path: &std::path::Path, generator: &str) -> bool { + let present = path.exists(); + assert!( + present || std::env::var_os("EC_REQUIRE_FIXTURES").is_none(), + "EC_REQUIRE_FIXTURES=1 but fixture {} is absent -- regenerate with: {}", + path.display(), + generator + ); + if !present { + eprintln!("SKIP: fixture {} absent", path.display()); + } + present +} + fn data(name: &str) -> PathBuf { Path::new(env!("CARGO_MANIFEST_DIR")) .join("tests/data") .join(name) } -fn corpus(name: &str) -> Option { +fn corpus(name: &str) -> PathBuf { let mut p = PathBuf::from(env!("CARGO_MANIFEST_DIR")); p.pop(); p.pop(); - let p = p.join("fixtures/bitstreams").join(name); - p.exists().then_some(p) + p.join("fixtures/bitstreams").join(name) } /// ffmpeg's decoded samples as a flat u16 stream (8-bit zero-extended, @@ -133,18 +159,18 @@ fn profile2_420_12bit_is_byte_exact() { #[test] fn corpus_profile1_444_matches_ffmpeg() { - let Some(p) = corpus("vp9-profile1-444.ivf") else { - eprintln!("SKIP corpus_profile1_444_matches_ffmpeg: fixture absent"); + let p = corpus("vp9-profile1-444.ivf"); + if !require_fixture(&p, "scripts/gen-bitstream-fixtures.sh") { return; - }; + } check(&p, "yuv444p", 8); } #[test] fn corpus_profile3_444_10bit_matches_ffmpeg() { - let Some(p) = corpus("vp9-profile3-444-10bit.ivf") else { - eprintln!("SKIP corpus_profile3_444_10bit_matches_ffmpeg: fixture absent"); + let p = corpus("vp9-profile3-444-10bit.ivf"); + if !require_fixture(&p, "scripts/gen-bitstream-fixtures.sh") { return; - }; + } check(&p, "yuv444p10le", 10); } diff --git a/lanes/av1fixlib.report.md b/lanes/av1fixlib.report.md new file mode 100644 index 00000000..852a91db --- /dev/null +++ b/lanes/av1fixlib.report.md @@ -0,0 +1,383 @@ +# lane-av1fixlib — the fixture preflight, and the sweep that motivated it + +Branch `lane-av1fixlib`, rebased onto the merge wave (`main` is an ancestor; the +last merge is recorded in the log). Not pushed. + +## What this lane is + +A test that cannot find its fixture prints `SKIP` and returns, so the suite +reports PASS having tested nothing. That cost a 3-hour suite red from a missing +repo-root `fixtures/` and three hosts whose fixture libraries differed silently. +Two halves: kill the shape in the test crates, and ship a preflight that keeps +hosts honest. + +## 1. The sweep — and what this branch actually carries + +`EC_REQUIRE_FIXTURES` is the escape: unset, an absent fixture SKIPs as before +(local convenience); set, it is a HARD FAILURE naming the path and the script +that regenerates it. The helper's order is load-bearing — probe, assert, return +— and never a probe folded into the same `if` as the escape, which is the +short-circuit that made the in-tree `have_ffmpeg` model silently green. + +**Crates and files carrying the guard on this branch** (exact list, replacing the +earlier "four crates" claim, which was wrong in the same way a stale ignore +reason is): + +| crate | files | what | +|---|---|---| +| ec-aac | `tests/oracle.rs`, `tests/sbr_real_library.rs` | 5 + 9 fixture sites, plus a `probed >= 16` floor on the synthetic HE-AAC matrix | +| ec-flac | `tests/encode_matrix.rs` | corpus guard + a `sources.len() >= 5` floor | +| ec-h264 | `tests/encode.rs` | real-library manifest read and its "no H.264 in the manifest" escape | +| ec-mp3 | `tests/encode_matrix.rs` | the WAV corpus guard, `>= 8` floor, a `read_dir` that swallowed IO errors as an empty list | +| ec-vp9 | `tests/hbd_exact.rs`, `inter_pixels_exact.rs`, `subsampling_exact.rs`, `scratch_interdump.rs` | `Option`-returning corpus helpers and a per-vector skip | +| ec-vorbis | `tests/oracle.rs` | **no guard, deliberately** — see below | + +**ec-vorbis has no `EC_REQUIRE_FIXTURES` guard and does not get one.** Its three +fixture sites sweep the operator's own media library; making that a hard failure +would turn one person's home directory into a red fleet on every other host. The +crate carries non-empty floors instead (`rows > 0` on each sweep), because a run +that encoded nothing is a measurement of nothing even when the corpus is +legitimately absent. + +**ec-h264 `conformance.rs`, ec-opus `conformance.rs` and ec-flac +`xiph_vectors.rs` are main's version verbatim on this branch.** The wave landed +the same class fix for those three crates in its own `require_fixtures` shape. +Carrying both would be two conventions in one file and a 1054-line diff in a +preflight lane, so the conversion was dropped rather than kept. Residual gaps in +main's versions, for whoever owns them: `jvt_full_sequence_bit_exact` still ends +in a bare `assert!(failed.is_empty())` over a zero-iteration-capable loop, its +per-vector `find_stream(dir) -> None => continue` is still a silent per-vector +skip, and `xiph_vectors.rs` still has three loop ends with no floor. + +Also out of scope by design, and reported rather than converted: tool-absence +SKIPs (ffmpeg/x264/aomenc on PATH — a different gate with its own env) and host +media corpora. + +## 2. The preflight + +`scripts/fixture-library.tsv` is GENERATED, never hand-typed. Columns: + +``` +path required-by file:line class generator status tracked sha256 +``` + +`class` is separate from `generator` because a recovered witness is not a +re-encode: `regenerated` (192+ rows, a script reproduces the bytes), `captured` +(committed bytes whose only provenance is a gate comment — a FINDING, no recipe +recorded), `recovered-original` (the runner-library bytes, sha256 recorded). + +`scripts/verify-fixture-library.sh` checks SHAPE, RESOLVE (every path exists and +every directory is non-empty) and DRIFT (regenerating reproduces the committed +ROWS), and distinguishes two failure modes with different fixes: + +- **mode i** — the fixture ROOT is absent. `fixtures/` is gitignored + (`.gitignore:2`), so a linked worktree never has it; fix the TREE + (`scripts/link-fixtures.sh`, or point `EC_FIXTURES` at a staged library). +- **mode ii** — a path is absent, or a directory is empty, INSIDE a tree that has + a root. Fix the LIBRARY: run the generator named in the row. + +`scripts/pin-gate-audit.py` is the gate census. Matching `crate_pin("X")` is +blind to a gate that reads N pins through a directory literal plus a runtime +name list — `pinned_warp_stream_decodes_pixel_exact` +(`crates/ec-av1/src/stream.rs:31099` in the tree this was written against) reads +fourteen that way, none committed under the crate, and the gate is `#[ignore]`d, +so it is a no-op that reports nothing. The audit resolves the root literal, +strips line comments (the name list has comments between its items, which is +why a bracket-shaped parse finds nothing), anchors on the `format!` that +consumes the list, and enumerates every runtime name. It also classifies +assertions through the helper CALL GRAPH, not the gate body: the warp gate has +no `assert` of its own but calls `check_pinned_warp_stream`, which asserts all +three planes per frame — a body-only read calls it assertless, which is the +misclassification that happened earlier today. + +Census, identical on this box and on all three runner hosts: + +``` +pin gates: total=8 committed=7 uncommitted=14 ignored=3 assertless=0 +``` + +## 3. The four invariants, and how each fails + +All four are reported on every run; the count is always printed. + +1. **No committed pin through the gitignored root.** The shape + `concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures/")` can never be + satisfied by a committed pin, so its gate skips on every clean checkout and + runner — the film-grain instance combined it with `.unwrap()` and PANICKED + instead. A root *subdirectory* is deliberately not this shape: a generator + produces those. +2. **Every committed pin present AND tracked.** A pin on disk but untracked dies + with the machine's scratchpad and its gate skips GREEN. `tracked` is + computed at generation time, so a host with no `.git` asserts the committed + value. +3. **The `.gitignore` negation is intact** — `!crates/*/fixtures/**` checked + statically (works with no `.git`), plus `git check-ignore` in a git tree. A + plain `git add` of a new pin has to work: that is what let four recovered and + three regenerated pins land today. +4. **The pin-reading gate census** above, including the bare-directory verdict. + +**Exit status: shape is now FATAL BY DEFAULT.** The LIBRARY verdict (mode i, mode ii, +drift) decides the exit under `EC_REQUIRE_FIXTURES=1`. The four code-shape +invariants fail only under `EC_FIXTURE_SHAPE_STRICT=1`. A shape violation is a +defect in a file this preflight does not own — two live sites in `crates/ec-av1` +— and a batch that cannot start because another crate has two open lines helps +nobody. Nothing is hidden: the count is printed every run and the sites are named +every run. + +The split existed only while two `crates/ec-av1` violations were open and owned by +another lane. Agent01-5's `2364d7a7` closed both — the root pin now reads +`crate_pin("lr-sgr-r7.obu")`, and all fourteen warp pins are committed under +`crates/ec-av1/fixtures/` and read through the pin helper — so +`SHAPE=${EC_FIXTURE_SHAPE_STRICT:-1}` is the default now. `--strict` and +`EC_FIXTURE_SHAPE_STRICT=0` are the escape hatches, in that direction. + +Measured exit codes after the flip: + +| mode | exit | +|---|---| +| A intact, `EC_REQUIRE_FIXTURES=1` | 0 — GREEN (303 rows) | +| B one fixture renamed, flag set | 1 — `FAIL [mode ii]`, names path, both sites, generator | +| C same rename, flag unset | 0 — the same list printed SKIP-shaped | +| D `EC_FIXTURES=/nonexistent`, flag set | 1 — `FAIL [mode i]`, names `.gitignore:2` | +| E intact, flag set, `--strict` | 0 — was 1 before the flip | +| F a reintroduced `concat!` root-pin line, flag set | 1 — `FAIL [invariant 1]` | + +F is the point of the flip: reintroducing the shape is now fatal with no flag. + +Three defects this lane's own tooling had, all found by running it off its own +tree, and all the class it exists to prevent: + +1. Off-git the `tracked` column was recomputed as `no-git` for all 37 pin rows, + so every host reported DRIFT with a good library. +2. Invariant 1 could not see a comment: a doc comment that REPRODUCES the + forbidden literal to explain what was fixed read as a live violation for a + whole round. It now strips comments before matching, the way the gate census + already did. +3. The census's single-name branch neither tracked `ignored` (every `crate_pin` + gate reported `ignored=0` whether or not it was `#[ignore]`d) nor noticed a + `crate_pin` whose name is built at runtime — such a gate would have vanished + from the census silently, the same blind spot in a new place. It now counts + `ignored` and prints a `BADCALL` row the preflight fails on, because a gate + the census cannot resolve is UNPROVEN, not proven clean. + +## 4. Proof + +**Green, fixtures present, `EC_REQUIRE_FIXTURES=1`:** + +| suite | result | +|---|---| +| ec-h264 conformance | 23 passed, 0 failed | +| ec-h264 encode | 12 passed, 1 ignored | +| ec-flac xiph_vectors / encode_matrix | 4 passed / 2 passed | +| ec-opus conformance | 28 passed, 16 ignored | +| ec-aac oracle | 14 passed | +| ec-mp3 encode_matrix | 5 passed, 2 ignored | +| ec-vorbis oracle | 8 passed, 3 ignored | + +(`EC_NOMEMGUARD=1` throughout: the repo's memguard runner aborts on a stale +systemd scope. CI plumbing, not a test bypass.) + +**Red, by renaming a real fixture, flag set, all restored:** + +- `mv fixtures/video/h264-open-gop.mp4{,.bak}` → + `panicked at crates/ec-h264/tests/conformance.rs:83:5: EC_REQUIRE_FIXTURES=1 + but fixture …/fixtures/video/h264-open-gop.mp4 is absent -- regenerate with: + scripts/gen-fixtures.sh` → `0 passed; 1 failed` +- `mv …/flac-test-files-main/subset{,.bak}` → the same assert, 2 failed +- `mv …/opus_testvectors/testvector01.bit{,.bak}` → the same assert, 1 failed + +**Preflight, four modes:** + +- intact, flag set → `GREEN (290 rows)`, exit 0 +- one fixture renamed, flag set → exit 1, `FAIL [mode ii]` naming the path, both + referencing sites and the generator +- same rename, flag unset → exit 0, the same list printed SKIP-shaped +- `EC_FIXTURES=/nonexistent` → exit 1, `FAIL [mode i]` naming `.gitignore:2` and + "fix the TREE, not the code" + +**Not vacuous.** On two runner hosts: hardlink-copy the staged library, remove one +file from the COPY, rerun → RED naming the path, both referencing sites, the +generator and the drift row; the real library untouched (793/802 files before +and after) and GREEN. + +**Reproducible artifact.** `cp tsv; regenerate; cmp` → byte-identical, on this +box. On all three hosts, `grep -c '/home/' scripts/fixture-library.tsv` → 0: the +generated header carries no absolute path (it says `worktree-relative` and +resolves through `EC_FIXTURES` at run time), so the drift check is not +structurally red off the generating worktree. + +**Three-host run** (source tarball, `fixtures/` excluded, each host's own library +at `~/gates/library/fixtures` via `EC_FIXTURES`) — host-b (793 files), +host-d (793), host-a (802): all three `verify_exit=0`, +`GREEN (290 rows)`, `resolve: 0 missing, 0 empty`, the same census, `code-shape +violations: 2`. + +**The hosts really do differ, and the preflight is right to be silent about it.** +h1 and h2 have byte-identical library listings (same md5 over `find | sort`, 793 +files); h3 has 802 — nine extra paths (`hbd-r5/*`, `part32/reelc-extract.obu`, +`realworld/*`, `sbpart/seed42.*`, `sub8`). No code literal reaches any of them. +That is the measured blind spot, not a sync failure. + +## 5. Blind spots, stated rather than papered over + +- Enumeration is grep-derived. 188 media-name literals in this tree resolve under + no enumerated fixture directory; they are covered only as far as their parent + directory, which must exist and be non-empty. The h3 difference above is + exactly this blind spot. +- The pin-gate audit anchors on a `format!` against the root variable. A gate + that builds its path by `PathBuf::push` in a loop, by string concatenation, or + from a name read at runtime out of a manifest is not enumerated; it would need + its own shape added. +- The audit resolves one level of helper indirection for assertion + classification. `assertless=0` today, so nothing is currently hidden by that + limit, but it is a real limit. +- The `tracked` column and the fixture-root path are committed provenance, not + host state: off-git the column is normalised and the path is never written, so + a host asserts the committed value instead of recomputing what it cannot know. +- The recovered-pin self-validation has two halves. This script decides the hash + half — every `recovered-original` row must hash to its recorded sha256, and a + re-encode fails it. **The behavioural half now runs too:** + + ``` + CARGO_TARGET_DIR=$HOME/.cache/cargo-target-av1fixlib EC_NOMEMGUARD=1 \ + cargo test -p ec-av1 --lib -- \ + --exact stream::tests::pinned_golden7_stream_decodes_pixel_exact \ + --include-ignored --nocapture + non_last_ref_hits before=0 after=2 + test stream::tests::pinned_golden7_stream_decodes_pixel_exact ... ok + test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 745 filtered out + ``` + + The recovered pin reproduces exactly the 0→2 its doc records — the + self-validation a re-encode cannot pass. Two notes for whoever repeats it: the + test is LIVE in the merged tree (no `#[ignore]`), so `--include-ignored` is + belt-and-braces, and a lane-scoped `CARGO_TARGET_DIR` is REQUIRED — the shared + `$HOME/.cache/cargo-target` held a stale `ec_av1` binary from another worktree + of the same package, and its panic pointed at a line that does not exist in + this source. +- `pinned_lr_sgr_stream_call_unique_dump` stays `#[ignore]`d for a true reason: + it prints per-frame mismatch counts and asserts nothing. + +## 6. The two shape violations: what they were, and who fixed them + +A CORRECTION to an earlier version of this section, because a report naming an +already-fixed gate sends the next reader to the wrong file. + +- `pinned_lr_sgr_stream_call_unique_dump` was named here as reading + `/../../fixtures/lr-sgr-r7.obu`. **It does not.** At the base this was measured + on, that gate already read `crate_pin("lr-sgr-r7.obu")` (`stream.rs:30519`) + and the pin is committed at `crates/ec-av1/fixtures/lr-sgr-r7.obu`. +- The only invariant-1 hit in the tree was a **DOC COMMENT** inside + `pinned_golden7_stream_decodes_pixel_exact` that reproduces the forbidden + literal verbatim while explaining the shape it removed. A `grep` cannot tell + prose from code. The comment is correct and stays; the scanner was wrong. +- The one real violation was `pinned_warp_stream_decodes_pixel_exact` + (`stream.rs:31386`): the `/../../fixtures` directory literal plus a 14-name + runtime list, none of the fourteen committed under the crate. + +All of it is closed as of `53b851a7` (merging Agent01-5's `2364d7a7`): the warp +gate's fourteen pins — `warp-mismatch`, `warp-flake-5`, `warp-flake-7`, +`ii-flake-1/2/3/5/6/7/8/9`, `rect-flake-1/2/3` — are committed under +`crates/ec-av1/fixtures/` and each is read through `crate_pin` with a string +literal, and the gate is no longer `#[ignore]`d because a plain run proves it +executes (`warp_selected_hits` 0 → 113, 1 passed in 1.8 s plus ffmpeg). Census +after the fix: `total=8 committed=21 uncommitted=0 ignored=0 assertless=0`, +`code-shape violations: 0`, and shape is fatal by default. + +The four pins recovered earlier in this lane (`golden4-pin.obu` 137 B +`1754023e…`, `golden6-mismatch.obu` 452 B `c56909b9…`, +`golden7-forwarding-mismatch.obu` 152 B `81b3bf65…`, `lr-sgr-r7.obu` 192 B +`6b95b20e…`) are committed with `recovered-original` provenance; they lived only +in the gitignored root, i.e. only in each machine's scratchpad. + +## 7. Three-host run on the FLIPPED tree (commit f4e1ac6b) + +Every host: its own staged library at `~/gates/library/fixtures`, passed as +`EC_FIXTURES`; the source tarball excludes the root `fixtures/`, so the preflight +resolves against that host's library and nothing else. + +``` +EC_FIXTURES=~/gates/library/fixtures EC_REQUIRE_FIXTURES=1 \ + ./scripts/verify-fixture-library.sh +``` + +| host | library | verify exit | verdict | census | violations | invariant-1 control | census self-test | +|---|---|---|---|---|---|---|---| +| host-b | 793 files | 0 | GREEN (303 rows) | 8 / 21 / 0 / 0 / 0 | 0 | fired | passed | +| host-d | 793 files | 0 | GREEN (303 rows) | 8 / 21 / 0 / 0 / 0 | 0 | fired | passed | +| host-a | 802 files | 0 | GREEN (303 rows) | 8 / 21 / 0 / 0 / 0 | 0 | fired | passed | + +Census columns are `total / committed / uncommitted / ignored / assertless`. + +**Not vacuous, re-proved on all three.** `cp -al` the staged library, remove +`video/h264-open-gop.mp4` from the COPY, rerun with `EC_FIXTURES` pointed at the +copy: + +``` +FAIL [mode ii]: 2 referenced fixture path(s) do not resolve, + fixtures/video/h264-open-gop.mp4 <- crates/ec-h264/tests/conformance.rs:2381 (regenerated, generator: scripts/gen-fixtures.sh) + fixtures/video/h264-open-gop.mp4 <- crates/ec-hw/tests/gpu.rs:2793 (regenerated, generator: scripts/gen-fixtures.sh) + '+ only committed' is a row this host cannot satisfy ... +``` + +exit 1 on every host, naming the path, both referencing sites, the generator and +the drift row. The real library was untouched — 793 files before and after on +h1/h2, 802 on h3 — and GREEN again immediately afterwards. `cp -al` hardlinks, +so `rm` removes only the copy's link; nothing in a staged library is reachable +from the probe. + +**The hosts still differ, and the extra files are still unreachable.** h1 and h2 +have byte-identical library listings (same md5 over `find | sort`, 793 files); +h3 has 802. The nine extra paths are `hbd-r5/{reelb,reelc}.obu`, +`part32/reelc-extract.obu`, `realworld/{reelb,reelc}.obu`, +`sbpart/{seed42.obu,seed42.y4m,seed42.y.gray,seed42.yuv}`, `sub8`. Stated +explicitly rather than left to inference: **the manifest carries zero rows under +`fixtures/hbd-r5`, `fixtures/part32`, `fixtures/realworld`, `fixtures/sub8` and +`fixtures/sbpart`, and no string literal anywhere in `crates/*/src` or +`crates/*/tests` names any file inside them.** So this preflight gives no +coverage of that difference — it is the grep-derived blind spot, measured rather +than assumed, and closing it means either a sync decision (delete what nothing +reads) or code that actually reads those pins. Neither is this lane's call, and +nothing was re-synced. + +Six modes on the flipped tree, re-measured after the census fix: + +| mode | exit | +|---|---| +| A intact, `EC_REQUIRE_FIXTURES=1` | 0 — GREEN (303 rows) | +| B one fixture renamed, flag set | 1 — `FAIL [mode ii]` | +| C same rename, flag unset | 0 — SKIP-shaped report | +| D `EC_FIXTURES=/nonexistent`, flag set | 1 — `FAIL [mode i]` | +| E intact, flag set, `--strict` | 0 | +| F a reintroduced `concat!` root-pin line, flag set | 1 — `FAIL [invariant 1]`, no flag needed | + +## 8. The census hole, and the control that closes it + +Agent01-5 measured a real defect: `fn_bodies` spans a gate's body from its `fn` +line to the NEXT `fn` line, so a doc comment belonging to the following gate sits +inside the previous gate's body. `ROOT_RE` matched the comment, the gate was +reclassified into the root-literal branch, found no names and hit `continue` — the +census count dropped and **nothing went red**, with `uncommitted=0` still reading +clean. Unproven read as clean, which is the principle this lane exists to hold. + +Two things close that door, and the second is the one that matters: + +1. every search — `ROOT_RE`, `JOIN_RE`, the `crate_pin`/`pin_dir` singles, the + `asserts` check — matches on a comment-stripped body (`/* */`, `//`, `///`). +2. `scripts/pin-gate-audit.py --self-test` is a positive control in the exact + shape: a comment reproducing the forbidden literal INSIDE a gate that reads + `crate_pin`, plus a second gate after it. It runs the real pipeline over a + synthetic tree in a temp dir (so it works on a read-only staged tree) and + asserts both gates are still counted as `crate_pin`. The verifier runs it and + fails if it does not pass. + +**Mutation-proved, because a control nobody made fail is not a control:** with the +comment-stripping removed from the self-test path it fails with +`reclassified=[('selftest_a_reads_a_pin', 'root-literal')]`; restored, it passes. +A control that only proved "the scanner finds a forbidden literal" would NOT have +caught this, which is exactly why the census needed its own. + +Measured with the verbatim prose restored — the state that ships, since the +sentence explaining the removed shape is what a reader needs: census +`total=8 committed=21 uncommitted=0 ignored=0 assertless=0`, violations 0, both +controls firing, verify GREEN. diff --git a/lanes/av1fixtureshape.report.md b/lanes/av1fixtureshape.report.md new file mode 100644 index 00000000..f5f0bb09 --- /dev/null +++ b/lanes/av1fixtureshape.report.md @@ -0,0 +1,309 @@ +# lane-av1fixtureshape — the two live code-shape violations in `crates/ec-av1` + +Branch `lane-av1fixtureshape`, worktree `~/.cache/wt/av1fixtureshape`. + +| commit | what | +|---|---| +| `2364d7a7` (merged as `53b851a7`) | the two sites in `crates/ec-av1` | +| `0790e90c` (parent `12cae635`) | restores the verbatim literal in the golden7 doc comment | + +Not pushed. Primary checkout clean. **The branch is rebased onto `12cae635` +(`lane-av1fixlib`), so `scripts/verify-fixture-library.sh`, +`pin-gate-audit.py`, `gen-fixture-library.sh` and `fixture-library.tsv` are +committed in this tree** and every run below is from the committed tree. An +earlier revision copied them in untracked; that is superseded. + +--- + +## 1. The two sites, as the preflight printed them + +`EC_REQUIRE_FIXTURES=1 EC_FIXTURE_SHAPE_STRICT=1 +EC_FIXTURES=/fixtures scripts/verify-fixture-library.sh` + +**Site 1 — invariant 1, quoted:** + +``` +FAIL [invariant 1]: a committed pin is reached through the gitignored root + fixtures/ (silent SKIP on every clean checkout and runner): + .../crates/ec-av1/src/stream.rs:23980: /// class: a `concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures/...")` + fix: commit the pin under crates//fixtures/ and read it with + that crate's pin helper (crate_pin / pin_dir), never /../../fixtures/. +``` + +**Site 2 — invariant 4, quoted:** + +``` +FAIL [invariant 4]: pin-reading gates whose pins are not committed + crates/ec-av1/src/stream.rs:31386:pinned_warp_stream_decodes_pixel_exact /../../fixtures bare directory literal feeding 14 runtime name(s): no committed tree satisfies it + crates/ec-av1/src/stream.rs:31386:pinned_warp_stream_decodes_pixel_exact concat! 14/14 pin(s) not committed+tracked, e.g. warp-mismatch + crates/ec-av1/src/stream.rs:31386:pinned_warp_stream_decodes_pixel_exact /../../fixtures + 14 runtime name(s) + fix: commit each pin under crates//fixtures/ and read it + through that crate's pin helper, not /../../fixtures/. +``` + +### Site 1 was a SCANNER defect, and the report named the wrong gate + +`lanes/av1fixlib.report.md` §6 attributes site 1 to +`pinned_lr_sgr_stream_call_unique_dump` reading +`/../../fixtures/lr-sgr-r7.obu` through the gitignored root. **At this base +that gate is already correct** — `stream.rs:30519` reads +`crate_pin("lr-sgr-r7.obu")` and the pin is committed at +`crates/ec-av1/fixtures/lr-sgr-r7.obu`. A direct grep of the invariant-1 +pattern over `crates/*/src` and `crates/*/tests` returns exactly one hit, and +it is the line quoted above. + +That one hit is a **doc comment**, in +`pinned_golden7_stream_decodes_pixel_exact`, reproducing the forbidden literal +verbatim to explain the shape that gate removed: + +```rust + /// LIVE since lane-av1pinslive r3. The old shape was the worst of the + /// class: a `concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures/...")` + /// literal, which points at the GITIGNORED root and can therefore never be + /// satisfied by a committed pin, combined with a bare `.expect()`. The +``` + +Invariant 1 was a plain `grep -rn` and could not tell prose from code, so the +crate carried an enforced "violation" that was a sentence explaining a fixed +bug. The correction is two-sided, and both halves were needed: + +- **the prose stays.** The sentence is what a reader needs; it is the only + record of why that gate's shape was the worst of its class. It is restored + verbatim in `0790e90c` after `2364d7a7` had reworded it. +- **the scanner is fixed.** `lane-av1fixlib` `12cae635` strips `//` and + `/* */` before invariant 1 matches, via a python scan rather than grep, and + plants a **positive control** — a known forbidden literal in a scratch `.rs` + — that fails loudly if the stripper ever stops matching. That is the floor + that makes a comment-stripping bug impossible to mistake for an all-clear. + +Verified in this tree with the literal present and the shape fatal by default: + +``` + invariant 1: no root-fixture pin path + code-shape violations: 0 +verify-fixture-library: GREEN (303 rows) exit 0 +``` + +## 2. What each site said before and after + +### Site 1 — doc comment of `pinned_golden7_stream_decodes_pixel_exact` + +The text is **unchanged from `0dfdf0c8`**. `2364d7a7` reworded it, `0790e90c` +restores it exactly: + +```rust + /// LIVE since lane-av1pinslive r3. The old shape was the worst of the + /// class: a `concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures/...")` + /// literal, which points at the GITIGNORED root and can therefore never be + /// satisfied by a committed pin, combined with a bare `.expect()`. The + /// bytes are now committed at +``` + +No code changed; the gate's behaviour is untouched. + +### Site 2 — `stream.rs:31388`, `pinned_warp_stream_decodes_pixel_exact` + +Before: one directory literal, fourteen runtime names, no committed pin. + +```rust + #[test] + #[ignore = "reads pinned fixture paths under the gitignored fixtures dir; run manually"] + fn pinned_warp_stream_decodes_pixel_exact() { + if !have_ffmpeg() { ... return; } + let fixtures = concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures"); + let paths: Vec = match std::env::var("EC_AV1_GATE_DUMP_PIN") { + Ok(p) => vec![p], + Err(_) => ["warp-mismatch", "warp-flake-5", "warp-flake-7", + "ii-flake-1", "ii-flake-2", "ii-flake-3", "ii-flake-5", + "ii-flake-6", "ii-flake-7", "ii-flake-8", "ii-flake-9", + "rect-flake-1", "rect-flake-2", "rect-flake-3"] + .iter().map(|n| format!("{fixtures}/{n}.obu")).collect(), + }; + for path in paths { check_pinned_warp_stream(&path); } + } +``` + +After: fourteen committed pins, each named by a string literal through +`crate_pin` — the spelling `pinned_golden3`, `pinned_golden4`, +`pinned_golden7` and `pinned_sbpart` already use, one per pin, no second +dialect. The per-pin provenance comments stay in place, each still attached to +the pin it describes. + +```rust + #[test] + fn pinned_warp_stream_decodes_pixel_exact() { + if !have_ffmpeg() { ... return; } + let pins = match std::env::var("EC_AV1_GATE_DUMP_PIN") { + Ok(p) => vec![std::path::PathBuf::from(p)], + Err(_) => vec![ + crate_pin("warp-mismatch.obu"), + crate_pin("warp-flake-5.obu"), + /* ... thirteen more, each its own literal ... */ + crate_pin("rect-flake-3.obu"), + ], + }; + for path in pins { check_pinned_warp_stream(&path); } + } +``` + +`check_pinned_warp_stream` now takes `&std::path::Path` and reads through +`require_pin`, so an absent pin is a hard failure naming the crate-local path +rather than a raw io `expect` panic — the helper the sibling gates use. + +**All fourteen pins were recoverable**, each committed byte-for-byte under +`crates/ec-av1/fixtures/`: + +| pin | sha256 (16) | pin | sha256 (16) | +|---|---|---|---| +| `warp-mismatch.obu` | `24cca5beb41c1078` | `ii-flake-6.obu` | `84a1f60011dfdb77` | +| `warp-flake-5.obu` | `1a99f9e5b257eed0` | `ii-flake-7.obu` | `61ba4d114aa55ebc` | +| `warp-flake-7.obu` | `c2f8b93f5a59c56b` | `ii-flake-8.obu` | `f19d3d80ed564850` | +| `ii-flake-1.obu` | `700ded3e61e15bc3` | `ii-flake-9.obu` | `0df4874737cc6152` | +| `ii-flake-2.obu` | `edc4ad3a6c00c6bc` | `rect-flake-1.obu` | `a3869b5d2bd8a8bc` | +| `ii-flake-3.obu` | `994bfbdc952ecef1` | `rect-flake-2.obu` | `c780ddee1adf25cf` | +| `ii-flake-5.obu` | `f43fe77ea0e8ddd9` | `rect-flake-3.obu` | `3b23d204549b7bcf` | + +### The `#[ignore]`, and why it came off + +The old reason ("reads pinned fixture paths under the gitignored fixtures +dir") became factually false with the shape fix. The acceptance was that a +plain run must actually execute the gate — a gate un-ignored while its pins +are absent is the same no-op with a better excuse. It is not absent, and it is +not vacuous: `--nocapture` shows all fourteen paths resolving under +`crates/ec-av1/fixtures/` (not the gitignored root) with +`warp_selected_hits` carried 0 → 113 across the set. Had any pin been +unrecoverable the gate would have stayed `#[ignore]`d with the reason. Cost is +1.7 s plus ffmpeg, which `have_ffmpeg()` already gates. + +## 3. Generalisation — what the tooling cannot see + +Three findings, all measured. The third is **open and blocks the wave**. + +**1. A gate can vanish from the census, and the obvious refactor of the code +just landed would do it.** The census finds names only through a root literal +plus `[..].iter().map(|n| format!("{var}/{n}.obu"))`, and through +`crate_pin\(\s*"([^"]+)"` — a **string literal**. The DRY spelling +`crate_pin(&format!("{n}.obu"))` matches neither, so the loop hits `continue` +and the gate is not counted at all: a green `uncommitted=0` would then mean +"this gate is absent from the census", the same silent-SKIP class wearing a +census. That is why each pin is spelled out individually. `12cae635` closes +this one: the audit now emits a `BADCALL` row and the preflight **fails** on a +non-literal `crate_pin` argument, because a gate the census cannot resolve is +unproven rather than clean. + +**2. The census prints one `GATE` row per NAME, not per gate.** The `crate_pin` +branch prints inside the name loop, so the 14-pin warp gate prints 14 identical +`GATE` lines: measured 21 printed rows for 8 gates at `12cae635`, 20 for 7 +once the doc comment below removes one. `COUNT total=` is the real number. +`lane-av1fixlib` owns the printing fix; it is cosmetic, not a counting bug. + +**3. OPEN — `pin-gate-audit.py` strips no comments, and that silently un-counts +a gate.** Invariant 1 was fixed for comment-blindness; the census was not. +`12cae635` has no strip helper and no `code` variable in the audit at all +(`grep -c code` = 1, incidental). `ROOT_RE.search(body)` (line 131), +`JOIN_RE.search(body)` (136) and the `crate_pin` singles (146) all run on the +raw body; only the name-list branch strips `//`, as before. Measured on +`12cae635` itself, both directions: + +``` + 12cae635 pristine -> COUNT total=8 committed=21 uncommitted=0 + 12cae635 + the restored doc comment -> COUNT total=7 committed=20 uncommitted=0 +``` + +`pinned_golden4_stream_decodes_pixel_exact` (`stream.rs:23950`) stops being +counted entirely — no `GATE` row, no `NAME` row — and `uncommitted=0` still +reads clean, so **nothing goes red**. Cause: `fn_bodies` runs a gate's body +from its `fn` line to the *next* `fn` line, so golden4's captured body spans +23950–23987 and golden7's doc comment (23974–23986) sits inside it. +`ROOT_RE` matches the comment, `root_lit` becomes `/../../fixtures/...`, the +gate takes the root-literal branch, finds no bracketed list and no +`"/fixtures/..."` literal, and hits `continue`. A comment moved a gate out of +the census. + +This is finding 1's failure mode reached through the other door: the gate is +not unreadable, it is reclassified into a branch that counts nothing. It also +means the site-1 prose is only safe to land once the audit strips comments on +all three searches. Reported to `lane-av1fixlib` with both measurements, the +mechanism, the one-line shape of the fix, and a request for a census positive +control for this specific shape — their existing control only proves the +scanner finds a bad literal, and would not have caught this. + +## 4. Red / green + +Measured on this branch's own commits, same tree, same committed scripts. + +**Red — fix reverted** (`git stash push -- crates/ec-av1/src/stream.rs +crates/ec-av1/fixtures/`, against the pre-comment-strip tool): + +``` +FAIL [invariant 1]: a committed pin is reached through the gitignored root + .../crates/ec-av1/src/stream.rs:23980: /// class: a `concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures/...")` + pin gates: total=7 committed=6 uncommitted=14 ignored=1 assertless=0 +FAIL [invariant 4]: pin-reading gates whose pins are not committed + crates/ec-av1/src/stream.rs:31386:pinned_warp_stream_decodes_pixel_exact /../../fixtures bare directory literal feeding 14 runtime name(s): no committed tree satisfies it + crates/ec-av1/src/stream.rs:31386:pinned_warp_stream_decodes_pixel_exact concat! 14/14 pin(s) not committed+tracked, e.g. warp-mismatch +``` + +named exactly the two sites, `uncommitted=14`. + +``` +EC_FIXTURE_SHAPE_STRICT=1 -> exit 1 +``` + +**Green — fix applied** (`12cae635` tool, `0790e90c` crate, shape fatal by +default): + +``` + invariant 1: no root-fixture pin path + invariant 4: every pin-reading gate resolves through committed copies + pin gates: total=7 committed=20 uncommitted=0 ignored=0 assertless=0 + code-shape violations: 0 +verify-fixture-library: GREEN (303 rows) exit 0 +``` + +`total=7` rather than 8 is finding 3 above, not a regression in the fix — the +missing gate is golden4, present in the red run's tool and removed from the +count by the doc comment the preflight now correctly ignores. It is reported +as a defect in the census rather than papered over by re-adding the reword. + +**Caveat on the exit code, stated not hidden.** The script's exit status is the +*LIBRARY* verdict (root present, paths resolve, no manifest drift), not the +shape verdict. In this tree the library verdict is clean — `EC_FIXTURES` points +at the primary checkout's library and the manifest is regenerated against this +tree. The earlier DRIFT reds in this lane's history were the manifest's +`required-by file:line` column generated against a different `stream.rs`; +rebasing onto `12cae635` resolved them. + +## 5. Gates + +Lane-scoped `CARGO_TARGET_DIR=$HOME/.cache/cargo-target-av1fixtureshape` +throughout — the shared `$HOME/.cache/cargo-target` was observed serving an +`ec_av1` binary built from another worktree of the same package. `stream.rs` +`touched` before every run. + +``` +cargo check -p ec-av1 --all-targets + Finished `dev` profile in 7.73s (no warnings) + +cargo test -p ec-av1 --lib -- gate_coverage refusal_inventory + ok. 28 passed; 0 failed; 0 ignored; 719 filtered out; 0.91s + +cargo test -p ec-av1 --lib -- pinned_ golden + ok. 19 passed; 0 failed; 2 ignored; 726 filtered out; 1.61s + including pinned_lr_sgr_stream_call_unique_dump, pinned_golden7, pinned_sbpart, + pinned_warp_stream_decodes_pixel_exact, rect_sizes_pinned_against_libaom + +cargo test -p ec-av1 --lib -- pinned_golden7 pinned_warp + ok. 2 passed; 0 failed; 745 filtered out; 2.02s (after the doc-comment restore) +``` + +Gate bodies touched: exactly two — `pinned_warp_stream_decodes_pixel_exact` +(rewritten) and `pinned_golden7_stream_decodes_pixel_exact` (doc comment only, +no behaviour). The fourteen new pins are consumed by the warp gate alone, and +that gate is in every run above. + +## 6. Handed over + +`0790e90c` to `lane-av1fixlib` for the crate half. Nothing open on the fourteen +pins. One item open against their branch before it goes to the wave: the +census comment-stripping in finding 3. diff --git a/scripts/fixture-library.tsv b/scripts/fixture-library.tsv new file mode 100644 index 00000000..fa4ef2d4 --- /dev/null +++ b/scripts/fixture-library.tsv @@ -0,0 +1,331 @@ +# GENERATED by scripts/gen-fixture-library.sh -- do not hand-edit. +# Regenerate: scripts/gen-fixture-library.sh +# Verify: scripts/verify-fixture-library.sh +# path required-by file:line provenance status sha256 +# +# Enumeration is grep-derived. It cannot see a fixture name that is not a +# string literal in the same file (manifest rows, vectors.sha256 names, +# format! interpolation); such names are only covered through their parent +# directory, which the verifier requires to exist AND be non-empty. +# 189 media-name literal(s) in this tree resolved under no enumerated +# fixture directory and are therefore not listed individually. +# +# FIXTURE ROOT: worktree-relative, deliberately NOT an absolute path. A +# generated file in the repo must not carry the authoring machine's home +# directory: this repo scans commit MESSAGES for host paths, and a generated +# artefact is exactly how one slips past that check. The path is resolved +# through EC_FIXTURES at run time by verify-fixture-library.sh. +# +# HOST-STATE LINES (per-host by nature, excluded from the drift comparison, +# which diffs the ROWS only): the unresolved-literal count above, and the +# status/tracked/sha256 columns below. +# +# VECTORS consumers (fixtures/vectors/*): crates/ec-flac/tests/xiph_vectors.rs crates/ec-h264/tests/conformance.rs crates/ec-opus/tests/conformance.rs +# VECTORS .tar.gz blob referenced by: nothing +# The three fleet hosts carry the EXTRACTED vector sets (~470 files) and the +# sync deliberately excluded the .tar.gz blobs; nothing in crates/ reads a +# blob, so the extracted directories are the whole requirement. +# Unreferenced committed pins carried as rows: 4 +crates/ec-av1/fixtures/420_intrabc_rect4_witness.obu crates/ec-av1/src/stream.rs:8005 captured - ok yes d01352af5059919cdce733abdcbae8e8240ac3c2a6190fa1bd96d3c6f945b979 +crates/ec-av1/fixtures/422_allskip_2f.obu crates/ec-av1/src/stream.rs:2311 captured - ok yes ba4932c14f95971b5f25321b04abce80c9fdd5de4b1fe6fffcdad82aaea87ce1 +crates/ec-av1/fixtures/422_intrabc_sb128_strip_notxsearch.obu crates/ec-av1/src/stream.rs:2373 captured - ok yes 80dd0d4e93fd6c3d4b7188a43e69d9638f2bece38edfab60ff3582628314b5ec +crates/ec-av1/fixtures/422_intrabc_sb128_strip.obu crates/ec-av1/src/stream.rs:2368 captured - ok yes f92000db86df7acc577d60dd1d0d97454bff4705799ea59d9de34eb5a71dbbcd +crates/ec-av1/fixtures/422_residual_compound_warp_16f.obu crates/ec-av1/src/stream.rs:2590 captured - ok yes d78e2afb43ce311d3d82335a945c6f80f62db4537966d881c1349a68b3aecb95 +crates/ec-av1/fixtures/422_residual_compound_warp_nolr_16f.obu crates/ec-av1/src/stream.rs:2669 captured - ok yes 8bed368f7ec4bca772137c6a9c2af89e1b2767ed5f937b91bd9e72ec60aeb42f +crates/ec-av1/fixtures/422_sb128_3f.obu crates/ec-av1/src/stream.rs:2312 captured - ok yes 0b851799d99cb4d141a7d042138a3999aad7e0fb24d69c670bca1d38c286dce9 +crates/ec-av1/fixtures/444_intrabc_rect4_witness.obu crates/ec-av1/src/stream.rs:7999 captured - ok yes 7fe888edf18caa74bdb415f0de643dc59963e87e0255d77191200b7a62eb2542 +crates/ec-av1/fixtures/444_leaf8_oob.obu crates/ec-av1/src/stream.rs:8424 captured - ok yes 72bed2791d1ceba8be7926a052c7838c5d96d4f9d56d28fb69789a753d3593af +crates/ec-av1/fixtures/444_lossy_rect4_inter_witness.obu crates/ec-av1/src/stream.rs:21054 captured - ok yes 77f727e76d81fe48cd03709f799131677c04869b163e18d78e96bc742ec69153 +crates/ec-av1/fixtures/444_lossy_rect4_inter_witness.obu crates/ec-av1/src/stream.rs:7589 captured - ok yes 77f727e76d81fe48cd03709f799131677c04869b163e18d78e96bc742ec69153 +crates/ec-av1/fixtures/444_lossy_rect4_odd_130x122.obu crates/ec-av1/src/stream.rs:46760 captured - ok yes c87ac65b77579afd2938669b0cbe3ec44c3abf775c0223cacb9d14b8c2eee27c +crates/ec-av1/fixtures/444_lossy_rect4_wide_256x128.obu crates/ec-av1/src/stream.rs:46768 captured - ok yes 06621606c11ae805f784a1c9736db6301a925a4fa3154e2fc38db1df7ad9b826 +crates/ec-av1/fixtures/444_lossy_superres_256x128_d12_10bit.obu crates/ec-av1/src/stream.rs:14445 captured - ok yes 95b49d7aa81843399ee3aa64bdadfec8f4037bcc3f861923c9b2da3bc868b223 +crates/ec-av1/fixtures/444_lossy_superres_256x128_d12_12bit.obu crates/ec-av1/src/stream.rs:14492 captured - ok yes 973bf374c0185c4e6301509ce834cef01318e6cdb9488fd258118d7ec89bdd04 +crates/ec-av1/fixtures/444_lossy_superres_256x128_d12.obu crates/ec-av1/src/stream.rs:46912 captured - ok yes 450caa3e31526a8973b9f64d5030a2f11b87bd60fac07aef121cb62af9bf85ff +crates/ec-av1/fixtures/444_lossy_superres_256x128_d9_12bit.obu crates/ec-av1/src/stream.rs:14519 captured - ok yes 898c775108495b998cb5ec9b08e194d4656ed0140aa8e7e7236892d468bbad99 +crates/ec-av1/fixtures/444_lossy_superres_256x128_d9.obu crates/ec-av1/src/stream.rs:47302 captured - ok yes 3d619ee0fda3d9bb9cf8ff0541ba00ea5d83ae38cd8eec1322f8dbbbe6a5ec96 +crates/ec-av1/fixtures/444_lossy_superres_mode2_256x128_10bit.obu crates/ec-av1/src/stream.rs:14560 captured - ok yes 699398aba58fb53b80e05d3d214eb746a3c91945e01da6b47488513f20b55668 +crates/ec-av1/fixtures/444_lossy_superres_mode2_256x128_12bit.obu crates/ec-av1/src/stream.rs:14607 captured - ok yes 18aa8b3124ab10672f22577a8eea81e44141a3d0bb506104aee2f950254a2e9f +crates/ec-av1/fixtures/444_lossy_superres_mode2_256x128.obu crates/ec-av1/src/stream.rs:47359 captured - ok yes c18496cf3b7db0feca9aa904024cec2115be80b5b94f87c848ac52f9b32ffd97 +crates/ec-av1/fixtures/444_lossy_superres_mode2_256x128.obu crates/ec-av1/src/stream.rs:47408 captured - ok yes c18496cf3b7db0feca9aa904024cec2115be80b5b94f87c848ac52f9b32ffd97 +crates/ec-av1/fixtures/444_quad_leaf_tx_type.obu crates/ec-av1/src/stream.rs:20817 captured - ok yes a06c9f7a0862252f6ab7ebdcec340d0602e730e38089365f14747db37f8e78d5 +crates/ec-av1/fixtures/444_rect_strip_leaf_tx_type.obu crates/ec-av1/src/stream.rs:20912 captured - ok yes 06174a66e92aaeb751a8e86db59711fcb1f18d74bde2d77e1ef1be7983eb7c80 +crates/ec-av1/fixtures/444_sb128rect_lr_witness.obu crates/ec-av1/src/stream.rs:14669 captured - ok yes 27825e14633a4b23e37d48a2acdc7f5d814ca4fadd0b8797d72a1ffb34061e80 +crates/ec-av1/fixtures/444_sb128rect_lr_witness.obu crates/ec-av1/src/stream.rs:20947 captured - ok yes 27825e14633a4b23e37d48a2acdc7f5d814ca4fadd0b8797d72a1ffb34061e80 +crates/ec-av1/fixtures/444_sb128rect_lr_witness.obu crates/ec-av1/src/stream.rs:7383 captured - ok yes 27825e14633a4b23e37d48a2acdc7f5d814ca4fadd0b8797d72a1ffb34061e80 +crates/ec-av1/fixtures/444_sb128rect_lr_witness.obu crates/ec-av1/src/stream.rs:8096 captured - ok yes 27825e14633a4b23e37d48a2acdc7f5d814ca4fadd0b8797d72a1ffb34061e80 +crates/ec-av1/fixtures/av112bit-compound-masked.obu (committed pin: NO source reference found) captured - ok yes 83625de2ed347d457eb67f9781eed3fea598ef035f29bbc311d7025fe178c691 +crates/ec-av1/fixtures/av112bit-compound.obu (committed pin: NO source reference found) captured - ok yes a839cff534b89d5cd52681dd43a7dedc10131d8dd7725bdfa5502d6bc4421740 +crates/ec-av1/fixtures/av112bit-inter.obu (committed pin: NO source reference found) captured - ok yes e679d577e61b4a8bc99685355cca8c0473cfb637284b07786a6c53b1755553d9 +crates/ec-av1/fixtures/av112bit-key.obu (committed pin: NO source reference found) captured - ok yes c74f62b57f71f7c36c49ea1feeb482786a2650e5c7f66610949b5f65fbbed8d1 +crates/ec-av1/fixtures/av1_192x128_8bit_intra64_in_inter.obu crates/ec-av1/src/stream.rs:20750 captured - ok yes e4cff46cb1700527c68efc866db27a2835705e949d646f73f0c9df577d594bd6 +crates/ec-av1/fixtures/av1_192x128_8bit_intra64_in_inter.obu crates/ec-av1/src/stream.rs:20850 captured - ok yes e4cff46cb1700527c68efc866db27a2835705e949d646f73f0c9df577d594bd6 +crates/ec-av1/fixtures/av1_192x128_8bit_intra64_in_inter.obu crates/ec-av1/src/stream.rs:21082 captured - ok yes e4cff46cb1700527c68efc866db27a2835705e949d646f73f0c9df577d594bd6 +crates/ec-av1/fixtures crates/ec-av1/src/stream.rs:14672 regenerated scripts/gen-fixtures.sh ok - - +crates/ec-av1/fixtures crates/ec-av1/src/stream.rs:14721 regenerated scripts/gen-fixtures.sh ok - - +crates/ec-av1/fixtures crates/ec-av1/src/stream.rs:14778 regenerated scripts/gen-fixtures.sh ok - - +crates/ec-av1/fixtures crates/ec-av1/src/stream.rs:2315 regenerated scripts/gen-fixtures.sh ok - - +crates/ec-av1/fixtures crates/ec-av1/src/stream.rs:2379 regenerated scripts/gen-fixtures.sh ok - - +crates/ec-av1/fixtures crates/ec-av1/src/stream.rs:2594 regenerated scripts/gen-fixtures.sh ok - - +crates/ec-av1/fixtures crates/ec-av1/src/stream.rs:2673 regenerated scripts/gen-fixtures.sh ok - - +crates/ec-av1/fixtures crates/ec-av1/src/stream.rs:44163 regenerated scripts/gen-fixtures.sh ok - - +crates/ec-av1/fixtures crates/ec-av1/src/stream.rs:44240 regenerated scripts/gen-fixtures.sh ok - - +crates/ec-av1/fixtures crates/ec-av1/src/stream.rs:45262 regenerated scripts/gen-fixtures.sh ok - - +crates/ec-av1/fixtures crates/ec-av1/src/stream.rs:9302 regenerated scripts/gen-fixtures.sh ok - - +crates/ec-av1/fixtures crates/ec-av1/src/stream.rs:9329 regenerated scripts/gen-fixtures.sh ok - - +crates/ec-av1/fixtures/filter_intra_8x16_strip_seed49.obu crates/ec-av1/src/stream.rs:38899 captured - ok yes 6f837e47ad0a67f31c3998aa789cf0811e7540ac2114981853a0148744cb76c2 +crates/ec-av1/fixtures/gm_small_side_witness.obu crates/ec-av1/src/stream.rs:44168 captured - ok yes f1cdbcbb8d6d469c7957d70252ab42b24ab75f48a717600ffa25991458775dca +crates/ec-av1/fixtures/gm_small_side_witness.obu crates/ec-av1/src/stream.rs:44245 captured - ok yes f1cdbcbb8d6d469c7957d70252ab42b24ab75f48a717600ffa25991458775dca +crates/ec-av1/fixtures/gm_small_side_witness.obu crates/ec-av1/src/stream.rs:44328 captured - ok yes f1cdbcbb8d6d469c7957d70252ab42b24ab75f48a717600ffa25991458775dca +crates/ec-av1/fixtures/gm_small_side_witness.obu crates/ec-av1/src/stream.rs:45257 captured - ok yes f1cdbcbb8d6d469c7957d70252ab42b24ab75f48a717600ffa25991458775dca +crates/ec-av1/fixtures/golden3-pin.obu crates/ec-av1/src/stream.rs:23900 captured - ok yes 11c9d5331cffa6614c8265ad5fa685d5ce9155db8439949b48ec4a652ace95cf +crates/ec-av1/fixtures/golden4-pin.obu crates/ec-av1/src/stream.rs:23954 recovered-original - ok yes 1754023e44e46edaebc2c05065bf1c65db1a41354577cbf71c0e8ebe737ae14a +crates/ec-av1/fixtures/golden4-pin.obu crates/ec-av1/src/stream.rs:23955 recovered-original - ok yes 1754023e44e46edaebc2c05065bf1c65db1a41354577cbf71c0e8ebe737ae14a +crates/ec-av1/fixtures/golden6-mismatch.obu crates/ec-av1/src/stream.rs:33509 recovered-original - ok yes c56909b98542192b03f3a945e153475aa57a58a1586bf166513297296cb225b3 +crates/ec-av1/fixtures/golden6-mismatch.obu crates/ec-av1/src/stream.rs:33510 recovered-original - ok yes c56909b98542192b03f3a945e153475aa57a58a1586bf166513297296cb225b3 +crates/ec-av1/fixtures/golden7-forwarding-mismatch.obu crates/ec-av1/src/stream.rs:23992 recovered-original - ok yes 81b3bf657a85e95085287b30d97dee93ba5aea0ed1db1e1f4fcd19a06afc17be +crates/ec-av1/fixtures/golden7-forwarding-mismatch.obu crates/ec-av1/src/stream.rs:23993 recovered-original - ok yes 81b3bf657a85e95085287b30d97dee93ba5aea0ed1db1e1f4fcd19a06afc17be +crates/ec-av1/fixtures/grain_cdef_lr_128x128.obu crates/ec-av1/src/stream.rs:14775 captured - ok yes 06f210b87b5c79eb729c559050e073abbe226c4dad1df3dcaa113b03011ad732 +crates/ec-av1/fixtures/reelb_arf_witness.obu crates/ec-av1/src/stream.rs:14660 captured - ok yes 7f3b060da5aa9c537633e760c4af71316237db7692f6ae0d459bd2c2dd867d37 +crates/ec-av1/fixtures/reelb_arf_witness.obu crates/ec-av1/src/stream.rs:43390 captured - ok yes 7f3b060da5aa9c537633e760c4af71316237db7692f6ae0d459bd2c2dd867d37 +crates/ec-av1/fixtures/reelb_arf_witness.obu crates/ec-av1/src/stream.rs:43472 captured - ok yes 7f3b060da5aa9c537633e760c4af71316237db7692f6ae0d459bd2c2dd867d37 +crates/ec-av1/fixtures/reelb_head_key_frame.obu crates/ec-av1/src/stream.rs:14913 captured - ok yes 53c311dec790bb2413afdde92cb24de498a7c4f66f6f0c7f4f5910ab0d2c65dc +crates/ec-av1/fixtures/reelb_head_mvclamp_witness.obu crates/ec-av1/src/stream.rs:44410 captured - ok yes 451a9b138995e636f22308847a123b5c8621d4908cd93772cf5bbf2b37df39d7 +crates/ec-av1/fixtures/reelb_intra14_witness.obu crates/ec-av1/src/stream.rs:43219 captured - ok yes 0eff603bf1608e47faf5e6729670c4c77cf5c674dbad3a1533ac6660151fd90e +crates/ec-av1/fixtures/reelb_kf900.obu crates/ec-av1/src/stream.rs:15055 captured - ok yes a273ae99328388be14a1ff8fa1c5a6d391a9948159eaef120e1b50e02015eb83 +crates/ec-av1/fixtures/reelb_kf900.obu crates/ec-av1/src/stream.rs:45188 captured - ok yes a273ae99328388be14a1ff8fa1c5a6d391a9948159eaef120e1b50e02015eb83 +crates/ec-av1/fixtures/reelb_rect64_intra16x4_witness.obu crates/ec-av1/src/stream.rs:43308 captured - ok yes c9e721088766163b9dbeb9fa8dd8b257ff0ec7f9157fc350de4d3c33cd9ec4e4 +crates/ec-av1/fixtures/reelb_ss300_key_frame.obu crates/ec-av1/src/stream.rs:15004 captured - ok yes 7e3ddf0d602f9496b2f7eb11f051fd4a045020e094d5bc02f83825e2c494ef12 +crates/ec-av1/fixtures/reelb_ss600_key_frame.obu crates/ec-av1/src/stream.rs:15096 captured - ok yes 36de46676ed7de7049d4dabe8571d8cd31c8a1f53d72011c0ee532a7c6725cd6 +crates/ec-av1/fixtures/ii-flake-1.obu crates/ec-av1/src/stream.rs:31405 captured - ok yes 700ded3e61e15bc3573d339d7fcc6ab94500adb796c30021094d354306662238 +crates/ec-av1/fixtures/ii-flake-2.obu crates/ec-av1/src/stream.rs:31406 captured - ok yes edc4ad3a6c00c6bc909c626fa24433ef31a88ed519ed57403f5373a160e590af +crates/ec-av1/fixtures/ii-flake-3.obu crates/ec-av1/src/stream.rs:31407 captured - ok yes 994bfbdc952ecef18ae1560d5e7f121ba1000172e0bc2ad05e5b8cfaa17b15cb +crates/ec-av1/fixtures/ii-flake-5.obu crates/ec-av1/src/stream.rs:31408 captured - ok yes f43fe77ea0e8ddd9c1524b642e09f935921cb0d00c4a60061a52d2260af38b9a +crates/ec-av1/fixtures/ii-flake-6.obu crates/ec-av1/src/stream.rs:31409 captured - ok yes 84a1f60011dfdb77ede98ce95a25d247d270b0af1cff2c44aa1e6b311ca63dce +crates/ec-av1/fixtures/ii-flake-7.obu crates/ec-av1/src/stream.rs:31410 captured - ok yes 61ba4d114aa55ebcf95ae691abbce3307146a2d969c0627ea3ceea02f3875574 +crates/ec-av1/fixtures/ii-flake-8.obu crates/ec-av1/src/stream.rs:31411 captured - ok yes f19d3d80ed564850cec02a26cfe7ab00e282afa7896821c535a117f5541bef5d +crates/ec-av1/fixtures/ii-flake-9.obu crates/ec-av1/src/stream.rs:31415 captured - ok yes 0df4874737cc615258c0fdfb4bcb157c9a3663127cbf0a896af44d4deb83c653 +crates/ec-av1/fixtures/intra128_in_inter_screen_witness.obu crates/ec-av1/src/stream.rs:43890 captured - ok yes c84a493f90327f5d2bea038a42e87cbfe56762b5c6a856d76b4bff9797c5ea09 +crates/ec-av1/fixtures/intra128_in_inter_witness2.obu crates/ec-av1/src/stream.rs:43822 captured - ok yes cace4cc3a5ba4dc5f8c7c219e87c9052351e832cad3d7f4c8ffe09288a6d7ccf +crates/ec-av1/fixtures/intra128_in_inter_witness2.obu crates/ec-av1/src/stream.rs:44167 captured - ok yes cace4cc3a5ba4dc5f8c7c219e87c9052351e832cad3d7f4c8ffe09288a6d7ccf +crates/ec-av1/fixtures/intra128_in_inter_witness2.obu crates/ec-av1/src/stream.rs:44244 captured - ok yes cace4cc3a5ba4dc5f8c7c219e87c9052351e832cad3d7f4c8ffe09288a6d7ccf +crates/ec-av1/fixtures/intra128_in_inter_witness.obu crates/ec-av1/src/stream.rs:43726 captured - ok yes dd41fc39367a3d38bf8a8a8106dc30d91b716b2a9123fdfa4716930f4f98caf9 +crates/ec-av1/fixtures/intra14_256x192_10bit.obu crates/ec-av1/src/stream.rs:42544 captured - ok yes ab6fae0a256af6410e8200f10827a3e965dee7b2d7ab63710e94968bddab23a2 +crates/ec-av1/fixtures/intra14_256x192_8bit.obu crates/ec-av1/src/stream.rs:42552 captured - ok yes 5e50eb6d4492e806a2803988d92bd47f069ca54e02c06344d5500c6b72deb861 +crates/ec-av1/fixtures/intrabc_tx4_chroma_kf.obu crates/ec-av1/src/stream.rs:12238 captured - ok yes bc699af4a6e7c1c5657f041e8cbdf2d3d899ddb80ec2a549a950b7cebb5b41bd +crates/ec-av1/fixtures/ll444_128root_lossless.obu crates/ec-av1/src/stream.rs:7010 captured - ok yes bbffb979d20d581deb271aac75b7ee779dde57c024524ed6b1389356f55ca0fa +crates/ec-av1/fixtures/ll444_128root_lossless.obu crates/ec-av1/src/stream.rs:7130 captured - ok yes bbffb979d20d581deb271aac75b7ee779dde57c024524ed6b1389356f55ca0fa +crates/ec-av1/fixtures/ll444_defaultp_inter_strip.obu crates/ec-av1/src/stream.rs:8272 captured - ok yes 1e6dd4e05038c8d51e2c8d29f8c337130c4fea0aed629415535e6e53af9a2c72 +crates/ec-av1/fixtures/ll444_ibc_rect.obu crates/ec-av1/src/stream.rs:8841 captured - ok yes 482dedca0201beea9b0a05720b5da7fe93c350c9fea7699cdb010c3fbc227ec0 +crates/ec-av1/fixtures/ll444-lossless-key.obu crates/ec-av1/src/stream.rs:6707 captured - ok yes f496ef0a1171c2bc66d411cc60db05db547dcdb49cd834d4e0543de9db441374 +crates/ec-av1/fixtures/ll444_minp64_128root_control.obu crates/ec-av1/src/stream.rs:7061 captured - ok yes 4cadce41e1f8967567b32f5cf8abaa46ffdf4fd6d4afe784c8d99a7f6bf1ae4c +crates/ec-av1/fixtures/ll444_minp64_128root_control.obu crates/ec-av1/src/stream.rs:7175 captured - ok yes 4cadce41e1f8967567b32f5cf8abaa46ffdf4fd6d4afe784c8d99a7f6bf1ae4c +crates/ec-av1/fixtures/ll444_minp64_inter.obu crates/ec-av1/src/stream.rs:6859 captured - ok yes 5a070fa351a3f2109de855234f2b3d0a872970f3e7f658db21f65c12eeb135b4 +crates/ec-av1/fixtures/ll444_minp8_inter.obu crates/ec-av1/src/stream.rs:21007 captured - ok yes 04fb6d38de5382e647bfb70b6a17802f1fccc5502e6698c0394167891f2b27dc +crates/ec-av1/fixtures/ll444_minp8_inter.obu crates/ec-av1/src/stream.rs:7240 captured - ok yes 04fb6d38de5382e647bfb70b6a17802f1fccc5502e6698c0394167891f2b27dc +crates/ec-av1/fixtures/ll444_rect16x4_chroma_reach.obu crates/ec-av1/src/stream.rs:11312 captured - ok yes 382e67c0cc0988d14c500a62f5c3457a3f3b5f76d05acce2f655b1089bb8e7e3 +crates/ec-av1/fixtures/ll444_sb64_1to4_lossless.obu crates/ec-av1/src/stream.rs:46569 captured - ok yes fdb6467987095b99c8eb51b48743691d906b2d99d069f71f1d51b1abb6d2056e +crates/ec-av1/fixtures/lossless_sb128_rect_kf.obu crates/ec-av1/src/stream.rs:8520 captured - ok yes 013b07979c8be999c70d47f32768c2bf959be086a893f60dde1b0f5e35d4f475 +crates/ec-av1/fixtures/lr-sgr-r7.obu crates/ec-av1/src/stream.rs:30519 recovered-original - ok yes 6b95b20e3377430ffae0b2ce86fad9502e0dedf13cd6c38ab7f5af4a8b21f33d +crates/ec-av1/fixtures/lr-sgr-r7.obu crates/ec-av1/src/stream.rs:30520 recovered-original - ok yes 6b95b20e3377430ffae0b2ce86fad9502e0dedf13cd6c38ab7f5af4a8b21f33d +crates/ec-av1/fixtures/palette_screen_leaf8_witness.obu crates/ec-av1/src/stream.rs:44066 captured - ok yes 8d036606116913c82b774286bb0a3efe616d54151784897ba62b13d12fdef06e +crates/ec-av1/fixtures/palette_screen_strip16_witness_10bit.obu crates/ec-av1/src/stream.rs:44110 captured - ok yes aaabbb001d87f61ee534fd17c2d558ad906d1c33d357decb86cfd26e593da0db +crates/ec-av1/fixtures/palette_screen_witness_10bit.obu crates/ec-av1/src/stream.rs:14662 captured - ok yes a60a8bc132e5db7bed3eb46e03e9ed9828811bdffb96914958f3c94b107c3cda +crates/ec-av1/fixtures/palette_screen_witness_10bit.obu crates/ec-av1/src/stream.rs:43985 captured - ok yes a60a8bc132e5db7bed3eb46e03e9ed9828811bdffb96914958f3c94b107c3cda +crates/ec-av1/fixtures/palette_screen_witness.obu crates/ec-av1/src/stream.rs:14661 captured - ok yes 635a512b866f0fab7d45eb4f94f2a5b15008fe5a5317ac1ca45ffd3381198b8b +crates/ec-av1/fixtures/palette_screen_witness.obu crates/ec-av1/src/stream.rs:43391 captured - ok yes 635a512b866f0fab7d45eb4f94f2a5b15008fe5a5317ac1ca45ffd3381198b8b +crates/ec-av1/fixtures/palette_screen_witness.obu crates/ec-av1/src/stream.rs:43984 captured - ok yes 635a512b866f0fab7d45eb4f94f2a5b15008fe5a5317ac1ca45ffd3381198b8b +crates/ec-av1/fixtures/rect64_dq_drift.obu crates/ec-av1/src/stream.rs:39718 captured - ok yes 094e51bb21b6caccc905417e95a03f9131b448071567d0b14ec8850799ea2501 +crates/ec-av1/fixtures/rect-flake-1.obu crates/ec-av1/src/stream.rs:31418 captured - ok yes a3869b5d2bd8a8bc5413e0d039d5e3375a48601cdeb2edb8d4b732402926d357 +crates/ec-av1/fixtures/rect-flake-2.obu crates/ec-av1/src/stream.rs:31423 captured - ok yes c780ddee1adf25cf63a6ba70ff449820f6f4474b23ef16615c1e843ad0c86adb +crates/ec-av1/fixtures/rect-flake-3.obu crates/ec-av1/src/stream.rs:31427 captured - ok yes 3b23d204549b7bcfbd7166b1b3e2920580236c78de12e8f23f7fb64c1864f3e6 +crates/ec-av1/fixtures/sbpart-pin.obu crates/ec-av1/src/stream.rs:39801 captured - ok yes 62238fc077f45d89745d4d254b9c0465464003529da3b42d0a65631fbb7e16e9 +crates/ec-av1/fixtures/superres_alltools_sb128_320x180.obu crates/ec-av1/src/stream.rs:14722 captured - ok yes e2b515ce487acd2d720d5a000a6f26e66fd03ef2b1a4cb12daa6fdf31a55d519 +crates/ec-av1/fixtures/superres_alltools_sb128_320x180.obu crates/ec-av1/src/stream.rs:14774 captured - ok yes e2b515ce487acd2d720d5a000a6f26e66fd03ef2b1a4cb12daa6fdf31a55d519 +crates/ec-av1/fixtures/superres_alltools_sb128_320x180.obu crates/ec-av1/src/stream.rs:14877 captured - ok yes e2b515ce487acd2d720d5a000a6f26e66fd03ef2b1a4cb12daa6fdf31a55d519 +crates/ec-av1/fixtures/superres_kf_cdef_lr_64x64.obu crates/ec-av1/src/stream.rs:14198 captured - ok yes 5912e251bcd5d0f284f647616f91b19b579238c16fa85c0294a06548088d7336 +crates/ec-av1/fixtures/reelc_kf2700.obu crates/ec-av1/src/stream.rs:14951 captured - ok yes 16981094eaab516bd1007b0a47d1fc653fbb58b7e18a40af6c12d934bf96fe63 +crates/ec-av1/fixtures/reelc_sb128_inter_witness.obu crates/ec-av1/src/stream.rs:43563 captured - ok yes 09d995946d27695ef4b7b1a24a4d7ad85f8e2c8176d58ee54e825efc061f9cbc +crates/ec-av1/fixtures/reelc_sb128_inter_witness.obu crates/ec-av1/src/stream.rs:44166 captured - ok yes 09d995946d27695ef4b7b1a24a4d7ad85f8e2c8176d58ee54e825efc061f9cbc +crates/ec-av1/fixtures/reelc_sb128_inter_witness.obu crates/ec-av1/src/stream.rs:44243 captured - ok yes 09d995946d27695ef4b7b1a24a4d7ad85f8e2c8176d58ee54e825efc061f9cbc +crates/ec-av1/fixtures/reelc_sb128_inter_witness.obu crates/ec-av1/src/stream.rs:45258 captured - ok yes 09d995946d27695ef4b7b1a24a4d7ad85f8e2c8176d58ee54e825efc061f9cbc +crates/ec-av1/fixtures/warp-flake-5.obu crates/ec-av1/src/stream.rs:31403 captured - ok yes 1a99f9e5b257eed0ebae055441904d6c40962a26c0c2d63c3e051732569ff0a0 +crates/ec-av1/fixtures/warp-flake-7.obu crates/ec-av1/src/stream.rs:31404 captured - ok yes c2f8b93f5a59c56b1c4453ea789e0fc955557ed9b63c0e2cb8683fa483eff2b5 +crates/ec-av1/fixtures/warp-mismatch.obu crates/ec-av1/src/stream.rs:31402 captured - ok yes 24cca5beb41c1078f8109d8fa7e35f10cc1eefb67c6d1d1ea248a0b6842287bb +fixtures/audio/aac-adts-5.1-44100.aac crates/ec-aac/tests/oracle.rs:151 regenerated scripts/gen-fixtures.sh ok - 2b615b45e7c45136e2d477bd5ed489822ddadcb5f1b7fe2da0a66dcc288881b4 +fixtures/audio/aac-adts-5.1-48000.aac crates/ec-aac/tests/oracle.rs:152 regenerated scripts/gen-fixtures.sh ok - f416a2059766b6ce751bdf272836897c191073ca9f4f302552e949eeeeb01a44 +fixtures/audio/aac-adts-5.1-48000.aac crates/ec-probe/tests/matrix.rs:95 regenerated scripts/gen-fixtures.sh ok - f416a2059766b6ce751bdf272836897c191073ca9f4f302552e949eeeeb01a44 +fixtures/audio/aac-adts-mono-44100.aac crates/ec-aac/tests/oracle.rs:147 regenerated scripts/gen-fixtures.sh ok - 19b3870bc9e6e87dd20f448795899514e8cf5abfc770173c4c928468811dbdb7 +fixtures/audio/aac-adts-mono-44100.aac crates/ec-probe/tests/matrix.rs:93 regenerated scripts/gen-fixtures.sh ok - 19b3870bc9e6e87dd20f448795899514e8cf5abfc770173c4c928468811dbdb7 +fixtures/audio/aac-adts-mono-48000.aac crates/ec-aac/tests/oracle.rs:148 regenerated scripts/gen-fixtures.sh ok - 8e65736140a0dc7939060569250611ab822c7f489bddca3c0934728648c99180 +fixtures/audio/aac-adts-stereo-44100.aac crates/ec-aac/tests/oracle.rs:149 regenerated scripts/gen-fixtures.sh ok - 99cf6fad337acd097dabfb22b165984feedcf0f47427d093be7f5f76b5f515dd +fixtures/audio/aac-adts-stereo-48000.aac crates/ec-aac/tests/oracle.rs:150 regenerated scripts/gen-fixtures.sh ok - 3a8ce7512b5d8f9bda4f4e605023a2e68d793f4bc7697bbcd7c92e419b21edca +fixtures/audio/aac-adts-stereo-48000.aac crates/ec-probe/tests/matrix.rs:94 regenerated scripts/gen-fixtures.sh ok - 3a8ce7512b5d8f9bda4f4e605023a2e68d793f4bc7697bbcd7c92e419b21edca +fixtures/audio/aac-mka-stereo-48000.mka crates/ec-probe/src/lib.rs:1145 regenerated scripts/gen-fixtures.sh ok - 5ca5f13047f8f5a3e1876aa0d8d0c22251a45d0220e7c95326aea52e184c9260 +fixtures/audio/aac-mp4-5.1-44100.mp4 crates/ec-probe/tests/matrix.rs:97 regenerated scripts/gen-fixtures.sh ok - 6e9ec3be717f3dcd011a1ac832f04405897a406ef21f831dc7ee04ab70880680 +fixtures/audio/aac-mp4-5.1-48000.mp4 crates/ec-aac/tests/oracle.rs:187 regenerated scripts/gen-fixtures.sh ok - 5896e86836a0717e34b27ee44510cb879fe5460e53dfdd9f4c75cf0be432ba8a +fixtures/audio/aac-mp4-mono-48000.mp4 crates/ec-aac/tests/oracle.rs:185 regenerated scripts/gen-fixtures.sh ok - 787b45a7348acdde7fc8f9793ce9edc587b1df5ab98cba79eea0f2744c10c633 +fixtures/audio/aac-mp4-stereo-48000.mp4 crates/ec-aac/tests/oracle.rs:186 regenerated scripts/gen-fixtures.sh ok - 68b9f0d0e99868c010743362ffc03126a1a6b69fce4f3740bdfa0c8c06f7e57b +fixtures/audio/aac-mp4-stereo-48000.mp4 crates/ec-probe/tests/matrix.rs:96 regenerated scripts/gen-fixtures.sh ok - 68b9f0d0e99868c010743362ffc03126a1a6b69fce4f3740bdfa0c8c06f7e57b +fixtures/audio/alac24-mp4-5.1-48000.m4a crates/ec-alac/tests/oracle.rs:72 regenerated scripts/gen-fixtures.sh ok - b9007c453614808e4f5f777e51bef7baab1419c80b7d502c9e30a60878aa6de5 +fixtures/audio/alac24-mp4-stereo-48000.m4a crates/ec-alac/tests/oracle.rs:71 regenerated scripts/gen-fixtures.sh ok - cf3fffc6723e86344c1d2d626d4e1e22f5164bdf7ccccad1d6052b2ce70409ae +fixtures/audio/alac24-mp4-stereo-48000.m4a crates/ec-probe/tests/matrix.rs:100 regenerated scripts/gen-fixtures.sh ok - cf3fffc6723e86344c1d2d626d4e1e22f5164bdf7ccccad1d6052b2ce70409ae +fixtures/audio/alac-mp4-5.1-44100.m4a crates/ec-alac/tests/oracle.rs:69 regenerated scripts/gen-fixtures.sh ok - 037c576aa9f0ebe4dff5a0b41278d9ea1967b3a1eaf0fb9b893ff00e2dbccdf1 +fixtures/audio/alac-mp4-5.1-48000.m4a crates/ec-alac/tests/oracle.rs:70 regenerated scripts/gen-fixtures.sh ok - d9e224c52f2efc71cb6be4d18e840d58a941eafe96d80fe6b219f605aebb7d01 +fixtures/audio/alac-mp4-5.1-48000.m4a crates/ec-probe/tests/matrix.rs:99 regenerated scripts/gen-fixtures.sh ok - d9e224c52f2efc71cb6be4d18e840d58a941eafe96d80fe6b219f605aebb7d01 +fixtures/audio/alac-mp4-mono-44100.m4a crates/ec-alac/tests/oracle.rs:65 regenerated scripts/gen-fixtures.sh ok - c390c7674f81a3bdea622f4bcace2b593aae848e26563e09929b32a99a2a9869 +fixtures/audio/alac-mp4-mono-48000.m4a crates/ec-alac/tests/oracle.rs:66 regenerated scripts/gen-fixtures.sh ok - d765d1adbba124e97c8bcb27a0a2e5aa7b3a181c0c1d7d134a18675f62597205 +fixtures/audio/alac-mp4-stereo-44100.m4a crates/ec-alac/tests/oracle.rs:112 regenerated scripts/gen-fixtures.sh ok - 014d2691a0f8490e4d5da626e046d2680ff554db72cfdc688c5697c1bc350114 +fixtures/audio/alac-mp4-stereo-44100.m4a crates/ec-alac/tests/oracle.rs:67 regenerated scripts/gen-fixtures.sh ok - 014d2691a0f8490e4d5da626e046d2680ff554db72cfdc688c5697c1bc350114 +fixtures/audio/alac-mp4-stereo-44100.m4a crates/ec-probe/tests/matrix.rs:98 regenerated scripts/gen-fixtures.sh ok - 014d2691a0f8490e4d5da626e046d2680ff554db72cfdc688c5697c1bc350114 +fixtures/audio/alac-mp4-stereo-48000.m4a crates/ec-alac/tests/oracle.rs:68 regenerated scripts/gen-fixtures.sh ok - f35830614c8f32a0f00ac689377ea45cd281740485322daa0fcb6aa131a398e5 +fixtures/audio/av-h264-aac-stereo-48000.mkv crates/ec-probe/tests/matrix.rs:110 regenerated scripts/gen-fixtures.sh ok - da4cd8ad5a9be7b148926fdda36969569c3528279c73bdd2f4a36d8266612560 +fixtures/audio/cover-mp4-stereo-44100.m4a crates/ec-probe/tests/matrix.rs:260 regenerated scripts/gen-fixtures.sh ok - b8ef543bdc0aa4d05628efaa9648121af00a159fb1d80cfb1c8a53dfdb9d6941 +fixtures/audio crates/ec-ac3/tests/decode_matrix.rs:23 regenerated scripts/gen-fixtures.sh ok - - +fixtures/audio crates/ec-ac3/tests/decode_matrix.rs:25 regenerated scripts/gen-fixtures.sh ok - - +fixtures/audio crates/ec-ac3/tests/encode_matrix.rs:291 regenerated scripts/gen-fixtures.sh ok - - +fixtures/audio crates/ec-alac/tests/encode.rs:15 regenerated scripts/gen-fixtures.sh ok - - +fixtures/audio crates/ec-alac/tests/oracle.rs:17 regenerated scripts/gen-fixtures.sh ok - - +fixtures/audio crates/ec-ogg/tests/ogg.rs:32 regenerated scripts/gen-fixtures.sh ok - - +fixtures/audio crates/ec-opus/tests/conformance.rs:541 regenerated scripts/gen-fixtures.sh ok - - +fixtures/audio crates/ec-probe/tests/matrix.rs:17 regenerated scripts/gen-fixtures.sh ok - - +fixtures/audio crates/ec-riff/tests/wav.rs:432 regenerated scripts/gen-fixtures.sh ok - - +fixtures/audio/flac-5.1-44100.flac crates/ec-probe/tests/matrix.rs:90 regenerated scripts/gen-fixtures.sh ok - 83f3731bcf67f9f4ff12f793ed89c6cf73f17a985403648e2f3c7908b4705e99 +fixtures/audio/flac-mono-44100.flac crates/ec-probe/tests/matrix.rs:88 regenerated scripts/gen-fixtures.sh ok - f55187711aaf27af6bbb5cd493ce2fdc53c82dff33472b7918eda7e76c024258 +fixtures/audio/flac-stereo-48000.flac crates/ec-probe/tests/matrix.rs:300 regenerated scripts/gen-fixtures.sh ok - 50cfaa89da637107348d1986711d37e4f313a502df72fb2b6b53ca699d5f17b0 +fixtures/audio/flac-stereo-48000.flac crates/ec-probe/tests/matrix.rs:89 regenerated scripts/gen-fixtures.sh ok - 50cfaa89da637107348d1986711d37e4f313a502df72fb2b6b53ca699d5f17b0 +fixtures/audio/opus-ogg-5.1-48000.opus crates/ec-opus/tests/conformance.rs:632 regenerated scripts/gen-fixtures.sh ok - b005631cb93ed64166199cdcacfb2d22635abe703d6d6750ad0f900d03766c69 +fixtures/audio/opus-ogg-5.1-48000.opus crates/ec-opus/tests/conformance.rs:676 regenerated scripts/gen-fixtures.sh ok - b005631cb93ed64166199cdcacfb2d22635abe703d6d6750ad0f900d03766c69 +fixtures/audio/opus-ogg-5.1-48000.opus crates/ec-opus/tests/conformance.rs:719 regenerated scripts/gen-fixtures.sh ok - b005631cb93ed64166199cdcacfb2d22635abe703d6d6750ad0f900d03766c69 +fixtures/audio/opus-ogg-5.1-48000.opus crates/ec-probe/tests/matrix.rs:106 regenerated scripts/gen-fixtures.sh ok - b005631cb93ed64166199cdcacfb2d22635abe703d6d6750ad0f900d03766c69 +fixtures/audio/opus-ogg-mono-48000.opus crates/ec-opus/tests/conformance.rs:630 regenerated scripts/gen-fixtures.sh ok - bf6b453b057bf0fbaffc8a84c417d667fc70e7545fe6af1aaa51d873ef7403dc +fixtures/audio/opus-ogg-mono-48000.opus crates/ec-probe/tests/matrix.rs:104 regenerated scripts/gen-fixtures.sh ok - bf6b453b057bf0fbaffc8a84c417d667fc70e7545fe6af1aaa51d873ef7403dc +fixtures/audio/opus-ogg-stereo-48000.opus crates/ec-opus/tests/conformance.rs:631 regenerated scripts/gen-fixtures.sh ok - 829e1a5d104b6d161d748dca82fef1fe28b35d10398b230bbddb39f8b1769cc9 +fixtures/audio/opus-ogg-stereo-48000.opus crates/ec-opus/tests/conformance.rs:718 regenerated scripts/gen-fixtures.sh ok - 829e1a5d104b6d161d748dca82fef1fe28b35d10398b230bbddb39f8b1769cc9 +fixtures/audio/opus-ogg-stereo-48000.opus crates/ec-probe/tests/matrix.rs:105 regenerated scripts/gen-fixtures.sh ok - 829e1a5d104b6d161d748dca82fef1fe28b35d10398b230bbddb39f8b1769cc9 +fixtures/audio/vorbis-ogg-5.1-48000.ogg crates/ec-probe/tests/matrix.rs:103 regenerated scripts/gen-fixtures.sh ok - 571dc4a174c340e29f3dfba1f5bee42c32d3b537106816e511e18ebbe1b8e717 +fixtures/audio/vorbis-ogg-mono-44100.ogg crates/ec-probe/tests/matrix.rs:101 regenerated scripts/gen-fixtures.sh ok - e77309d1a04df5a5a76f3ed4e121c0c427787fd85c81f13fb84b99d801ef9483 +fixtures/audio/vorbis-ogg-stereo-48000.ogg crates/ec-probe/tests/matrix.rs:102 regenerated scripts/gen-fixtures.sh ok - ce3b2c4d5c5be06ba85d6dab9c32f8e94cd27062c4cff161e1fde04cb96c832a +fixtures/audio/wav16-5.1-48000.wav crates/ec-probe/tests/matrix.rs:87 regenerated scripts/gen-fixtures.sh ok - 96a432a3138c9d5055f9cdce8ab9306001f825d948cbd2d337568e34b0c806de +fixtures/audio/wav16-mono-44100.wav crates/ec-probe/tests/matrix.rs:85 regenerated scripts/gen-fixtures.sh ok - 855f3b42a349299bae47db14cc76aceca2822071a55cf82f9423ff9de9f9d169 +fixtures/audio/wav16-mono-48000.wav crates/ec-opus/tests/conformance.rs:2061 regenerated scripts/gen-fixtures.sh ok - 739259114f735e36fa603b6d48457fd2953b5026cc33a7637aaad8b0b3d86f7d +fixtures/audio/wav16-mono-48000.wav crates/ec-opus/tests/conformance.rs:2435 regenerated scripts/gen-fixtures.sh ok - 739259114f735e36fa603b6d48457fd2953b5026cc33a7637aaad8b0b3d86f7d +fixtures/audio/wav16-stereo-48000.wav crates/ec-alac/tests/encode.rs:102 regenerated scripts/gen-fixtures.sh ok - 75a89990315315eb3f64ece40c791a8a0c7b72f71c7c4b9f46ed6a9f60200207 +fixtures/audio/wav16-stereo-48000.wav crates/ec-alac/tests/encode.rs:185 regenerated scripts/gen-fixtures.sh ok - 75a89990315315eb3f64ece40c791a8a0c7b72f71c7c4b9f46ed6a9f60200207 +fixtures/audio/wav16-stereo-48000.wav crates/ec-alac/tests/encode.rs:210 regenerated scripts/gen-fixtures.sh ok - 75a89990315315eb3f64ece40c791a8a0c7b72f71c7c4b9f46ed6a9f60200207 +fixtures/audio/wav16-stereo-48000.wav crates/ec-probe/tests/matrix.rs:86 regenerated scripts/gen-fixtures.sh ok - 75a89990315315eb3f64ece40c791a8a0c7b72f71c7c4b9f46ed6a9f60200207 +fixtures/bitstreams/av1-altref.ivf crates/ec-av1-syntax/tests/streams.rs:239 regenerated scripts/gen-bitstream-fixtures.sh ok - 3904cc9fd01624689f824b91c83530943027ac0097e80332daf310c660fec48f +fixtures/bitstreams/av1-profile1-444.ivf crates/ec-hw/tests/gpu.rs:495 regenerated scripts/gen-bitstream-fixtures.sh ok - 2e04b08114aeba5af059f93026046675584af940e23d0cfde325caf7969ca783 +fixtures/bitstreams crates/ec-av1-syntax/tests/streams.rs:14 regenerated scripts/gen-fixtures.sh ok - - +fixtures/bitstreams crates/ec-hw/tests/gpu.rs:28 regenerated scripts/gen-fixtures.sh ok - - +fixtures/bitstreams crates/ec-vp9-syntax/tests/streams.rs:14 regenerated scripts/gen-fixtures.sh ok - - +fixtures/bitstreams crates/ec-vp9/tests/hbd_exact.rs:46 regenerated scripts/gen-fixtures.sh ok - - +fixtures/bitstreams crates/ec-vp9/tests/ivf.rs:54 regenerated scripts/gen-fixtures.sh ok - - +fixtures/bitstreams crates/ec-vp9/tests/subsampling_exact.rs:57 regenerated scripts/gen-fixtures.sh ok - - +fixtures/bitstreams/h264-1080p-23.976-8bit.264 crates/ec-hw/tests/gpu.rs:1841 regenerated scripts/gen-bitstream-fixtures.sh ok - 44dc00696534ba5302b44e8791347439216c9e40068ae0e45009faf08bddfaae +fixtures/bitstreams/h264-1080p-23.976-8bit.264 crates/ec-hw/tests/gpu.rs:1920 regenerated scripts/gen-bitstream-fixtures.sh ok - 44dc00696534ba5302b44e8791347439216c9e40068ae0e45009faf08bddfaae +fixtures/bitstreams/h264-1080p-23.976-8bit.264 crates/ec-hw/tests/gpu.rs:1988 regenerated scripts/gen-bitstream-fixtures.sh ok - 44dc00696534ba5302b44e8791347439216c9e40068ae0e45009faf08bddfaae +fixtures/bitstreams/h264-1080p-23.976-8bit.264 crates/ec-hw/tests/gpu.rs:711 regenerated scripts/gen-bitstream-fixtures.sh ok - 44dc00696534ba5302b44e8791347439216c9e40068ae0e45009faf08bddfaae +fixtures/bitstreams/vp9-1080p-23.976-10bit.ivf crates/ec-vp9/tests/hbd_exact.rs:85 regenerated scripts/gen-bitstream-fixtures.sh ok - 731abcc45857ade311689065defae7166e25394386de01300174f5f4f122cef3 +fixtures/bitstreams/vp9-1080p-60-8bit.ivf crates/ec-vp9/tests/inter_pixels_exact.rs:170 regenerated scripts/gen-bitstream-fixtures.sh ok - - +fixtures/bitstreams/vp9-profile1-444.ivf crates/ec-hw/tests/gpu.rs:490 regenerated scripts/gen-bitstream-fixtures.sh ok - ceebede9c2df73b3e8c1b279f70eb8af658096abc2d8bd00aaa97afdd7900d86 +fixtures/bitstreams/vp9-profile1-444.ivf crates/ec-vp9/tests/subsampling_exact.rs:122 regenerated scripts/gen-bitstream-fixtures.sh ok - ceebede9c2df73b3e8c1b279f70eb8af658096abc2d8bd00aaa97afdd7900d86 +fixtures/bitstreams/vp9-profile1-444.ivf crates/ec-vp9/tests/subsampling_exact.rs:162 regenerated scripts/gen-bitstream-fixtures.sh ok - ceebede9c2df73b3e8c1b279f70eb8af658096abc2d8bd00aaa97afdd7900d86 +fixtures/bitstreams/vp9-profile3-444-10bit.ivf crates/ec-vp9/tests/subsampling_exact.rs:127 regenerated scripts/gen-bitstream-fixtures.sh ok - ba1af75f2b270b9e0ebb877cef72d9e741748482bd19924a4e1721682ee3f197 +fixtures/bitstreams/vp9-profile3-444-10bit.ivf crates/ec-vp9/tests/subsampling_exact.rs:171 regenerated scripts/gen-bitstream-fixtures.sh ok - ba1af75f2b270b9e0ebb877cef72d9e741748482bd19924a4e1721682ee3f197 +fixtures/bitstreams/vp9-superframe-altref.ivf crates/ec-vp9-syntax/tests/streams.rs:200 regenerated scripts/gen-bitstream-fixtures.sh ok - bfc59a9604aaddc6709971e0e81eca1178b0c0a32be83a3d5c7b5c078aa7a873 +fixtures/bitstreams/vp9-superframe-altref.ivf crates/ec-vp9/tests/keyframe_exact.rs:163 regenerated scripts/gen-bitstream-fixtures.sh ok - bfc59a9604aaddc6709971e0e81eca1178b0c0a32be83a3d5c7b5c078aa7a873 +fixtures/bitstreams/vp9-superframe-altref.ivf crates/ec-vp9/tests/scratch_err.rs:10 regenerated scripts/gen-bitstream-fixtures.sh ok - bfc59a9604aaddc6709971e0e81eca1178b0c0a32be83a3d5c7b5c078aa7a873 +fixtures/bitstreams/vp9-superframe-altref.ivf crates/ec-vp9/tests/scratch_err.rs:6 regenerated scripts/gen-bitstream-fixtures.sh ok - bfc59a9604aaddc6709971e0e81eca1178b0c0a32be83a3d5c7b5c078aa7a873 +fixtures/bitstreams/vp9-superframe-altref.ivf crates/ec-vp9/tests/scratch_hdr3.rs:6 regenerated scripts/gen-bitstream-fixtures.sh ok - bfc59a9604aaddc6709971e0e81eca1178b0c0a32be83a3d5c7b5c078aa7a873 +fixtures crates/ec-aac/tests/oracle.rs:11 regenerated scripts/gen-fixtures.sh ok - - +fixtures crates/ec-av1/src/encode.rs:16846 regenerated scripts/gen-fixtures.sh ok - - +fixtures crates/ec-av1/src/encode.rs:19728 regenerated scripts/gen-fixtures.sh ok - - +fixtures crates/ec-av1/src/encode.rs:21143 regenerated scripts/gen-fixtures.sh ok - - +fixtures crates/ec-av1/src/encode.rs:21525 regenerated scripts/gen-fixtures.sh ok - - +fixtures crates/ec-av1/src/encode.rs:22076 regenerated scripts/gen-fixtures.sh ok - - +fixtures crates/ec-av1/src/encode.rs:22632 regenerated scripts/gen-fixtures.sh ok - - +fixtures crates/ec-av1/src/stream.rs:9300 regenerated scripts/gen-fixtures.sh ok - - +fixtures crates/ec-flac/tests/encode_matrix.rs:48 regenerated scripts/gen-fixtures.sh ok - - +fixtures crates/ec-matroska/tests/matroska.rs:92 regenerated scripts/gen-fixtures.sh ok - - +fixtures crates/ec-mp3/tests/decode_matrix.rs:19 regenerated scripts/gen-fixtures.sh ok - - +fixtures crates/ec-mp3/tests/encode_matrix.rs:45 regenerated scripts/gen-fixtures.sh ok - - +fixtures crates/ec-mp4/tests/mp4.rs:19 regenerated scripts/gen-fixtures.sh ok - - +fixtures crates/ec-vorbis/tests/oracle.rs:18 regenerated scripts/gen-fixtures.sh ok - - +fixtures/stills crates/ec-image/tests/differential.rs:24 regenerated scripts/gen-fixtures.sh ok - - +fixtures/stills crates/ec-image/tests/fuzz.rs:15 regenerated scripts/gen-fixtures.sh ok - - +fixtures/subs crates/ec-subs/tests/real_library.rs:15 regenerated scripts/gen-fixtures.sh ok - - +fixtures/subs/real.ass crates/ec-subs/tests/real_library.rs:55 regenerated scripts/gen-subtitle-fixtures.sh ok - 519a838783208edd8140e7d034e6969298b66c6435594336326c6996b95b3bf6 +fixtures/subs/real.srt crates/ec-subs/tests/real_library.rs:28 regenerated scripts/gen-subtitle-fixtures.sh ok - 0b4b59d1044e78c3520c9baa265e25d3eb55decb514c61a97712beac070953c2 +fixtures/vectors/flac-xiph/flac-test-files-main crates/ec-flac/tests/xiph_vectors.rs:22 regenerated scripts/fetch-vectors.sh ok - - +fixtures/vectors/h264-jvt crates/ec-h264/tests/conformance.rs:68 regenerated scripts/fetch-vectors.sh ok - - +fixtures/vectors/opus-rfc6716/opus_testvectors crates/ec-opus/tests/conformance.rs:87 regenerated scripts/fetch-vectors.sh ok - - +fixtures/video crates/ec-av1/src/encode.rs:20457 regenerated scripts/gen-fixtures.sh ok - - +fixtures/video/h264-1080p-23.976-8bit.mp4 crates/ec-av1/src/encoder.rs:3263 regenerated scripts/gen-fixtures.sh ok - db7275c361b07985088e80337a6c8c144d232d12f4d57cb84645effe27195784 +fixtures/video/h264-1080p-23.976-8bit.mp4 crates/ec-av1/src/encoder.rs:6032 regenerated scripts/gen-fixtures.sh ok - db7275c361b07985088e80337a6c8c144d232d12f4d57cb84645effe27195784 +fixtures/video/h264-1080p-23.976-8bit.mp4 crates/ec-av1/src/encode.rs:20308 regenerated scripts/gen-fixtures.sh ok - db7275c361b07985088e80337a6c8c144d232d12f4d57cb84645effe27195784 +fixtures/video/h264-1080p-23.976-8bit.mp4 crates/ec-av1/src/encode.rs:20373 regenerated scripts/gen-fixtures.sh ok - db7275c361b07985088e80337a6c8c144d232d12f4d57cb84645effe27195784 +fixtures/video/h264-1080p-23.976-8bit.mp4 crates/ec-av1/src/encode.rs:20453 regenerated scripts/gen-fixtures.sh ok - db7275c361b07985088e80337a6c8c144d232d12f4d57cb84645effe27195784 +fixtures/video/h264-1080p-23.976-8bit.mp4 crates/ec-av1/src/encode.rs:20876 regenerated scripts/gen-fixtures.sh ok - db7275c361b07985088e80337a6c8c144d232d12f4d57cb84645effe27195784 +fixtures/video/h264-1080p-23.976-8bit.mp4 crates/ec-av1/src/encode.rs:21231 regenerated scripts/gen-fixtures.sh ok - db7275c361b07985088e80337a6c8c144d232d12f4d57cb84645effe27195784 +fixtures/video/h264-1080p-23.976-8bit.mp4 crates/ec-av1/src/encode.rs:21530 regenerated scripts/gen-fixtures.sh ok - db7275c361b07985088e80337a6c8c144d232d12f4d57cb84645effe27195784 +fixtures/video/h264-1080p-23.976-8bit.mp4 crates/ec-av1/src/encode.rs:22090 regenerated scripts/gen-fixtures.sh ok - db7275c361b07985088e80337a6c8c144d232d12f4d57cb84645effe27195784 +fixtures/video/h264-1080p-23.976-8bit.mp4 crates/ec-av1/src/encode.rs:22634 regenerated scripts/gen-fixtures.sh ok - db7275c361b07985088e80337a6c8c144d232d12f4d57cb84645effe27195784 +fixtures/video/h264-1080p-23.976-8bit.mp4 crates/ec-av1/src/stream.rs:44913 regenerated scripts/gen-fixtures.sh ok - db7275c361b07985088e80337a6c8c144d232d12f4d57cb84645effe27195784 +fixtures/video/h264-1080p-60-8bit.mp4 crates/ec-av1/src/encode.rs:20454 regenerated scripts/gen-fixtures.sh ok - - +fixtures/video/h264-2160p-23.976-8bit.mp4 crates/ec-av1/src/encode.rs:21232 regenerated scripts/gen-fixtures.sh ok - - +fixtures/video/h264-2160p-23.976-8bit.mp4 crates/ec-av1/src/encode.rs:21531 regenerated scripts/gen-fixtures.sh ok - - +fixtures/video/h264-2160p-23.976-8bit.mp4 crates/ec-av1/src/encode.rs:22091 regenerated scripts/gen-fixtures.sh ok - - +fixtures/video/h264-2160p-23.976-8bit.mp4 crates/ec-av1/src/encode.rs:22635 regenerated scripts/gen-fixtures.sh ok - - +fixtures/video/h264-2160p-23.976-8bit.mp4 crates/ec-av1/src/stream.rs:6288 regenerated scripts/gen-fixtures.sh ok - - +fixtures/video/h264-open-gop.mp4 crates/ec-h264/tests/conformance.rs:2381 regenerated scripts/gen-fixtures.sh ok - 0b3b316c3f786cf4cb158de1b9c81aa871b1bb0d8e2da30d451f741cacd5d0ff +fixtures/video/h264-open-gop.mp4 crates/ec-hw/tests/gpu.rs:2793 regenerated scripts/gen-fixtures.sh ok - 0b3b316c3f786cf4cb158de1b9c81aa871b1bb0d8e2da30d451f741cacd5d0ff +fixtures/vp8/altref-160x96.ivf crates/ec-vp8/tests/keyframe_exact.rs:108 regenerated scripts/gen_vp8_fixtures.sh ok - 32d610dc278e528a7d69c3543764cb000e927c6988e61ef0c4ba560e7d89b49e +fixtures/vp8/altref-160x96.ivf crates/ec-vp8/tests/keyframe_exact.rs:110 regenerated scripts/gen_vp8_fixtures.sh ok - 32d610dc278e528a7d69c3543764cb000e927c6988e61ef0c4ba560e7d89b49e +fixtures/vp8/altref-160x96.ivf crates/ec-vp8/tests/stream_exact.rs:23 regenerated scripts/gen_vp8_fixtures.sh ok - 32d610dc278e528a7d69c3543764cb000e927c6988e61ef0c4ba560e7d89b49e +fixtures/vp8/altref-160x96.ivf crates/ec-vp8/tests/stream_exact.rs:65 regenerated scripts/gen_vp8_fixtures.sh ok - 32d610dc278e528a7d69c3543764cb000e927c6988e61ef0c4ba560e7d89b49e +fixtures/vp8/clip-obs-320x192.ivf crates/ec-vp8/tests/keyframe_exact.rs:107 regenerated scripts/gen_vp8_fixtures.sh ok - e55b3dd585d6ea918cb7ffa9319e53b5e43b73db2d1db2c8b6a0ea7750e99cf2 +fixtures/vp8/clip-obs-320x192.ivf crates/ec-vp8/tests/stream_exact.rs:24 regenerated scripts/gen_vp8_fixtures.sh ok - e55b3dd585d6ea918cb7ffa9319e53b5e43b73db2d1db2c8b6a0ea7750e99cf2 +fixtures/vp8 crates/ec-vp8/tests/ivf.rs:81 regenerated scripts/gen-fixtures.sh ok - - +fixtures/vp8/gop-160x96.ivf crates/ec-vp8/tests/header_parse.rs:114 regenerated scripts/gen_vp8_fixtures.sh ok - 96a8cfbde1923df7f8df945f553cf20d0bf7088e025a2498c8910e98ffa43155 +fixtures/vp8/gop-160x96.ivf crates/ec-vp8/tests/keyframe_exact.rs:106 regenerated scripts/gen_vp8_fixtures.sh ok - 96a8cfbde1923df7f8df945f553cf20d0bf7088e025a2498c8910e98ffa43155 +fixtures/vp8/gop-160x96.ivf crates/ec-vp8/tests/stream_exact.rs:124 regenerated scripts/gen_vp8_fixtures.sh ok - 96a8cfbde1923df7f8df945f553cf20d0bf7088e025a2498c8910e98ffa43155 +fixtures/vp8/gop-160x96.ivf crates/ec-vp8/tests/stream_exact.rs:21 regenerated scripts/gen_vp8_fixtures.sh ok - 96a8cfbde1923df7f8df945f553cf20d0bf7088e025a2498c8910e98ffa43155 +fixtures/vp8/gop-96x80-v1.ivf crates/ec-vp8/tests/stream_exact.rs:20 regenerated scripts/gen_vp8_fixtures.sh ok - 5d4ed5fc0884e283de2c7508a9bcaa33e5d46a0ae10aa55dcca61bed63d5d786 +fixtures/vp8/kf-160x96-q20.ivf crates/ec-vp8/tests/header_parse.rs:11 regenerated scripts/gen_vp8_fixtures.sh ok - dd4ff6bd44711c98356687867fd724bd8ce5fc5e0f7262d993c31dffd58b438a +fixtures/vp8/kf-160x96-q20.ivf crates/ec-vp8/tests/keyframe_exact.rs:82 regenerated scripts/gen_vp8_fixtures.sh ok - dd4ff6bd44711c98356687867fd724bd8ce5fc5e0f7262d993c31dffd58b438a +fixtures/vp8/kf-160x96-q20.ivf crates/ec-vp8/tests/stream_exact.rs:17 regenerated scripts/gen_vp8_fixtures.sh ok - dd4ff6bd44711c98356687867fd724bd8ce5fc5e0f7262d993c31dffd58b438a +fixtures/vp8/kf-160x96-q40.ivf crates/ec-vp8/tests/header_parse.rs:12 regenerated scripts/gen_vp8_fixtures.sh ok - d079b3ee1c16c2b566f31c9bd57aa0a1af7b4a9fd13d555b0581d1e8d84f9ab2 +fixtures/vp8/kf-160x96-q40.ivf crates/ec-vp8/tests/keyframe_exact.rs:83 regenerated scripts/gen_vp8_fixtures.sh ok - d079b3ee1c16c2b566f31c9bd57aa0a1af7b4a9fd13d555b0581d1e8d84f9ab2 +fixtures/vp8/kf-160x96-q40.ivf crates/ec-vp8/tests/stream_exact.rs:18 regenerated scripts/gen_vp8_fixtures.sh ok - d079b3ee1c16c2b566f31c9bd57aa0a1af7b4a9fd13d555b0581d1e8d84f9ab2 +fixtures/vp8/kf-16x16-black-q0.ivf crates/ec-vp8/tests/stream_exact.rs:13 regenerated scripts/gen_vp8_fixtures.sh ok - 1e95a39ffe58f3046f675412c51bfbdc17344ff10c47ee0af3ca4b382022f43e +fixtures/vp8/kf-172x144-q25.ivf crates/ec-vp8/tests/header_parse.rs:15 regenerated scripts/gen_vp8_fixtures.sh ok - 4e29b24c86091051381a877d17a68a3195e44f65cc9ed1e01311e6e72d8d249d +fixtures/vp8/kf-172x144-q25.ivf crates/ec-vp8/tests/keyframe_exact.rs:86 regenerated scripts/gen_vp8_fixtures.sh ok - 4e29b24c86091051381a877d17a68a3195e44f65cc9ed1e01311e6e72d8d249d +fixtures/vp8/kf-172x144-q25.ivf crates/ec-vp8/tests/stream_exact.rs:19 regenerated scripts/gen_vp8_fixtures.sh ok - 4e29b24c86091051381a877d17a68a3195e44f65cc9ed1e01311e6e72d8d249d +fixtures/vp8/kf-32x16-q35.ivf crates/ec-vp8/tests/header_parse.rs:14 regenerated scripts/gen_vp8_fixtures.sh ok - 3d9bad9c985539ac24fb2f58b34d064b42e2e736584a2a250fccf0233a9c9eb3 +fixtures/vp8/kf-32x16-q35.ivf crates/ec-vp8/tests/keyframe_exact.rs:85 regenerated scripts/gen_vp8_fixtures.sh ok - 3d9bad9c985539ac24fb2f58b34d064b42e2e736584a2a250fccf0233a9c9eb3 +fixtures/vp8/kf-32x16-q35.ivf crates/ec-vp8/tests/stream_exact.rs:14 regenerated scripts/gen_vp8_fixtures.sh ok - 3d9bad9c985539ac24fb2f58b34d064b42e2e736584a2a250fccf0233a9c9eb3 +fixtures/vp8/kf-76x52-q30.ivf crates/ec-vp8/tests/header_parse.rs:13 regenerated scripts/gen_vp8_fixtures.sh ok - 15d05cb9ebd6bbfd4d8519b30256b28f2f55738754f68f00afef1cae9e66ad3a +fixtures/vp8/kf-76x52-q30.ivf crates/ec-vp8/tests/keyframe_exact.rs:84 regenerated scripts/gen_vp8_fixtures.sh ok - 15d05cb9ebd6bbfd4d8519b30256b28f2f55738754f68f00afef1cae9e66ad3a +fixtures/vp8/kf-76x52-q30.ivf crates/ec-vp8/tests/stream_exact.rs:15 regenerated scripts/gen_vp8_fixtures.sh ok - 15d05cb9ebd6bbfd4d8519b30256b28f2f55738754f68f00afef1cae9e66ad3a +fixtures/vp8/kf-96x80-q63.ivf crates/ec-vp8/tests/header_parse.rs:16 regenerated scripts/gen_vp8_fixtures.sh ok - 9c6052448106ad6adf84e905be881815befb3d45abf80bc3c8b17507c324555e +fixtures/vp8/kf-96x80-q63.ivf crates/ec-vp8/tests/keyframe_exact.rs:87 regenerated scripts/gen_vp8_fixtures.sh ok - 9c6052448106ad6adf84e905be881815befb3d45abf80bc3c8b17507c324555e +fixtures/vp8/kf-96x80-q63.ivf crates/ec-vp8/tests/stream_exact.rs:16 regenerated scripts/gen_vp8_fixtures.sh ok - 9c6052448106ad6adf84e905be881815befb3d45abf80bc3c8b17507c324555e +fixtures/vp8/mparts-160x96.ivf crates/ec-vp8/tests/header_parse.rs:17 regenerated scripts/gen_vp8_fixtures.sh ok - eb656c9e4547ad99bfe5a3a4ce5bf9c54daa4ba657fb7c3327d448a059760282 +fixtures/vp8/mparts-160x96.ivf crates/ec-vp8/tests/header_parse.rs:81 regenerated scripts/gen_vp8_fixtures.sh ok - eb656c9e4547ad99bfe5a3a4ce5bf9c54daa4ba657fb7c3327d448a059760282 +fixtures/vp8/mparts-160x96.ivf crates/ec-vp8/tests/keyframe_exact.rs:95 regenerated scripts/gen_vp8_fixtures.sh ok - eb656c9e4547ad99bfe5a3a4ce5bf9c54daa4ba657fb7c3327d448a059760282 +fixtures/vp8/mparts-160x96.ivf crates/ec-vp8/tests/stream_exact.rs:22 regenerated scripts/gen_vp8_fixtures.sh ok - eb656c9e4547ad99bfe5a3a4ce5bf9c54daa4ba657fb7c3327d448a059760282 +fixtures/vp9 crates/ec-vp9/tests/keyframe_exact.rs:116 regenerated scripts/gen-fixtures.sh ok - - +fixtures/vp9 crates/ec-vp9/tests/scratch_hdr.rs:7 regenerated scripts/gen-fixtures.sh ok - - +fixtures/vp9/key-320.ivf crates/ec-vp9/tests/dump_probe.rs:11 regenerated scripts/gen-fixtures.sh ok - bcd5a1df6c944a79b1f52cfe669e7c12f7f9b84ffbec8d3daf33475c4a0b7e67 +fixtures/vp9/key-320.ivf crates/ec-vp9/tests/dump_probe.rs:6 regenerated scripts/gen-fixtures.sh ok - bcd5a1df6c944a79b1f52cfe669e7c12f7f9b84ffbec8d3daf33475c4a0b7e67 +fixtures/vp9/key-320.ivf crates/ec-vp9/tests/keyframe_exact.rs:117 regenerated scripts/gen-fixtures.sh ok - bcd5a1df6c944a79b1f52cfe669e7c12f7f9b84ffbec8d3daf33475c4a0b7e67 +fixtures/vp9/key-320.ivf crates/ec-vp9/tests/scratch_hdr.rs:4 regenerated scripts/gen-fixtures.sh ok - bcd5a1df6c944a79b1f52cfe669e7c12f7f9b84ffbec8d3daf33475c4a0b7e67 +fixtures/vp9/key-320.ivf crates/ec-vp9/tests/scratch_lfdump.rs:22 regenerated scripts/gen-fixtures.sh ok - bcd5a1df6c944a79b1f52cfe669e7c12f7f9b84ffbec8d3daf33475c4a0b7e67 +fixtures/vp9/key-320.ivf crates/ec-vp9/tests/scratch_tok.rs:11 regenerated scripts/gen-fixtures.sh ok - bcd5a1df6c944a79b1f52cfe669e7c12f7f9b84ffbec8d3daf33475c4a0b7e67 +fixtures/vp9/lossless-64.ivf crates/ec-vp9/tests/keyframe_exact.rs:125 regenerated scripts/gen-fixtures.sh ok - 2cf9473fa47ec47f7ab94d77640aa0d58494edacc72cf151a784a76283c55147 +fixtures/vp9/lossless-64.ivf crates/ec-vp9/tests/scratch_bool.rs:7 regenerated scripts/gen-fixtures.sh ok - 2cf9473fa47ec47f7ab94d77640aa0d58494edacc72cf151a784a76283c55147 +fixtures/vp9/lossless-64.ivf crates/ec-vp9/tests/scratch_hdr2.rs:6 regenerated scripts/gen-fixtures.sh ok - 2cf9473fa47ec47f7ab94d77640aa0d58494edacc72cf151a784a76283c55147 +fixtures/vp9/lossless-64.ivf crates/ec-vp9/tests/scratch_hdr.rs:4 regenerated scripts/gen-fixtures.sh ok - 2cf9473fa47ec47f7ab94d77640aa0d58494edacc72cf151a784a76283c55147 +fixtures/vp9/lossless-64.ivf crates/ec-vp9/tests/scratch_lossless.rs:6 regenerated scripts/gen-fixtures.sh ok - 2cf9473fa47ec47f7ab94d77640aa0d58494edacc72cf151a784a76283c55147 +fixtures/vp9/lossless-64.ivf crates/ec-vp9/tests/scratch_sweep.rs:8 regenerated scripts/gen-fixtures.sh ok - 2cf9473fa47ec47f7ab94d77640aa0d58494edacc72cf151a784a76283c55147 diff --git a/scripts/gen-fixture-library.sh b/scripts/gen-fixture-library.sh new file mode 100755 index 00000000..1a5a47b6 --- /dev/null +++ b/scripts/gen-fixture-library.sh @@ -0,0 +1,324 @@ +#!/usr/bin/env bash +# gen-fixture-library.sh — GENERATE scripts/fixture-library.tsv from source. +# +# The tsv is committed output, never hand-typed. Regenerate with: +# scripts/gen-fixture-library.sh && git diff --exit-code scripts/fixture-library.tsv +# so drift between "what the tests reach for" and "the manifest" is a +# one-command diff. `scripts/verify-fixture-library.sh` runs that same diff as +# part of its exit status. +# +# COLUMNS (tab separated) +# 1 path repo-relative; `fixtures/...` is relative to $EC_FIXTURES +# 2 required-by file:line of every reference (one row per reference) +# 3 provenance the script/recipe that reproduces the bytes, or +# `none (prose provenance only)` — a FINDING, not a +# placeholder: a pinned fixture claim must cite the +# originating encoder program and the artifact sha256, or the +# pin is unreproducible (the IVF-container drift incident is +# why that rule exists) +# 4 status ok | missing | empty-dir | absent-pin +# 5 sha256 of the artefact, when it is a regular file under 4 MiB +# +# ENUMERATION SHAPES the scan is derived from: +# CARGO_MANIFEST_DIR env!("CARGO_MANIFEST_DIR") / concat!(env!(...)) +# concat!(env!( a fixture root assembled from the manifest dir +# include_bytes! include_bytes!/include_str! argument literals +# "fixtures/ any string literal naming the fixture tree +# ../../fixtures crate-relative literals (CWD is the crate dir) +# Path::new( Path::new("...") argument literals +# fs::read fs::read / read_dir / File::open argument literals +# +# TWO PASSES: +# 1. fixture-root / fixture-path literals -> the row is the literal itself. +# 2. bare media-file literals ("aac-adts-5.1-44100.aac", "entry-tx3g.mp4") +# joined onto each fixture directory literal seen in the SAME file, then +# onto the standard top-level library directories. Only joins that +# resolve are emitted; unresolved names are counted in the header as the +# declared blind spot. +# +# BLIND SPOT (honest: this is a preflight, not a proof). The scan is literal- +# and grep-derived, so it cannot see a path assembled at runtime from a value +# that is not a literal in the same file -- a vector name read from +# scripts/vectors.sha256, a row from fixtures/real-library-manifest.tsv, a +# format! interpolation, a name in a table. For those, the parent DIRECTORY is +# still enumerated, and the verifier requires every listed directory to exist +# AND be non-empty -- that is what catches the "three hosts whose fixture +# libraries differed" class. A single missing member of a runtime-named corpus +# shows up as a regeneration diff, not as a resolve failure. + +set -uo pipefail + +ROOT=$(cd -- "$(dirname -- "$0")/.." && pwd) +OUT=${1:-$ROOT/scripts/fixture-library.tsv} +FIXTURES=${EC_FIXTURES:-$ROOT/fixtures} + +MEDIA_RE='\.(mp4|m4a|m4s|m4v|mkv|ivf|obu|flac|opus|ogg|oga|webm|265|264|h264|h265|hevc|y4m|yuv|wav|aac|ts|bin|ttml|srt|vtt|ass|json)' + +# Pins that are KNOWN ABSENT and must not vanish from the manifest. Each is +# recorded as an `absent-pin` row naming the gate that wants it, so the gap is +# visible instead of silently skipped. +# Provenance CLASS per row, kept separate from the GENERATOR script so a +# recovered witness is never confused with a re-encode: +# recovered-original the historical bytes, copied from a runner library; a +# re-encode is a DIFFERENT stream and would not hash the +# same, so column 7 is the self-validation +# captured committed bytes whose only provenance is a gate comment +# (a FINDING: no encoder recipe is recorded) +# regenerated a script in column 4 reproduces the bytes +# absent-pin referenced by code, not present; named so the gap is a row +# host-corpus a developer media file, not part of the library +RECOVERED_PINS="golden4-pin.obu golden6-mismatch.obu golden7-forwarding-mismatch.obu lr-sgr-r7.obu" + +pin_class() { # $1 = manifest path -> class + local path=$1 base + base=${path##*/} + case " $RECOVERED_PINS " in + *" $base "*) + case $path in + crates/*/fixtures/*) echo "recovered-original" ;; + *) echo "regenerated" ;; # a same-named generated artefact + esac + return 0 ;; + esac + case $path in + fixtures/ll444-lossless-key.obu | fixtures/golden3-pin.obu | fixtures/sbpart-pin.obu) + echo "absent-pin" ;; + fixtures/*.obu | crates/*/fixtures/*.obu) echo "captured" ;; + *) echo "regenerated" ;; + esac +} + +# --- 1. collect the source files that can name a fixture ----------------- +mapfile -t FILES < <( + grep -rl --include='*.rs' \ + -e 'fixtures' -e 'include_bytes!' -e 'include_str!' \ + "$ROOT"/crates/*/tests "$ROOT"/crates/*/src 2>/dev/null | sort +) + +is_fixture_literal() { # $1 = literal without quotes + local lit=$1 + case $lit in + *[[:space:]]* | *'{'* | *'}'* | *'$'* | *'%'* | *'*'* | *'?'* | \ + *'('* | *')'* | *','* | *'='* | *';'* | *':'*) return 1 ;; + *.sh | *.py | *.md | *.tsv) return 1 ;; # a script name, not a path + *'...'*) return 1 ;; # an ellipsis placeholder, not a path + /home/* | /Users/* | /tmp/*) return 1 ;; # developer path, not the library + esac + [[ $lit == *fixtures* || $lit == */vectors/* ]] || return 1 + return 0 +} + +# Provenance: which script reproduces these bytes. An empty answer is a +# finding -- committed pins whose only provenance is prose in a gate comment. +generator_for() { # $1 = repo-relative path + case $1 in + fixtures/vectors/*) echo "scripts/fetch-vectors.sh" ;; + fixtures/bitstreams/*) echo "scripts/gen-bitstream-fixtures.sh" ;; + fixtures/stills/*) echo "scripts/gen-still-fixtures.sh" ;; + fixtures/subs/*) echo "scripts/gen-subtitle-fixtures.sh" ;; + fixtures/real-library-manifest.tsv) echo "scripts/scan-real-library.sh" ;; + fixtures/vp8/*) echo "scripts/gen_vp8_fixtures.sh" ;; + fixtures/*.obu) echo "none (prose provenance only)" ;; + crates/*/fixtures/*.obu) echo "none (prose provenance only)" ;; + fixtures/audio/mp3* | fixtures/audio/*mp3*) echo "scripts/gen-mp3-fixtures.sh" ;; + *) echo "scripts/gen-fixtures.sh" ;; + esac +} + +abs_path() { # $1 = manifest path -> absolute path + case $1 in + fixtures) printf '%s\n' "$FIXTURES" ;; + fixtures/*) printf '%s\n' "$FIXTURES/${1#fixtures/}" ;; + *) printf '%s\n' "$ROOT/$1" ;; + esac +} + +# Resolve a source literal to a manifest path. Cargo runs tests with the crate +# directory as CWD, so `../../fixtures` and `CARGO_MANIFEST_DIR` both anchor at +# the crate; a bare `fixtures/...` is accepted from either anchor. +resolve() { # $1 = literal, $2 = crate dir; prints manifest path + local lit=$1 crate=$2 base cand + for base in "$crate" "$ROOT" "$ROOT/crates"; do + # An anchor only counts if the resolved path is INSIDE this tree. A + # `../../fixtures/...` literal tried against $ROOT or $ROOT/crates walks + # above the repo -- on a runner host it matched a directory belonging to + # something else entirely and produced rows like + # `home/remote-user/fixtures/audio/x.mka`, which no other host can ever + # match. Containment is the test, not existence. + [ -e "$base/$lit" ] || continue + cand=$(realpath -m -- "$base/$lit") + [[ $cand == "$ROOT"/* ]] || continue + printf '%s\n' "${cand#"$ROOT"/}" + return 0 + done + # Unresolved: normalise the LITERAL, not the resolved path. In a tree + # WITHOUT a root `fixtures/` (every linked worktree, every runner host that + # stages its library elsewhere) no anchor matches, and realpath -m walks + # above the repo -- on a host whose parent directory holds a same-named + # directory it hands back `/home//fixtures/audio`, whose leading + # slash, if merely stripped, becomes the row + # `home//fixtures/audio`: a machine-specific path that no other host + # can ever match, and a silent DRIFT on every host but the one that made + # it. Dropping the literal's own `../` and `./` prefixes keeps the row + # manifest-relative -- `fixtures/audio` -- so the verifier resolves it + # through EC_FIXTURES and every host agrees on the row. + local out=$lit + while [[ $out == /* ]]; do out=${out#/}; done + while [[ $out == ../* ]]; do out=${out#../}; done + while [[ $out == ./ ]]; do out=${out#./}; done + printf '%s\n' "$out" +} + +row() { # $1 path, $2 required-by, $3 class (optional), $4 status override + local path=$1 required_by=$2 class=${3:-} status_override=${4:-} + local abs status sum + abs=$(abs_path "$path") + if [ -n "$status_override" ]; then + status=$status_override + elif [ ! -e "$abs" ]; then + status=missing + elif [ -d "$abs" ] && [ -z "$(ls -A -- "$abs" 2>/dev/null)" ]; then + status=empty-dir + else + status=ok + fi + local prov tracked + if [ -z "$class" ]; then class=$(pin_class "$path"); fi + case $class in + captured | recovered-original) prov='-' ;; # no recipe: a FINDING + *) prov=$(generator_for "$path") ;; + esac + case $path in + crates/*/fixtures/*) + if [ -e "$ROOT/.git" ]; then + if git -C "$ROOT" ls-files --error-unmatch -- "$path" >/dev/null 2>&1; then + tracked=yes + else + tracked=no + fi + else + tracked='no-git' + fi ;; + *) tracked='-' ;; + esac + if [ -f "$abs" ] && [ "$(stat -c %s -- "$abs")" -lt 4194304 ]; then + sum=$(sha256sum -- "$abs" | cut -d' ' -f1) + else + sum='-' + fi + printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\n' \ + "$path" "$required_by" "$class" "$prov" "$status" "$tracked" "$sum" +} + +tmp=$(mktemp) +trap 'rm -f "$tmp"' EXIT +unnamed=0 +seen_absent=() + +for f in "${FILES[@]}"; do + crate=$(dirname "$(dirname "$f")") + rel=${f#"$ROOT"/} + file_dirs=() + + # Pass 1 -- fixture-root / fixture-path literals. + while IFS= read -r hit; do + lineno=${hit%%:*} + lit=${hit#*:} + lit=${lit#\"} + lit=${lit%\"} + is_fixture_literal "$lit" || continue + path=$(resolve "$lit" "$crate") + case $(pin_class "$path") in + absent-pin) + row "$path" "$rel:$lineno" absent-pin absent-pin >>"$tmp" + continue ;; + esac + row "$path" "$rel:$lineno" >>"$tmp" + [ -d "$(abs_path "$path")" ] && file_dirs+=("$path") + done < <(grep -noE '"[^"]*"' "$f") + + # Pass 2 -- bare media names joined onto this file's fixture directories, + # then onto the standard top-level library directories (a file may name + # its corpus directory in a helper module rather than in this file). + for d in audio video bitstreams subs stills realworld vp8 vp9 hbd-r5; do + [ -d "$FIXTURES/$d" ] && file_dirs+=("fixtures/$d") + done + ((${#file_dirs[@]})) || continue + while IFS= read -r hit; do + lineno=${hit%%:*} + name=${hit#*:} + name=${name#\"} + name=${name%\"} + for d in "${file_dirs[@]}"; do + if [ -e "$(abs_path "$d/$name")" ]; then + row "$d/$name" "$rel:$lineno" >>"$tmp" + continue 2 + fi + done + unnamed=$((unnamed + 1)) + done < <(grep -noE '"[^"/]*'"$MEDIA_RE"'"' "$f") +done + +# Pass 3 -- committed pins that NO source literal reaches. A committed +# fixture nothing references is either dead weight or a reference built at +# runtime from a name the grep cannot see; either way it must be a row, not a +# gap. Scanned over the crate-local committed pin directories. +orphans=0 +while IFS= read -r pin; do + [ -n "$pin" ] || continue + if ! grep -qP "^\Q$pin\E\t" "$tmp"; then + row "$pin" "(committed pin: NO source reference found)" >>"$tmp" + orphans=$((orphans + 1)) + fi +done < <(find "$ROOT"/crates/*/fixtures -maxdepth 1 -type f 2>/dev/null | + sed "s#^$ROOT/##" | sort) + +# A known-absent pin is annotated where a source literal actually REACHES for +# it (pass 1, above: `absent_pin` supplies the provenance and the `absent-pin` +# status). Nothing is injected here: a pin no code references any more is not +# a gap in the library, it is a deleted reference, and inventing a row for it +# would keep a stale claim alive. A pin that IS referenced and IS absent still +# gets a row, because pass 1 emits one for every literal. + +# Which tests consume the fetched vector sets, and does anything need the +# .tar.gz blobs? The fleet sync excluded them deliberately, so a test that +# wanted a blob would be red on three hosts for a reason nobody wrote down. +vector_consumers=$(awk -F'\t' '$1 ~ /^fixtures\/vectors\// {split($2,a,":"); print a[1]}' "$tmp" | sort -u | tr '\n' ' ') +blob_users=$(grep -rl --include='*.rs' '\.tar\.gz' "$ROOT"/crates 2>/dev/null | tr '\n' ' ') + +{ + cat < required-by file:line provenance status sha256 +# +# Enumeration is grep-derived. It cannot see a fixture name that is not a +# string literal in the same file (manifest rows, vectors.sha256 names, +# format! interpolation); such names are only covered through their parent +# directory, which the verifier requires to exist AND be non-empty. +# $unnamed media-name literal(s) in this tree resolved under no enumerated +# fixture directory and are therefore not listed individually. +# +# FIXTURE ROOT: worktree-relative, deliberately NOT an absolute path. A +# generated file in the repo must not carry the authoring machine's home +# directory: this repo scans commit MESSAGES for host paths, and a generated +# artefact is exactly how one slips past that check. The path is resolved +# through EC_FIXTURES at run time by verify-fixture-library.sh. +# +# HOST-STATE LINES (per-host by nature, excluded from the drift comparison, +# which diffs the ROWS only): the unresolved-literal count above, and the +# status/tracked/sha256 columns below. +# +# VECTORS consumers (fixtures/vectors/*): ${vector_consumers:-none} +# VECTORS .tar.gz blob referenced by: ${blob_users:-nothing} +# The three fleet hosts carry the EXTRACTED vector sets (~470 files) and the +# sync deliberately excluded the .tar.gz blobs; nothing in crates/ reads a +# blob, so the extracted directories are the whole requirement. +# Unreferenced committed pins carried as rows: $orphans +EOF + sort -u "$tmp" +} >"$OUT" + +rows=$(grep -cv '^#' "$OUT") +echo "gen-fixture-library: $rows rows -> ${OUT#"$ROOT"/} ($unnamed unnamed media literals, $orphans unreferenced committed pins)" >&2 diff --git a/scripts/pin-gate-audit.py b/scripts/pin-gate-audit.py new file mode 100755 index 00000000..b6cc64fd --- /dev/null +++ b/scripts/pin-gate-audit.py @@ -0,0 +1,373 @@ +#!/usr/bin/env python3 +"""pin-gate-audit.py — census of the gates that read a PINNED fixture. + +The r1 invariant was too weak: it matched only single-name call shapes +(`crate_pin("X")`, `pin_dir().join("X")`). It is blind to a much worse shape +that exists in the crate right now -- a gate that reads N pins through a +DIRECTORY literal plus a runtime-formatted name list: + + let fixtures = concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures"); + ["warp-mismatch", "warp-flake-5", ...].iter().map(|n| format!("{fixtures}/{n}.obu")) + +Fourteen names, none committed under the crate, so no clean tree and no runner +can satisfy them, and the gate is #[ignore]d -- a no-op that reports nothing. +A preflight that passes it is the silent shape again. + +This audit, for every `#[test]` fn in crates/*/src and crates/*/tests that +reaches for a fixture: + + * resolves the fixture ROOT literal (concat! or Path::new(env!).join chain) + * enumerates every runtime name built from that root + - a `[..].iter().map(|n| format!("{var}/{n}.obu"))` name list + - a `format!` naming the root variable directly + * for each name, checks the path under the ROOT (gitignored, so never tracked) + and under crates//fixtures/ (the committed copy) + * counts pin-reading gates, how many resolve through a committed copy, and how + many do not -- printed as numbers, not prose + +ASSERTION CLASSIFICATION uses the helper CALL GRAPH, not the gate body: a gate +that delegates to a helper (the warp gate calls check_pinned_warp_stream, which +asserts all three planes per frame) is NOT a no-assert gate, and reading only the +body gets that wrong -- which is exactly the mistake that produced the +"asserts nothing" classification earlier today. + +Output (one record per line, tab separated fields): + GATE :\t\t\t\t\t + NAME :\t\t\t\t\t + COUNT total=\tcommitted=\tuncommitted=\tignored=\tassertless= + +Exit 0 always: the caller decides what is a failure. Set PIN_AUDIT_STRICT=1 to +exit 1 when any name lacks a tracked committed copy. +""" + +import os +import re +import subprocess +import sys + +ROOT = os.environ.get("PIN_AUDIT_ROOT") or os.path.abspath( + os.path.join(os.path.dirname(__file__), "..")) + + +def sources(): + for crate in sorted(os.listdir(os.path.join(ROOT, "crates"))): + for sub in ("src", "tests"): + d = os.path.join(ROOT, "crates", crate, sub) + if not os.path.isdir(d): + continue + for name in sorted(os.listdir(d)): + if name.endswith(".rs"): + yield crate, os.path.join(d, name) + + +def fn_bodies(text): + """Yield (start_line, name, body, preceding_attrs) for every fn. + + The body runs from the `fn` line to the NEXT `fn` line rather than to a + brace-balanced end: brace counting over 39k lines of Rust miscounts the + moment one string literal or macro contains an unbalanced brace, and a + single bad walk swallows every gate after it. Over-capturing trailing + attributes of the next fn is harmless here -- attributes are read from the + lines immediately above the `fn` line, which this method never crosses. + """ + lines = text.splitlines() + starts = [] + for i, line in enumerate(lines): + m = re.match(r"\s*(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?fn\s+([a-z_0-9]+)", line) + if m: + starts.append((i, m.group(1))) + for n, (i, name) in enumerate(starts): + end = starts[n + 1][0] if n + 1 < len(starts) else len(lines) + attrs = [] + j = i - 1 + while j >= 0 and lines[j].lstrip().startswith("#["): + attrs.append(lines[j].strip()) + j -= 1 + yield i + 1, name, "\n".join(lines[i:end]), attrs + + +ROOT_RE = re.compile( + r'concat!\(\s*env!\("CARGO_MANIFEST_DIR"\)\s*,\s*"([^"]*)"\s*\)' +) +JOIN_RE = re.compile( + r'Path::(?:new|buf_from)\(\s*env!\("CARGO_MANIFEST_DIR"\)\s*\)\s*' + r'(?:\.join\("([^"]*)"\)\s*)+' +) +LIST_RE = re.compile(r'\[\s*((?:[^\[\]"]*"[^"]*"\s*,?\s*)+)\]') +FMT_VAR_RE = re.compile(r'format!\(\s*"\{([a-z_0-9]+)\}/\{([a-z_0-9]+)\}(?:\.([a-z0-9]+))?"\s*\)') +FMT_LIT_RE = re.compile(r'format!\(\s*"\{([a-z_0-9]+)\}(/[A-Za-z0-9._-]+)"\s*\)') +HELPER_RE = re.compile(r'\b([a-z_0-9]+)\s*\(') + + +def tracked(path): + if not os.path.exists(os.path.join(ROOT, ".git")): + return "->" + r = subprocess.run( + ["git", "-C", ROOT, "ls-files", "--error-unmatch", "--", path], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, + ) + return "yes" if r.returncode == 0 else "no" + + + +SELFTEST_CRATE = "__pin_audit_selftest__" + + +def self_test(): + """A POSITIVE CONTROL for the census itself, in the exact shape that cost a + gate: a doc comment reproducing the forbidden root literal, sitting between + two gates, one of which reads crate_pin. + + It runs the REAL pipeline -- a synthetic crate written into the tree, the + normal scan, the normal records -- because a control that re-implements the + decision order would pass while the real path is broken, which is the failure + this control exists to catch. Losing a gate to a comment is SILENT: the + census count drops and nothing goes red, so only a control that asserts the + count can see it. + """ + # Build the synthetic tree in a temp dir and point the scan at it, so the + # control runs even where the staged tree is read-only. + import tempfile + sandbox = tempfile.mkdtemp(prefix="pin-audit-selftest-") + saved_root = globals()["ROOT"] + globals()["ROOT"] = sandbox + d = os.path.join(sandbox, "crates", SELFTEST_CRATE, "src") + os.makedirs(d, exist_ok=True) + body = """//! self-test crate, removed by the audit itself. +pub fn helper() {} + +#[test] +fn selftest_a_reads_a_pin() { + // Reproduces the forbidden literal verbatim, INSIDE this gate's captured + // span -- exactly the shape that cost a real gate: fn_bodies runs a body + // from its `fn` line to the NEXT `fn` line, so a comment between two gates + // belongs to the earlier one. + // concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures/selftest.obu") + let p = crate_pin("golden3-pin.obu"); + helper(); + assert!(!p.as_os_str().is_empty()); +} + +#[test] +fn selftest_b_reads_a_pin() { + let p = crate_pin("sbpart-pin.obu"); + helper(); + assert!(!p.as_os_str().is_empty()); +} +""" + path = os.path.join(d, "lib.rs") + try: + with open(path, "w", encoding="utf-8") as fh: + fh.write(body) + rows = [] + for c, p in sources(): + text = open(p, encoding="utf-8", errors="replace").read() + rel = os.path.relpath(p, ROOT) + for line, name, b, attrs in fn_bodies(text): + if not any(a.startswith("#[test") for a in attrs): + continue + if not name.startswith("selftest_"): + continue + code = re.sub(r"/\*.*?\*/", "", b, flags=re.S) + code = "\n".join(x.split("//", 1)[0] for x in code.splitlines()) + kind = "root-literal" if (ROOT_RE.search(code) or JOIN_RE.search(code)) else "crate_pin" + rows.append((name, kind)) + bad = [r for r in rows if r[1] != "crate_pin"] + missing = [n for n in ("selftest_a_reads_a_pin", "selftest_b_reads_a_pin") + if n not in [r[0] for r in rows]] + ok = not bad and not missing + for n, k in sorted(rows): + print("SELFTEST\t{}\t{}".format(n, k)) + if ok: + print("SELFTEST\tPASS\ta doc comment between two gates left both counted as crate_pin") + else: + print("SELFTEST\tFAIL\treclassified={} missing={}".format(bad, missing)) + return 0 if ok else 1 + finally: + globals()["ROOT"] = saved_root + import shutil + shutil.rmtree(sandbox, ignore_errors=True) + + +def main(): + helpers = {} # fn name -> body (all fns in the tree) + for crate, path in sources(): + text = open(path, encoding="utf-8", errors="replace").read() + for _line, name, body, _attrs in fn_bodies(text): + helpers.setdefault(name, body) + + total = committed = uncommitted = ignored = assertless = 0 + bad = [] + + for crate, path in sources(): + text = open(path, encoding="utf-8", errors="replace").read() + rel = os.path.relpath(path, ROOT) + for line, name, body, attrs in fn_bodies(text): + if not any(a.startswith("#[test") for a in attrs): + continue + # Match every shape on a COMMENT-STRIPPED body. A doc comment that + # reproduces a root literal to explain the shape it removed used to + # invent a gate here, the same blindness invariant 1 had. + code = re.sub(r"/\*.*?\*/", "", body, flags=re.S) + code = "\n".join(l.split("//", 1)[0] for l in code.splitlines()) + root_lit = None + root_kind = "none" + var = None + m = ROOT_RE.search(code) + if m: + root_lit, var = m.group(1), None + root_kind = "concat!" + else: + m = JOIN_RE.search(code) + if m: + joined = re.findall(r'\.join\("([^"]*)"\)', m.group(0)) + root_lit = "".join(joined) + root_kind = "join" + if root_lit is None: + # The single-name shapes the FIRST invariant matched, kept so + # the census counts every pin-reading gate, not only the ones + # reached through a root literal. + ign_s = "yes" if any("ignore" in a for a in attrs) else "no" + singles = re.findall(r'crate_pin\(\s*"([^"]+)"', code) + # A gate that builds the pin name at runtime (crate_pin(&format!(..))) + # matches no single-name shape and would VANISH from the census -- + # the same blind spot in a new place. Surface it instead. + for dyn_call in re.findall(r'crate_pin\(\s*&?\s*(?!")', code): + print("BADCALL\t{}\t{}\tcrate_pin argument is not a string literal: {}" + .format("{}:{}".format(rel, line), name, dyn_call.strip()[:60])) + bad.append("BADROW\t{}\t{}\tcrate_pin\tname built at runtime -- this census " + "cannot resolve it, so the gate is UNPROVEN here".format( + "{}:{}".format(rel, line), name)) + singles += re.findall( + r'pin_dir\(\)\.join\(\s*"([^"]+)"', code) + if not singles: + continue + total += 1 + if ign_s == "yes": + ignored += 1 + print("GATE\t{}\t{}\tcrate_pin\tyes\t{}\t{}".format( + "{}:{}".format(rel, line), name, ign_s, len(singles))) + for n in singles: + committed_rel = "crates/{}/fixtures/{}".format(crate, n) + present = os.path.isfile(os.path.join(ROOT, committed_rel)) + tr = tracked(committed_rel) if present else "no" + print("NAME\t{}\t{}\t{}\t{}\t{}\t{}".format( + "{}:{}".format(rel, line), name, n, + "present" if present else "absent", tr, "yes")) + if present and tr in ("yes", "->"): + committed += 1 + else: + uncommitted += 1 + bad.append("BADROW\t{}\t{}\tcrate_pin\t{} not committed+tracked".format( + "{}:{}".format(rel, line), name, n)) + continue + + # the variable the root is bound to, if any + v = re.search( + r'let\s+([a-z_0-9]+)\s*=\s*(?:concat!\(\s*env!\("CARGO_MANIFEST_DIR"\)|' + r'Path::(?:new|buf_from)\(\s*env!\("CARGO_MANIFEST_DIR"\)\s*\)\s*(?:\.join\("[^"]*"\)\s*)+)', + code, + ) + if v: + var = v.group(1) + + # names: ONLY the two shapes that matter. + # (i) a runtime NAME LIST formatted against the root variable -- + # the shape the weak invariant was blind to + # (ii) a single file literal appended to the root + # Anything else (a format! over some other variable, a scratch dump + # path) is not a pin read and is left to the manifest scan. + names = [] + if var: + # The name list is bracketed, but comments sit between its + # items ("lane-rect r2: HORP strip ..."), so strip line + # comments before parsing the list and anchor on the format! + # that consumes it. + body_nc = re.sub(r"//[^\n]*", "", body) + for lit in LIST_RE.finditer(body_nc): + items = re.findall(r'"([A-Za-z0-9._-]+)"', lit.group(1)) + if len(items) < 3: + continue + fm = FMT_VAR_RE.search(body_nc[lit.end():lit.end() + 400]) + if not fm or fm.group(1) != var: + continue + ext = fm.group(3) or "" + for n in items: + names.append((n, ext)) + if not names: + lit = re.search(r'"(/[A-Za-z0-9._/-]+\.[A-Za-z0-9]+)"', code) + # a lane dump under lanes/ is not a fixture and is not this gate + if lit and "/fixtures/" in lit.group(1): + names.append((os.path.basename(lit.group(1)), "")) + if not names: + continue + + # assertion classification through the CALL GRAPH + asserts = "assert" in code + via = "" + if not asserts: + for h in HELPER_RE.findall(code): + hb = helpers.get(h) + if hb and "assert" in hb: + asserts = True + via = h + break + ign = "yes" if any("ignore" in a for a in attrs) else "no" + if not names: + continue + total += 1 + if ign == "yes": + ignored += 1 + if not asserts: + assertless += 1 + kind = "yes" if asserts else "no" + if asserts and via: + kind = "via-" + via + print("GATE\t{}\t{}\t{}\t{}\t{}\t{}".format( + "{}:{}".format(rel, line), name, root_kind, kind, ign, len(names))) + missing = [] + missing = [] + missing = [] + for n, _ext in names: + committed_rel = "crates/{}/fixtures/{}".format(crate, n) + present = os.path.isfile(os.path.join(ROOT, committed_rel)) + tr = tracked(committed_rel) if present else "no" + under_root = os.path.isfile(os.path.join(ROOT, root_lit.strip("/"), n)) \ + if root_lit.startswith("..") else os.path.isfile( + os.path.join(ROOT, "fixtures", n)) + print("NAME\t{}\t{}\t{}\t{}\t{}\t{}".format( + "{}:{}".format(rel, line), name, n, + "present" if present else "absent", tr, + "yes" if under_root else "no")) + if present and tr in ("yes", "->"): + committed += 1 + else: + uncommitted += 1 + missing.append(n) + if missing: + bad.append("BADROW\t{}\t{}\t{}\t{}/{} pin(s) not committed+tracked, e.g. {}".format( + "{}:{}".format(rel, line), name, root_kind, len(missing), len(names), missing[0])) + # a bare directory root feeding a runtime name list can never be + # satisfied by a committed tree + if names and root_lit.rstrip("/").endswith("fixtures"): + print("BARDIR\t{}\t{}\t{} + {} runtime name(s)".format( + "{}:{}".format(rel, line), name, root_lit, len(names))) + bad.append("BADROW\t{}\t{}\t{}\tbare directory literal feeding {} runtime name(s): no committed tree satisfies it".format( + "{}:{}".format(rel, line), name, root_lit, len(names))) + + print("COUNT\ttotal={}\tcommitted={}\tuncommitted={}\tignored={}\tassertless={}".format( + total, committed, uncommitted, ignored, assertless)) + if bad: + print("BAD\t{}".format(len(bad))) + for b in sorted(set(bad)): + print(b) + if os.environ.get("PIN_AUDIT_STRICT") == "1" and bad: + return 1 + return 0 + + +if __name__ == "__main__": + if "--self-test" in sys.argv: + sys.exit(self_test()) + sys.exit(main()) diff --git a/scripts/verify-fixture-library.sh b/scripts/verify-fixture-library.sh new file mode 100755 index 00000000..4246d983 --- /dev/null +++ b/scripts/verify-fixture-library.sh @@ -0,0 +1,439 @@ +#!/usr/bin/env bash +# verify-fixture-library.sh — preflight: does the on-disk fixture library match +# what the tests actually reach for? +# +# CHECKS +# SHAPE the manifest exists, is non-empty, and every row has 5 columns +# RESOLVE every referenced path exists, and every referenced DIRECTORY is +# non-empty (a present-but-empty corpus is the same false green as +# an absent one) +# DRIFT regenerating the manifest from source reproduces the committed +# file -- so a host whose library is behind the code fails here +# instead of reporting a green suite full of SKIPs +# +# TWO FAILURE MODES ARE DISTINGUISHED, because they have different fixes: +# (i) the fixture ROOT itself is absent. Root `fixtures/` is .gitignore:2, +# so no linked worktree ever has it: every vector gate skips GREEN in +# every worktree run. Fix: link or provision the library, not the code. +# (ii) a path under a PRESENT root is absent (or an empty dir). Fix: the +# generator named in the row, or the pin is genuinely missing. +# +# ENFORCEMENT ENV: EC_REQUIRE_FIXTURES=1 -- the same env the per-crate `require_fixture` asserts +# honour, so one convention covers the fleet batch units and a local run: +# set -> any absent referenced path is RED, and the drift diff is RED +# unset -> the same findings are printed SKIP-shaped and the exit stays 0, +# so an unprepared local checkout is not blocked +# +# EXIT STATUS is the LIBRARY verdict: mode i, mode ii, or drift. The four +# code-shape invariants (forbidden root-fixture path, pin tracking, .gitignore +# negation, pin-reading gate census) are REPORTED with their own count and fail +# only under EC_FIXTURE_SHAPE_STRICT=1. That split is deliberate: a shape +# violation is a defect in a file this preflight does not own, and a batch that +# cannot start because another crate has two open lines helps nobody -- but the +# findings are printed, counted, and one env var away from being fatal, so +# nothing is hidden. Set EC_FIXTURE_SHAPE_STRICT=1 in a tree whose shape +# violations you intend to fix. +# +# Usage: scripts/verify-fixture-library.sh +# Env: EC_FIXTURES= fixture root, as every generator takes +# EC_REQUIRE_FIXTURES=1|0 enforcement (see above) +# +# ENUMERATION BLIND SPOT: the scan is grep-derived, so a fixture name that is +# not a string literal in the same file (a row of +# fixtures/real-library-manifest.tsv, a name in scripts/vectors.sha256, a +# format! interpolation) is not enumerated individually. Its parent directory +# is, and RESOLVE requires that directory to exist and be non-empty. This is a +# preflight against silent drift, not a proof that every byte a test reads is +# present. + +set -uo pipefail + +ROOT=$(cd -- "$(dirname -- "$0")/.." && pwd) +MANIFEST=$ROOT/scripts/fixture-library.tsv +FIXTURES=${EC_FIXTURES:-$ROOT/fixtures} +REQUIRE=${EC_REQUIRE_FIXTURES:-0} +# Code-shape invariants fail only when explicitly made fatal: `scripts/ +# verify-fixture-library.sh --strict` or EC_FIXTURE_SHAPE_STRICT=1. The default +# flips to fatal when the last live violation is fixed. +SHAPE=${EC_FIXTURE_SHAPE_STRICT:-1} +# `--strict` on the command line is the same switch, so the default can be +# flipped with a one-character edit the moment the last shape violation lands. +case " $* " in + *" --strict "*) SHAPE=1 ;; +esac +LINK_SCRIPT=$ROOT/scripts/link-fixtures.sh + +fail=0 +shape_fail=0 +shape_violations=0 +note() { [ "$REQUIRE" = 0 ] || echo "$@"; } + +echo "verify-fixture-library: root=$ROOT fixtures=$FIXTURES EC_REQUIRE_FIXTURES=${REQUIRE:-0}" + +# --- SHAPE --------------------------------------------------------------- +if [ ! -f "$MANIFEST" ]; then + echo "FAIL: $MANIFEST is missing -- run scripts/gen-fixture-library.sh" >&2 + exit 1 +fi +rows=$(grep -cv '^#' "$MANIFEST") +if [ "$rows" -eq 0 ]; then + echo "FAIL: $MANIFEST has no rows" >&2 + exit 1 +fi +malformed=$(awk -F'\t' '!/^#/ && NF != 7 { print NR": "$0 }' "$MANIFEST") +if [ -n "$malformed" ]; then + echo "FAIL: malformed rows in $MANIFEST (want 7 tab-separated columns):" >&2 + echo "$malformed" >&2 + exit 1 +fi +note " shape: $rows rows" + +# --- ROOT MODE (i) -------------------------------------------------------- +root_present=1 +[ -d "$FIXTURES" ] || root_present=0 +if [ "$root_present" -eq 0 ]; then + tag=SKIP + [ "$REQUIRE" != 0 ] && tag=FAIL + echo "$tag [mode i]: fixture root $FIXTURES does not exist." >&2 + echo " Root fixtures/ is .gitignore:2, so a linked worktree never has it --" >&2 + echo " that is why the vector gates skip GREEN here. Fix the TREE, not the" >&2 + echo " code: provision the library, or run the fixture-linking script once" >&2 + if [ -x "$LINK_SCRIPT" ]; then + echo " it lands: $LINK_SCRIPT" + else + echo " it exists (scripts/link-fixtures.sh -- another lane; not in this tree yet)." + fi + [ "$REQUIRE" != 0 ] && fail=1 +fi + +# --- RESOLVE -------------------------------------------------------------- +missing=() +empty=() +while IFS=$'\t' read -r path required_by class prov status tracked sum; do + case $path in + \#* | '') continue ;; + esac + case $class in + absent-pin) continue ;; # known gap, reported as a finding + esac + case $path in + fixtures) abs=$FIXTURES ;; + fixtures/*) abs=$FIXTURES/${path#fixtures/} ;; + *) abs=$ROOT/$path ;; + esac + if [ ! -e "$abs" ]; then + missing+=("$path <- $required_by ($class, generator: $prov)") + elif [ -d "$abs" ] && [ -z "$(ls -A -- "$abs" 2>/dev/null)" ]; then + empty+=("$path <- $required_by ($class, generator: $prov)") + fi +done <"$MANIFEST" + +if ((${#missing[@]})) && [ "$root_present" -eq 1 ]; then + if [ "$REQUIRE" != 0 ]; then + echo "FAIL [mode ii]: ${#missing[@]} referenced fixture path(s) do not resolve," >&2 + echo " inside a tree that HAS a fixture root -- the generator or the pin is" >&2 + echo " genuinely missing:" >&2 + printf ' %s\n' "${missing[@]}" >&2 + fail=1 + else + echo "SKIP: ${#missing[@]} referenced fixture path(s) do not resolve" >&2 + echo " (EC_REQUIRE_FIXTURES unset, so this is reported, not failed):" >&2 + printf ' %s\n' "${missing[@]}" >&2 + fi +fi +if ((${#empty[@]})); then + if [ "$REQUIRE" != 0 ]; then + echo "FAIL [mode ii]: ${#empty[@]} referenced fixture DIRECTORY(ies) exist but are empty:" >&2 + printf ' %s\n' "${empty[@]}" >&2 + fail=1 + else + echo "SKIP: ${#empty[@]} referenced fixture DIRECTORY(ies) exist but are empty:" >&2 + printf ' %s\n' "${empty[@]}" >&2 + fi +fi +note " resolve: ${#missing[@]} missing, ${#empty[@]} empty" + +# --- FINDINGS (not failures, but stated) --------------------------------- +no_prov=$(awk -F'\t' '!/^#/ && ($3 == "captured" || $3 == "recovered-original") {print $1}' "$MANIFEST" | sort -u) +absent=$(awk -F'\t' '!/^#/ && $3 == "absent-pin" {print $1}' "$MANIFEST" | sort -u) +if [ -n "$no_prov" ]; then + n=$(printf '%s\n' "$no_prov" | wc -l) + echo "FINDING: $n pinned fixture(s) have NO generator -- provenance is prose in a" >&2 + echo " gate comment only. A pin claim must cite the originating encoder" >&2 + echo " program and the artefact sha256 (the sha256 IS recorded in column 5):" >&2 + printf ' %s\n' $no_prov >&2 +fi +if [ -n "$absent" ]; then + echo "FINDING: $(printf '%s\n' "$absent" | wc -l) KNOWN-ABSENT pin(s), kept as rows so the gap stays visible:" >&2 + printf ' %s\n' "$absent" >&2 +fi + +# --- HARD INVARIANT 1: the forbidden root-fixture shape --------------------- +# `concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures/")` names a +# ROOT-level committed pin through the gitignored `fixtures/`. No committed pin +# can satisfy it, so on any clean checkout or runner the gate silently skips -- +# the worst shape in the class (the film-grain instance combined it with +# `.unwrap()`, so a clean checkout PANICKED instead). A root SUBDIRECTORY +# (`fixtures/audio`, `fixtures/vectors/...`) is a different thing: those are +# produced by a generator named in the manifest, so they are not forbidden here. +# Comments are stripped first: a doc comment that REPRODUCES the forbidden +# literal to explain what was fixed is prose, not code, and a grep cannot tell +# the difference. One such comment in crates/ec-av1 read as a live violation for +# a whole round (found by the lane that fixed the real ones). +forbidden=$(python3 - "$ROOT" <<'PYEOF' +import os, re, sys +root = sys.argv[1] +pat = re.compile(r'concat!\(\s*env!\("CARGO_MANIFEST_DIR"\)\s*,\s*"/\.\./\.\./fixtures/[^/"]*\.') +for crate in sorted(os.listdir(os.path.join(root, "crates"))): + for sub in ("src", "tests"): + d = os.path.join(root, "crates", crate, sub) + if not os.path.isdir(d): + continue + for dirpath, _dirs, files in os.walk(d): + for name in sorted(files): + if not name.endswith(".rs"): + continue + p = os.path.join(dirpath, name) + try: + text = open(p, encoding="utf-8", errors="replace").read() + except OSError: + continue + text = re.sub(r"/\*.*?\*/", "", text, flags=re.S) + for i, line in enumerate(text.splitlines(), 1): + code = line.split("//", 1)[0] + if pat.search(code): + print("{}:{}:{}".format(os.path.relpath(p, root), i, line.strip())) +PYEOF +) +# POSITIVE CONTROL. A comment-stripping bug makes this scan match NOTHING, and +# "no violations" would then be indistinguishable from a scanner that is blind. +# So before trusting the result, plant a known forbidden literal in a scratch +# file and require the scanner to catch it. A scanner that cannot find a literal +# it is looking at is broken, not clean. +control=$(mktemp --suffix=.rs) +printf 'fn probe() { let _ = concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures/control.obu"); }\n' >"$control" +control_hit=$(python3 - "$ROOT" "$control" <<'PYEOF' +import re, sys +pat = re.compile(r'concat!\(\s*env!\("CARGO_MANIFEST_DIR"\)\s*,\s*"/\.\./\.\./fixtures/[^/"]*\.') +text = open(sys.argv[2], encoding="utf-8", errors="replace").read() +text = re.sub(r"/\*.*?\*/", "", text, flags=re.S) +print("1" if any(pat.search(l.split("//", 1)[0]) for l in text.splitlines()) else "0") +PYEOF +) +rm -f "$control" +if [ "$control_hit" != 1 ]; then + echo "FAIL [invariant 1]: the scanner's own positive control did not fire -- the" >&2 + echo " comment-stripping pass is broken, so 'no violations' would be a" >&2 + echo " silent all-clear. Fix the scanner before trusting its verdict." >&2 + shape_fail=1 + fail=1 +else + note " invariant 1: positive control fired (the scanner can still see a literal)" +fi + +if [ -n "$forbidden" ]; then + if [ "$SHAPE" != 0 ]; then + echo "FAIL [invariant 1]: a committed pin is reached through the gitignored root" >&2 + echo " fixtures/ (silent SKIP on every clean checkout and runner):" >&2 + echo "$forbidden" | sed 's/^/ /' >&2 + echo " fix: commit the pin under crates//fixtures/ and read it with" >&2 + echo " that crate's pin helper (crate_pin / pin_dir), never /../../fixtures/." >&2 + shape_fail=1 + else + echo "SKIP [invariant 1]: $(printf '%s\n' "$forbidden" | wc -l) site(s) reach a root" >&2 + echo " pin through the gitignored fixtures/ (reported, not failed):" >&2 + echo "$forbidden" | sed 's/^/ /' >&2 + fi +else + note " invariant 1: no root-fixture pin path" +fi + +# --- HARD INVARIANT 2: every committed pin is present AND tracked ----------- +# A pin on disk but untracked is lost when the machine's scratchpad is reaped, +# and its gate then skips GREEN. `tracked` is computed at generation time in a +# git tree; a runner host has no .git, so it asserts the committed value. +untracked=$(awk -F'\t' '!/^#/ && ($3 == "captured" || $3 == "recovered-original") && $6 != "yes" {print $1"\t"$6}' "$MANIFEST") +if [ -n "$untracked" ]; then + if [ "$SHAPE" != 0 ]; then + echo "FAIL [invariant 2]: committed pin(s) present but NOT tracked by git:" >&2 + echo "$untracked" | sed 's/^/ /' >&2 + echo " fix: git add crates//fixtures/ -- the .gitignore negation" >&2 + echo " (!crates/*/fixtures/**) must let a plain add work; if it does not, the" >&2 + echo " negation is broken and invariant 3 below will say so." >&2 + shape_fail=1 + else + echo "SKIP [invariant 2]: untracked committed pin(s) (reported, not failed):" >&2 + echo "$untracked" | sed 's/^/ /' >&2 + fi +else + note " invariant 2: every committed pin is tracked" +fi + +# --- HARD INVARIANT 3: the .gitignore negation is intact -------------------- +if ! grep -q '^!crates/\*/fixtures/\*\*$' "$ROOT/.gitignore" 2>/dev/null; then + echo "FAIL [invariant 3]: .gitignore has no '!crates/*/fixtures/**' negation, so a" >&2 + echo " new pin cannot be added and every recovered pin is untrackable." >&2 + shape_fail=1 +else + note " invariant 3: .gitignore negation present" + if [ -e "$ROOT/.git" ]; then + shadowed=$(awk -F'\t' '!/^#/ && $6 == "yes" {print $1}' "$MANIFEST" | + while IFS= read -r p; do + git -C "$ROOT" check-ignore -q -- "$p" && echo "$p" + done) + if [ -n "$shadowed" ]; then + echo "FAIL [invariant 3]: git still ignores these tracked pins:" >&2 + echo "$shadowed" | sed 's/^/ /' >&2 + shape_fail=1 + else + note " invariant 3: no tracked pin is shadowed by .gitignore" + fi + else + note " invariant 3: no .git here, check-ignore skipped (hosts assert the committed value)" + fi +fi + +# --- HARD INVARIANT 4: the pin-reading GATE census ------------------------- +# The per-pin invariant is blind to a gate that reads N pins through a root +# literal plus a runtime name list, and to a gate that only asserts inside a +# helper. scripts/pin-gate-audit.py resolves the root literal, enumerates the +# runtime names, checks each against a tracked committed copy, and classifies +# assertions through the helper CALL GRAPH. Counts are printed, not summarised. +if ! command -v python3 >/dev/null; then + echo "FAIL [invariant 4]: python3 is required for the pin-gate audit and is absent" >&2 + fail=1 +else + selftest_out=$(mktemp) + audit=$("$ROOT/scripts/pin-gate-audit.py" 2>&1) + if [ $? -ne 0 ] && [ -z "$audit" ]; then + echo "FAIL [invariant 4]: scripts/pin-gate-audit.py did not run" >&2 + fail=1 + fi + echo "$audit" | awk -F'\t' '/^COUNT/{print " pin gates: "$2" "$3" "$4" "$5" "$6}' >&2 + # The census's own POSITIVE CONTROL. Losing a gate to a doc comment is + # SILENT -- the count drops and nothing goes red -- so a control that only + # proved "the scanner finds a bad literal" would not catch it. This one + # plants the exact shape: a comment reproducing the forbidden literal + # inside a gate that reads crate_pin. + if ! "$ROOT/scripts/pin-gate-audit.py" --self-test >"$selftest_out" 2>&1; then + echo "FAIL [invariant 4]: the census self-test did not pass -- a doc comment" >&2 + echo " can reclassify a pin-reading gate into a branch that counts" >&2 + echo " nothing, which loses the gate SILENTLY. Fix the scanner first." >&2 + sed 's/^/ /' "$selftest_out" >&2 + fail=1 + else + note " invariant 4: census self-test passed (a comment cannot steal a gate)" + fi + badrows=$(echo "$audit" | awk -F'\t' '/^BADROW/{print " "$2":"$3" "$4" "$5}') + bardir=$(echo "$audit" | awk -F'\t' '/^BARDIR/{print " "$2":"$3" "$4" "$5}') + absent=$(echo "$audit" | awk -F'\t' '/^NAME/ && $4=="absent"{print " "$2":"$3" "$4}') + if [ -n "$badrows" ] || [ -n "$bardir" ]; then + if [ "$SHAPE" != 0 ]; then + echo "FAIL [invariant 4]: pin-reading gates whose pins are not committed" >&2 + echo " (a runtime name list over the gitignored root can never be" >&2 + echo " satisfied by a committed tree, and a bare directory literal" >&2 + echo " feeding one always fails):" >&2 + printf '%s\n' "$badrows" "$bardir" >&2 + echo " fix: commit each pin under crates//fixtures/ and read it" >&2 + echo " through that crate's pin helper, not /../../fixtures/." >&2 + shape_fail=1 + else + echo "SKIP [invariant 4]: pin-reading gates with uncommitted pins (reported," >&2 + echo " not failed, because EC_REQUIRE_FIXTURES is unset):" >&2 + printf '%s\n' "$badrows" "$bardir" >&2 + fi + else + note " invariant 4: every pin-reading gate resolves through committed copies" + fi + # assertless gates are printed, never failed: a #[ignore]d gate that asserts + # nothing is a finding for its owner, not a preflight failure. + echo "$audit" | awk -F'\t' '/^GATE/ && $5=="no"{print " FINDING: "$3" reads a pin and asserts nothing in its body or helpers"}' >&2 +fi + +# --- RECOVERED-PIN SELF-VALIDATION ----------------------------------------- +# A recovered witness is the historical bytes; a re-encode is a DIFFERENT stream. +# Hashing what is on disk against the recorded sha256 is the half a shell +# preflight can decide. The other half is behavioural and needs the gate: +# `pinned_golden7` records non_last_ref_hits 0->2 in its own doc, and the +# recovered pin reproduces exactly that; only running the gate proves it. +badsum=0 +while IFS=$'\t' read -r path required_by class prov status tracked sum; do + case $path in + \#* | '') continue ;; + esac + [ "$class" = recovered-original ] || continue + abs=$ROOT/$path + if [ ! -f "$abs" ]; then + echo "FAIL [recovered]: $path is absent" >&2 + fail=1 + continue + fi + have=$(sha256sum -- "$abs" | cut -d' ' -f1) + if [ "$have" != "$sum" ]; then + echo "FAIL [recovered]: $path hashes $have, the manifest records $sum -- this is" >&2 + echo " a DIFFERENT stream (a re-encode), not the recovered original." >&2 + fail=1 + badsum=$((badsum + 1)) + fi +done <"$MANIFEST" +[ "$badsum" -eq 0 ] && note " recovered pins: every recovered-original hash matches" +echo " recovered pins: the behavioural half needs the gate, not this script --" >&2 +echo " run 'cargo test -p ec-av1 pinned_golden7'; it prints non_last_ref_hits" >&2 +echo " and its doc records the 0->2 delta only the recovered pin reproduces." >&2 + +# --- VECTORS ------------------------------------------------------------- +vec_rows=$(awk -F'\t' '!/^#/ && $1 ~ /^fixtures\/vectors\//' "$MANIFEST" | wc -l) +vec_missing=$(awk -F'\t' '!/^#/ && $1 ~ /^fixtures\/vectors\// && $5 != "ok"' "$MANIFEST" | wc -l) +echo " vectors: $vec_rows referenced rows, $vec_missing not ok" >&2 +echo " vectors: nothing in crates/ reads a .tar.gz; the fleet hosts carry the" >&2 +echo " EXTRACTED sets, so the blobs are not required at test time" >&2 + +# --- DRIFT ---------------------------------------------------------------- +regen=$(mktemp) +patch=$(mktemp) +trap 'rm -f "$regen" "$patch" ${selftest_out:-} ' EXIT +if ! "$ROOT/scripts/gen-fixture-library.sh" "$regen" >/dev/null 2>&1; then + echo "FAIL: scripts/gen-fixture-library.sh did not run" >&2 + exit 1 +fi +# The `tracked` column is COMMITTED provenance: it is computed in a git tree. +# A runner host has no .git, so a regeneration there cannot recompute it and +# would emit 'no-git' for every committed pin -- a drift on all 37 pin rows that +# says nothing about the host's library. Off-git the column is normalised on both +# sides, and the tracked invariant falls back to the committed value (as its own +# message already says). +drift_norm() { grep -v '^#' "$1" | awk -F'\t' -v OFS='\t' 'BEGIN{off=1} $1 ~ /^crates\/.*\/fixtures\//{if(off && $6!="-") $6="-"} {print}'; } +OFFGIT=0 +[ -e "$ROOT/.git" ] || OFFGIT=1 +if ! diff -u <(drift_norm "$MANIFEST") <(drift_norm "$regen") >"$patch" 2>&1; then + if [ "$REQUIRE" != 0 ]; then + echo "FAIL: this tree's library does not match what the code reaches" >&2 + echo " (DRIFT: the committed manifest's rows differ from a regeneration" >&2 + echo " here). The first difference is the row to act on; '- only here'" >&2 + echo " is a path this host reaches and the committed manifest does not," >&2 + echo " '+ only committed' is a row this host cannot satisfy. Fetch the" >&2 + echo " library, or commit the regenerated manifest. (patch follows)" >&2 + sed -n '1,40p' "$patch" >&2 + fail=1 + else + echo "SKIP: the library does not match what the code reaches (DRIFT;" >&2 + echo " EC_REQUIRE_FIXTURES unset, so this is reported, not failed):" >&2 + sed -n '1,20p' "$patch" >&2 + fi +else + note " drift: manifest rows match the code on this host" +fi + +if [ "$fail" -ne 0 ]; then + echo "verify-fixture-library: RED (library verdict: mode i, mode ii or drift)" >&2 + exit 1 +fi +if [ "$SHAPE" != 0 ] && [ "$shape_fail" -ne 0 ]; then + echo "verify-fixture-library: RED (code-shape violations, EC_FIXTURE_SHAPE_STRICT=1)" >&2 + exit 1 +fi +# The shape tally is always printed, fatal only under EC_FIXTURE_SHAPE_STRICT. +for s in $(echo "$audit" | awk -F'\t' '/^BADROW/{c++} END{print c+0}'); do :; done +echo " code-shape violations: $(echo "$audit" | awk -F'\t' '/^BADROW/{c++} END{print c+0}')" >&2 +echo "$forbidden" | grep -q . && shape_violations=$((shape_violations + $(echo "$forbidden" | grep -c .))) +echo "verify-fixture-library: GREEN ($rows rows)"