forge
Explore
Log in

Don't you dare go Hollow

lane-av1txctxband2 r2: the mixed-lossless RESIDUE arms are the SAME missing publish, not three more defects

Browse files at this commit

a87fc0c4bae821d189fad1ff0c9d86297b2326aeAhmet Kaan GümüşParent: e226c3b
lane-av1mixllconj §7 named three residuals on this recipe and declined to claim
them ("separate defects this change shrinks but does not remove"). Measured, they
are this lane's defect at smaller frame sizes: a lossy block reading a band a
lossless block above it should have published into and did not.

Measured on f2dd27b0~1 (= 0bfee517) against aomdec EC_AV1_FINAL_DUMP, decode
order, per differing frame:

  420_mixll_256x128_6f.obu  7 dumps  red f1..f6: 6051/4115/2962/26566/41876/14749
  420_mixll_320x240_5f.obu  6 dumps  red f1..f5: 15031/16259/21932/65405/90077
  420_mixll_320x240_6f.obu  7 dumps  red f6 only: 19398

With the one publish: 7/7, 6/6 and 7/7 byte-exact, 0 differing bytes on every
plane of every decode-order frame. Recipes reproduce mixllconj §1's byte counts
and sha prefixes (37fbe7cb, 40d613fd); m5_320x240's f2/f3 read 16259/21932 here
against the 16006/21930 that report records, because its table predates
lane-av1offtile's chroma-plane clip — f1/f4/f5 and both other cells match exactly.

- three fixtures, pinned by fnv1a64, and a second gate
  a_420_mixed_lossless_residue_arms_are_byte_exact_in_decode_order asserting all
  three (decode-order dumps, hidden frames, and the route-counter delta > 0)
- mutation proof widened: removing the one set_txfm_ctxs call turns the residue
  gate red on a PIXEL diff (6051 bytes on 420_mixll_256x128_6f frame 1 — the same
  number the pre-fix tree produced) while the 640x480 gate turns red on the
  REFUSAL, so neither gate is carried by the other
- lane-av1mixllconj's own 256x128 pin gate stays green under that mutation, which
  is the control that the fix is not what already made the pin exact

Reported independently by lane-av1mixllres, whose one-line fix is this lane's
already-landed line; measured here on this tip rather than taken on report.
crates/ec-av1/fixtures/420_mixll_256x128_6f.obuadded+0 -0

Binary file changed

crates/ec-av1/fixtures/420_mixll_320x240_5f.obuadded+0 -0

Binary file changed

crates/ec-av1/fixtures/420_mixll_320x240_6f.obuadded+0 -0

Binary file changed

