av1txctxband2: correct the band-overwrite counter's doc to what the predicate actually measures
Browse files at this commit0b7aabe049dcf54366a424973dc11fde5ca7e1b5Parent: ec0357f1 changed file +34 -15
- crates/ec-av1/src/decode.rs +34 -15
crates/ec-av1/src/decode.rsmodified+34 -15
| @@ -29941,14 +29941,23 @@ fn read_block_tx_size( | |||
| 29941 | 4 | 29941 | 4 |
| 29942 | }; | 29942 | }; |
| 29943 | // The gate's non-vacuity arm, on the DECISION, sampled BEFORE the | 29943 | // The gate's non-vacuity arm, on the DECISION, sampled BEFORE the |
| 29944 | - // write: this publish OVERWRITES a size some earlier block of the same | 29944 | + // write: this publish CHANGES at least one of the above-band cells it |
| 29945 | - // frame had left in one of the columns it covers -- the only way a | 29945 | + // covers -- the cell did not already hold `pub_above`, so a later |
| 29946 | - // later `get_tx_size_context` / `txfm_partition_context` reader can | 29946 | + // `get_tx_size_context` / `txfm_partition_context` reader in the same |
| 29947 | - // see it. On a frame whose blocks all sit in lossless segments nothing | 29947 | + // tile column reads a value the publish produced. |
| 29948 | - // reads either band (libaom's `read_tx_size` returns before | 29948 | + // |
| 29949 | - // `get_tx_size_context`, and the var-tx tree is gated on | 29949 | + // CORRECTED 2026-09-30 (refutation pass `lanes/refute-av1txctxband2`): |
| 29950 | - // `!xd->lossless`), so a wholly-lossless stream whose inter blocks are | 29950 | + // an earlier version of this comment, and of the static's doc, claimed |
| 29951 | - // all non-skip leaves this at zero. | 29951 | + // the write counts only when it OVERWRITES "a size some earlier block |
| 29952 | + // had left", and that a wholly-lossless all-non-skip stream leaves it | ||
| 29953 | + // at zero. MEASURED FALSE: 420_lossless_tallinter_8x16.obu fires 48, | ||
| 29954 | + // ALL with every covered column still at `TXFM_CTX_INIT` -- a first | ||
| 29955 | + // write into a fresh tile column counts here too, because the test is | ||
| 29956 | + // "the cell did not already hold this value", not "some block wrote a | ||
| 29957 | + // different value earlier". Of the pin's 944 fires, 183 are that | ||
| 29958 | + // first-touch case. The count is still a decision (no reader, no | ||
| 29959 | + // intra-only frame, no unchanged column), so the gate keeps its teeth; | ||
| 29960 | + // only the doc's stronger reading was wrong. | ||
| 29952 | let overwrote = !fctx.intra_only.with(std::cell::Cell::get) | 29961 | let overwrote = !fctx.intra_only.with(std::cell::Cell::get) |
| 29953 | && (0..side_mi).any(|i| n.above_txfm.get(at_mi.1 + i) != Some(&pub_above)); | 29962 | && (0..side_mi).any(|i| n.above_txfm.get(at_mi.1 + i) != Some(&pub_above)); |
| 29954 | set_txfm_ctxs(n, at_mi, 4, side_mi, side_mi, skip && is_inter); | 29963 | set_txfm_ctxs(n, at_mi, 4, side_mi, side_mi, skip && is_inter); |
| @@ -34821,14 +34830,24 @@ thread_local! { | |||
| 34821 | /// doing. | 34830 | /// doing. |
| 34822 | pub(crate) static SUB8_LOSSLESS_NO_VARTX: std::cell::Cell<usize> = const { std::cell::Cell::new(0) }; | 34831 | pub(crate) static SUB8_LOSSLESS_NO_VARTX: std::cell::Cell<usize> = const { std::cell::Cell::new(0) }; |
| 34823 | /// lane-av1txctxband2: SQUARE lossless blocks on an INTER frame whose | 34832 | /// lane-av1txctxband2: SQUARE lossless blocks on an INTER frame whose |
| 34824 | - /// `set_txfm_ctxs` publish CHANGED an above-band cell -- i.e. the write | 34833 | + /// `set_txfm_ctxs` publish CHANGED at least one above-band cell it covers |
| 34825 | - /// overwrote a size some earlier block of the same frame had left, which | 34834 | + /// (the cell did not already hold the published size), so a later |
| 34826 | - /// is the only way a later `get_tx_size_context` / | 34835 | + /// `get_tx_size_context` / `txfm_partition_context` reader in the same |
| 34827 | - /// `txfm_partition_context` reader can see it. Zero on an intra-only | 34836 | + /// tile column reads a value this publish produced. Zero on an intra-only |
| 34828 | /// frame (where `fill_lf_grid_rect_inner` publishes the same 4x4 value at | 34837 | /// frame (where `fill_lf_grid_rect_inner` publishes the same 4x4 value at |
| 34829 | - /// the same footprint) and on a wholly-lossless stream whose inter blocks | 34838 | + /// the same footprint). |
| 34830 | - /// are all non-skip (nothing reads either band there), so a gate cannot | 34839 | + /// |
| 34831 | - /// look armed by merely decoding a lossless fixture. | 34840 | + /// CORRECTED 2026-09-30 (refutation pass `lanes/refute-av1txctxband2`): |
| 34841 | + /// this doc previously claimed the hit meant "overwrote a size some | ||
| 34842 | + /// earlier block left" and that a wholly-lossless all-non-skip stream | ||
| 34843 | + /// leaves it at zero. MEASURED FALSE -- `420_lossless_tallinter_8x16.obu` | ||
| 34844 | + /// fires **48**, all of them first touches of a column still at | ||
| 34845 | + /// `TXFM_CTX_INIT`; `420_lossless_arf_1to4_320x240_5f.obu` fires 320, 53 of | ||
| 34846 | + /// them first touches. Of the pin's 944, **183 are first-touch**. The | ||
| 34847 | + /// predicate tests "the cell did not already hold this value", which is | ||
| 34848 | + /// the decision that matters (no reader, no intra-only frame, no unchanged | ||
| 34849 | + /// column still reads 0), but it is NOT the strictly narrower causal claim | ||
| 34850 | + /// the old text made. | ||
| 34832 | pub(crate) static LOSSLESS_SQ_TXFM_BAND_OVERWRITE_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) }; | 34851 | pub(crate) static LOSSLESS_SQ_TXFM_BAND_OVERWRITE_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) }; |
| 34833 | } | 34852 | } |
| 34834 | 34853 | ||