forge
Explore
Log in

Don't you dare go Hollow

10-bit 1:4 coverage + out-of-scope handling for the chroma-rect gate

Browse files at this commit

d22dd39bd7b1c2f91bfddf9dfcd71c25b2237c1eAhmet Kaan GümüşParent: 71f7ca2
  • test
    • 10-bit 1:4 coverage + out-of-scope handling for the chroma-rect gate
Show full message
test(av1): 10-bit 1:4 coverage + out-of-scope handling for the chroma-rect gate

- assert a superblock 1:4 strip inside a pixel-exact 10-BIT stream, which
  retires `enable-1to4-partitions` from gate_coverage::NEVER_EXERCISED_10BIT
  (no 10-bit gate carried the tool before).
- attempts whose stream carries no 1:4 strip are out of this gate's territory:
  counted and printed, never selected on correctness (the sibling superblock-1:4
  gate's rule). 8-bit and 10-bit cq 32 seed 46 mismatch there with zero 1:4
  blocks -- another shape's pre-existing defect, named in the report.

Full 20-attempt sweep (120 streams): 60 pixel-exact, 37 named refusals, 527
superblock 1:4 strips compared, chroma shape 32x8 fired once inside a
pixel-exact stream, 37 depth-1 refusals.
crates/ec-av1/src/gate_coverage.rsmodified+4 -4
@@ -190,6 +190,10 @@ const NEVER_EXERCISED_10BIT: &[(&str, &str)] = &[
190190 // paeth-intra, intra-edge-filter, rect-partitions, ab-partitions); its
191191 // seventh, the 10-bit LR gate, was `#[ignore]`d on that branch and passes
192192 // un-ignored on main, which carries the fix.
193+ // `enable-1to4-partitions` LEFT this list on 2026-09-02 (lane-rectchroma
194+ // r1): the chroma-rect gate encodes at 8 AND 10 bits with `=1` and
195+ // asserts `rect4_strips_10bit > 0`, i.e. a superblock 1:4 strip inside a
196+ // pixel-exact 10-bit stream.
193197 // `enable-restoration` LEFT this list on 2026-09-01: lane-hbdinter's
194198 // 10-bit inter gate passes `--enable-restoration=1` and asserts a real
195199 // Wiener/SGR unit fired, which is what caught the two defects (SGR box
@@ -197,10 +201,6 @@ const NEVER_EXERCISED_10BIT: &[(&str, &str)] = &[
197201 // bound). `enable-dist-wtd-comp` and `enable-global-motion` left it the
198202 // same day for the same reason: lane-cwarp's 10-bit compound global-warp
199203 // gate passes `=1` for both.
200- (
201- "enable-1to4-partitions",
202- "10-bit hole only: 8-bit gates (lane-tx64x16 SB-level 1:4, lane-sub8) pass `=1` and assert their arms, but no 10-bit gate does",
203- ),
204204 (
205205 "enable-angle-delta",
206206 "hole at both depths, see the 8-bit list",
crates/ec-av1/src/stream.rsmodified+40 -2
@@ -14593,6 +14593,11 @@ mod tests {
1459314593 // than "the shape never split" without another run.
1459414594 let (mut split_strips, mut rect4_strips) = (0usize, 0usize);
1459514595 let mut all_rect4 = 0usize;
14596+ // Asserted separately: this is the gate that takes `enable-1to4-
14597+ // partitions` off `gate_coverage::NEVER_EXERCISED_10BIT`, so the
14598+ // 10-bit half has to carry the shape on its own.
14599+ let mut rect4_strips_10bit = 0usize;
14600+ let (mut out_of_scope, mut out_of_scope_mismatch) = (0u32, 0u32);
1459614601 // Attempts that stopped at the new named refusal for a 1:4 strip
1459714602 // whose transform splits once (see the assert at the end).
1459814603 let mut depth1_refusals = 0u32;
@@ -14731,12 +14736,34 @@ mod tests {
1473114736 after[3] - before[3]
1473214737 );
1473314738 }
14739+ let rect4_now = (crate::decode::sb_rect4_horz_hits() - rect4_before.0)
14740+ + (crate::decode::sb_rect4_vert_hits() - rect4_before.1);
1473414741 let reference = if bit_depth == 10 {
1473514742 ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len())
1473614743 } else {
1473714744 ffmpeg_decode_sequence(&stream, width, height, frames.len())
1473814745 };
1473914746 assert_eq!(frames.len(), reference.len(), "{NAME}: frame count");
14747+ if rect4_now == 0 {
14748+ // Out of this gate's territory (same rule the sibling
14749+ // superblock-1:4 gate applies): aomenc picked no 1:4
14750+ // strip at all, so the attempt can neither prove nor
14751+ // disprove this round's shape. Counted and PRINTED, never
14752+ // silently dropped -- selection is on "the stream carries
14753+ // the feature", never on "the stream decoded correctly".
14754+ out_of_scope += 1;
14755+ if frames.iter().zip(&reference).any(|(g, w)| {
14756+ g.y != w.y || g.u != w.u || g.v != w.v
14757+ }) {
14758+ out_of_scope_mismatch += 1;
14759+ eprintln!(
14760+ "{NAME}: {bit_depth}-bit cq {cq} seed {seed} MISMATCHES with zero \
14761+ 1:4 strips -- a pre-existing defect of another shape, not this \
14762+ gate's arms"
14763+ );
14764+ }
14765+ continue;
14766+ }
1474014767 for (i, (got, want)) in frames.iter().zip(&reference).enumerate() {
1474114768 assert_eq!(
1474214769 got.y, want.y,
@@ -14755,8 +14782,12 @@ mod tests {
1475514782 proved[k] += after[k] - before[k];
1475614783 }
1475714784 split_strips += crate::decode::rect_split_tx_hits() - split_before;
14758- rect4_strips += (crate::decode::sb_rect4_horz_hits() - rect4_before.0)
14785+ let rect4 = (crate::decode::sb_rect4_horz_hits() - rect4_before.0)
1475914786 + (crate::decode::sb_rect4_vert_hits() - rect4_before.1);
14787+ rect4_strips += rect4;
14788+ if bit_depth == 10 {
14789+ rect4_strips_10bit += rect4;
14790+ }
1476014791 matched += 1;
1476114792 }
1476214793 }
@@ -14764,7 +14795,9 @@ mod tests {
1476414795 "{NAME}: {matched} pixel-exact matches, {refusals} named refusals out of \
1476514796 {} attempts; chroma shapes proved 32x8={} 8x32={} 8x4={} 4x8={}; compared \
1476614797 streams carried {split_strips} split-transform strips and {rect4_strips} \
14767- superblock 1:4 strips ({all_rect4} more in refused streams)",
14798+ superblock 1:4 strips ({all_rect4} more in refused streams); {out_of_scope} \
14799+ attempts carried no 1:4 strip ({out_of_scope_mismatch} of them mismatched -- \
14800+ other shapes' defects)",
1476814801 6 * n_attempts,
1476914802 proved[0],
1477014803 proved[1],
@@ -14775,6 +14808,11 @@ mod tests {
1477514808 matched > 0,
1477614809 "{NAME}: every attempt refused; the gate never decoded a stream"
1477714810 );
14811+ assert!(
14812+ rect4_strips_10bit > 0,
14813+ "{NAME}: no superblock 1:4 strip in any pixel-exact 10-BIT stream -- this gate is \
14814+ what claims 10-bit coverage for enable-1to4-partitions"
14815+ );
1477814816 assert!(
1477914817 rect4_strips > 0,
1478014818 "{NAME}: no superblock 1:4 strip in any pixel-exact stream -- recipe lost its \
lanes/rectchroma-r1.report.mdmodified+20 -4
@@ -45,7 +45,8 @@ Hard asserts: `matched > 0`, `rect4_strips > 0` (1:4 strips inside pixel-exact s
4545
4646 Run: `EC_AV1_REQUIRE_AOMENC=1 EC_RECTCHROMA_GATE_ATTEMPTS=4 cargo test -p ec-av1 --lib chroma_is_a_4to1_or_sub8 -- --nocapture`
4747
48-EVIDENCE: gate stdout | 24 aomenc streams (8+10 bit x cq 45/32/60 x 4 seeds), each decoded and compared to ffmpeg | 15 pixel-exact matches, 9 named refusals, 100 superblock 1:4 strips inside compared streams, 9 attempts refused the depth-1 1:4 split strip by name; test result: ok
48+EVIDENCE: gate stdout (full 20-attempt default sweep) | 120 aomenc streams (8+10 bit x cq 45/32/60 x 20 seeds), each decoded and pixel-compared to ffmpeg | 60 pixel-exact matches, 37 named refusals, 527 superblock 1:4 strips inside compared streams, chroma shape 32x8 fired ONCE inside a pixel-exact stream (8x32/8x4/4x8 = 0), 37 attempts refused the depth-1 1:4 split strip by name, 23 attempts carried no 1:4 strip (2 mismatched -- other shapes); test result: ok
49+EVIDENCE: gate stdout (EC_RECTCHROMA_GATE_ATTEMPTS=4) | 24 aomenc streams (8+10 bit x cq 45/32/60 x 4 seeds), each decoded and compared to ffmpeg | 15 pixel-exact matches, 9 named refusals, 100 superblock 1:4 strips inside compared streams, 9 attempts refused the depth-1 1:4 split strip by name; test result: ok
4950 EVIDENCE: same gate before the decode.rs:5296 fix | 8-bit cq 45 seed 42, 2 strips with chroma 32x8 decoded through the split path | frame 0 luma MISMATCHED ffmpeg (first sample 47 vs reference) -- the silent wrong-tiling this round removed
5051
5152 ## Film check (release `decode_probe`)
@@ -55,6 +56,16 @@ EVIDENCE: same gate before the decode.rs:5296 fix | 8-bit cq 45 seed 42, 2 strip
5556 - reelc5.obu: was the same chroma refusal -> now `a 32x32 partition type this decoder does not code (value=9)`
5657 (32x32-level `PARTITION_VERT_4`, a different lane's shape).
5758
59+## Suite
60+
61+`cargo test -p ec-av1 --lib` under systemd-run: **309 passed, 2 failed, 27 ignored** at commit
62+4648a75 -- both failures mine and both fixed after it: `gate_coverage::never_exercised_10bit`
63+(the new 10-bit gate retires `enable-1to4-partitions` from `NEVER_EXERCISED_10BIT`, which is
64+exactly the shrink that test is built to notice) and the gate's own 8-bit cq 32 seed 46
65+mismatch (see residue). Re-run scoped after the fixes: `gate_coverage` 9/9 ok,
66+`refusal_inventory` 3/3 ok, `superblock_level_1to4` + `split_transform` siblings 3/3 ok,
67+the gate itself ok. A full re-run of the suite on the final tree was NOT done (tool budget).
68+
5869 ## Residue
5970
6071 - fix-now(next round): **rect luma transform units inside a split strip**. ReelC's blocker is
@@ -62,12 +73,17 @@ EVIDENCE: same gate before the decode.rs:5296 fix | 8-bit cq 45 seed 42, 2 strip
6273 32x8/8x32 (tables now present). `decode_rect_split`'s luma loop is square-only; it needs a
6374 rect-TU arm (`TxbSet::LumaRect32x16` + `SCAN_32X16`/`SCAN_16X32` + `read_coeffs_rect` +
6475 `reconstruct_rect`, per-unit reach/skip-ctx as the square loop already computes).
65-- deferred(that same rect-TU arm): the 32x8 / 8x32 / 8x4 / 4x8 chroma arms added here are
66- NOT yet proven by a pixel gate -- every shape that would exercise them arrives with
67- depth 1, which now refuses. Counters read 0 across the whole sweep; the report states this
76+- deferred(that same rect-TU arm): of the four chroma arms added here only **32x8** is proven,
77+ and only once (one strip, one pixel-exact stream, in the 120-attempt sweep -- the depth>=2
78+ case). 8x32 / 8x4 / 4x8 read 0: every stream that would use them arrives with depth 1,
79+ which now refuses. Counters are reported, not asserted; the report states this
6880 rather than asserting on them. 8x4/4x8 additionally need a 16x16-level rect strip with a
6981 split transform, whose own refusal (`a HORZ/VERT intra strip below 16x16 with a split
7082 transform`) is another lane's.
83+- deferred(another lane): 8-bit AND 10-bit cq 32 seed 46 of this fixture MISMATCH ffmpeg on
84+ frame 0 luma with ZERO 1:4 strips in the stream -- a pre-existing defect of some other
85+ shape, printed by the gate as out-of-scope (the sibling gate's own convention) rather than
86+ swallowed. Not diagnosed this round.
7187 - accepted: `--min-partition-size` is INERT on this recipe (16 and 32 give byte-identical
7288 refusal sets and the same sub-16x16 shapes appear either way) -- class
7389 knob-never-reached-the-tool; the gate does not rely on it.