From 66f249979b2bf320bc85aa22edde703d2a8758df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Fri, 28 Aug 2026 13:31:40 +0300 Subject: [PATCH] wip(av1): deblocking gate flake -- localize selection mechanism, not currently reproducible Root cause of the SELECTION MECHANISM (not the decoder bug itself): the test's source fixture is genuinely nondeterministic run-to-run. `ffmpeg -f lavfi -i gradients=...:seed=42` does NOT honor `seed` for its c0..c7 colors (they default to "random", drawn from an unseeded RNG independent of the filter's own `seed` option) -- confirmed by sha256-hashing 5 consecutive y4m generations with identical args: all 5 differ, and a byte-level cmp shows the first divergence inside the pixel data (not the header). So every test run encodes genuinely different frame content through aomenc, which is itself a second, compounding nondeterminism source (cq=55/cpu-used=0 RD search hashes differently run-to-run even with --threads=1, confirmed separately). This is NOT the documented parallel-flake-is-attempt-selection class (no seed loop exists in this test at all) -- it's fixture-content variance, a new mechanism for the same flake family. Added EC_AV1_GATE_DUMP (env-gated, mirrors EC_AV1_PIN/EC_AV1_PIN_N convention) to dump the exact encoded stream this test decoded, for pinning a future failure without re-deriving the mechanism. Could NOT reproduce the mismatch this round: 1503 attempts of the single filtered test (parallel, EC_AV1_GATE_DUMP capturing every stream) plus 3 full `cargo test -p ec-av1 --release --lib` runs, all green, 0 failures. The ledger's "reproduced 2x at 9/10 rate on 95e9170 (post chroma fix)" note does not hold at this HEAD in this environment -- P(0 failures in 1503 trials | true rate 10%) is astronomically small, so either the historical 9/10 estimate was from a much smaller sample (2 failures observed over some earlier N, not a measured 10%), or e74ceb5's chroma tx_type inherit fix (which reads an actual CDF symbol per inter chroma block) incidentally closed a desync that was also reachable from specific luma-only content -- unconfirmed, flagged as the next hypothesis to chase if a failing stream ever surfaces again. Class: stale-premise lanes (5th instance) -- re-measure the claimed rate before trusting a lane charter's numbers. --- crates/ec-av1/src/stream.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index 147a905c..3d887c08 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -1764,6 +1764,9 @@ mod tests { String::from_utf8_lossy(&out.stderr) ); let stream = out.stdout; + if let Ok(dump) = std::env::var("EC_AV1_GATE_DUMP") { + std::fs::write(dump, &stream).expect("dump stream"); + } let before = decode::deblock_hits(); let frames = match decode_stream(&stream) { Ok(frames) => frames,