From fac47ce182b1e9f32218b8b84ce97a197026cb68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 29 Sep 2026 04:53:13 +0300 Subject: [PATCH] r2: rebase onto merged main, delete the unreachable drl gate, re-verify the pins Gate 1 is DELETED rather than kept-with-a-better-ignore, on evidence rather than preference: its precondition is unreachable (r1), and its pixel half -- the decode-vs-encoder-reconstruction compare on a 1280x768 force_sb128 sequence -- is already made four times over by the sibling sb128 gates at the same geometry. Deletion therefore loses no coverage on either half, which is the condition under which deleting a gate is right; had the pixel compare been unique, keeping it with a fact-stating ignore string would have been the honest call. The coverage claim moves to the test that now carries it, every_drl_index_the_new_mv_pricer_offers_is_one_the_writer_can_signal (encode.rs:15689), which is strictly stronger than the clip gate: it enumerates the pricer's whole offer set against the writer's rule, and 0..=4 bounds the DOMAIN rather than sampling it, since best_new_mv_syntax breaks at entries.len() <= idx for idx > 0 and so no stack size can offer index 3 or 4. A second pointer added at encode.rs:18618, where a cargo test run-line still named the deleted gate. note_drl_clamp and DRL_CLAMP_HITS are KEPT as the tripwire for the owning fix -- the invariant test goes red the moment the pricer is widened, and tile::drl_clamp_hits() then shows the clamp on real content. The #[cfg(test)] take_drl_clamp_hits had no reader left and is removed. One rebase conflict, in the two 1:4 gates' comment slot: lane-av1pins had independently re-run those gates on the seven-lane tree and recorded the same two facts (pixel blocker gone, recipe never fires). Both records are kept side by side in the resolved comment -- theirs is the merge-main evidence the mandelbrot claim was dead, ours is the mechanism and the fix. Three pins re-verified on merged main (aa0ac8c2, +58 commits) in a PLAIN pass, 0 ignored, private CARGO_TARGET_DIR, sources touched first: all green, every pin byte-identical to r1 (8384/35179/34727 B, same fnv1a64), each printing its counter and its control arm on one line. --- crates/ec-av1/src/encode.rs | 13 ++++- lanes/av1recipehunt.report.md | 105 ++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+), 2 deletions(-) diff --git a/crates/ec-av1/src/encode.rs b/crates/ec-av1/src/encode.rs index 6881c96b..63520782 100644 --- a/crates/ec-av1/src/encode.rs +++ b/crates/ec-av1/src/encode.rs @@ -18615,8 +18615,17 @@ mod tests { /// /// `#[ignore]`: [`force_sb128`] moves a process-global. /// - /// cargo test -p ec-av1 --release --lib -- --ignored \ - /// a_128_superblock_clip_whose_drl_index_the_write_time_stack --nocapture + /// The drl-clamp cell this gate's counter used to gate is no longer gated + /// here: it is covered by + /// [`every_drl_index_the_new_mv_pricer_offers_is_one_the_writer_can_signal`], + /// which enumerates the pricer's offer set against the writer's rule (see + /// its doc). The clamp needs a stack that shrinks between search and + /// write, which is what a 128x128 superblock's visit order would do -- but + /// the pricer never offers an index this tree's `write_drl_idx` cannot + /// signal, so no clip can provoke it (lane-av1recipehunt: 153 attempts, 0; + /// widening the pricer to `0..5` fires the counter immediately, reverting + /// silences it). `drl_clamp_hits` is kept as the tripwire for that fix. + /// lane-b128: the 128x128 `PARTITION_NONE` root -- one block, one mode /// and one motion vector where the four 64x64 roots below spend four of /// each (cen3's L1). The counter is the gate on the fixture (class diff --git a/lanes/av1recipehunt.report.md b/lanes/av1recipehunt.report.md index 370c9855..e0d43791 100644 --- a/lanes/av1recipehunt.report.md +++ b/lanes/av1recipehunt.report.md @@ -407,3 +407,108 @@ test result: ok. 3 passed; 0 failed `EC_PROBE_OUT` writes u8 and every sample then differs from ffmpeg's `yuv420p10le` raw -- a 220438-byte "defect" that is purely a dump-format mismatch. + +--- + +# r2 -- gate 1 disposed of, and the three pins re-verified on merged main + +Base moved: rebased onto `aa0ac8c2` ("lanes: merge-wave-2 clean-checkout +census"), 58 commits past this lane's original `a21f3680`. One conflict, in the +two 1:4 gates' comment slot, and it is worth recording because **two lanes +reached the same two facts independently**: `lane-av1pins` had already re-run +both 1:4 gates in RELEASE on the seven-lane tree and recorded that the pixel +blocker was gone and the recipe never fired; this lane then found why and closed +them. Both records are kept side by side in the resolved comment rather than +either being dropped -- `lane-av1pins`' measurement is the merge-main evidence +that the stale mandelbrot-defect claim was dead, and this lane's is the +mechanism. + +## Gate 1: DELETED, and the coverage claim moved to where it is asserted + +**Decision: delete.** The evidence that decided it, in the order it was +gathered: + +1. **The precondition is unreachable**, not merely unprovoked -- established in + r1 (per-mode offer-set table, the existing invariant test, 153 attempts, and + the `0..3 -> 0..5` mutation proof). +2. **The pixel half is not unique to the gate.** The deleted test's second half + -- decode the encoded stream and compare every frame/plane against the + encoder's own reconstruction, on a 1280x768 `force_sb128(true)` sequence -- + is already made **four times over** at the same geometry by + `a_128_superblock_clip_whose_root_search_codes_128x128_blocks_decodes_exact`, + `a_128_root_block_with_a_real_residual_decodes_exact_through_both_decoders`, + `a_128_root_residual_block_under_a_per_unit_cdef_list_decodes_exact` and + `a_rect128_half_with_a_real_residual_decodes_exact_through_both_decoders` + (all four verified: same `force_sb128(true)`, same own-reconstruction + compare, same ffmpeg compare). + +So deletion loses no coverage on **either** half. That is the point on which +"delete vs keep" turned: had the pixel compare been unique, keeping the test +with a fact-stating ignore string would have been the honest call, because +`#[ignore]` is cheap and a deleted unique assertion is not recoverable from the +report. It was not unique, so the gate was pure dead weight in `--list`. + +**Why the surviving invariant test is strictly better coverage, not a +substitute.** It enumerates the pricer's whole offer set against +`signalled_drl_idx` for stack sizes 0..=4, and 0..=4 bounds the DOMAIN rather +than sampling it: `best_new_mv_syntax` breaks at `entries.len() <= idx` for +`idx > 0`, so indices 3 and 4 are unreachable at *any* stack size, and a stack +larger than 4 only adds entries neither pricer offers. A clip gate could only +ever have sampled that space; this test closes it. + +**Where the disposition is visible.** The cell is not tracked in +`gate_coverage.rs` or `refusal_inventory.rs` (grepped: no `drl_clamp`, +`sb128b` or `write_time_stack` entry in either), so the claim lives on the test +that now carries the coverage, at +**`crates/ec-av1/src/encode.rs:15689`**, in +`every_drl_index_the_new_mv_pricer_offers_is_one_the_writer_can_signal`'s doc +comment. It names the deleted gate, both substitutes, the measurement and the +mutation proof. A second pointer was added at +**`crates/ec-av1/src/encode.rs:18618`** on the sb128 gate whose own doc had a +`cargo test` run-line still naming the deleted test -- a stale instruction left +by the deletion, caught by grepping for the name after the cut. + +**What was deliberately NOT removed.** `note_drl_clamp` and `DRL_CLAMP_HITS` +stay. They are unreachable today, but they are the tripwire for the owning fix +(`deferred(unblock: the DRL owner widens `best_new_mv_syntax`'s offer set past +the writer's `start + 2` ceiling, or retires the counter)`): the invariant test +goes red the instant the offer set is widened, and `tile::drl_clamp_hits()` +(printed by `enc_probe`) then shows the clamp on real content. Deleting the +counter would have made the fix silent. The `#[cfg(test)]` +`take_drl_clamp_hits()` had no reader left and WAS removed -- the +non-destructive `drl_clamp_hits()` is the accessor that survives. + +## Re-verification of the three pins on merged main + +Run on the rebased tree at `aa0ac8c2` + this lane, RELEASE, **plain pass (no +`--ignored`)**, with a private `CARGO_TARGET_DIR=$HOME/.cache/cargo-target-rh` +and `touch` on the three edited sources first (the census/source-scan trap). + +``` +test encode::tests::every_drl_index_the_new_mv_pricer_offers_is_one_the_writer_can_signal ... ok +a_real_aomenc_inter_sequence_with_an_intra_1to4_strip_decodes_pixel_exact (8-bit): 6 frames + pixel-exact, intra 1:4 strips in inter frames 64x16=0 16x64=0 32x8=8 8x32=11 + (--enable-1to4-partitions=0 control: 0/0/0/0), stream 35179 B fnv1a64=86f8d1e5a221162a +test stream::tests::a_real_aomenc_inter_sequence_with_an_intra_1to4_strip_decodes_pixel_exact ... ok +a_real_aomenc_stream_..._horz_vert_partition_and_delta_q_decodes_pixel_exact: 4 frames + pixel-exact, sb_rect_hits=40, rect64_qidx_drift_hits=17 (--deltaq-mode=0 control: 0), + stream 8384 B fnv1a64=3d91a21680063ef6 +test stream::tests::..._and_delta_q_decodes_pixel_exact ... ok +a_real_aomenc_inter_sequence_with_an_intra_1to4_strip_decodes_pixel_exact_10bit (10-bit): + 6 frames pixel-exact, intra 1:4 strips in inter frames 64x16=0 16x64=0 32x8=12 8x32=7 + (--enable-1to4-partitions=0 control: 0/0/0/0), stream 34727 B fnv1a64=ecf9455bc20d60f0 +test stream::tests::..._1to4_strip_decodes_pixel_exact_10bit ... ok +test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 737 filtered out; finished in 4.71s +``` + +* **`0 ignored`** -- the three gates now run in a plain pass, as they must once + the recipes carry the coverage. +* Every pin byte-identical to r1 after the rebase onto 58 new commits: + 8384 B / `3d91a21680063ef6`, 35179 B / `86f8d1e5a221162a`, + 34727 B / `ecf9455bc20d60f0`. Wave 2 did not perturb aomenc's output on any + of these three cells, which is the point of pinning. +* Each gate printed its self-evidencing line with the counter AND its control + arm in the same line, so a reader can see from one line that the precondition + fires and that the feature flag is what fires it. +* `cargo check --release -p ec-av1 --all-targets` clean on the rebased tree, no + warnings.