R7 -- fix leftover test call sites for the r6 ref_ctx fix, but re-mask compound_idx blend
Browse files at this commit3f636a9655f08221a9fdc57641c9fcec88681b4dParent: d706250- fix
- r7 -- fix leftover test call sites for the r6 ref_ctx fix, but re-mask compound_idx blend
2 changed files +36 -9
crates/ec-av1/src/decode.rsmodified+27 -5
| @@ -4652,8 +4652,27 @@ fn decode_inter_block( | |||
| 4652 | // still correct; the four candidates above were not re-audited | 4652 | // still correct; the four candidates above were not re-audited |
| 4653 | // this round. Refusing here (rather than shipping a value-exact- | 4653 | // this round. Refusing here (rather than shipping a value-exact- |
| 4654 | // most-of-the-time blend) until one of them is found wrong. | 4654 | // most-of-the-time blend) until one of them is found wrong. |
| 4655 | - // r6 TEMP PROBE: refusal disabled to trace the compound_idx read | 4655 | + // r6/r7: found and fixed one real bug (mvstack.rs ref_ctx family |
| 4656 | - // itself; restore before commit. | 4656 | + // undercounted compound neighbours in the single_ref_p*/comp_ref*/ |
| 4657 | + // comp_bwdref* context reads -- kept, real fix). Unmasking on | ||
| 4658 | + // that fix alone and running the wide gate sweep (many seeds, | ||
| 4659 | + // `a_real_aomenc_stream_with_compound_references_decodes_pixel_exact`/ | ||
| 4660 | + // `a_real_aomenc_stream_with_reference_select_reads_comp_mode_correctly`, | ||
| 4661 | + // cq-level=45) still mismatches roughly half the time, at | ||
| 4662 | + // different frames each run for the SAME seed -- aomenc's own | ||
| 4663 | + // cpu-used=0 RD search is run-to-run nondeterministic (noted | ||
| 4664 | + // above), so this is a second, still-unfound compound_idx defect, | ||
| 4665 | + // not the one r6/r7 fixed. r6's own residual-mismatch note (321/ | ||
| 4666 | + // 846 pixels not fitting the (9,7)-vs-plain-average hypothesis | ||
| 4667 | + // either) already flagged more than one bug here. Re-masking: | ||
| 4668 | + // do not ship a blend that is right only sometimes. | ||
| 4669 | + return Err(unsupported( | ||
| 4670 | + "a COMPOUND_REFERENCE 16x16 leaf using the plain/distance-weighted \ | ||
| 4671 | + average blend (comp_group_idx == 0) -- proven non-pixel-exact against \ | ||
| 4672 | + real aomenc streams beyond the one bug lane-av1blend r6/r7 fixed \ | ||
| 4673 | + (lane-av1blend r7, wide gate sweep)", | ||
| 4674 | + )); | ||
| 4675 | + #[allow(unreachable_code)] | ||
| 4657 | let (fwd_offset, bck_offset, compound_idx) = if !skip_mode && enable_jnt_comp { | 4676 | let (fwd_offset, bck_offset, compound_idx) = if !skip_mode && enable_jnt_comp { |
| 4658 | let idx_ctx = get_comp_index_context( | 4677 | let idx_ctx = get_comp_index_context( |
| 4659 | neighbours, | 4678 | neighbours, |
| @@ -5557,12 +5576,15 @@ fn decode_inter_block8( | |||
| 5557 | // that comment. | 5576 | // that comment. |
| 5558 | // r3: same defect as the 16x16 leaf's own mask above -- see | 5577 | // r3: same defect as the 16x16 leaf's own mask above -- see |
| 5559 | // that comment (compound_idx's decoded value, not the blend | 5578 | // that comment (compound_idx's decoded value, not the blend |
| 5560 | - // math or reference-slot bookkeeping). | 5579 | + // math or reference-slot bookkeeping). r6/r7: same re-mask |
| 5580 | + // as the 16x16 leaf above -- one real bug found and fixed | ||
| 5581 | + // (mvstack.rs ref_ctx family), a second, still-unfound | ||
| 5582 | + // compound_idx defect surfaces on the wide gate sweep. | ||
| 5561 | return Err(unsupported( | 5583 | return Err(unsupported( |
| 5562 | "a COMPOUND_REFERENCE 8x8 leaf using the plain/distance-weighted \ | 5584 | "a COMPOUND_REFERENCE 8x8 leaf using the plain/distance-weighted \ |
| 5563 | average blend (comp_group_idx == 0) -- proven non-pixel-exact \ | 5585 | average blend (comp_group_idx == 0) -- proven non-pixel-exact \ |
| 5564 | - against a real aomenc stream (lane-av1blend r1/r3, see \ | 5586 | + against real aomenc streams beyond the one bug lane-av1blend \ |
| 5565 | - av1blend-r1-mismatch.obu)", | 5587 | + r6/r7 fixed (lane-av1blend r7, wide gate sweep)", |
| 5566 | )); | 5588 | )); |
| 5567 | #[allow(unreachable_code)] | 5589 | #[allow(unreachable_code)] |
| 5568 | let (fwd_offset, bck_offset, compound_idx) = if !skip_mode && enable_jnt_comp { | 5590 | let (fwd_offset, bck_offset, compound_idx) = if !skip_mode && enable_jnt_comp { |
crates/ec-av1/src/stream.rsmodified+9 -4
| @@ -744,9 +744,9 @@ mod tests { | |||
| 744 | // constructing the (module-private) `Neighbours` itself. | 744 | // constructing the (module-private) `Neighbours` itself. |
| 745 | const PARTITION_NONE: usize = 0; | 745 | const PARTITION_NONE: usize = 0; |
| 746 | let ii_ctx = intra_inter_ctx(false, false, false, false); | 746 | let ii_ctx = intra_inter_ctx(false, false, false, false); |
| 747 | - let sr_p1_ctx = single_ref_p1_ctx(None, None); | 747 | + let sr_p1_ctx = single_ref_p1_ctx(None, None, None, None); |
| 748 | - let sr_p3_ctx = single_ref_p3_ctx(None, None); | 748 | + let sr_p3_ctx = single_ref_p3_ctx(None, None, None, None); |
| 749 | - let sr_p5_ctx = single_ref_p5_ctx(None, None); | 749 | + let sr_p5_ctx = single_ref_p5_ctx(None, None, None, None); |
| 750 | 750 | ||
| 751 | for run in 0..4 { | 751 | for run in 0..4 { |
| 752 | let picture = test_card(width, height); | 752 | let picture = test_card(width, height); |
| @@ -2633,7 +2633,12 @@ mod tests { | |||
| 2633 | // capability gap tracked on its own (not a | 2633 | // capability gap tracked on its own (not a |
| 2634 | // COMPOUND_REFERENCE defect); accept it here too | 2634 | // COMPOUND_REFERENCE defect); accept it here too |
| 2635 | // rather than fail a compound-specific gate on a | 2635 | // rather than fail a compound-specific gate on a |
| 2636 | - // partition-search coincidence. | 2636 | + // partition-search coincidence. lane-av1blend r7: |
| 2637 | + // re-swept the wide gate with the plain-average | ||
| 2638 | + // blend unmasked (r6/r7's ref_ctx fix alone) and it | ||
| 2639 | + // still mismatches on real streams beyond that one | ||
| 2640 | + // bug -- re-masked comp_group_idx == 0 too, so this | ||
| 2641 | + // stays a legal named refusal. | ||
| 2637 | assert!( | 2642 | assert!( |
| 2638 | msg.contains("COMPOUND_REFERENCE") || msg.contains("a partition"), | 2643 | msg.contains("COMPOUND_REFERENCE") || msg.contains("a partition"), |
| 2639 | "{NAME}: comp_mode fired (seed {seed}) but the refusal \ | 2644 | "{NAME}: comp_mode fired (seed {seed}) but the refusal \ |