refusal_inventory: say WHICH kind of proof each PROVEN row carries
Browse files at this commit28056ec0ff82da78c65e40117370c8c7817f9905Parent: 9e73b941 changed file +153 -4
crates/ec-av1/src/refusal_inventory.rsmodified+153 -4
| @@ -301,7 +301,47 @@ const REFUSALS: &[&str] = &[ | ||
| 301 | 301 | /// `a_real_aomenc_mixed_lossless_segment_frame_decodes_sample_exact` is the |
| 302 | 302 | /// witness. |
| 303 | 303 | #[cfg(test)] |
| 304 | -const PROVEN: &[(&str, &str)] = &[ | |
| 304 | +/// Which KIND of proof each [`PROVEN`] row carries. | |
| 305 | +/// | |
| 306 | +/// A 2-tuple made every row look equally proven, which is the whole defect: | |
| 307 | +/// a row whose gate drives a hand-built stream into the guard and a row | |
| 308 | +/// whose gate sweeps an alphabet and shows nothing reaches it are held to | |
| 309 | +/// the same standard and read the same way. `label()` is what the tests | |
| 310 | +/// print, so the distinction is visible in the suite's own output. | |
| 311 | +/// | |
| 312 | +/// lane-av1refusalclaim r3 also proposed a third variant, `TablePin` | |
| 313 | +/// ("the arms are pinned exactly but the domain the table is REACHED over | |
| 314 | +/// is unestablished"). It is deliberately NOT carried: the one row it was | |
| 315 | +/// minted for now has a gate that establishes the reach domain | |
| 316 | +/// (`every_chroma_unit_decode_block_rect_can_present_has_a_coefficient_table` | |
| 317 | +/// reads the eight `decode_block_rect` call sites' own literal `bw`/`bh`, | |
| 318 | +/// pins the resulting chroma table exactly, and asserts the `(4,8)`/`(8,4)` | |
| 319 | +/// residual is UNPRODUCIBLE), so `Enumeration` is the honest tag and a | |
| 320 | +/// variant with no row would be dead weight. Re-add it the day a gate really | |
| 321 | +/// pins a table without measuring its caller domain -- and give it a row. | |
| 322 | +#[cfg(test)] | |
| 323 | +enum Proof { | |
| 324 | + /// A written stream REACHES the guard and is refused by this exact | |
| 325 | + /// string: the gate goes RED if the guard is removed. | |
| 326 | + NegativeGate, | |
| 327 | + /// The gate enumerates every input the guard can be reached over and | |
| 328 | + /// shows that none of them reaches it: it proves UNREACHABILITY, so it | |
| 329 | + /// is GREEN if the guard is removed. | |
| 330 | + Enumeration, | |
| 331 | +} | |
| 332 | + | |
| 333 | +#[cfg(test)] | |
| 334 | +impl Proof { | |
| 335 | + fn label(&self) -> &'static str { | |
| 336 | + match self { | |
| 337 | + Proof::NegativeGate => "NEGATIVE (reaches the guard; red on removal)", | |
| 338 | + Proof::Enumeration => "ENUMERATION (proves unreachability; green on removal)", | |
| 339 | + } | |
| 340 | + } | |
| 341 | +} | |
| 342 | + | |
| 343 | +#[cfg(test)] | |
| 344 | +const PROVEN: &[(&str, &str, Proof)] = &[ | |
| 305 | 345 | // lane-t900 r20, census: three real streams present exactly the 18 |
| 306 | 346 | // `(side, write_w, write_h)` triples `INTER_BLOCK_SHAPES` lists, and |
| 307 | 347 | // `rect_inter_residual_supported` covers every rectangular one -- the only |
| @@ -318,6 +358,7 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 318 | 358 | ( |
| 319 | 359 | "a non-skip rectangular (HORZ/VERT/HORZ_B) strip needs rectangular residual coding", |
| 320 | 360 | "a_block_shape_census_over_three_real_streams_leaves_the_rect_residual_refusal_unreachable", |
| 361 | + Proof::Enumeration, | |
| 321 | 362 | ), |
| 322 | 363 | // lane-t900 r20, census: the shapes that can reach `decode_intra_rect_in_inter`'s |
| 323 | 364 | // size-group/tx-category lookup are the ten rectangular census shapes with |
| @@ -326,6 +367,7 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 326 | 367 | ( |
| 327 | 368 | "an intra-coded {bw}x{bh} block on the inter block path (no size-group/tx-category row for that shape here)", |
| 328 | 369 | "every_intra_in_inter_shape_the_census_lists_has_a_size_group_row", |
| 370 | + Proof::Enumeration, | |
| 329 | 371 | ), |
| 330 | 372 | // lane-t900 r20, census: the only sub-8 footprints three real streams |
| 331 | 373 | // present are the 16x4/4x16 strips of a 16x16-level 1:4 partition, whose |
| @@ -334,6 +376,7 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 334 | 376 | ( |
| 335 | 377 | "an intra 16x4/4x16 strip inside an inter 16x16-level 1:4 partition (its 4:2:0 chroma pair is coded once for two strips; only the inter path implements that pairing)", |
| 336 | 378 | "a_sub8_footprint_census_over_real_streams_leaves_the_intra_16x4_pairing_refusal_unreachable", |
| 379 | + Proof::Enumeration, | |
| 337 | 380 | ), |
| 338 | 381 | // lane-t900 r20, census: the rect transform tables and scans, enumerated |
| 339 | 382 | // over the shapes the measured block-shape domain hands each helper (block |
| @@ -347,14 +390,17 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 347 | 390 | ( |
| 348 | 391 | "a rectangular inter luma transform unit whose shape has no coefficient table set here", |
| 349 | 392 | "every_rect_transform_shape_the_census_lists_has_a_coefficient_table_and_scan", |
| 393 | + Proof::Enumeration, | |
| 350 | 394 | ), |
| 351 | 395 | ( |
| 352 | 396 | "a rectangular inter chroma transform unit whose shape has no coefficient table set here", |
| 353 | 397 | "every_rect_transform_shape_the_census_lists_has_a_coefficient_table_and_scan", |
| 398 | + Proof::Enumeration, | |
| 354 | 399 | ), |
| 355 | 400 | ( |
| 356 | 401 | "a rectangular transform unit whose shape has no coefficient scan table here", |
| 357 | 402 | "every_rect_transform_shape_the_census_lists_has_a_coefficient_table_and_scan", |
| 403 | + Proof::Enumeration, | |
| 358 | 404 | ), |
| 359 | 405 | // lane-t900 r21, enumeration: a var-tx leaf is never larger than the unit |
| 360 | 406 | // the tree was entered with, and both callers enter at or below their own |
| @@ -363,10 +409,12 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 363 | 409 | ( |
| 364 | 410 | "an inter var-tx tree with a leaf transform larger than 32x32", |
| 365 | 411 | "a_var_tx_tree_never_presents_a_leaf_larger_than_the_unit_it_entered", |
| 412 | + Proof::Enumeration, | |
| 366 | 413 | ), |
| 367 | 414 | ( |
| 368 | 415 | "an inter var-tx tree with a leaf transform larger than 64x64", |
| 369 | 416 | "a_var_tx_tree_never_presents_a_leaf_larger_than_the_unit_it_entered", |
| 417 | + Proof::Enumeration, | |
| 370 | 418 | ), |
| 371 | 419 | // Pre-existing proofs, registered by lane-t900 r21: a negative gate (a |
| 372 | 420 | // hand-built 12-bit sequence header is refused BY THIS EXACT STRING rather |
| @@ -380,32 +428,38 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 380 | 428 | ( |
| 381 | 429 | "a 32x32 partition type this decoder does not code (value={part32})", |
| 382 | 430 | "every_partition_value_of_an_enumerated_alphabet_has_an_arm", |
| 431 | + Proof::Enumeration, | |
| 383 | 432 | ), |
| 384 | 433 | ( |
| 385 | 434 | "an INTER 32x32 partition type this decoder does not code (value={part32})", |
| 386 | 435 | "every_partition_value_of_an_enumerated_alphabet_has_an_arm", |
| 436 | + Proof::Enumeration, | |
| 387 | 437 | ), |
| 388 | 438 | ( |
| 389 | 439 | "a 128x128 superblock partition value outside the 8-symbol alphabet", |
| 390 | 440 | "every_partition_value_of_an_enumerated_alphabet_has_an_arm", |
| 441 | + Proof::Enumeration, | |
| 391 | 442 | ), |
| 392 | 443 | // lane-t900 r24, enumeration: the key-frame superblock root's own `match` |
| 393 | 444 | // has an arm for all ten `partition_w64` values. |
| 394 | 445 | ( |
| 395 | 446 | "a superblock-level partition value outside PARTITION_NONE..PARTITION_VERT_4", |
| 396 | 447 | "every_partition_value_of_an_enumerated_alphabet_has_an_arm", |
| 448 | + Proof::Enumeration, | |
| 397 | 449 | ), |
| 398 | 450 | // lane-t900 r24, enumeration: the inter 16x16-level if/else chain's |
| 399 | 451 | // branches name all ten `partition_w16` values between them. |
| 400 | 452 | ( |
| 401 | 453 | "an inter 16x16-level partition value outside NONE/HORZ/VERT/SPLIT/AB/1:4", |
| 402 | 454 | "every_partition_value_of_an_if_chain_alphabet_is_named_by_a_branch", |
| 455 | + Proof::Enumeration, | |
| 403 | 456 | ), |
| 404 | 457 | // lane-t900 r24, enumeration: every (CDF width, symbol) pair a tx_type row |
| 405 | 458 | // can present maps to a distinct member of that width's own set. |
| 406 | 459 | ( |
| 407 | 460 | "a tx_type symbol outside its CDF's own set: {t}", |
| 408 | 461 | "every_tx_type_symbol_of_every_cdf_width_maps_into_its_own_set", |
| 462 | + Proof::Enumeration, | |
| 409 | 463 | ), |
| 410 | 464 | // lane-t900 r24 + lane-av1txr RE-PIN, measured: the reader covers spec |
| 411 | 465 | // 5.11.40's whole value domain (`0..=(1 << 20) - 2`, both ends of every |
| @@ -419,6 +473,7 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 419 | 473 | ( |
| 420 | 474 | "a Golomb tail longer than this decoder reads", |
| 421 | 475 | "read_golomb_reads_every_value_a_conformant_stream_can_carry", |
| 476 | + Proof::Enumeration, | |
| 422 | 477 | ), |
| 423 | 478 | // lane-t900 r25, enumeration: `parse_tile_group` is the only producer of |
| 424 | 479 | // the `tiles` vector `decode_stream` tests, and its success path always |
| @@ -427,6 +482,7 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 427 | 482 | ( |
| 428 | 483 | "a frame OBU with no tile group", |
| 429 | 484 | "a_frame_obu_that_parses_always_carries_at_least_one_tile", |
| 485 | + Proof::Enumeration, | |
| 430 | 486 | ), |
| 431 | 487 | // lane-t900 r25, negative gates: hand-built streams that reach each |
| 432 | 488 | // refusal by name and output no picture (a `show_existing_frame` header |
| @@ -434,10 +490,12 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 434 | 490 | ( |
| 435 | 491 | "a show_existing_frame header naming an empty reference slot", |
| 436 | 492 | "a_show_existing_frame_header_naming_an_empty_slot_is_refused_by_name", |
| 493 | + Proof::NegativeGate, | |
| 437 | 494 | ), |
| 438 | 495 | ( |
| 439 | 496 | "an inter frame with no key frame before it", |
| 440 | 497 | "an_inter_frame_opening_a_stream_is_refused_by_name", |
| 498 | + Proof::NegativeGate, | |
| 441 | 499 | ), |
| 442 | 500 | // lane-t900 r25, enumeration: a motion_mode/obmc symbol is read only under |
| 443 | 501 | // `is_motion_variation_allowed_bsize` (min side >= 8), and each of the 17 |
| @@ -446,6 +504,7 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 446 | 504 | ( |
| 447 | 505 | "a motion_mode symbol for a block shape with no CDF row here", |
| 448 | 506 | "every_shape_that_allows_motion_variation_has_a_motion_mode_cdf_row", |
| 507 | + Proof::Enumeration, | |
| 449 | 508 | ), |
| 450 | 509 | // lane-av112bit: real-aomenc 12-bit streams, each refused by name |
| 451 | 510 | // (the gates encode with aomenc --bit-depth=12 and assert the exact |
| @@ -470,6 +529,7 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 470 | 529 | ( |
| 471 | 530 | "a chroma format of 4:2:2 (subsampling_x != subsampling_y): this decoder decodes 4:2:0 and 4:4:4; 4:2:2 is not ported, and 4:4:0 (0,1) is not a codable cell", |
| 472 | 531 | "a_non_420_subsampled_sequence_header_is_refused_by_name", |
| 532 | + Proof::NegativeGate, | |
| 473 | 533 | ), |
| 474 | 534 | // lane-av1txr-r2 paired, lane-av1-qmatrix RETIRED with its gate: the |
| 475 | 535 | // refusal's witness is now |
| @@ -488,6 +548,7 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 488 | 548 | ( |
| 489 | 549 | "an intra mode this decoder does not code (round 2)", |
| 490 | 550 | "every_intra_mode_symbol_of_the_y_mode_alphabet_is_coded", |
| 551 | + Proof::Enumeration, | |
| 491 | 552 | ), |
| 492 | 553 | // lane-t900 r26, enumeration: `compute_image_size` is 0 only for a zero |
| 493 | 554 | // frame width/height, which no path a header can code produces (swept |
| @@ -495,6 +556,7 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 495 | 556 | ( |
| 496 | 557 | "a frame with no mode-info grid", |
| 497 | 558 | "every_frame_size_a_header_can_code_has_a_mode_info_grid", |
| 559 | + Proof::Enumeration, | |
| 498 | 560 | ), |
| 499 | 561 | // lane-t900 r26, negative gates: written streams that reach each refusal |
| 500 | 562 | // by name (a 64x32 inter frame over a 64x64 reference; a stream opening on |
| @@ -511,6 +573,7 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 511 | 573 | ( |
| 512 | 574 | "a reference frame selected with no picture at this frame's own ref_frame_idx slot for it", |
| 513 | 575 | "a_selected_reference_with_an_empty_ref_frame_idx_slot_refuses_by_name", |
| 576 | + Proof::NegativeGate, | |
| 514 | 577 | ), |
| 515 | 578 | // lane-t900 r27, negative gate + census: a written key frame carrying |
| 516 | 579 | // each of the three mode-overriding features (over three segment ids) is |
| @@ -536,6 +599,7 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 536 | 599 | ( |
| 537 | 600 | "a frame whose segmentation enables SEG_LVL_REF_FRAME/SKIP/GLOBALMV (this decoder reads segment_id but never lets a segment override a block's reference, skip or mode)", |
| 538 | 601 | "a_frame_whose_segmentation_overrides_a_block_mode_is_refused_by_name", |
| 602 | + Proof::NegativeGate, | |
| 539 | 603 | ), |
| 540 | 604 | // lane-t900 r27, structural audit + witness: `record_inter_rect_mi` is the |
| 541 | 605 | // single writer of the interp-filter neighbour band, and no call site |
| @@ -549,6 +613,7 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 549 | 613 | ( |
| 550 | 614 | "an OBMC neighbour whose switchable interp filter was never recorded", |
| 551 | 615 | "every_inter_record_publishes_an_obmc_readable_filter", |
| 616 | + Proof::Enumeration, | |
| 552 | 617 | ), |
| 553 | 618 | // lane-t900 r28: all three scaled-reference (superres) refusals -- the |
| 554 | 619 | // 8x8 partition leaf, the sub-8x8 inter block and warp -- are LIFTED and |
| @@ -564,10 +629,12 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 564 | 629 | ( |
| 565 | 630 | "a coded HORZ/VERT strip whose chroma transform has no rect coefficient tables here", |
| 566 | 631 | "every_rect_strip_shape_the_split_path_codes_has_a_luma_and_chroma_table", |
| 632 | + Proof::Enumeration, | |
| 567 | 633 | ), |
| 568 | 634 | ( |
| 569 | 635 | "a split intra strip whose transform unit is {tx_w}x{tx_h} (no luma coefficient tables for that shape here)", |
| 570 | 636 | "every_rect_strip_shape_the_split_path_codes_has_a_luma_and_chroma_table", |
| 637 | + Proof::Enumeration, | |
| 571 | 638 | ), |
| 572 | 639 | // lane-av1-refusalaudit, enumeration + witness2 hunt: decode_block_rect64's |
| 573 | 640 | // chroma-unit table covers every conformant 64-axis strip unit in both |
| @@ -581,6 +648,7 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 581 | 648 | ( |
| 582 | 649 | "a 64-axis strip whose chroma unit has no coefficient table", |
| 583 | 650 | "every_chroma_unit_a_64_axis_strip_can_present_has_a_coefficient_table", |
| 651 | + Proof::Enumeration, | |
| 584 | 652 | ), |
| 585 | 653 | // lane-av1rect8x16, enumeration: `decode_block_rect`'s `_` arm. The nine |
| 586 | 654 | // textual `decode_block_rect(` matches are 1 declaration + 8 call sites |
| @@ -602,6 +670,7 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 602 | 670 | ( |
| 603 | 671 | "a rectangular chroma transform whose size has no coefficient table", |
| 604 | 672 | "every_chroma_unit_decode_block_rect_can_present_has_a_coefficient_table", |
| 673 | + Proof::Enumeration, | |
| 605 | 674 | ), |
| 606 | 675 | // lane-t900 r33, enumeration: each of the four symbols this guard tests is |
| 607 | 676 | // read under a size gate that no 128-pixel side passes (the call site's |
| @@ -610,6 +679,7 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 610 | 679 | ( |
| 611 | 680 | "CfL, filter intra or a palette on a 128-root HORZ/VERT intra block (every one of their size gates caps at 64x64 or below, so none of these symbols exists there)", |
| 612 | 681 | "no_128_root_half_reads_a_cfl_filter_intra_or_palette_symbol", |
| 682 | + Proof::Enumeration, | |
| 613 | 683 | ), |
| 614 | 684 | // lane-av1txr: the sub-8x8 intrabc refusal this census pinned is GONE (the |
| 615 | 685 | // capability landed; see the note in `REFUSALS`). The census gate survives |
| @@ -628,10 +698,12 @@ const PROVEN: &[(&str, &str)] = &[ | ||
| 628 | 698 | ( |
| 629 | 699 | "a reference picture whose height does not match this frame's own true size", |
| 630 | 700 | "an_inter_frame_shorter_than_its_reference_is_refused_by_name", |
| 701 | + Proof::NegativeGate, | |
| 631 | 702 | ), |
| 632 | 703 | ( |
| 633 | 704 | "a frame naming primary_ref_frame at a reference slot with no saved CDF state", |
| 634 | 705 | "an_inter_frame_naming_an_unrefreshed_primary_ref_slot_is_refused_by_name", |
| 706 | + Proof::NegativeGate, | |
| 635 | 707 | ), |
| 636 | 708 | ]; |
| 637 | 709 | |
| @@ -703,7 +775,8 @@ pub(crate) fn pins_refusal(src: &str, refusal: &str) -> bool { | ||
| 703 | 775 | #[cfg(test)] |
| 704 | 776 | mod tests { |
| 705 | 777 | use super::{ |
| 706 | - CAPABILITY_CLAIMS, GATES_THAT_SKIP_ON_A_DECODE_ERROR, PROVEN, REFUSALS, squash_source, | |
| 778 | + CAPABILITY_CLAIMS, GATES_THAT_SKIP_ON_A_DECODE_ERROR, PROVEN, Proof, REFUSALS, | |
| 779 | + squash_source, | |
| 707 | 780 | }; |
| 708 | 781 | use std::collections::BTreeSet; |
| 709 | 782 | |
| @@ -2544,7 +2617,7 @@ mod tests { | ||
| 2544 | 2617 | let mut neither: Vec<&str> = Vec::new(); |
| 2545 | 2618 | let mut unanchored: Vec<String> = Vec::new(); |
| 2546 | 2619 | let mut unbounded: Vec<String> = Vec::new(); |
| 2547 | - for (reason, gate) in PROVEN { | |
| 2620 | + for (reason, gate, _kind) in PROVEN { | |
| 2548 | 2621 | assert!( |
| 2549 | 2622 | found.contains(*reason), |
| 2550 | 2623 | "{reason:?} is listed as proven but is no longer a decode-path refusal -- \ |
| @@ -2646,7 +2719,7 @@ mod tests { | ||
| 2646 | 2719 | #[test] |
| 2647 | 2720 | fn every_named_gate_body_is_bounded_in_these_files() { |
| 2648 | 2721 | let mut resolved = 0usize; |
| 2649 | - for (reason, gate) in PROVEN { | |
| 2722 | + for (reason, gate, _kind) in PROVEN { | |
| 2650 | 2723 | let body = |
| 2651 | 2724 | gate_body(gate).unwrap_or_else(|why| panic!("{reason:?} names {gate}: {why}")); |
| 2652 | 2725 | assert!( |
| @@ -2668,6 +2741,82 @@ mod tests { | ||
| 2668 | 2741 | } |
| 2669 | 2742 | } |
| 2670 | 2743 | |
| 2744 | + /// The taxonomy is a CLAIM about each row, so it carries its own | |
| 2745 | + /// non-vacuity: every variant is used by at least one row (a variant no | |
| 2746 | + /// row can be in is not a category), the two labels do not collapse into | |
| 2747 | + /// one string, and the row lane-av1refusalclaim r3 wanted to RE-TAG is | |
| 2748 | + /// tagged from evidence inside its own gate BODY -- never from the | |
| 2749 | + /// gate's name, which is the only thing the previous 2-tuple carried. | |
| 2750 | + /// | |
| 2751 | + /// r3 minted a `TablePin` variant because "a rectangular chroma transform | |
| 2752 | + /// whose size has no coefficient table" was pinned to a table whose | |
| 2753 | + /// REACHED-OVER domain had never been measured. Main has since replaced | |
| 2754 | + /// that row's gate with one that reads the eight `decode_block_rect` call | |
| 2755 | + /// sites' own literal `bw`/`bh`, pins the resulting chroma table exactly, | |
| 2756 | + /// and asserts the `(4,8)`/`(8,4)` residual is UNPRODUCIBLE. `Enumeration` | |
| 2757 | + /// is therefore the honest tag and `TablePin` is not carried; if a later | |
| 2758 | + /// edit weakens that gate back to a bare table pin, the three evidence | |
| 2759 | + /// pins below go red instead of leaving the row quietly overclaiming. | |
| 2760 | + #[test] | |
| 2761 | + fn every_proven_row_names_which_kind_of_proof_it_carries() { | |
| 2762 | + let mut negative = 0usize; | |
| 2763 | + let mut enumeration = 0usize; | |
| 2764 | + for (reason, gate, kind) in PROVEN { | |
| 2765 | + eprintln!(" {} -- {reason:?} -> {gate}", kind.label()); | |
| 2766 | + match kind { | |
| 2767 | + Proof::NegativeGate => negative += 1, | |
| 2768 | + Proof::Enumeration => enumeration += 1, | |
| 2769 | + } | |
| 2770 | + } | |
| 2771 | + assert_eq!( | |
| 2772 | + negative + enumeration, | |
| 2773 | + PROVEN.len(), | |
| 2774 | + "a PROVEN row carries no proof kind, so the table says nothing about it" | |
| 2775 | + ); | |
| 2776 | + assert!( | |
| 2777 | + negative > 0, | |
| 2778 | + "no row is tagged NEGATIVE, so the NegativeGate variant is dead weight" | |
| 2779 | + ); | |
| 2780 | + assert!( | |
| 2781 | + enumeration > 0, | |
| 2782 | + "no row is tagged ENUMERATION, so the Enumeration variant is dead weight" | |
| 2783 | + ); | |
| 2784 | + assert_ne!( | |
| 2785 | + Proof::NegativeGate.label(), | |
| 2786 | + Proof::Enumeration.label(), | |
| 2787 | + "the two kinds print the same string, so the taxonomy is one category in two hats" | |
| 2788 | + ); | |
| 2789 | + | |
| 2790 | + let (reason, gate, kind) = PROVEN | |
| 2791 | + .iter() | |
| 2792 | + .find(|(reason, _, _)| { | |
| 2793 | + *reason == "a rectangular chroma transform whose size has no coefficient table" | |
| 2794 | + }) | |
| 2795 | + .map(|(reason, gate, kind)| (*reason, *gate, kind)) | |
| 2796 | + .expect("the (4,8) chroma-table row left PROVEN"); | |
| 2797 | + assert!( | |
| 2798 | + matches!(kind, Proof::Enumeration), | |
| 2799 | + "{reason:?} is tagged {:?}, but its gate enumerates the caller domain", | |
| 2800 | + kind.label() | |
| 2801 | + ); | |
| 2802 | + let body = gate_body(gate).unwrap_or_else(|why| panic!("{reason:?} names {gate}: {why}")); | |
| 2803 | + for evidence in [ | |
| 2804 | + "the number of decode_block_rect call sites changed", | |
| 2805 | + "for residual in [(4usize, 8usize), (8, 4)]", | |
| 2806 | + "the caller set can now produce a 4x8/8x4 chroma shape", | |
| 2807 | + ] { | |
| 2808 | + assert!( | |
| 2809 | + body.contains(evidence), | |
| 2810 | + "{gate} no longer carries {evidence:?}, so the Enumeration tag on {reason:?} \ | |
| 2811 | + claims a reach domain the gate has stopped measuring" | |
| 2812 | + ); | |
| 2813 | + } | |
| 2814 | + eprintln!( | |
| 2815 | + "refusal inventory: {negative} NEGATIVE, {enumeration} ENUMERATION of {} PROVEN rows", | |
| 2816 | + PROVEN.len() | |
| 2817 | + ); | |
| 2818 | + } | |
| 2819 | + | |
| 2671 | 2820 | /// Lane-av1refusalspan: the invariant that catches a boundary that |
| 2672 | 2821 | /// over-reaches. Tested on its own text, so it cannot be satisfied by the |
| 2673 | 2822 | /// scanner happening to be right on the current sources. |