forge
Explore
Log in

Don't you dare go Hollow

The red-before proof the odd-dimension gate was missing

Browse files at this commit

2fa693f8c0013b8c848d8737212d159d7c9c0cb2Ahmet Kaan GümüşParent: d858fab
  • test
    • the red-before proof the odd-dimension gate was missing
Show full message
test(av1formatsweep): the red-before proof the odd-dimension gate was missing

Flooring the mode-info grid's ceil -- ec-av1-syntax's
`h.mi_cols = 2 * ((h.frame_width + 7) >> 3)` to `2 * (h.frame_width >> 3)`
-- turns a_real_aomenc_odd_coded_dimension_streams_decode_pixel_exact red on
its first arm (decode-order frame 0, byte 128: ours 74 vs oracle 170, 11538
bytes differ) and green on revert. Recorded in the gate's doc comment.

Also records why the nearer mutation is not evidence: flooring
decode::round_ss leaves the gate green because aomenc rounds a 4:2:0 frame's
coded size DOWN to even, so this recipe cannot produce a stream with an odd
luma dimension at all (a testsrc2 131x131 y4m encodes as max_frame=130x130,
and this decoder decodes that frame correctly; the ffmpeg reference padding
to 131x131 is the artifact). The sweep's odd-dimension cell is therefore
'even, not a multiple of 8'.
crates/ec-av1/src/stream.rsmodified+24 -0
@@ -42066,6 +42066,30 @@ pub(crate) mod tests {
42066 /// makes aomenc set `allow_screen_content_tools`, which this decoder42066 /// makes aomenc set `allow_screen_content_tools`, which this decoder
42067 /// refuses BY NAME at 12 bits (see `a_12bit_screen_content_stream_is_42067 /// refuses BY NAME at 12 bits (see `a_12bit_screen_content_stream_is_
42068 /// refused_by_name`).42068 /// refused_by_name`).
42069+ ///
42070+ /// NON-VACUITY, RED-BEFORE PROVEN: the mode-info grid's ceil is the
42071+ /// arithmetic this cell depends on, and mutating it turns every arm red
42072+ /// -- `ec-av1-syntax`'s `h.mi_cols = 2 * ((h.frame_width + 7) >> 3)`
42073+ /// floored to `2 * (h.frame_width >> 3)` makes the first arm fail at
42074+ /// decode-order frame 0, byte 128 (ours 74 vs oracle 170, 11538 bytes
42075+ /// differ); reverted, the gate is green again. A NEARER mutation,
42076+ /// flooring `decode::round_ss` from libaom's `ROUND_POWER_OF_TWO`,
42077+ /// leaves this gate GREEN and is not evidence either way: aomenc rounds
42078+ /// a 4:2:0 frame's coded size DOWN to even, so no stream this recipe can
42079+ /// produce codes an odd luma dimension, and the chroma-extent ceil only
42080+ /// differs from its floor when the luma dimension is itself odd.
42081+ ///
42082+ /// Also asserted, so a recipe that silently became even-dimensioned can
42083+ /// not pass as this cell: the header's `ss (1,1)` and bit depth, the
42084+ /// partial mode-info grid (`mi*8 > dim`), every frame's chroma plane
42085+ /// being `ceil(w/2)*ceil(h/2)`, and
42086+ /// `decode::inter_edge_strip_hits()` non-zero after a per-arm reset --
42087+ /// measured per arm: `[0,6,0,4,48,12]`, `[0,0,0,4,0,6]`,
42088+ /// `[0,4,0,10,0,10]`, `[0,4,0,8,0,12]`, `[0,4,0,8,0,8]`,
42089+ /// `[0,0,0,12,0,14]`, where the even-size control (128x96) reads all
42090+ /// zeros. Without the counter a decoder that dropped the partial column
42091+ /// entirely would still pass the pixel compare (class
42092+ /// `gate-blind-to-feature`).
42069 #[test]42093 #[test]
42070 fn a_real_aomenc_odd_coded_dimension_streams_decode_pixel_exact() {42094 fn a_real_aomenc_odd_coded_dimension_streams_decode_pixel_exact() {
42071 const NAME: &str = "a_real_aomenc_odd_coded_dimension_streams_decode_pixel_exact";42095 const NAME: &str = "a_real_aomenc_odd_coded_dimension_streams_decode_pixel_exact";
lanes/av1formatsweep.report.mdmodified+24 -8
@@ -135,14 +135,30 @@ Shared helpers added: `odd_dim_stream` / `chroma_format_stream` (ffmpeg y4m →
135 aomenc pipe, deadline from `run_with_stdin`), `odd_dim_header_mi_grid`,135 aomenc pipe, deadline from `run_with_stdin`), `odd_dim_header_mi_grid`,
136 `assert_444_header`.136 `assert_444_header`.
137 137
138-**Honest gap in the proof:** the odd-dimensions gate's counter and geometry138+**Red-before proof for gate A (done).** The mutation that bites is the
139-assertions are in place, but its red-before (mutation) proof is NOT139+mode-info grid's ceil: `ec-av1-syntax`'s
140-complete. Forcing `decode::round_ss` from libaom's `ROUND_POWER_OF_TWO` to a140+`h.mi_cols = 2 * ((h.frame_width + 7) >> 3)` floored to
141-floor division left the gate GREEN — the odd-dimension extents are computed141+`2 * (h.frame_width >> 3)` turns the gate red on the first arm — decode-order
142-from the mode-info grid (`mi_cols*4 >> ss`), not through `round_ss`. A142+frame 0, byte 128, ours 74 vs oracle 170, 11538 bytes differ — and green again
143-mutation inside that extent computation is the outstanding proof. Gates B and143+on revert.
144-C inherit the same `aomdec` byte-compare proof as the 180 existing gates, and144+
145-no mutation proof either.145+**Why the nearer mutation was the wrong one.** Flooring `decode::round_ss`
146+(libaom's `ROUND_POWER_OF_TWO`) leaves the gate GREEN, and that is not a gap
147+in the gate: aomenc rounds a 4:2:0 frame's coded size DOWN to even, so no
148+stream this recipe can produce codes an odd luma dimension, and the
149+chroma-extent ceil only differs from its floor when the luma dimension is
150+itself odd. Verified directly: a `testsrc2 131x131` yuv420p y4m (ffmpeg
151+accepts it) comes out of aomenc as a stream whose sequence header says
152+`max_frame=130x130` — and this decoder decodes that 130x130 frame correctly.
153+The ffmpeg reference for the same file comes back 131x131 (25873 samples
154+against our 25350), which is ffmpeg padding to the y4m header, not a decoder
155+defect. **Consequence for the matrix:** the "luma dimension itself odd" cell
156+is not producible through the aomenc + lavfi recipe, so it can be neither
157+gated nor refuted from here; the sweep's odd-dimension cell is "even, not a
158+multiple of 8".
159+
160+**Still unproven:** gates B and C carry no mutation proof — they inherit the
161+`aomdec` byte-compare proof the 180 existing gates run on.
146 162
147 ## 3. Divergences, localized163 ## 3. Divergences, localized
148 164