crates/ec-av1/src/stream.rsmodified+77 -0
@@ -9472,6 +9472,83 @@ pub(crate) mod tests {
9472 block(s) overwrote a stale above-band size"9472 block(s) overwrote a stale above-band size"
9473 );9473 );
9474 }9474 }
9475+
9476+ /// lane-av1txctxband2 r2: the SAME one-line publish, three MORE cells —
9477+ /// the mixed-lossless RESIDUE `lanes/av1mixllconj.report.md` §7 left
9478+ /// explicitly unnamed ("separate defects this change shrinks but does not
9479+ /// remove"). **They are the same defect.** All three are this recipe's
9480+ /// mixed-lossless+altref stream at 256x128 (6 frames) and 320x240 (5 and 6
9481+ /// frames); each has a lossy block whose `get_tx_size_context` /
9482+ /// `txfm_partition_context` read a band a lossless block above should have
9483+ /// published into and did not.
9484+ ///
9485+ /// Measured on `f2dd27b0~1` (= `0bfee517`, the tip before this lane's
9486+ /// publish) against `aomdec`'s `EC_AV1_FINAL_DUMP`, decode order, per
9487+ /// differing frame:
9488+ ///
9489+ /// ```text
9490+ /// 420_mixll_256x128_6f.obu 7 dumps red f1..f6: 6051 / 4115 / 2962 / 26566 / 41876 / 14749
9491+ /// 420_mixll_320x240_5f.obu 6 dumps red f1..f5: 15031 / 16259 / 21932 / 65405 / 90077
9492+ /// 420_mixll_320x240_6f.obu 7 dumps red f6 only: 19398
9493+ /// ```
9494+ ///
9495+ /// With the publish: **7/7, 6/6 and 7/7 byte-exact**, 0 differing bytes on
9496+ /// every plane of every decode-order frame. `m5_320x240`'s f2/f3 here
9497+ /// (16259 / 21932) differ from the 16006 / 21930 `lane-av1mixllconj` §7
9498+ /// records, because that table was taken before `lane-av1offtile`'s
9499+ /// chroma-plane clip merged; f1/f4/f5 and both other cells match it exactly.
9500+ ///
9501+ /// Recipe (ffmpeg 8.1.3 `testsrc2`, shared oracle `aomenc`; `--limit` is the
9502+ /// only variable per cell):
9503+ /// ```text
9504+ /// ffmpeg -f lavfi -i testsrc2=size=<W>x<H>:rate=25 -frames:v <N> -pix_fmt yuv420p src.y4m
9505+ /// aomenc --codec=av1 --obu -o <cell>.obu --passes=1 --cpu-used=4 --limit=<N> \
9506+ /// --end-usage=q --cq-level=0 --aq-mode=1 src.y4m
9507+ /// ```
9508+ /// sha256 `8a203e52…` (22336 B), `40d613fd…` (28716 B), `37fbe7cb…`
9509+ /// (38686 B); pinned below by fnv1a64, not a `const SHA256` compared
9510+ /// against itself.
9511+ #[test]
9512+ fn a_420_mixed_lossless_residue_arms_are_byte_exact_in_decode_order() {
9513+ const NAME: &str = "a_420_mixed_lossless_residue_arms_are_byte_exact_in_decode_order";
9514+ let _gate_lock = lock_gate_counters();
9515+ // (file, bytes, fnv1a64, decode-order frames, hidden)
9516+ const CELLS: [(&str, usize, u64, usize, usize); 3] = [
9517+ ("420_mixll_256x128_6f.obu", 22336, 5694016005779287373, 7, 1),
9518+ ("420_mixll_320x240_5f.obu", 28716, 5855109243102450179, 6, 1),
9519+ ("420_mixll_320x240_6f.obu", 38686, 49021385186397678, 7, 1),
9520+ ];
9521+ for (file, bytes, fnv, frames, hidden) in CELLS {
9522+ let path = crate_pin(file);
9523+ let data = std::fs::read(&path)
9524+ .unwrap_or_else(|e| panic!("{NAME}: the committed pin {file} is missing ({e})"));
9525+ assert_eq!(data.len(), bytes, "{NAME}: {file} size drifted");
9526+ assert_eq!(fnv1a64(&data), fnv, "{NAME}: {file} bytes drifted");
9527+ let before = crate::decode::lossless_sq_txfm_band_overwrite_hits();
9528+ let (decoded, got_hidden) = decode_all_frames_vs_oracle(&data, file);
9529+ let overwrote = crate::decode::lossless_sq_txfm_band_overwrite_hits() - before;
9530+ assert_eq!(
9531+ decoded, frames,
9532+ "{NAME}/{file}: the oracle decoded {decoded} frames in DECODE order"
9533+ );
9534+ assert_eq!(
9535+ got_hidden, hidden,
9536+ "{NAME}/{file}: {decoded} decode-order dumps against {decoded} - {got_hidden} \
9537+ shown outputs means the gate saw {hidden} hidden alt-ref picture/ies"
9538+ );
9539+ assert!(
9540+ overwrote > 0,
9541+ "{NAME}/{file}: no lossless square block on an inter frame published a txfm \
9542+ band that OVERWROTE an earlier block's size ({overwrote} of them did), so this \
9543+ cell does not exercise the missing publish at all (class \
9544+ gate-blind-to-feature) -- re-encode per the recipe above"
9545+ );
9546+ eprintln!(
9547+ "{NAME}/{file}: {decoded} decode-order frame(s) byte-exact ({got_hidden} hidden), \
9548+ {overwrote} lossless square inter block(s) overwrote a stale above-band size"
9549+ );
9550+ }
9551+ }
9475 /// lane-av1444rect r2 — the SAME class as the gate above, second9552 /// lane-av1444rect r2 — the SAME class as the gate above, second
9476 /// instance: `decode_rect4_16_intrabc` applied the 4:2:0 pair geometry at9553 /// instance: `decode_rect4_16_intrabc` applied the 4:2:0 pair geometry at
9477 /// ss (0,0), where `is_chroma_reference` makes an intra-BC 1:4 strip its9554 /// ss (0,0), where `is_chroma_reference` makes an intra-BC 1:4 strip its
lanes/av1txctxband2.report.mdmodified+60 -10
@@ -19,6 +19,7 @@ mi=(80,110) …)`, plus the same claim independently re-measured by
19 | The reader that broke | the 8x4 intra leaf with `use_filter_intra` at **mi=(80,110)**, `tx_size_cat0[2]` where libaom reads row 1. |19 | The reader that broke | the 8x4 intra leaf with `use_filter_intra` at **mi=(80,110)**, `tx_size_cat0[2]` where libaom reads row 1. |
20 | `420_mixll_altref_640x480_5f.obu` (87537 B) | **REFUSED** at base → **6/6 decode-order frames byte-exact**; whole-stream paired `EC_SYMR` ladder **457 907 / 457 907 bit-identical, zero divergence** |20 | `420_mixll_altref_640x480_5f.obu` (87537 B) | **REFUSED** at base → **6/6 decode-order frames byte-exact**; whole-stream paired `EC_SYMR` ladder **457 907 / 457 907 bit-identical, zero divergence** |
21 | `420_mixll_altref_640x480_6f.obu` (115615 B) | **REFUSED** at base → **7/7 decode-order frames byte-exact** |21 | `420_mixll_altref_640x480_6f.obu` (115615 B) | **REFUSED** at base → **7/7 decode-order frames byte-exact** |
22+| the three `m_256x128` / `m_320x240` **residue** arms `lane-av1mixllconj` §7 handed over as unnamed | **THE SAME DEFECT — red at base (96319 / 208704 / 19398 differing bytes) → 7/7, 6/6, 7/7 byte-exact**, now fixtures + a second gate (§6.2) |
22 | Corpus sweep, 110 committed fixtures | **EXACT 100 → 100, REFUSED 10 → 10, RED 0 → 0, FRAMECOUNT 0 → 0** — all ten refusals are the pre-existing by-name 4:2:2 chroma refusal. **Zero rows change**: the fix is a strict no-op on everything already correct, and it is the two NEW 640x480 fixtures that go REFUSED → 6/6 and 7/7 EXACT. |23 | Corpus sweep, 110 committed fixtures | **EXACT 100 → 100, REFUSED 10 → 10, RED 0 → 0, FRAMECOUNT 0 → 0** — all ten refusals are the pre-existing by-name 4:2:2 chroma refusal. **Zero rows change**: the fix is a strict no-op on everything already correct, and it is the two NEW 640x480 fixtures that go REFUSED → 6/6 and 7/7 EXACT. |
23 | Recipe's closed cells | re-measured with the fix: 256x128 pin **6/6 EXACT**, 176x144 **6/6 EXACT**, 352x288 **6/6 EXACT**, the 4:4:4 arm green in the corpus (§6.1) |24 | Recipe's closed cells | re-measured with the fix: 256x128 pin **6/6 EXACT**, 176x144 **6/6 EXACT**, 352x288 **6/6 EXACT**, the 4:4:4 arm green in the corpus (§6.1) |
24 | Class sweep | 5 sites of `context-band-not-published`; **1 was this defect (fixed), 1 is a real libaom-fidelity gap that IS reached but has NO observable effect on any fixture measured (`read_block_tx_size_rect`'s lossless arm, missing the `skip && is_inter` term — 29/1/9/6/16 measured hits), 2 are unobservable by construction, 1 is a deliberate gate that measurement clears** (§7) |25 | Class sweep | 5 sites of `context-band-not-published`; **1 was this defect (fixed), 1 is a real libaom-fidelity gap that IS reached but has NO observable effect on any fixture measured (`read_block_tx_size_rect`'s lossless arm, missing the `skip && is_inter` term — 29/1/9/6/16 measured hits), 2 are unobservable by construction, 1 is a deliberate gate that measurement clears** (§7) |
@@ -287,7 +288,37 @@ by the project's 4:2:2 decision.
287 | 176x144 of the same recipe, regenerated and re-encoded here | **6/6 decode-order EXACT** (oracle 6 dumps, 0 differing bytes) |288 | 176x144 of the same recipe, regenerated and re-encoded here | **6/6 decode-order EXACT** (oracle 6 dumps, 0 differing bytes) |
288 | 352x288 of the same recipe, regenerated and re-encoded here | **6/6 decode-order EXACT** (oracle 6 dumps, 0 differing bytes) |289 | 352x288 of the same recipe, regenerated and re-encoded here | **6/6 decode-order EXACT** (oracle 6 dumps, 0 differing bytes) |
289 | the 4:4:4 arm | green; every `440_*` fixture in the §6 sweep is `EXACT` except the one by-name 4:2:2 refusal |290 | the 4:4:4 arm | green; every `440_*` fixture in the §6 sweep is `EXACT` except the one by-name 4:2:2 refusal |
290-| `m_320x240`, `m5_320x240`, the 6-frame `m_256x128` residuals named by `lane-av1mixllconj` §7 | **not claimed closed, and not measured here** — they are generated cells, not committed fixtures, so the §6 sweep does not cover them and no number in this report speaks to them |291+| the `m_320x240` / `m5_320x240` / 6-frame `m_256x128` **residue** that `lane-av1mixllconj` §7 left unnamed ("separate defects this change shrinks but does not remove") | **THE SAME DEFECT, and closed.** Measured on `f2dd27b0~1` they are red; with this lane's one publish they are **7/7, 6/6 and 7/7 byte-exact** (§6.2), and they now carry their own fixtures and gate `a_420_mixed_lossless_residue_arms_are_byte_exact_in_decode_order` |
292+
293+### 6.2 The residue arms, measured and gated
294+
295+`lane-av1mixllconj` §7 named three residuals on this same recipe and explicitly
296+declined to claim them: *"separate defects this change shrinks but does not
297+remove."* They are not separate. Each is a lossy block whose
298+`get_tx_size_context` / `txfm_partition_context` read a band that a lossless
299+block above it should have published into and did not — this lane's defect, at
300+smaller frame sizes.
301+
302+```text
303+ at f2dd27b0~1 (= 0bfee517) with this lane's publish
304+420_mixll_256x128_6f.obu 7 dumps, red f1..f6: 7/7 byte-exact
305+ 6051 / 4115 / 2962 / 26566 / 41876 / 14749
306+420_mixll_320x240_5f.obu 6 dumps, red f1..f5: 6/6 byte-exact
307+ 15031 / 16259 / 21932 / 65405 / 90077
308+420_mixll_320x240_6f.obu 7 dumps, red f6 only: 19398 7/7 byte-exact
309+```
310+
311+Decode order, per differing frame, against `aomdec`'s `EC_AV1_FINAL_DUMP`, both
312+sides bit-depth-correct, hidden alt-ref frames included. The recipes reproduce
313+`lane-av1mixllconj` §1's byte counts and sha prefixes (`37fbe7cb…`, `40d613fd…`).
314+`m5_320x240`'s f2/f3 here read 16259 / 21932 against the 16006 / 21930 that
315+report's §7 table records, because that table predates `lane-av1offtile`'s
316+chroma-plane clip; f1/f4/f5 and both other cells match it exactly.
317+
318+All three are committed as fixtures and asserted by
319+`a_420_mixed_lossless_residue_arms_are_byte_exact_in_decode_order`, pinned by
320+fnv1a64. They are excluded from the §6 corpus sweep (which is the pre-existing
321+corpus plus nothing else), so the zero-row diff in §6 is unaffected.
291 322
292 ## 7. Class sweep — `context-band-not-published`323 ## 7. Class sweep — `context-band-not-published`
293 324
@@ -365,8 +396,9 @@ SITE3-PATCHED 420_mixll_altref_640x480_6f: oracle=7 diffbytes=0
365 396
366 ## 9. Fix-now | deferred(<unblock>) | accepted397 ## 9. Fix-now | deferred(<unblock>) | accepted
367 398
368-* **fix-now** — the one-call publish, its route counter and accessor, the two399+* **fix-now** — the one-call publish, its route counter and accessor, FIVE
369- fixtures and the gate. Landed in this commit.400+ fixtures (the two 640x480 cells plus the three residue arms of §6.2) and TWO
401+ gates. Landed in this commit.
370 * **fix-now** — the class sweep (§7), because it is what found the site.402 * **fix-now** — the class sweep (§7), because it is what found the site.
371 * **deferred(unblock: a cell where a SKIPPED inter rect strip sits on a LOSSLESS403 * **deferred(unblock: a cell where a SKIPPED inter rect strip sits on a LOSSLESS
372 segment AND a lossy block later reads its column — the five fixtures that404 segment AND a lossy block later reads its column — the five fixtures that
@@ -377,24 +409,42 @@ SITE3-PATCHED 420_mixll_altref_640x480_6f: oracle=7 diffbytes=0
377 * **accepted** — §7 site 2's missing publish on a `tx_mode != TX_MODE_SELECT`409 * **accepted** — §7 site 2's missing publish on a `tx_mode != TX_MODE_SELECT`
378 frame. Unreachable by construction (both readers are gated on SELECT); closing410 frame. Unreachable by construction (both readers are gated on SELECT); closing
379 it would add a write nothing reads.411 it would add a write nothing reads.
380-* **accepted** — the §6 residuals `lane-av1mixllconj` §7 names on the 6-frame412+* **fix-now (second commit)** — the three residue arms of §6.2. `lane-av1mixllconj`
381- 256x128 and the 320x240 arms. Not this class, not measured here, not claimed.413+ §7 handed them over as unnamed separate defects; measured, they are this
414+ lane's defect, and they are now fixtures and a gate rather than a report note.
382 415
383 ## 10. Scoped test command and output416 ## 10. Scoped test command and output
384 417
385 ```text418 ```text
386 CARGO_TARGET_DIR=$HOME/.cache/cargo-target-av1txctxband2 EC_NOMEMGUARD=1 \419 CARGO_TARGET_DIR=$HOME/.cache/cargo-target-av1txctxband2 EC_NOMEMGUARD=1 \
387- cargo test -p ec-av1 --lib -- a_420_mixed_lossless_alt_ref_640x480_txfm_band_publish \420+ cargo test -p ec-av1 --lib -- a_420_mixed_lossless
388- a_420_mixed_lossless_alt_ref_sub8_vartx
389 ```421 ```
390 422
391 ```text423 ```text
392-running 2 tests424+running 3 tests
393-test stream::tests::a_420_mixed_lossless_alt_ref_640x480_txfm_band_publish_is_byte_exact_in_decode_order ... ok
394 test stream::tests::a_420_mixed_lossless_alt_ref_sub8_vartx_witness_is_byte_exact_in_decode_order ... ok425 test stream::tests::a_420_mixed_lossless_alt_ref_sub8_vartx_witness_is_byte_exact_in_decode_order ... ok
395-test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 805 filtered out; finished in 2.06s426+test stream::tests::a_420_mixed_lossless_alt_ref_640x480_txfm_band_publish_is_byte_exact_in_decode_order ... ok
427+test stream::tests::a_420_mixed_lossless_residue_arms_are_byte_exact_in_decode_order ... ok
428+test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 805 filtered out; finished in 2.51s
396 ```429 ```
397 430
431+The same command with the one `set_txfm_ctxs` call removed — the mutation proof
432+across all three, and note the residue gate fails on a PIXEL diff while the
433+640x480 gate fails on the REFUSAL, so neither gate is carried by the other:
434+
435+```text
436+test …640x480_txfm_band_publish… ... FAILED
437+ this decoder refused the stream: unsupported: AV1 tile (a Golomb tail longer than this decoder reads)
438+test …mixed_lossless_residue_arms… ... FAILED
439+ 420_mixll_256x128_6f.obu: decode-order frame 1 of 7 (6 shown, 1 hidden) differs from the
440+ oracle at byte 16584 (ours 96 vs 91), 6051 bytes differ
441+test …alt_ref_sub8_vartx_witness… ... ok <-- lane-av1mixllconj's gate, untouched by this fix
442+test result: FAILED. 1 passed; 2 failed; 0 ignored; 0 measured; 805 filtered out
443+```
444+
445+**6051** is the hand-measured base red for that frame's f1 in §6.2 — the mutation
446+reproduces the number the pre-fix tree produced, not a different one.
447+
398 The corpus sweep (§6) is the regression evidence for everything else: 110448 The corpus sweep (§6) is the regression evidence for everything else: 110
399 fixtures swept before and after with **zero rows changing**.449 fixtures swept before and after with **zero rows changing**.
400 450