From d6ceb79ee48b7775c8b932e557ebd86c42fbff92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sat, 3 Oct 2026 06:26:23 +0300 Subject: [PATCH] ec-av1: the seventh 4:2:2 corpus cell is pinned, and re-measured exact here the_pinned_422_corpus_cells_decode_pixel_exact carried six of the seven cells lanes/av1422ffmpegbase.report.md 2.1 measured as diverging, and its doc said why the seventh was missing: "THIS BRANCH MUST NOT LAND UNTIL THAT CELL CLOSES AND THE CORPUS RE-MEASURES 51/51". s422_384x240 has since closed -- lane-av1422tailskip measured it byte-exact on all 16 displayed and all 17 decode-order frames and refuted the group-tail chroma SKIP arm the risk study's R4 blamed -- so the first half of that condition is met and the row belongs in the gate. Re-measured on THIS tree, not taken from the closure report, with EC_AV1_REQUIRE_FFMPEG=1 and the crate's own comparator (ffmpeg, display order, yuv422p): byte-exact on all 16 frames, per-plane coefficient-unit census delta units [1992, 1254, 1256] and coded [955, 742, 854], so the compare is not vacuous with respect to 4:2:2. The sibling gate on the same bytes (the_pinned_422_palette_intra_in_inter_cell_window_is_byte_exact) also runs green here: 17 decode-order frames byte-exact against aomdec, 16 chroma palette unit windows. The row pins 422_palette_intra_in_inter_384x240_17f.obu rather than committing a second copy of the sweep's s422_384x240.obu: lane-av1422tailskip had already committed those exact bytes under that name and the two files are byte for byte identical (sha256 bf1c658e...a4b815b, 19344 B, fnv1a64 0x923ccabfcb933e90). One stream, one pin. Row non-vacuity: mutating that row's fnv1a64 by one turns the gate red on "[422_palette_intra_in_inter_384x240_17f.obu]: bytes drifted", so the row is read and compared. (Mutating the sha256 column stays green by design -- it is the corpus's identity column for a re-capture, not an in-process assertion.) The doc's "Why these six" paragraph is corrected rather than extended: the seventh is NOT a round_ss cell. 384x240 is 8- AND 16-aligned; it was the late-starting frame-1 alt-ref chroma residual, so it is described as its own class rather than folded into the non-8-aligned-geometry sentence. The gate's own landing condition had a second half -- "AND THE CORPUS RE-MEASURES 51/51" -- so it was run here rather than assumed: the census's ffmpeg-oracle driver (~/.cache/census422b/ffcensus.py, display order, shown frames, geometry from ffprobe, a count over zero frames is a hard error) against a dump_yuv built from THIS lane's tree. 51 of 51 4:2:2 cells BYTE-EXACT, s422_384x240 among them at 0/0/0, and the same run put all 44 4:2:0 / 4:4:4 controls at BYTE-EXACT (95/95 over the corpus). Every remapped stream path's sha256 was checked against the census's recorded sha before use; 0 unresolved. Limits: ffmpeg oracle, display order (the aomdec decode-order census was not re-run), and the census's probe_split_control is obsolete now that the lift has landed. --- crates/ec-av1/src/stream.rs | 72 +++++++++++++++++++++++++++++-------- 1 file changed, 58 insertions(+), 14 deletions(-) diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index bff955b8..0ee2dcf3 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -3994,25 +3994,51 @@ pub(crate) mod tests { /// earned, and the one that replaces seven gates whose only behavioural /// assertion was `err.contains(REFUSAL)`. /// - /// **Why these six.** The measurement base + /// **Why these seven.** The measurement base /// (`lanes/av1422ffmpegbase.report.md` section 2.1) recorded seven 4:2:2 /// cells that diverged from ffmpeg: `s422_320x246`, `s422_322x240`, /// `s422_322x246`, `s422_352x242_10b`, `s422_384x240`, - /// `s422_416x242_10b`, `s422_416x250_10b`. Six are closed and are pinned - /// here, each byte-exact against ffmpeg with the per-plane - /// coefficient-unit census as its non-vacuity arm. All six are + /// `s422_416x242_10b`, `s422_416x250_10b`. ALL SEVEN are closed and are + /// pinned here, each byte-exact against ffmpeg with the per-plane + /// coefficient-unit census as its non-vacuity arm. Six of them are /// CHROMA-only divergences at non-8-aligned geometries -- odd or /// 2-mod-4 luma dimensions, where `round_ss` and the chroma block walk /// disagree with a hardcoded `>> 1` -- which is why they are the rows a /// lift cannot afford to leave unasserted: they are the cells that would /// go quietly wrong again. /// - /// **The seventh, `s422_384x240`, is NOT here, on purpose.** It is the - /// reserved group-tail chroma SKIP arm (`decode.rs`; the risk study R4 - /// flags it as owned elsewhere), it is still red, and pinning a red cell - /// inside a green gate is how a gate stops being a gate. - /// **THIS BRANCH MUST NOT LAND UNTIL THAT CELL CLOSES AND THE CORPUS - /// RE-MEASURES 51/51** -- see `lanes/av1422lift.report.md`. + /// **The seventh, `s422_384x240`, IS here now.** lane-av1422lift pinned six + /// of the seven and deliberately left this one out: it was still red, and + /// pinning a red cell inside a green gate is how a gate stops being a gate + /// ("THIS BRANCH MUST NOT LAND UNTIL THAT CELL CLOSES AND THE CORPUS + /// RE-MEASURES 51/51", `lanes/av1422lift.report.md` §7). The cell closed in + /// lane-av1422tailskip, and NOT through the reserved group-tail chroma SKIP + /// arm the risk study's R4 blamed: that lane measured it byte-exact against + /// ffmpeg on all 16 displayed frames and all 17 decode-order frames, 0/0/0 + /// wrong samples in Y/U/V, with the fix's own counter + /// (`palette_422_unit_window_hits`) non-zero on this stream. + /// `lanes/av1422tailskip.report.md` §1 records the measurement and the + /// refutation of the arm attribution. + /// + /// That lane had already committed these exact bytes under the name + /// `422_palette_intra_in_inter_384x240_17f.obu` (sha256 `bf1c658e...a815b`, + /// the sweep artifact byte for byte), so the row below pins THAT file + /// rather than committing a second copy of one stream under a second name. + /// Unlike the other six, this cell sits at an 8- AND 16-aligned geometry + /// (384x240): it was the late-starting frame-1 alt-ref chroma residual + /// (`lanes/av1422late.report.md`), not the `round_ss` class -- which is why + /// it is pinned as its own row here rather than folded into that sentence. + /// + /// **The corpus re-measures 51/51**, which was the second half of the + /// condition the paragraph above quotes. Re-run for this row with the + /// ffmpeg-oracle census driver (`~/.cache/census422b/ffcensus.py`: display + /// order, shown frames, geometry from `ffprobe`, a count over zero frames + /// is a hard error) and a `dump_yuv` built from THIS lane's tree: + /// **51 of 51 4:2:2 cells BYTE-EXACT** -- `s422_384x240` among them at + /// 0/0/0 -- and, in the same run, all 44 4:2:0 / 4:4:4 controls BYTE-EXACT + /// (95/95 over the whole corpus). That run is a measurement of this tree, + /// not a re-reading of the closure report; the per-cell rows here are what + /// keep the seven named ones from drifting back. /// /// **The census arm, per row.** `assert_422_stream_pixel_exact` asserts /// that all three planes read a non-zero number of coefficient units AND @@ -4023,14 +4049,18 @@ pub(crate) mod tests { /// the same decode walked 4994 units, so a green here with no census /// assert would have proven nothing about 4:2:2. /// - /// **Provenance of the six pins.** All six are `aomenc --codec=av1 + /// **Provenance of the seven pins.** All seven are `aomenc --codec=av1 /// --profile=2 --input-bit-depth=<8|10> --cpu-used=0 --cq-level=24 /// --limit=16 --auto-alt-ref=1 --enable-global-motion=1 --passes=1 /// --obu` over a hand-built `C422` y4m (header line, then `FRAME\n` plus /// one frame of planes per frame -- libaom's y4minput requires those six - /// bytes before EVERY frame), produced by the census sweep and copied in - /// from `~/.cache/census422b/sweep/`. They are ordinary libaom 4:2:2 - /// streams with nothing bolted on. + /// bytes before EVERY frame), produced by the census sweep. The first six + /// were copied in from `~/.cache/census422b/sweep/`; the seventh is the + /// same sweep's `s422_384x240.obu`, which lane-av1422tailskip had already + /// committed under the name in its own row (the two files are byte for + /// byte identical -- sha256 `bf1c658e9bfdc13ec1ed51e59049d2b81201941b6ef45\ + /// 71f8382f356ea4b815b`), so it is pinned under that name here. They are + /// ordinary libaom 4:2:2 streams with nothing bolted on. #[test] fn the_pinned_422_corpus_cells_decode_pixel_exact() { const NAME: &str = "the_pinned_422_corpus_cells_decode_pixel_exact"; @@ -4100,6 +4130,20 @@ pub(crate) mod tests { 10, 16, ), + ( + // Census cell `s422_384x240` -- the seventh previously + // diverging cell, closed by lane-av1422tailskip. Same bytes as + // the sweep's `s422_384x240.obu`, already in this fixtures dir + // under the name lane-av1422tailskip's own gate pins. + "422_palette_intra_in_inter_384x240_17f.obu", + 19344usize, + 0x923ccabfcb933e90u64, + "bf1c658e9bfdc13ec1ed51e59049d2b81201941b6ef4571f8382f356ea4b815b", + 384usize, + 240usize, + 8u8, + 16usize, + ), ] { let row = format!("{NAME}[{file}]"); let path = crate_pin(file);