forge
Explore
Log in

Don't you dare go Hollow

Un-ignore the intrabc TX_MODE_SELECT witness

Browse files at this commit

bbe08502569c6ab76be0418fa800ca7793f20eaaAhmet Kaan GümüşParent: 0674134
  • test
    • un-ignore the intrabc TX_MODE_SELECT witness
    • lift the 128-root screen-strip refusal
Show full message
test(av1): un-ignore the intrabc TX_MODE_SELECT witness; lift the 128-root screen-strip refusal

Both arms of `an_intrabc_block_under_tx_mode_select_decodes_pixel_exact`
decode pixel-exact against ffmpeg, and the census gate's `tiled-square-cq45`
arm rejoins the ordinary table (it is no longer the hole the refusal was one
`&&` narrower than). r31's note that cq=45's intrabc blocks are all `skip`
was read off the desynced decode: corrected, cq=45 carries 3 unskipped of 10
and cq=30 carries 1 of 16, so both arms exercise both sides of the split and
both assert the var-tx counter fired.

Inventory: "an intrabc block under TxMode::Select" deleted (lifted); "a
HORZ/VERT intra strip in a screen-content frame" deleted -- r31's
enumeration (`av1_allow_palette`'s `bw > 64 || bh > 64` bound) is its proof
that a 128-root half codes no palette syntax at all, so a screen frame's
half is syntactically identical to the non-screen one the r18 witness
already decodes byte-exact. One residue registered: a var-tx tree resolving
to mixed leaf sizes, unreached by either arm.
crates/ec-av1/src/decode.rsmodified+6 -6
@@ -8119,12 +8119,12 @@ fn decode_intra_rect_in_inter(
81198119 // reference holds (a fresh smooth ramp) in exactly those two bands of an
81208120 // inter frame and the encoder codes those forced halves INTRA.
81218121 if bw.max(bh) == 128 {
8122- if allow_screen_content_tools {
8123- return Err(unsupported(
8124- "a HORZ/VERT intra strip in a screen-content frame (palette syntax \
8125- is consumed for square blocks only)",
8126- ));
8127- }
8122+ // lane-t900 r32: no screen-content refusal here. `av1_allow_palette`
8123+ // rejects every footprint with a 128-pixel side (`bw > 64 || bh > 64`,
8124+ // enumerated by `no_block_footprint_with_a_128_pixel_side_can_carry_\
8125+ // palette_syntax`), so a 128-root half consumes no palette syntax and
8126+ // a screen-content frame's half is syntactically identical to the
8127+ // non-screen one this arm already decodes byte-exact.
81288128 if coeff_trace_on() {
81298129 // lane-t900 r16: which decode-order frame this arm fires in --
81308130 // interleaved with the `EC_COEFF_FRAME` markers, this is what
crates/ec-av1/src/refusal_inventory.rsmodified+15 -46
@@ -56,7 +56,6 @@ const REFUSALS: &[&str] = &[
5656 "a block that actually uses a palette (Y) -- reconstruction is out of scope",
5757 "intra block copy on a HORZ/VERT/1:4 rect intra strip (reconstruction is not ported at this shape)",
5858 "a sub-8x8 leaf that uses intrabc (this reader has no block-vector path; the 8x8-and-up reader reconstructs one)",
59- "an intrabc block under TxMode::Select (its transform size is coded by the inter var-tx partition tree, which this decoder never reads)",
6059 "a bit depth of 12 (this decoder is gated at 8 and 10 only: warp/MC/wiener rounding shifts change at 12-bit and no 12-bit gate exists)",
6160 "a frame OBU with no tile group",
6261 "a frame naming primary_ref_frame at a reference slot with no saved CDF state",
@@ -124,37 +123,21 @@ const REFUSALS: &[&str] = &[
124123 // What still refuses is the 128-root half of a screen-content frame, whose
125124 // body (`decode_block_128rect`) reads no palette syntax and for which no
126125 // `--sb-size=128` screen witness exists yet.
127- // lane-t900 r23 CENSUS for this string's remaining 128-root arm (the
128- // 16x4/4x16 arm was lifted in r22): its premise is already known to be
129- // false by the spec -- `read_palette_mode_info` (5.11.46) codes palette
130- // only for `Block_Width <= 64 && Block_Height <= 64`, so a 128x64/64x128
131- // half consumes NO palette syntax and the screen flag changes nothing
132- // about it. It stays because nothing witnesses it: 6 aomenc encodes at
133- // `--sb-size=128 --tune-content=screen` (704x320 = 5*128+64 by 2*128+64,
134- // the edge-forced size r18 proved for the non-screen twin; screen cell
135- // content at cq 10/20/40, and r18's own panning-texture-plus-fresh-ramp
136- // shape with `--max-partition-size=128 --enable-ab-partitions=0
137- // --enable-1to4-partitions=0`) code ZERO 128-root halves of any kind
138- // (`intra128_in_inter` and `sb128_rect` both 0 in every stream), so
139- // lifting it would be a capability claim no gate exercises (class
140- // `refusal-lifted-without-a-gate`). What is still untried: a 10-bit
141- // source, and screen content in the forced bands with a NON-screen
142- // interior.
143- // lane-t900 r31, ENUMERATION: the premise is DISPROVED -- `av1_allow_palette`'s
144- // bound (`palette_bsize_ctx_wh`: `bw > 64 || bh > 64`) rejects every
145- // footprint with a 128-pixel side, so a screen-content frame codes no
146- // palette syntax on a 128-root half and that half decodes exactly like the
147- // non-screen twin r18 already witnesses (test
148- // `no_block_footprint_with_a_128_pixel_side_can_carry_palette_syntax`).
149- // The string is a claim about the SYNTAX, and the syntax it fears does not
150- // exist at this size. It stays UNPROVEN and live for two reasons: the
151- // guarded condition is reachable (proving the lift safe is not proving the
152- // case absent), and lifting it is a `decode.rs` edit -- delete the
153- // `if allow_screen_content_tools { return Err(unsupported(..)) }` block
154- // inside the `bw.max(bh) == 128` branch of `decode_intra_rect_in_inter`
155- // -- which needs a `--sb-size=128 --tune-content=screen` witness that
156- // actually codes a 128-root half (r23's census found none).
157- "a HORZ/VERT intra strip in a screen-content frame (palette syntax is consumed for square blocks only)",
126+ // lane-t900 r32: the 128-root arm is LIFTED. r31's enumeration
127+ // (`no_block_footprint_with_a_128_pixel_side_can_carry_palette_syntax`) is
128+ // its proof -- `av1_allow_palette`'s `bw > 64 || bh > 64` bound means a
129+ // 128x64/64x128 half codes NO palette syntax at all, so a screen-content
130+ // frame's half is byte-identical in syntax to the non-screen twin gate
131+ // `an_intra_coded_128_half_inside_an_inter_frame_decodes_pixel_exact`
132+ // already decodes pixel-exact. Nothing of this string remains.
133+ // lane-t900 r32: the residue of the LIFTED "an intrabc block under
134+ // TxMode::Select". The inter var-tx tree is read in full, but the intra
135+ // luma reconstruct loop it feeds is a UNIFORM grid of one square
136+ // transform, so a tree resolving to mixed leaf sizes would be
137+ // reconstructed at the wrong stride. Neither arm of
138+ // `an_intrabc_block_under_tx_mode_select_decodes_pixel_exact` reaches it
139+ // (both resolve uniform), so it is unwitnessed and stays live.
140+ "an intrabc block whose var-tx tree resolved to mixed leaf transform sizes",
158141 "a motion_mode symbol for a block shape with no CDF row here",
159142 ];
160143
@@ -374,20 +357,6 @@ const PROVEN: &[(&str, &str)] = &[
374357 "a frame naming primary_ref_frame at a reference slot with no saved CDF state",
375358 "an_inter_frame_naming_an_unrefreshed_primary_ref_slot_is_refused_by_name",
376359 ),
377- // lane-t900 r31, census + refusal-by-name: 13 real `--tune-content=screen
378- // --enable-intrabc=1` key frames measure this string instead of assuming
379- // it. The refusal is NOT unreachable -- an exact-repetition source
380- // (a 2x2 tiling of one bar pattern) with the rect/1:4 partitions off codes
381- // an unskipped intrabc block on a square block of a TX_MODE_SELECT frame,
382- // and exactly that arm refuses by name while the other twelve decode
383- // pixel-exact. So it is a real capability gap with a waiting witness gate
384- // (`an_intrabc_block_under_tx_mode_select_decodes_pixel_exact`, ignored),
385- // and libaom does not couple the two bits: `select_tx_mode`
386- // (encodeframe.c:2355) never reads `allow_intrabc`.
387- (
388- "an intrabc block under TxMode::Select (its transform size is coded by the inter var-tx partition tree, which this decoder never reads)",
389- "an_intrabc_census_over_screen_key_frames_measures_the_tx_select_refusal",
390- ),
391360 ];
392361
393362 /// Gates whose `Err` arm turns a decode failure into a printed SKIP rather than
crates/ec-av1/src/stream.rsmodified+31 -19
@@ -4370,7 +4370,7 @@ mod tests {
43704370 const TILE: &str = "smptebars=size=128x96:rate=25";
43714371 let (width, height) = (256usize, 192usize);
43724372 // (arm, source, cq, tx-size-search, tiled, square_only)
4373- let arms: [(&str, &str, &str, &str, bool, bool); 13] = [
4373+ let arms: [(&str, &str, &str, &str, bool, bool); 14] = [
43744374 ("smptebars-cq40-txs1", SB, "40", "1", false, false),
43754375 ("smptebars-cq45-txs1", SB, "45", "1", false, false),
43764376 ("smptebars-cq55-txs1", SB, "55", "1", false, false),
@@ -4384,13 +4384,11 @@ mod tests {
43844384 ("tiled-cq30-txs1", TILE, "30", "1", true, false),
43854385 ("tiled-cq45-txs1", TILE, "45", "1", true, false),
43864386 ("tiled-square-cq30-txs1", TILE, "30", "1", true, true),
4387- // `tiled-square-cq45-txs1` belongs here too and is NOT in this
4388- // table: its intrabc blocks are all `skip`, so the `&& !skip`
4389- // guard lets them through -- and the frame decodes WRONG against
4390- // ffmpeg. A refusal one `&&` narrower than the hole it guards
4391- // (class `refusal-hides-a-defect`); that arm lives in the ignored
4392- // gate below with the unskipped one, and the guard itself is a
4393- // `decode.rs` edit this round could not make.
4387+ // lane-t900 r32: both square arms are now ORDINARY census members
4388+ // -- cq30 (unskipped intrabc, the inter var-tx tree) and cq45
4389+ // (all-skip intrabc, `maxRectTxSize` with no symbol at all) decode
4390+ // pixel-exact, so nothing here reaches the lifted refusal.
4391+ ("tiled-square-cq45-txs1", TILE, "45", "1", true, true),
43944392 ];
43954393 let (mut select_arms, mut premise_arms, mut intrabc_arms, mut blocks_total) =
43964394 (0u32, 0u32, 0u32, 0usize);
@@ -4468,9 +4466,9 @@ mod tests {
44684466 tx_mode == Select, so the refusal's own premise was never within reach"
44694467 );
44704468 assert_eq!(
4471- refused_tx_select, 1,
4472- "{NAME}: exactly one arm (tiled-square-cq30-txs1) must reach the refusal -- if \
4473- none does, the census no longer measures it; if more do, say so here"
4469+ refused_tx_select, 0,
4470+ "{NAME}: lane-t900 r32 lifted this refusal -- an intrabc block now reads the \
4471+ INTER tx-size syntax, so no arm may reach it again"
44744472 );
44754473 assert!(frames_compared > 0, "{NAME}: no frame was compared pixel-exact");
44764474 }
@@ -4484,13 +4482,17 @@ mod tests {
44844482 /// (`read_var_tx_size`), which this decoder reads nowhere on the intra
44854483 /// path -- reading the intra `tx_depth` symbol instead desyncs.
44864484 ///
4487- /// Two arms of the same recipe: `cq=30`, whose intrabc block is unskipped
4488- /// and refused by name, and `cq=45`, whose intrabc blocks are all `skip`
4489- /// and therefore pass the `&& !skip` guard -- and decode WRONG (frame 0
4490- /// mismatches ffmpeg). So the refusal is one `&&` narrower than the hole:
4491- /// until the var-tx read lands, the skipped case needs the same refusal.
4485+ /// lane-t900 r32 closed both arms. A SKIPPED intrabc block reads no
4486+ /// tx-size symbol at all (`allowSelect = !skip || !is_inter`, false for an
4487+ /// intrabc block since libaom's `is_inter_block` counts one); reading the
4488+ /// intra `tx_depth` for it consumed a symbol libaom never wrote and
4489+ /// desynced the tile a whole block later, at the superblock corner
4490+ /// (192,64) (class `equal-range-means-unread`). An UNSKIPPED one reads the
4491+ /// inter var-tx tree (`read_var_tx_size`). r31's note that cq=45's blocks
4492+ /// are all `skip` was read off that desynced decode: with the tx-size read
4493+ /// corrected, cq=45 carries 3 unskipped intrabc blocks of 10 and cq=30
4494+ /// carries 1 of 16, so both arms exercise both sides of the split.
44924495 #[test]
4493- #[ignore = "capability gap: an intrabc block's tx size is coded by the inter var-tx tree"]
44944496 fn an_intrabc_block_under_tx_mode_select_decodes_pixel_exact() {
44954497 const NAME: &str = "an_intrabc_block_under_tx_mode_select_decodes_pixel_exact";
44964498 if !have_ffmpeg() || !have_aomenc() {
@@ -4507,11 +4509,21 @@ mod tests {
45074509 (select={select} premise={premise})"
45084510 );
45094511 crate::decode::reset_intrabc_hits();
4512+ crate::decode::reset_intrabc_vartx_hits();
45104513 let frames = decode_stream(&stream).unwrap_or_else(|e| panic!("{NAME}: cq={cq}: {e}"));
4514+ let (blocks, vartx) =
4515+ (crate::decode::intrabc_hits(), crate::decode::intrabc_vartx_hits());
4516+ assert!(blocks > 0, "{NAME}: cq={cq} no longer decodes an intrabc block");
4517+ // r31 recorded cq=45's intrabc blocks as ALL skip; that was read
4518+ // off the desynced decode. With the tx-size read corrected both
4519+ // arms carry unskipped ones (cq30 1 of 16, cq45 3 of 10), so both
4520+ // must reach the var-tx tree or the gate is blind to the lift
4521+ // (class `gate-blind-to-feature`).
45114522 assert!(
4512- crate::decode::intrabc_hits() > 0,
4513- "{NAME}: cq={cq} no longer decodes an intrabc block"
4523+ vartx > 0,
4524+ "{NAME}: cq={cq} no longer reads the inter var-tx tree for an intrabc block"
45144525 );
4526+ eprintln!("{NAME}: cq={cq} {blocks} intrabc block(s), {vartx} through var-tx");
45154527 let theirs = ffmpeg_decode_sequence(&stream, width, height, frames.len());
45164528 assert_eq!(frames.len(), theirs.len(), "{NAME}: cq={cq} frame count");
45174529 for (i, (ours, ref_frame)) in frames.iter().zip(theirs.iter()).enumerate() {