ec-av1: refuse using_qmatrix by name (third silent-garbage field) + census table
Browse files at this commit754210ba6ef73535c11c0241f1968d2d0bc958d0Parent: ec34b0d4 changed files +315 -15
- crates/ec-av1/src/cdf_state.rs +3 -3
- crates/ec-av1/src/refusal_inventory.rs +16 -0
- crates/ec-av1/src/stream.rs +70 -0
- lanes/av1txrouting.report.md +226 -12
crates/ec-av1/src/cdf_state.rsmodified+3 -3
| @@ -322,9 +322,9 @@ impl TxbSet { | ||
| 322 | 322 | |
| 323 | 323 | /// lane-txi: this set's `reduced_tx_set == 0` counterpart -- the WIDER |
| 324 | 324 | /// `tx_type` alphabet the same coefficient tables are read with when the |
| 325 | - /// frame header's bit is off. Every pair here is the one | |
| 326 | - /// `decode::txbset_for`/`txbset_for_inter`/`inter_txbset_for` resolve off | |
| 327 | - /// that bit, transcribed from the DECODER's own map so writer and reader | |
| 325 | + /// frame header's bit is off. Every pair here is the counterpart | |
| 326 | + /// `decode::txbset_for`/`inter_txbset_for` resolve off that bit, | |
| 327 | + /// transcribed from the DECODER's own map so writer and reader | |
| 328 | 328 | /// cannot drift (class `table-and-reader-move-together`); a set with no |
| 329 | 329 | /// counterpart -- intra 16x16 and 32x32, inter 32x32, 64x64, every |
| 330 | 330 | /// chroma set -- is its own, and widening an already-wide set is the |
crates/ec-av1/src/refusal_inventory.rsmodified+16 -0
| @@ -70,6 +70,14 @@ const REFUSALS: &[&str] = &[ | ||
| 70 | 70 | // at the sequence header. Gate: |
| 71 | 71 | // `a_non_420_subsampled_sequence_header_is_refused_by_name`. |
| 72 | 72 | "a chroma format other than 4:2:0 (subsampling_x/y != 1/1): every chroma extent in this decoder is hardcoded to 4:2:0 and the probe emits 4:2:0 planes only, so a 4:4:4/4:2:2 stream would decode silently wrong pixels", |
| 73 | + // lane-av1txr-r2: the third member of the same silent-garbage family. | |
| 74 | + // `using_qmatrix`/`qm_y`/`qm_u`/`qm_v` are parsed by `ec-av1-syntax` but | |
| 75 | + // read by NOTHING on the decode path -- dequantisation is `base_q_idx` + | |
| 76 | + // the plane DC/AC deltas only -- so a real `aomenc --enable-qm=1` stream | |
| 77 | + // decoded with no refusal and wrong pixels (measured: byte-diff vs ffmpeg | |
| 78 | + // while the qm-off control is byte-exact). Refused at the frame header. | |
| 79 | + // Gate: `a_frame_using_quantisation_matrices_is_refused_by_name`. | |
| 80 | + "a frame using quantisation matrices (using_qmatrix=1): dequantisation here is base_q_idx plus the plane DC/AC deltas only, so qm_y/qm_u/qm_v would be ignored and the frame would decode silently wrong pixels", | |
| 73 | 81 | // lane-lossless/lane-lossless2: a lossless frame (base_q_idx 0) decodes |
| 74 | 82 | // sample-exact, KEY and INTER -- TX_4X4 with the Walsh-Hadamard transform |
| 75 | 83 | // on every plane, no `tx_type` symbol, `is_cfl_allowed` narrowed to a |
| @@ -321,6 +329,14 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 321 | 329 | "a chroma format other than 4:2:0 (subsampling_x/y != 1/1): every chroma extent in this decoder is hardcoded to 4:2:0 and the probe emits 4:2:0 planes only, so a 4:4:4/4:2:2 stream would decode silently wrong pixels", |
| 322 | 330 | "a_non_420_subsampled_sequence_header_is_refused_by_name", |
| 323 | 331 | ), |
| 332 | + // lane-av1txr-r2: the gate encodes the same source twice with real aomenc | |
| 333 | + // (`--enable-qm=1` and `--enable-qm=0`), asserts the qm-off CONTROL decodes | |
| 334 | + // and the qm-on stream is refused by name -- so the refusal is exercised | |
| 335 | + // against the exact encoder path it names, not merely present. | |
| 336 | + ( | |
| 337 | + "a frame using quantisation matrices (using_qmatrix=1): dequantisation here is base_q_idx plus the plane DC/AC deltas only, so qm_y/qm_u/qm_v would be ignored and the frame would decode silently wrong pixels", | |
| 338 | + "a_frame_using_quantisation_matrices_is_refused_by_name", | |
| 339 | + ), | |
| 324 | 340 | ( |
| 325 | 341 | "intra block copy on a HORZ/VERT/1:4 rect intra strip (reconstruction is not ported at this shape)", |
| 326 | 342 | "a_real_aomenc_screen_key_frame_reads_use_intrabc_on_rect_strips", |
crates/ec-av1/src/stream.rsmodified+70 -0
| @@ -1631,6 +1631,24 @@ fn decode_frame( | ||
| 1631 | 1631 | "a chroma format other than 4:2:0 (subsampling_x/y != 1/1): every chroma extent in this decoder is hardcoded to 4:2:0 and the probe emits 4:2:0 planes only, so a 4:4:4/4:2:2 stream would decode silently wrong pixels", |
| 1632 | 1632 | )); |
| 1633 | 1633 | } |
| 1634 | + // lane-av1txr-r2: `quantization_params.using_qmatrix` (spec 5.9.12) is | |
| 1635 | + // parsed by `ec-av1-syntax` along with `qm_y`/`qm_u`/`qm_v` (frame.rs | |
| 1636 | + // :190-196, :1418-1426), but this decoder reads NONE of them: every | |
| 1637 | + // dequantisation below is `base_q_idx` plus the plane DC/AC deltas only | |
| 1638 | + // (`Quantizer::new`), so a stream that applies quantisation matrices | |
| 1639 | + // dequantises every coefficient off the wrong table. The same | |
| 1640 | + // silent-garbage class as the non-4:2:0 guard above. Measured: a real | |
| 1641 | + // `aomenc --enable-qm=1` key frame (`using_qmatrix = 1`, `qm_y/u/v = 5`) | |
| 1642 | + // decodes with NO refusal and its planes byte-differ from ffmpeg, while | |
| 1643 | + // the `--enable-qm=0` control of the same source and recipe is | |
| 1644 | + // byte-exact. Refuse by name rather than return garbage. Gate: | |
| 1645 | + // `a_frame_using_quantisation_matrices_is_refused_by_name` below. | |
| 1646 | + if header.quantization.using_qmatrix { | |
| 1647 | + return Err(Error::unsupported( | |
| 1648 | + "AV1 decode_stream", | |
| 1649 | + "a frame using quantisation matrices (using_qmatrix=1): dequantisation here is base_q_idx plus the plane DC/AC deltas only, so qm_y/qm_u/qm_v would be ignored and the frame would decode silently wrong pixels", | |
| 1650 | + )); | |
| 1651 | + } | |
| 1634 | 1652 | // lane-dpm1: a LOSSLESS frame (`qindex == 0` with zero deltas, spec 5.9.12) |
| 1635 | 1653 | // is a different tile syntax, and this decoder has none of it: libaom |
| 1636 | 1654 | // forces TX_4X4 with the WALSH-HADAMARD transform over every block (so no |
| @@ -2099,6 +2117,58 @@ pub(crate) mod tests { | ||
| 2099 | 2117 | assert_eq!(frames.len(), 1, "{NAME}: the 4:2:0 control decoded no frame"); |
| 2100 | 2118 | } |
| 2101 | 2119 | |
| 2120 | + /// lane-av1txr-r2: a frame using quantisation matrices is refused by name | |
| 2121 | + /// -- the THIRD member of the silent-garbage family the non-4:2:0 gate | |
| 2122 | + /// above opened (the verifier's census miss). | |
| 2123 | + /// | |
| 2124 | + /// `using_qmatrix`/`qm_y`/`qm_u`/`qm_v` are parsed by `ec-av1-syntax` | |
| 2125 | + /// (frame.rs:190-196, :1418-1426) but have NO consumer anywhere on the | |
| 2126 | + /// decode path -- every dequantisation is `base_q_idx` plus the plane | |
| 2127 | + /// DC/AC deltas only. Measured on a real aomenc pair (same source and | |
| 2128 | + /// recipe, only `--enable-qm` flipped): the qm-OFF control decodes | |
| 2129 | + /// byte-exact vs ffmpeg, the qm-ON stream used to decode with NO refusal | |
| 2130 | + /// and byte-differ from ffmpeg (silent garbage; class | |
| 2131 | + /// `refusal-hides-a-defect` read the other way -- a silent wrong decode | |
| 2132 | + /// is worse than a named gap). | |
| 2133 | + /// | |
| 2134 | + /// Both arms are real encoder output, so this is a reachability gate, not | |
| 2135 | + /// a hand-built construction: the qm-on arm carries `using_qmatrix = 1` | |
| 2136 | + /// (`qm_y/u/v = 5` on the measured fixture) and the refusal names the | |
| 2137 | + /// field rather than desyncing. | |
| 2138 | + #[test] | |
| 2139 | + fn a_frame_using_quantisation_matrices_is_refused_by_name() { | |
| 2140 | + const NAME: &str = "a_frame_using_quantisation_matrices_is_refused_by_name"; | |
| 2141 | + const REFUSAL: &str = "a frame using quantisation matrices"; | |
| 2142 | + if !have_ffmpeg() || !have_aomenc() { | |
| 2143 | + eprintln!( | |
| 2144 | + "SKIP {NAME}: needs ffmpeg + an aomenc oracle at {}", | |
| 2145 | + aomenc_path().display() | |
| 2146 | + ); | |
| 2147 | + return; | |
| 2148 | + } | |
| 2149 | + // CONTROL: the same source and recipe with quantisation matrices OFF | |
| 2150 | + // still decodes -- so the refusal below is about the qm bit, not about | |
| 2151 | + // the source or the encoder settings. | |
| 2152 | + let (_, control) = census_attempt("testsrc2", 128, 96, 3, &["--enable-qm=0"]); | |
| 2153 | + let frames = control.unwrap_or_else(|e| { | |
| 2154 | + panic!("{NAME}: the --enable-qm=0 control must decode, got: {e}") | |
| 2155 | + }); | |
| 2156 | + assert!(frames >= 1, "{NAME}: the qm-off control decoded no frame"); | |
| 2157 | + // The qm-on stream is the new refusal. | |
| 2158 | + let (_, qm) = census_attempt("testsrc2", 128, 96, 3, &["--enable-qm=1"]); | |
| 2159 | + let err = qm.err().unwrap_or_else(|| { | |
| 2160 | + panic!("{NAME}: the --enable-qm=1 stream now decodes -- flip this gate to a witness") | |
| 2161 | + }); | |
| 2162 | + assert!( | |
| 2163 | + err.contains(REFUSAL), | |
| 2164 | + "{NAME}: the qm-on stream stopped without the named refusal {REFUSAL:?} \ | |
| 2165 | + -- re-measure before trusting this gate. got: {err}" | |
| 2166 | + ); | |
| 2167 | + eprintln!( | |
| 2168 | + "{NAME}: qm-off control {frames} frames, qm-on refused by name ({REFUSAL})" | |
| 2169 | + ); | |
| 2170 | + } | |
| 2171 | + | |
| 2102 | 2172 | /// lane-av1-decode (pilot resume, 2026-09-19): a real libaom MONOCHROME key |
| 2103 | 2173 | /// frame is currently REFUSED BY NAME, and this gate pins that as today's |
| 2104 | 2174 | /// measured first stop for a real encoder stream. |
lanes/av1txrouting.report.mdmodified+226 -12
| @@ -206,13 +206,15 @@ Evidence: | ||
| 206 | 206 | |
| 207 | 207 | ### 9.2 Parsed-but-unread pixel-affecting header field sweep |
| 208 | 208 | |
| 209 | -A census of every `SequenceHeader`/`ColorConfig`/frame-header field against the | |
| 210 | -decoder's reads (scout report, re-derivable by grep) found exactly two | |
| 211 | -pixel-affecting fields the decoder never consumed; both are now closed: | |
| 209 | +A per-field census of every `SequenceHeader` / `ColorConfig` / | |
| 210 | +`QuantizationParams` / `FrameHeader` field against the decoder's PRODUCTION | |
| 211 | +reads (`crates/ec-av1/src/{stream,decode}.rs`, test modules excluded; each row | |
| 212 | +re-derivable by `grep -n "\.<field>\b"`) found **three** pixel-affecting fields | |
| 213 | +the decoder never consumed. All three are now closed: | |
| 212 | 214 | |
| 213 | 215 | 1. `subsampling_x/y` — §9.1 (refusal). |
| 214 | -2. **`disable_cdf_update`** (the new find): spec 8.3.2 skips ALL per-symbol CDF | |
| 215 | - adaptation when set, and libaom's tile entry does exactly that | |
| 216 | +2. **`disable_cdf_update`** (the second find): spec 8.3.2 skips ALL per-symbol | |
| 217 | + CDF adaptation when set, and libaom's tile entry does exactly that | |
| 216 | 218 | (`decodeframe.c:2909`, `allow_update_cdf && !disable_cdf_update`). The |
| 217 | 219 | decoder adapted unconditionally. Fixed at the one authoring point: |
| 218 | 220 | `msac::SymbolDecoder::adapt` (per READER, not global — frames decode on |
| @@ -230,13 +232,163 @@ pixel-affecting fields the decoder never consumed; both are now closed: | ||
| 230 | 232 | and its tables stay untouched; the default reader does not (flag |
| 231 | 233 | load-bearing). |
| 232 | 234 | |
| 233 | -Everything else never-read is dispositioned as metadata (color_primaries / | |
| 234 | -transfer_characteristics / color_range / chroma_sample_position, timing and | |
| 235 | -frame-id fields, `showable_frame`, `render_width/height` — deliberate per | |
| 236 | -`encode.rs:15917-15921`), or consumed indirectly by the parser (seq gates forced | |
| 237 | -into the frame header: superres/CDEF/restoration/warped/enable_ref_frame_mvs, | |
| 238 | -`separate_uv_delta_q`, `seq_force_*`). `mono_chrome`/`num_planes` is the sibling | |
| 239 | -lane-av1-mono's. | |
| 235 | +3. **`using_qmatrix` + `qm_y`/`qm_u`/`qm_v`** — the census MISS this section | |
| 236 | + previously claimed did not exist (found by the re-verifier; lane-av1txr-r2). | |
| 237 | + Parsed by `ec-av1-syntax` (`frame.rs:190-196`, `:1418-1426`), read by | |
| 238 | + NOTHING on the decode path: every dequantisation is `base_q_idx` plus the | |
| 239 | + plane DC/AC deltas. A real `aomenc --enable-qm=1` stream | |
| 240 | + (`using_qmatrix = 1`, `qm_y/u/v = 5` on the measured fixture) decoded with NO | |
| 241 | + refusal and byte-differed from ffmpeg, while the `--enable-qm=0` control of | |
| 242 | + the same source and recipe was byte-exact — the same silent-garbage class as | |
| 243 | + §9.1. Refused by name at the frame header (`stream.rs`, beside the non-4:2:0 | |
| 244 | + guard); gate `a_frame_using_quantisation_matrices_is_refused_by_name`, which | |
| 245 | + fails pre-fix (with the guard removed it panics "the --enable-qm=1 stream now | |
| 246 | + decodes"). | |
| 247 | + | |
| 248 | +The table below is the audit artifact the re-verifier asked for: every field of | |
| 249 | +those four structs, its first production read, or its disposition when unread. | |
| 250 | +It is the source of the "three" above, so the census is checkable rather than a | |
| 251 | +grep claim. Dispositions: `consumed` (a decoder read exists), | |
| 252 | +`refused` (a named guard refuses the case), `parser-forced` (a seq flag | |
| 253 | +`ec-av1-syntax` folds into a frame-header field the decoder DOES read), | |
| 254 | +`parser-internal` (used only while reading the header), `metadata` (no pixel | |
| 255 | +effect), `sibling-lane` (`mono_chrome`/`num_planes`, lane-av1-mono), and | |
| 256 | +`internal-equivalent` (`ref_order_hint`/`order_hints`, which the decoder | |
| 257 | +rebuilds from its own saved reference state — `stream.rs:1344`). | |
| 258 | + | |
| 259 | + | |
| 260 | +**SequenceHeader** | |
| 261 | + | |
| 262 | +| field | disposition | first prod read | | |
| 263 | +|---|---|---| | |
| 264 | +| `seq_profile` | parser-internal | sequence.rs parse; effect surfaced via subsampling_x/y + bit_depth guards | | |
| 265 | +| `still_picture` | parser-internal | parse branch | | |
| 266 | +| `reduced_still_picture_header` | parser-internal | parse branch | | |
| 267 | +| `timing_info` | metadata | display timing | | |
| 268 | +| `decoder_model_info` | metadata | display timing | | |
| 269 | +| `initial_display_delay_present_flag` | metadata | display timing | | |
| 270 | +| `operating_points` | metadata | op selection; decoder decodes all | | |
| 271 | +| `operating_point` | metadata | op selection | | |
| 272 | +| `operating_point_idc` | metadata | op selection | | |
| 273 | +| `frame_width_bits` | parser-internal | frame-size read width | | |
| 274 | +| `frame_height_bits` | parser-internal | frame-size read width | | |
| 275 | +| `max_frame_width` | parser-internal | frame-size validation | | |
| 276 | +| `max_frame_height` | parser-internal | frame-size validation | | |
| 277 | +| `frame_id_numbers_present_flag` | parser-internal | display_frame_id read | | |
| 278 | +| `delta_frame_id_length` | parser-internal | display_frame_id read | | |
| 279 | +| `additional_frame_id_length` | parser-internal | display_frame_id read | | |
| 280 | +| `use_128x128_superblock` | consumed | `stream.rs:1267` | | |
| 281 | +| `enable_filter_intra` | consumed | `stream.rs:1261` | | |
| 282 | +| `enable_intra_edge_filter` | consumed | `stream.rs:1263` | | |
| 283 | +| `enable_interintra_compound` | consumed | `stream.rs:1266` | | |
| 284 | +| `enable_masked_compound` | consumed | `stream.rs:1264` | | |
| 285 | +| `enable_warped_motion` | parser-forced | syntax/frame.rs:1053 -> h.allow_warped_motion | | |
| 286 | +| `enable_dual_filter` | consumed | `stream.rs:1262` | | |
| 287 | +| `enable_order_hint` | parser-forced | syntax/frame.rs:919,1068 -> order_hint_bits / ref_frame_sign_bias | | |
| 288 | +| `enable_jnt_comp` | consumed | `stream.rs:1265` | | |
| 289 | +| `enable_ref_frame_mvs` | parser-forced | syntax/frame.rs:970 -> h.use_ref_frame_mvs | | |
| 290 | +| `seq_force_screen_content_tools` | parser-forced | syntax/frame.rs:853 -> h.allow_screen_content_tools | | |
| 291 | +| `seq_force_integer_mv` | parser-forced | syntax/frame.rs:859 -> h.force_integer_mv | | |
| 292 | +| `order_hint_bits` | consumed | `stream.rs:1269` | | |
| 293 | +| `enable_superres` | parser-forced | syntax/frame.rs:1100 -> h.use_superres | | |
| 294 | +| `enable_cdef` | parser-forced | syntax/frame.rs:1576 -> h.cdef | | |
| 295 | +| `enable_restoration` | parser-forced | syntax/frame.rs:1605 -> h.loop_restoration | | |
| 296 | +| `color_config` | consumed | `stream.rs:724` | | |
| 297 | +| `film_grain_params_present` | parser-forced | syntax/frame.rs:809,1866 -> h.film_grain | | |
| 298 | + | |
| 299 | +**ColorConfig** | |
| 300 | + | |
| 301 | +| field | disposition | first prod read | | |
| 302 | +|---|---|---| | |
| 303 | +| `bit_depth` | consumed | `stream.rs:678` | | |
| 304 | +| `mono_chrome` | sibling-lane | lane-av1-mono; a mono stream is currently refused by the Golomb tripwire | | |
| 305 | +| `num_planes` | sibling-lane | lane-av1-mono | | |
| 306 | +| `color_primaries` | metadata | H.273 display | | |
| 307 | +| `transfer_characteristics` | metadata | H.273 display | | |
| 308 | +| `matrix_coefficients` | consumed | `stream.rs:727` | | |
| 309 | +| `color_range` | metadata | output range; probe emits limited-range 4:2:0 | | |
| 310 | +| `subsampling_x` | consumed | `stream.rs:1248` | | |
| 311 | +| `subsampling_y` | consumed | `stream.rs:1272` | | |
| 312 | +| `chroma_sample_position` | metadata | display | | |
| 313 | +| `separate_uv_delta_q` | parser-internal | decides qm_v coding, syntax/frame.rs:1422 | | |
| 314 | + | |
| 315 | +**FrameHeader** | |
| 316 | + | |
| 317 | +| field | disposition | first prod read | | |
| 318 | +|---|---|---| | |
| 319 | +| `show_existing_frame` | consumed | `stream.rs:603` | | |
| 320 | +| `frame_to_show_map_idx` | consumed | `stream.rs:624` | | |
| 321 | +| `frame_presentation_time` | metadata | decoder-model bookkeeping | | |
| 322 | +| `display_frame_id` | metadata | frame-id bookkeeping | | |
| 323 | +| `frame_type` | consumed | `stream.rs:853` | | |
| 324 | +| `frame_is_intra` | parser-internal | derived from frame_type; decoder reads frame_type/show_frame | | |
| 325 | +| `show_frame` | consumed | `stream.rs:892` | | |
| 326 | +| `showable_frame` | metadata | output eligibility; film grain parse uses it | | |
| 327 | +| `error_resilient_mode` | parser-internal | controls header reads (refresh flags / primary_ref) | | |
| 328 | +| `disable_cdf_update` | consumed | `stream.rs:1687` | | |
| 329 | +| `allow_screen_content_tools` | consumed | `stream.rs:1796` | | |
| 330 | +| `force_integer_mv` | consumed | `stream.rs:1833` | | |
| 331 | +| `current_frame_id` | metadata | frame-id bookkeeping | | |
| 332 | +| `frame_size_override_flag` | parser-internal | frame-size read | | |
| 333 | +| `order_hint` | consumed | `stream.rs:989` | | |
| 334 | +| `primary_ref_frame` | consumed | `stream.rs:1312` | | |
| 335 | +| `buffer_removal_time` | metadata | decoder-model bookkeeping | | |
| 336 | +| `refresh_frame_flags` | consumed | `stream.rs:644` | | |
| 337 | +| `ref_order_hint` | internal-equivalent | decoder keeps its own ref_order_hints from saved ref state (stream.rs:1344) | | |
| 338 | +| `frame_width` | consumed | `stream.rs:1786` | | |
| 339 | +| `frame_height` | consumed | `stream.rs:1787` | | |
| 340 | +| `upscaled_width` | consumed | `stream.rs:1694` | | |
| 341 | +| `render_width` | metadata | deliberate (encode.rs:15917-15921); display crop only | | |
| 342 | +| `render_height` | metadata | deliberate (encode.rs:15917-15921); display crop only | | |
| 343 | +| `use_superres` | consumed | `stream.rs:1694` | | |
| 344 | +| `superres_denom` | consumed | `stream.rs:1695` | | |
| 345 | +| `mi_cols` | consumed | `stream.rs:1325` | | |
| 346 | +| `mi_rows` | consumed | `stream.rs:1324` | | |
| 347 | +| `allow_intrabc` | consumed | `stream.rs:1797` | | |
| 348 | +| `frame_refs_short_signaling` | parser-internal | parser derives ref_frame_idx (consumed) | | |
| 349 | +| `ref_frame_idx` | consumed | `stream.rs:876` | | |
| 350 | +| `delta_frame_id` | metadata | frame-id bookkeeping | | |
| 351 | +| `allow_high_precision_mv` | consumed | `stream.rs:1877` | | |
| 352 | +| `interpolation_filter` | consumed | `stream.rs:1703` | | |
| 353 | +| `is_motion_mode_switchable` | consumed | `stream.rs:1744` | | |
| 354 | +| `use_ref_frame_mvs` | consumed | `stream.rs:1317` | | |
| 355 | +| `order_hints` | internal-equivalent | derived by decoder from ref_order_hints | | |
| 356 | +| `ref_frame_sign_bias` | consumed | `stream.rs:1879` | | |
| 357 | +| `disable_frame_end_update_cdf` | consumed | `stream.rs:1369` | | |
| 358 | +| `tile_info` | consumed | `stream.rs:759` | | |
| 359 | +| `quantization` | consumed | `stream.rs:1370` | | |
| 360 | +| `segmentation` | consumed | `stream.rs:1405` | | |
| 361 | +| `delta` | consumed | `stream.rs:1798` | | |
| 362 | +| `coded_lossless` | parser-internal | computed by parser; h.lossless carries it (consumed) | | |
| 363 | +| `all_lossless` | parser-internal | computed by parser | | |
| 364 | +| `lossless` | consumed | `stream.rs:1671` | | |
| 365 | +| `loop_filter` | consumed | `stream.rs:1791` | | |
| 366 | +| `cdef` | consumed | `stream.rs:1747` | | |
| 367 | +| `loop_restoration` | consumed | `stream.rs:1748` | | |
| 368 | +| `tx_mode` | consumed | `stream.rs:1740` | | |
| 369 | +| `reference_select` | consumed | `stream.rs:1887` | | |
| 370 | +| `skip_mode_present` | consumed | `stream.rs:1746` | | |
| 371 | +| `skip_mode_frame` | consumed | `stream.rs:1892` | | |
| 372 | +| `allow_warped_motion` | consumed | `stream.rs:1743` | | |
| 373 | +| `reduced_tx_set` | consumed | `stream.rs:1742` | | |
| 374 | +| `global_motion` | consumed | `stream.rs:1880` | | |
| 375 | +| `film_grain` | consumed | `stream.rs:666` | | |
| 376 | +| `header_bits` | parser-internal | tile-group byte alignment | | |
| 377 | + | |
| 378 | +**QuantizationParams** | |
| 379 | + | |
| 380 | +| field | disposition | first prod read | | |
| 381 | +|---|---|---| | |
| 382 | +| `base_q_idx` | consumed | `stream.rs:1370` | | |
| 383 | +| `delta_q_y_dc` | consumed | `stream.rs:1780` | | |
| 384 | +| `delta_q_u_dc` | consumed | `stream.rs:1781` | | |
| 385 | +| `delta_q_u_ac` | consumed | `stream.rs:1782` | | |
| 386 | +| `delta_q_v_dc` | consumed | `stream.rs:1783` | | |
| 387 | +| `delta_q_v_ac` | consumed | `stream.rs:1784` | | |
| 388 | +| `using_qmatrix` | refused | read at `stream.rs:1634` and refused by name | | |
| 389 | +| `qm_y` | refused | only present under using_qmatrix=1, now refused by name | | |
| 390 | +| `qm_u` | refused | only present under using_qmatrix=1, now refused by name | | |
| 391 | +| `qm_v` | refused | only present under using_qmatrix=1, now refused by name | | |
| 240 | 392 | |
| 241 | 393 | ### 9.3 transform.rs:1134 panic — ROOT-CAUSED AND FIXED (not a refusal) |
| 242 | 394 | |
| @@ -327,3 +479,65 @@ and is left standing. | ||
| 327 | 479 | 3. Add the 4x8/8x4 intrabc witnesses to the media-gated corpus (a real stream |
| 328 | 480 | that codes one: `warped.obu` reaches `RECT_INTRABC_VARTX_HITS == 1` and now |
| 329 | 481 | decodes past the old divergence). |
| 482 | + | |
| 483 | +## 10. Continuation r2 (2026-09-20): the refuted census + the third silent-garbage member | |
| 484 | + | |
| 485 | +The re-verifier REFUTED §9.2's "exactly two parsed-but-never-read | |
| 486 | +pixel-affecting fields". A third existed, and it was the same silent-garbage | |
| 487 | +class §9.1 had just closed for 4:4:4. This round is that finding. | |
| 488 | + | |
| 489 | +### 10.1 The fix: `using_qmatrix` refused by name | |
| 490 | + | |
| 491 | +`QuantizationParams.using_qmatrix` + `qm_y`/`qm_u`/`qm_v` are parsed | |
| 492 | +(`ec-av1-syntax/src/frame.rs:190-196`, `:1418-1426`) and read by NOTHING on the | |
| 493 | +decode path — dequantisation is `base_q_idx` + the plane DC/AC deltas only. A | |
| 494 | +spec-legal `aomenc --enable-qm=1` stream therefore decoded into silently wrong | |
| 495 | +pixels. | |
| 496 | + | |
| 497 | +`stream.rs`'s `decode_stream` now refuses it at the frame header, beside the | |
| 498 | +non-4:2:0 guard: | |
| 499 | + | |
| 500 | +``` | |
| 501 | +if header.quantization.using_qmatrix { | |
| 502 | + return Err(Error::unsupported( | |
| 503 | + "AV1 decode_stream", | |
| 504 | + "a frame using quantisation matrices (using_qmatrix=1): dequantisation here is \ | |
| 505 | + base_q_idx plus the plane DC/AC deltas only, so qm_y/qm_u/qm_v would be ignored \ | |
| 506 | + and the frame would decode silently wrong pixels", | |
| 507 | + )); | |
| 508 | +} | |
| 509 | +``` | |
| 510 | + | |
| 511 | +### 10.2 Evidence | |
| 512 | + | |
| 513 | +- Measured pair (real aomenc, same source / recipe, only `--enable-qm` flipped; | |
| 514 | + `~/.cache/aom-oracle/build/aomenc`): the qm-OFF stream is byte-exact vs | |
| 515 | + ffmpeg; the qm-ON stream (`using_qmatrix = 1`, `qm_y/u/v = 5`) decoded with NO | |
| 516 | + refusal and its planes byte-differed from ffmpeg. | |
| 517 | + `EC_AV1_PIN=<qm.obu> ... scratch_isolate_pinned_mismatch --ignored` prints the | |
| 518 | + parsed `using_qmatrix = true` on every frame. | |
| 519 | +- Gate `a_frame_using_quantisation_matrices_is_refused_by_name` (stream.rs): | |
| 520 | + encodes `--enable-qm=0` and `--enable-qm=1` with real aomenc via | |
| 521 | + `census_attempt`, asserts the qm-off CONTROL decodes and the qm-on stream | |
| 522 | + refuses by name. | |
| 523 | +- **Fail-pre-fix**, measured: with the guard removed the gate panics | |
| 524 | + `the --enable-qm=1 stream now decodes -- flip this gate to a witness` (and the | |
| 525 | + decode_probe pair above shows those bytes are wrong). | |
| 526 | +- Inventory: new `REFUSALS` entry + `PROVEN` pair; P3 doc fix — | |
| 527 | + `cdf_state.rs`'s `wide()` comment named the deleted `txbset_for_inter`, now | |
| 528 | + `inter_txbset_for`. | |
| 529 | + | |
| 530 | +### 10.3 Gates (this round) | |
| 531 | + | |
| 532 | +- `cargo test -p ec-av1 --lib -- refusal_inventory <the new gate> | |
| 533 | + a_reader_told_not_to_adapt a_non_420`: 16 passed, 0 failed. | |
| 534 | +- fail-pre-fix run (guard removed): 1 failed, 0 passed — the gate is | |
| 535 | + non-vacuous. | |
| 536 | +- `cargo check -p ec-av1 --all-targets`: 0 warnings. | |
| 537 | +- The full 595-test suite re-run belongs to the re-verifier. | |
| 538 | + | |
| 539 | +### 10.4 Next steps | |
| 540 | + | |
| 541 | +Unchanged from §9.7. This round closes the census hole; the warped key-frame | |
| 542 | +tx-depth context (§9.4) and the 1:4-rect-strip intrabc (lane 3) are still open. | |
| 543 | + |