forge
Explore
Log in

Don't you dare go Hollow

Merge lane/av1422gathercensus: the ss (1,0) chroma-gather enumeration is closed

Browse files at this commit

39732736743a1e3fb10de504da04743ae959be19Ahmet Kaan GümüşParent: 4674af41530537
98 gather call sites. 39 already route through around_mi_422_chroma. The
rest are inside a 4:4:4 or 4:2:0 guard, or are a 1-cell gather where the
pair rule reads the same cell. One site is structurally reachable at 4:2:2
and unwitnessed: decode_intrabc_owned_rect's around_mi_rect at the non-split
chroma block. Zero hits on the committed 4:2:2 corpus, and the instrument
fired on a 4:4:4 control, so the zero is a real zero. No route without a
witness. Comment only. No decode change.
crates/ec-av1/src/decode.rsmodified+15 -0
@@ -18019,6 +18019,21 @@ fn decode_intrabc_owned_rect(
18019 u_grid = ug;18019 u_grid = ug;
18020 v_grid = vg;18020 v_grid = vg;
18021 } else {18021 } else {
18022+ // lane-av1422gathercensus: the only `around_mi_rect` in the file
18023+ // that feeds a CHROMA coefficient context and can run at ss
18024+ // (1, 0): its above extent is the whole block's LUMA width, and
18025+ // libaom's `get_txb_ctx_general` reads one vote per CHROMA 4-px
18026+ // cell, so at ss (1, 0) the per-mi sum counts each chroma column
18027+ // twice (the class `around_mi_422_chroma` fixes).
18028+ // Kept verbatim because it is UNWITNESSED, not because it is
18029+ // unreachable: it runs only for a NON-skipped, non-lossless
18030+ // intrabc-owned 64x32/32x64 (or smaller) rect strip, and no
18031+ // committed 4:2:2 fixture codes one -- an env-gated probe here
18032+ // fired 0 times across the whole committed 4:2:2 corpus (24 gate
18033+ // tests, 21 decoding cells; see
18034+ // `lanes/av1422gathercensus.report.md`). A future fixture that
18035+ // enters it must route through `around_mi_422_chroma` under the
18036+ // ss (1, 0) guard.
18022 let around = neighbours.around_mi_rect((mi_r, mi_c), bw, bh);18037 let around = neighbours.around_mi_rect((mi_r, mi_c), bw, bh);
18023 let (ug, _) = read_inter_plane_rect(18038 let (ug, _) = read_inter_plane_rect(
18024 dec,18039 dec,
lanes/av1422gathercensus.report.mdadded+129 -0
@@ -0,0 +1,129 @@
1+# lane-av1422gathercensus — every chroma coefficient-context gather in
2+# `decode.rs` that can run at ss (1, 0) without `around_mi_422_chroma`
3+
4+Base `main` @ `2ca9e4e9` (branch `lane/av1422gathercensus`).
5+
6+The class: a gather that feeds a CHROMA plane's coefficient context
7+(`read_plane` / `read_inter_plane` / `read_inter_plane_rect` /
8+`read_rect_chroma_unit` / `read_coeffs*` plane 1|2 → `dc_sign_ctx`), spelled
9+with a LUMA extent, at ss (1, 0). One chroma 4-px cell spans TWO luma mi
10+columns, so a per-luma-mi sum counts each chroma column twice — libaom's
11+`get_txb_ctx_general` reads one vote per CHROMA cell
12+(`Neighbours::around_mi_422_chroma` is the pair rule). The prior sweep
13+(`lanes/av1422gather3.report.md`, `lanes/av1muchunk422sym.report.md` §6)
14+enumerated `around_mi_rect` call sites only; two bare `around_mi` instances
15+were fixed after (`decode_block_128rect` 4:2:2 mu-chunk gather; the
16+intra-in-inter side>64 gather at ~46834). This lane closes the enumeration.
17+
18+## Method
19+
20+A full mechanical pass over EVERY `neighbours.around(` / `around_mi(` /
21+`around_mi_rect(` / `around_rect(` call site in `crates/ec-av1/src/decode.rs`
22+(98 call sites, plus the 5 internal wrappers in the `Neighbours` impl), each classified by its enclosing function, whether the
23+result's plane 1|2 is consumed (the chroma indicator), the guard it sits
24+under, and the span passed. Guards confirmed by reading the branch
25+structure, not by the call's spelling.
26+
27+## Per-site verdicts (the class = chroma consumer, non-trivial luma span)
28+
29+| site (main line) | function | guard / span | reached at ss (1,0)? | verdict |
30+|---|---|---|---|---|
31+| **18022 (U), 18061 (V)** | `decode_intrabc_owned_rect` | none; above span = block LUMA `bw` | structurally yes; **0 hits** on the committed 4:2:2 corpus | **STOP** — unwitnessed (this report) |
32+| 28256, 28309 | `decode_leaf_split4` | `else` of `chroma_444`/`chroma_422` → 4:2:0 group | **no** (branch requires `!chroma_422`) | closed — 4:2:0-only |
33+| 29444, 29498 | `decode_leaf_rect8` | same 4:2:0 group arm | **no** | closed — 4:2:0-only |
34+| 48830 | `decode_inter_sub8_split4` | `if !chroma_444 && !chroma_422` group arm | **no** | closed — 4:2:0-only |
35+| 50860 | `decode_inter_sub8_rect2` | 4:2:0 group arm | **no** | closed — 4:2:0-only |
36+| 44249, 46085, 47149 | `decode_inter_block` | `if ss_x == 0 && ss_y == 0 && chroma_side > chroma_tx` | **no** | closed — 4:4:4-only |
37+| 26832, 27053 | `sub8_leaf_chroma444` | function is the 4:4:4 arm | **no** | closed — 4:4:4-only |
38+| 49546, 49612 | `decode_intra_sub8_leaf` | inside `if chroma_444` | **no** | closed — 4:4:4-only (prior lane, re-confirmed) |
39+| 49665 | `decode_intra_sub8_leaf` | `if chroma_444 {..} else {group}` | **no** | closed — 4:2:0/4:4:4 |
40+
41+Already routed through the pair rule (unchanged, listed for completeness):
42+13170, 13304, 13507, 14765, 14903, 15442, 16136, 16711, 17322, 18268,
43+18800, 18872, 19777, 19820, 20497, 23860, 23927, 24285, 24957, 25668,
44+25928, 27458, 31992, 43713, 43732, 43981, 45503, 45513, 45568, 45811,
45+46835, 47219, 47270, 47412, 48622, 50652, 52005, 52969, 53609.
46+
47+Provably equivalent to the pair rule (single chroma cell — `step_by(2)` over
48+a 1-cell extent is the same cell): 19588, 39663, 39851, 48434 (all
49+`around_mi(pos, MI|B4)`). No change needed at any ss.
50+
51+Luma-only (`[0]` / plane 0), out of class: the remaining ~60 call sites.
52+
53+## The one remaining site — measured
54+
55+`decode_intrabc_owned_rect` (main 17800) gathers its chroma context with
56+`around_mi_rect((mi_r, mi_c), bw, bh)` — the block's LUMA `bw`/`bh` — feeding
57+`read_inter_plane_rect` planes 1 and 2 (main 18022 / 18061). It runs only in
58+the `else` of `if cw.min(32) != cw || ch.min(32) != ch`, i.e. for a
59+non-split chroma plane block (`cw, ch <= 32`), and only when `!skip` and
60+`leaves.is_none()` (non-lossless) — the `if skip` and lossless arms take
61+other paths. So at ss (1, 0) a non-skipped lossy intrabc-owned 64x32 / 32x64
62+(or smaller) rect strip reaches it with a double-counted above vote.
63+
64+**Reachability, measured (temporary env-gated probe, removed before commit).**
65+`EC_IBC422GATHER` printed at that gather for every call; `EC_HALVSWEEP`
66+(same function, pre-existing) printed at function entry.
67+
68+- Over the whole committed 4:2:2 gate set — all 24 tests whose name contains
69+ `422` (`cargo test -p ec-av1 --lib 422`, 21 decoding cells incl. both
70+ `422_intrabc_sb128_strip*.obu`, plus the two named refusal cells and the
71+ two oracle-helper refusal tests) — `EC_IBC422GATHER` fired **0 times**.
72+ `EC_HALVSWEEP` also fired **0 times**: no committed 4:2:2 fixture enters
73+ `decode_intrabc_owned_rect` AT ALL (the 4:2:2 intraBC strips are
74+ 128-root, handled by `decode_block_128rect`'s own intrabc arm, not this
75+ function).
76+- Probe liveness (that the instrument can fire): `EC_HALVSWEEP` printed 5
77+ entries on the committed 4:4:4 owner-rect cell `r512.obu`
78+ (`a_444_intrabc_owned_rect_strip_sizes_its_chroma_plane_block_and_decodes`),
79+ so the function is entered by a committed fixture at other subsamplings.
80+ Across the same `EC_IBC422GATHER` runs (the 24 `422`-named tests plus every
81+ test whose name contains `intrabc`) no non-split entry fired: the
82+ 4:2:0/4:4:4 intrabc rect fixtures that hit this function keep `skip = true`
83+ (`a_16x4_intrabc_pair_strip_decodes_pixel_exact`: `ibc_owned bw=64 bh=32
84+ skip=true`), and the lossless r512 entries are all in the split arm.
85+
86+No encode was needed (and none was attempted): the branch requires a
87+non-skipped lossy intrabc rect strip, which none of the committed 4:2:2
88+cells codes.
89+
90+## Disposition
91+
92+- **STOP.** The site is structurally reachable at ss (1, 0) but UNWITNESSED:
93+ 0 of the 21 committed 4:2:2 decoding cells enters it. Per the ticket, no
94+ route and no pixel gate are added — a routing with no witness cannot be
95+ discriminated by any pixel compare (the same disposition the sibling
96+ sites took, e.g. `lanes/av1422gather3.report.md` §2/3 for the
97+ `chroma_444`-scoped pair).
98+- A dated comment at the site records the verdict so a future mechanical
99+ enumeration does not re-list it as new work, and names the fix
100+ (`around_mi_422_chroma` under the ss (1, 0) guard) required if a future
101+ fixture enters it.
102+- No behavioural change: `decode.rs` differs only by that comment.
103+ `cargo check -p ec-av1` → 0 errors (1 pre-existing `dead_code` warning in
104+ `dumpio.rs::pin_reporting`, unrelated).
105+
106+## Evidence summary
107+
108+- Class sites: 1 unwitnessed (`decode_intrabc_owned_rect`, 18022/18061);
109+ 9 guarded/closed rows (4:2:0 only, 4:4:4 only); 4 single-cell-equivalent
110+ rows; 39 already-routed rows.
111+- Probe counts: `EC_IBC422GATHER` 0 / `EC_HALVSWEEP` 0 over 24 `422`-named
112+ tests (21 decoding cells); `EC_HALVSWEEP` 5 on `r512.obu` (4:4:4) proving
113+ the instrument fires.
114+- `decode.rs`: comment only at 18022; probe removed.
115+- Report + comment committed on `lane/av1422gathercensus` (no push).
116+
117+## Repro
118+
119+```text
120+git worktree add -b lane/av1422gathercensus ~/.cache/wt/av1422gathercensus 2ca9e4e9
121+cd ~/.cache/wt/av1422gathercensus
122+# re-add the probe at decode.rs 18022 (`eprintln!("EC_IBC422GATHER ...")` under
123+# an env_flag) and run:
124+CARGO_TARGET_DIR=~/.cache/tgt-av1422gathercensus EC_IBC422GATHER=1 EC_HALVSWEEP=1 \
125+ cargo test -p ec-av1 --lib 422 -- --nocapture --test-threads=1 # 0 probe lines
126+CARGO_TARGET_DIR=~/.cache/tgt-av1422gathercensus EC_HALVSWEEP=1 \
127+ cargo test -p ec-av1 --lib a_444_intrabc_owned_rect_strip_sizes_its_chroma_plane_block_and_decodes \
128+ -- --nocapture # 5 EC_HALV lines (liveness)
129+```