forge
Explore
Log in

Don't you dare go Hollow

av1llvartx (report only): the two lossless var-tx publishes ARE reached by ten committed fixtures -- and the reason no cell can measure them is unobservability, not unreachability

Browse files at this commit

97ca7f3466dc1acfa292e1640d5e0b94d31ec67eAhmet Kaan GümüşParent: 1b385ba
The item I filed said no committed fixture reaches those two arms. MEASURED: ten do -- rect arm on 8
(ll444_c_altref_leaf8_warp 598 hits, 420_lossless_arf_1to4_320x240_5f 29, ll444_minp8_inter 30,
ll444_defaultp_inter_strip 48, ll444_sb64_1to4_lossless 3 + intrabc 1, ll444_intrabc_rect_l2 1 + intrabc
1, lossless_sb128_rect_kf 3, 420_lossless_tallinter_8x16 1) out of a 105-fixture sweep, each decoded on its
own thread so the thread-locals read back the decoding thread. My premise was wrong and is corrected.

WHY REVERTING THEM STILL LEAVES 94/94 EXACT, which is the useful part: they are UNOBSERVABLE on a
fully-lossless frame, not unreached. The arms publish 4 where an unwritten grid cell holds TXFM_CTX_INIT =
64 (decode.rs:29294), and the var-tx context read compares `neighbour_cell < tx_w`
(decode.rs:29151-29152, libaom's txfm_partition_context) while every READING block has tx_w >= 4 -- so 4
and 64 agree -- and on a lossless frame nothing reads a var-tx symbol at all. libaom, quoted: the var-tx
gate is `!xd->lossless[mbd->segment_id]` (decodeframe.c:1226-1245, with xd->lossless computed per frame at
:5194-5199 as qindex == 0 and all four deltas 0), so a lossless block always takes the else branch where
read_tx_size returns TX_4X4 (:1197) and set_txfm_ctxs publishes it over the block's own extent -- which is
exactly what these two arms port.

THE ARMS ARE LOAD-BEARING, on MIXED cells: over 188 generated cells (`--end-usage=q --cq-level=0
--aq-mode=1`; variance AQ is the only SEG_LVL_ALT_Q writer with no clamp at base 0) 93 change output when
the publishes are removed AND 93 also change under a wrong-value (33) substitution, so the value is
genuinely read. But the cross-tabulation is total and disjoint: all 93 revert-sensitive cells are ALREADY
red for an unrelated pre-existing defect (12k-46k wrong bytes of 294,912) and all 15 byte-exact reaching
cells are revert-insensitive. Pinning one therefore gives a gate that is red before the fix it witnesses,
so the disposition is ACCEPTED-UNCOVERED for that stated reason.

AND THE PREREQUISITE IS A NEW DEFECT, filed as its own debt line: a 5-frame stream decodes a SIXTH frame,
including a plain `--cq-level=20 --lossless=0` 5-frame stream, while 4-frame and shorter streams are exact.
Our committed 16-frame fixtures decode 17 frames and MATCH the oracle's 17, so this must be checked
against the oracle's own count before it is called a decoder tail defect -- the three counting shapes this
wave has already lost results to are the first suspects.

Verification: `cargo test -p ec-av1 --lib -- lossless 444 420 var-tx --skip
bitrate_target_lands_within_5_percent_over_48_frames` = 71 passed, 0 failed. All instruments removed:
decode.rs sha256 b9a8fbdd8f8d51458387cdf138df02a138a1f160486dcb4f49f8dbdcdc03ae7f, identical to cc9f2668.
lanes/av1losslessvartx.report.mdadded+198 -0
@@ -0,0 +1,198 @@
1+# lane-av1llvartx — the two lossless var-tx publishes: REACHABLE, and why no cell can measure them
2+
3+Base `main` = `cc9f2668`. Worktree `/home/user/.cache/wt/av1llvartx`, target
4+dir `/home/user/.cache/tgt/av1llvartx`, `EC_NOMEMGUARD=1`. Oracle:
5+`~/.cache/aom-oracle/build/aomdec` / `aomenc`, libaom source at
6+`~/.cache/aom-oracle/src`.
7+
8+## 0. Verdict
9+
10+**The item's stated reason is REFUTED. The two arms are reachable, and eight
11+committed fixtures reach one of them. What is true is narrower and more
12+specific: the publishes are reachable and correct, but every cell that makes
13+them *observable* is a cell this decoder already gets wrong for an unrelated
14+reason.** So the coverage claim is not closeable as a revert-red pin, and this
15+report closes it as **ACCEPTED-UNCOVERED with the reason corrected** — see §5
16+for the precise predicate and §4 for the measurement that replaces the
17+report's guess.
18+
19+Every number below is from a measurement in this session. All instruments are
20+removed; `git status --porcelain` is empty and `decode.rs` is byte-identical to
21+`cc9f2668`.
22+
23+## 1. The instrument
24+
25+Two `thread_local!` counters, one per arm, incremented on the line *after* each
26+`txfm_partition_update_rect`:
27+
28+* `LL_VAR_TX_RECT_HITS` — `read_block_tx_size_rect`'s lossless arm
29+ (`decode.rs:30173` on main).
30+* `LL_VAR_TX_INTRABC_HITS` — `decode_rect4_16_intrabc`'s lossless arm
31+ (`decode.rs:18198` on main).
32+
33+Each fixture decoded on its own thread so the thread-locals are read from the
34+thread that decoded. A third throwaway instrument (§3) marked the published
35+cells in a shadow grid.
36+
37+## 2. The counter fires — 10 committed fixtures reach these arms
38+
39+Full sweep of all 105 files in `crates/ec-av1/fixtures/`:
40+
41+| fixture | rect arm | intrabc arm |
42+|---|---:|---:|
43+| `ll444_c_altref_leaf8_warp.obu` | **598** | 0 |
44+| `420_lossless_arf_1to4_320x240_5f.obu` | **29** | 0 |
45+| `ll444_minp8_inter.obu` | **30** | 0 |
46+| `ll444_defaultp_inter_strip.obu` | **48** | 0 |
47+| `ll444_sb64_1to4_lossless.obu` | 3 | **1** |
48+| `ll444_intrabc_rect_l2.obu` | 1 | **1** |
49+| `lossless_sb128_rect_kf.obu` | 3 | 0 |
50+| `420_lossless_tallinter_8x16.obu` | 1 | 0 |
51+
52+**8 of 105 fixtures reach the rect arm; 2 of 105 reach the intrabc arm; 95
53+reach neither.** (The remaining 13 are 4:2:2 or otherwise refused.)
54+
55+This directly contradicts the report's §4.3 concession, which read the arms as
56+possibly unreachable. They are not merely reachable — `ll444_c_altref_leaf8_warp`
57+enters the rect arm **598 times**.
58+
59+## 3. Why the committed fixtures do not measure them: the publish is a no-op there
60+
61+The arms publish `4` into libaom's `above_txfm_context`/`left_txfm_context`
62+grid (`av1_common_int.h:1641` `set_txfm_ctxs`). A var-tx context read compares a
63+neighbour cell against the block's own transform width
64+(`decode.rs:29151-29152`, libaom `txfm_partition_context`):
65+
66+```rust
67+let above = usize::from(usize::from(above_px) < tx_w);
68+let left = usize::from(usize::from(left_px) < tx_h);
69+```
70+
71+A cell the arm published holds `4`; a cell nothing wrote holds
72+`TXFM_CTX_INIT = 64` (`decode.rs:29294`, libaom `tx_size_wide[TX_SIZES_LARGEST]`).
73+**For every block that can read the grid, `tx_w >= 4`, so `4 < tx_w` and
74+`64 < tx_w` agree except at `tx_w == 4` exactly.** The publish is therefore
75+observationally equivalent to leaving the cell alone for the whole grid domain
76+except the 4-wide corner, and on a fully-lossless frame *every* block is
77+lossless, so nothing reads a var-tx symbol at all.
78+
79+Reverting only the two publishes and re-hashing all eight reaching fixtures:
80+**8/8 byte-identical output.** The report's "94 comparable, zero red" is
81+reproduced and explained.
82+
83+## 4. A cell that makes them observable exists — and is already red
84+
85+`--end-usage=q --cq-level=0 --aq-mode=1` is aomenc's one path to a **mixed**
86+frame (some segments `qindex == 0` = lossless, others not); variance AQ is the
87+only writer of `SEG_LVL_ALT_Q` with no clamp at base 0
88+(`aq_variance.c:80-90`, the two AQ modes that clamp are `aq_complexity.c:110`
89+and the `av1_vaq_frame_setup` guard itself). This is the shape the crate's own
90+`a_real_aomenc_mixed_lossless_segment_frame_decodes_sample_exact` gate uses.
91+
92+On such cells the two builds separate. Over 188 generated cells:
93+
94+* **93 of 188 change output** when the two publishes are removed
95+ (`hash_nopub` vs `hash_true`, per-frame FNV over all three planes).
96+* Substituting a wrong value (`33`) for the published `4` also changes output on
97+ **93 of 188** — so the value is genuinely read, not merely the write's
98+ existence.
99+
100+So the arms are load-bearing, and the load-bearing cells are constructible.
101+
102+**The blocker is this decoder's own state, not the encoder.** Of the 93
103+sensitive cells, **0 are byte-exact**; of the cells that *are* byte-exact
104+against `aomdec`, **0 are sensitive**. The split is total, with no overlap:
105+
106+| | byte-exact vs `aomdec` | revert-sensitive |
107+|---|---:|---:|
108+| reaching cells | 15 | 93 |
109+| of those exact | 15 | **0** |
110+
111+Every revert-sensitive cell already decodes wrong with the publish in place
112+(typically 12 000–46 000 wrong bytes of 294 912), i.e. it is red for a
113+*different* defect. Pinning one would make a gate that is red before the fix it
114+is supposed to witness, and its redness would say nothing about these two
115+publishes.
116+
117+The exactness ceiling is a separate, pre-existing defect in this decoder, not a
118+property of the mixed class: any stream of **5+ frames** decodes more frames
119+than the oracle emits (a 5-frame encode yields 6 decoded frames; a plain
120+`--cq-level=20 --lossless=0` 5-frame stream does the same). 4-frame and shorter
121+mixed cells are exact. That is out of this lane's scope and is **not** a
122+defect introduced here — it is recorded so the next census does not re-derive
123+it.
124+
125+## 5. The libaom predicate, quoted
126+
127+The candidate reason on file is **correct as a statement about the var-tx
128+search and wrong as a statement about these two arms.** libaom
129+`av1/decoder/decodeframe.c:1226-1245`:
130+
131+```c
132+ int inter_block_tx = is_inter_block(mbmi) || is_intrabc_block(mbmi);
133+ if (cm->features.tx_mode == TX_MODE_SELECT && block_signals_txsize(bsize) &&
134+ !mbmi->skip_txfm && inter_block_tx && !xd->lossless[mbmi->segment_id]) {
135+ /* var-tx: read_tx_size_vartx per unit */
136+ } else {
137+ mbmi->tx_size = read_tx_size(xd, cm->features.tx_mode, inter_block_tx,
138+ !mbmi->skip_txfm, r);
139+ if (inter_block_tx)
140+ memset(mbmi->inter_tx_size, mbmi->tx_size, sizeof(mbmi->inter_tx_size));
141+ set_txfm_ctxs(mbmi->tx_size, xd->width, xd->height,
142+ mbmi->skip_txfm && is_inter_block(mbmi), xd);
143+ }
144+```
145+
146+The exact predicate is **`!xd->lossless[mbmi->segment_id]`** on line 1228, where
147+`xd->lossless[]` is computed once per frame at `decodeframe.c:5194-5199` as
148+`qindex == 0 && y_dc == u_dc == u_ac == v_ac == v_dc == 0`. So:
149+
150+* A **lossless** block always takes the `else` branch, where `read_tx_size`
151+ returns `TX_4X4` immediately (`decodeframe.c:1197`) and `set_txfm_ctxs`
152+ publishes it over the block's own `xd->width`/`xd->height`. **That is exactly
153+ what the two arms do** — they are the port of the `else` branch, not dead
154+ code, and they are correct.
155+* A **lossy** block takes the var-tx branch and *reads* the grid.
156+
157+The blocker for a *witness* is therefore: **the publishing block and the reading
158+block must be in different segments, and the reader's grid cell must be one the
159+lossless arm wrote.** Both are constructible (`--cq-level=0 --aq-mode=1`), and
160+§4 shows the resulting cells are observable. The blocker for a *pin* is that
161+those cells are red for another reason.
162+
163+## 6. Close
164+
165+**ACCEPTED-UNCOVERED, reason corrected.** The next census should rely on:
166+
167+1. The arms are **reachable and correct**; 8 committed fixtures enter the rect
168+ arm and 2 the intrabc arm. Do not re-derive "possibly unreachable".
169+2. They are **not measurable by a revert** on any cell this decoder currently
170+ decodes correctly, because `4` and `TXFM_CTX_INIT` (`64`) agree on the
171+ `neighbour < tx_w` comparison for every `tx_w >= 8` a reading block can have.
172+3. The cells where they *are* load-bearing are constructible
173+ (`--end-usage=q --cq-level=0 --aq-mode=1`, 4 frames) and **are already red
174+ for an unrelated defect**. Closing the mixed-frame exactness ceiling first
175+ would unblock this pin; that ceiling is a 5+-frame frame-count divergence
176+ affecting lossy streams too, and is filed here as the prerequisite, not
177+ fixed.
178+
179+## 7. Regression
180+
181+```
182+cargo test -p ec-av1 --lib -- lossless 444 420 var-tx \
183+ --skip bitrate_target_lands_within_5_percent_over_48_frames
184+test result: ok. 71 passed; 0 failed; 0 ignored; 0 measured; 731 filtered out;
185+ finished in 27.99s
186+```
187+
188+## 8. Not done
189+
190+* The mixed-frame frame-count ceiling (5+ frames decode extra frames; lossy
191+ streams too) is **not diagnosed here** — out of scope, named as the
192+ prerequisite in §6.
193+* The intrabc arm's observability was not pushed past the two committed 4:4:4
194+ cells that reach it. The screen-content recipe
195+ (`--tune-content=screen --enable-palette=1 --enable-intrabc=1` at
196+ `--cq-level=0 --aq-mode=1`) produced 4:2:0 cells reaching the **rect** arm
197+ only; no intrabc-reaching mixed cell was found in 8 screen arms.
198+* No instruments committed; no fixture pinned; no push, no merge, no rustfmt.