forge
Explore
Log in

Don't you dare go Hollow

lane-av1mixloss: lossless-segment rect leaves code no tx-depth symbol (decodeframe.c:1203 precedes TX_MODE_SELECT) — 6 tx-depth readers gated, mix.obu byte-exact vs oracle

Browse files at this commit

49ee9bd472e7904ff6576dc4ca072fa07ab5eae0Ahmet Kaan GümüşParent: a2a84c7
crates/ec-av1/src/decode.rsmodified+31 -6
@@ -10997,7 +10997,11 @@ fn decode_intra_rect_in_inter(
1099710997 hit!(SMOOTH_LUMA_HITS);
1099810998 }
1099910999 let smooth_neighbor_uv = neighbours.smooth_uv_neighbour(mi_r, mi_c, r, c);
11000- let depth = if fctx.tx_select_inter.with(std::cell::Cell::get) {
11000+ // lane-av1mixloss: the lossless-segment early return (`decodeframe.c:1203`)
11001+ // precedes `TX_MODE_SELECT`, so a lossless-segment intra-rect block inside
11002+ // an inter frame codes no depth symbol either (`xd->lossless` is per
11003+ // segment regardless of frame type; class sweep of the sub8 leaf's fix).
11004+ let depth = if fctx.tx_select_inter.with(std::cell::Cell::get) && !lossless(fctx) {
1100111005 // The frame's own `TXFM_CONTEXT` bands -- [`tx_size_context_txfm_rect`].
1100211006 let ctx = tx_size_context_txfm_rect(neighbours, (mi_r, mi_c), bw.min(64), bh.min(64), fctx);
1100311007 let d = match tx_cat {
@@ -11585,7 +11589,11 @@ fn decode_block_rect(
1158511589 // desynced the tile from that point on. That is why both strips of the
1158611590 // pinned HORZ quadrant were wrong from their very first pixel, and why our
1158711591 // range after the read equalled the oracle's range for the whole block.
11588- let depth = if tx_select {
11592+ // lane-av1mixloss: the lossless-segment early return
11593+ // (`decodeframe.c:1203`) precedes `TX_MODE_SELECT`, so a lossless-segment
11594+ // rect block codes no depth symbol here either (class sweep of the sub8
11595+ // leaf's fix).
11596+ let depth = if tx_select && !lossless(fctx) {
1158911597 // lane-av1txbands: EVERY frame now reads the real `TXFM_CONTEXT`
1159011598 // bands (`get_tx_size_context`, libaom `pred_common.h:342`) -- an
1159111599 // intra-only frame publishes them from every block too
@@ -12101,9 +12109,16 @@ fn decode_leaf_rect(
1210112109 // filter type is the NEIGHBOUR's `uv_mode` (libaom `get_filt_type`), not
1210212110 // a constant `false`.
1210312111 let smooth_neighbor_uv = neighbours.smooth_uv_neighbour(leaf_mi.0, leaf_mi.1, r, c);
12104- let depth = if tx_select {
12112+ let depth = if tx_select && !lossless(fctx) {
1210512113 // lane-t900 r2 (sibling sweep): the in-inter `TXFM_CONTEXT` band read
1210612114 // every other rect reader now does -- a no-op on a key frame.
12115+ // lane-av1mixloss: libaom `read_tx_size`'s first line
12116+ // (`decodeframe.c:1203`, `if (xd->lossless[segment_id]) return
12117+ // TX_4X4;`) precedes the `TX_MODE_SELECT` test, so a lossless-segment
12118+ // rect leaf codes NO depth symbol (`depth_to_tx_wh` clamps to 4x4).
12119+ // The mixed frame's 16x8 leaf at mi(10,0) forked exactly here: ours
12120+ // read `tx_size_cat1` (rng 55700->49918) where the oracle's next
12121+ // read was the leaf's own txb_skip.
1210712122 let ctx = tx_size_context_txfm_rect(neighbours, leaf_mi, bw, bh, fctx);
1210812123 // lane-rectsplitx r1: `bsize_to_tx_size_cat` (libaom `blockd.h`,
1210912124 // `bsize_to_tx_size_depth_table`) is 2 for BLOCK_16X8/BLOCK_8X16, so
@@ -12455,7 +12470,10 @@ fn decode_block_rect4(
1245512470 } else {
1245612471 uv_mode
1245712472 };
12458- let depth = if tx_select {
12473+ // lane-av1mixloss: the lossless-segment early return (`decodeframe.c:1203`)
12474+ // precedes `TX_MODE_SELECT`, so a lossless-segment rect4 block codes no
12475+ // depth symbol here either (class sweep of the sub8 leaf's fix).
12476+ let depth = if tx_select && !lossless(fctx) {
1245912477 // lane-av1txbands: EVERY frame now reads the real `TXFM_CONTEXT`
1246012478 // bands (`get_tx_size_context`, libaom `pred_common.h:342`) -- an
1246112479 // intra-only frame publishes them from every block too
@@ -13523,7 +13541,11 @@ fn decode_rect4_16_strip(
1352313541 // TX_16X4 and `sub_tx_size_map` reaches TX_4X4 in two steps, so the
1352413542 // depth symbol is the 3-symbol `tx_size_cat1` -- not the 2-symbol
1352513543 // `cat0` a 4x8 leaf reads nor the `cat2` a 32x8 strip does.
13526- let depth = if tx_select {
13544+ // lane-av1mixloss: the lossless-segment early return
13545+ // (`decodeframe.c:1203`) precedes `TX_MODE_SELECT`, so a
13546+ // lossless-segment strip codes no depth symbol here either (class
13547+ // sweep of the sub8 leaf's fix).
13548+ let depth = if tx_select && !lossless(fctx) {
1352713549 // lane-av1txbands: every frame reads the real `TXFM_CONTEXT` bands
1352813550 // (`get_tx_size_context`, libaom `pred_common.h:342`).
1352913551 let ctx = tx_size_context_txfm_rect(neighbours, lmi, bw, bh, fctx);
@@ -14095,7 +14117,10 @@ fn decode_block_rect64(
1409514117 uv_mode
1409614118 };
1409714119 let (mi_r, mi_c) = (r * (SUB / MI), c * (SUB / MI));
14098- let depth = if tx_select {
14120+ // lane-av1mixloss: the lossless-segment early return (`decodeframe.c:1203`)
14121+ // precedes `TX_MODE_SELECT`, so a lossless-segment 64-axis rect block codes
14122+ // no depth symbol here either (class sweep of the sub8 leaf's fix).
14123+ let depth = if tx_select && !lossless(fctx) {
1409914124 // lane-av1txbands: EVERY frame now reads the real `TXFM_CONTEXT`
1410014125 // bands (`get_tx_size_context`, libaom `pred_common.h:342`) -- an
1410114126 // intra-only frame publishes them from every block too
lanes/av1mix.report.mdmodified+28 -0
@@ -62,3 +62,31 @@
6262 - `fix-now | deferred(lane suivante) | accepted` : le fix du drift CDF lui-même.
6363 Unbloqué par : re-diff de l'historique d'adaptation du CDF (les valeurs des TUs 0-18 sont
6464 archivées dans les traces), puis comparaison de l'ordre d'application des updates CDF vs l'oracle.
65+
66+## Diagnostic de la divergence (session r2, 24-09-2026, session Agent26-2)
67+
68+- Le « fork CDF » de r1 (TU#19, cdf0 23340 vs 10886) et le « mi(6,0) br=1 ctx=1 non
69+ adapté » du r1-bis sont tous deux des **artefacts de convention d'impression** :
70+ notre `EC_COEFF_STEP tag=all_zero side=` imprime la ligne `txb_skip` **pré**-adaptation
71+ (copie `dbg_txbskip` avant `dec.symbol`, decode.rs), l'oracle instrumenté imprime
72+ **post**-adaptation. 25197 = 26876 - (26876>>4) : une adaptation du même défaut neuf
73+ `AOM_CDF2(5892)` (32768-5892=26876). **Aucune mise à jour CDF manquante.**
74+- Vrai fork : entre la lecture #151 (chroma) et le txb luma de mi(10,0), nous
75+ consommons **9 bits** contre **7 chez l'oracle** — un symbole `tx_size_cat1`
76+ en trop (rng 55700->49918, s=1) lu par `decode_leaf_rect` pour une feuille
77+ rect **16x8 d'un segment lossless** : le `read_tx_size` de libaom rend TX_4X4
78+ AVANT le test `TX_MODE_SELECT` (decodeframe.c:1203), donc l'oracle ne code
79+ aucun symbole de profondeur ici.
80+- Balayage de la classe : `&& !lossless(fctx)` ajouté aux lectures de profondeur
81+ de `decode_leaf_rect`, `decode_block_rect`, `decode_block_rect4`,
82+ `decode_rect4_16_strip`, `decode_block_rect64`, `decode_intra_rect_in_inter`
83+ (`decode_intra_sub8_leaf`, `decode_leaf_rect8`, le lecteur 128-root et
84+ `read_tx_size` l'avaient déjà).
85+- Preuve : mix.obu (cache, non ré-encodé) — chaîne rng EC identique à l'oracle
86+ (9565 all_zero, 2982 eob, valeurs identiques) et **4 frames byte-exact** vs
87+ l'aomdec instrumenté (294912 octets, `cmp` implicite par comparaison de
88+ tableaux). Porte témoin `a_real_aomenc_mixed_lossless_segment_frame_decodes_
89+ sample_exact` verte (3 arms, sample-exact vs ffmpeg, unités WHT comptées).
90+- Instrument de session : sonde `EC_SYMR` ajoutée à
91+ `~/.cache/aom-oracle/src/aom_dsp/bitreader.h` (aom_read_symbol_) — arbre
92+ scratch hors repo.