diff --git a/crates/ec-av1/src/encoder.rs b/crates/ec-av1/src/encoder.rs index 697c7a2c..4dbd0138 100644 --- a/crates/ec-av1/src/encoder.rs +++ b/crates/ec-av1/src/encoder.rs @@ -3700,9 +3700,16 @@ mod tests { set_lookahead(Some(on)); set_arf_tf_future(Some(fut)); let config = EncoderConfig { + // FINE (not the 120 the other facade tests use): at a coarse + // quantizer this fixture's ARF codes almost pure skip (17 + // pictures in 493 bytes) and a filtered source quantizes back + // to the same bytes, which made the future-half assertion + // below depend on where the suite's other tests had left the + // process-global preset. At q=60 the anchor carries real + // coefficients and the filter must move them. + base_q_idx: 60, width, height, - base_q_idx: 120, gop, colour: Colour::Bt709Limited, tile_cols_log2: 0, @@ -3711,6 +3718,16 @@ mod tests { let mut enc = Av1Encoder::with_pyramid(config, Pyramid::default()).unwrap(); let sources: Vec = (0..n).map(|t| noisy_card(width, height, t)).collect(); let packets = encode_all(&mut enc, &sources); + // The content gate is process-global and so is the preset: if + // either has been flipped under this test the pyramid is gone and + // there is no ARF to filter, which is a different failure from + // "the future neighbour changed nothing" (the suite reported the + // second when it meant the first). + assert!( + enc.pyramid().is_some(), + "{n} pictures at gop {gop}: the content gate dropped the pyramid, so no ARF was coded (speed {})", + crate::speed::speed(), + ); (concat(&packets), packets) }; for gop in [32usize, 8] { @@ -3752,8 +3769,11 @@ mod tests { set_arf_tf_future(None); assert!( base != symmetric, - "one display-future neighbour left the top ARF's filter unchanged ({} B both)", - base.len() + "one display-future neighbour left the top ARF's filter unchanged \ + ({} B vs {} B, preset {})", + base.len(), + symmetric.len(), + crate::speed::speed() ); let ours = crate::stream::decode_stream(&symmetric).expect("our decoder"); assert_eq!(ours.len(), 17, "the symmetric arm's display-order count"); diff --git a/lanes/lookahead.report.md b/lanes/lookahead.report.md index 5c35cf8d..50fc1ab5 100644 --- a/lanes/lookahead.report.md +++ b/lanes/lookahead.report.md @@ -45,11 +45,17 @@ buffer mid-run), with a gradient-plus-noise fixture: really consumed ([[gate-blind-to-feature]]: everything above would pass over a lookahead nothing reads) — and still decodes sample-exact. -RED first: in the split suite (not standalone) the future-half assertion -failed with "493 B both" — another test had left the process-global preset -high, every block coded as skip and the source filter could not change a byte -(class `process-global-knob-races-tests`). The test pins `set_speed(0)` under -`knob_write` now, the way the byte pins do; green in the suite below. +RED first, twice, and both reds were the FIXTURE, not the encoder. In the +split suite (never standalone) the future-half assertion failed with "493 B +both": at the q=120 the other facade tests use, this fixture's ARF codes +almost pure skip, and a filtered source quantizes back to the same bytes — +whether it does depends on where the suite's other tests left the +process-global preset, which is why it passed alone and failed in company +(class `process-global-knob-races-tests`). Pinning `set_speed(0)` under +`knob_write` (the byte pins' shape) did NOT fix it — the added assertion that +`enc.pyramid()` survived the content gate ruled the second suspect out — and +what fixed it is coding the witness at **q=60**, where the anchor carries real +coefficients and a filtered source must move them. Both guards ship. The gate is a second witness: `native_bd_arm` asserts our decoder's display-order count and ffmpeg sample-exactness for every one of its 48-picture