# lane-av1-witness2: Wave-2 census-shape witness hunt Branch `lane-av1-witness2` at `fe3e8418`. Hunt, not a fix lane: run real aomenc streams at the four Wave-2 census refusals (lanes/av1decode.report.md §4, Wave 2), watch for the refusal string on `decode_probe`, stop each shape after 8 encodes. **Verdict: 0 / 4 guards reached** in 31 valid encodes (one slot spent on an invalid `--aq-mode=4` that this aomenc build rejects). Two real-stream PANIC defects were found instead (Annex A) — both 4:4:4-only, both in `decode_block_128rect`'s / `decode_leaf8`'s execution stages, and they cut the 4:4:4 hunting domain short before any parse-level refusal can be evaluated. Method shared by every shape: content generated by ffmpeg 8.1.2 lavfi into `/tmp/av1w2/*.y4m` (busy `testsrc2`, moving banded `geq` content at 8-px and 4-px period, mandelbrot `tile=2x2` as screen-ish content), one `aomenc --obu --passes=1 --threads=1` encode per recipe, then `decode_probe ` grepping for the exact refusal string; probe stdout per stream kept as `/tmp/av1w2/.probe`. Encoder: `$HOME/.cache/aom-oracle/build/aomenc`. No fixtures committed; nothing under `crates/ec-av1/fixtures/`. ## Shape 1 — "a 64-axis strip whose chroma unit has no coefficient table" Guard: `decode.rs:15233`, the `_` arm of the chroma-unit match in `decode_block_rect64` (reached only for depth==0, non-skip, non-lossless superblock-level HORZ/VERT/1:4 strips). 8 encodes (`s1a`..`s1h`): 4:4:4 keyframes, `--tune-content=screen --enable-intrabc=1 --enable-palette=0`, rect+1:4 partitions on, `--min-partition-size=4`, sb 64 and 128, cq 10..63, cpu-used 0..2, `--allintra`, `--kf-max-dist=1` all-key variants. **No refusal; not reached.** Evidence, two parts: 1. The three streams that decode to completion (`s1b` bands cq45, `s1f` bands allintra cq10, `s1h` bands cq63 ×3 keyframes) never enter `decode_block_rect64` at all: `rect64_corner_tu: 64x32=0 32x64=0` in all three probes (the strips that fire are the 32-level `rect4_32` horz=7..16 / vert=8..32, and `intrabc_rect: 1..2`). The five remaining streams panic before completing (Annex A). 2. Static reduction [INFERENCE, source-read]: the handled arms `(32,32) (32,16) (16,32) (32,8) (8,32)` cover every conformant chroma footprint of a 64-axis strip in both supported chroma formats — at 4:4:4 the strip set is 64x32/32x64/64x16/16x64 → units (32,32)/(32,16)/(16,32); at 4:2:0 the halved footprints land on (32,16)/(16,32)/(32,8)/(8,32). There is no conformant strip whose unit misses the table, which is why no recipe can reach the arm. A 128-root half (128x64) is a different function (`decode_block_128rect`), and the 128 root has no 1:4 arm. ## Shape 2 — "a rectangular inter luma transform unit whose shape has no coefficient table set here" Guard: `decode.rs:21541`, the `_` arm of `rect_inter_luma_set`. 8 encodes (`s2a`..`s2h`): inter frames, `--enable-tx-size-search=1`, rect+1:4 on, `--min-partition-size=4`, one `--max-partition-size=16` sub-16-only recipe, one single-ref-only recipe (lag 0 + all compound off), 4:2:0 and 4:4:4, cq 10..45, cpu-used 0..2, sb 64/128. **No refusal; not reached.** Evidence: the rect-TU domain was genuinely exercised — `rect_inter: tu=5..10` and whole-block rectangular 32x8 inter TUs decoded (`rect32x8_inter_tu: 32x8=3/1` in s2b/s2g, the shape that stopped the pre-lane-rectres film cuts), sub-8 rect pieces `sub8_inter_rect: horz8x4=41 vert4x8=19` (s2g). Static reduction [INFERENCE, source-read]: the match covers all fourteen rect shapes the census lists (2:1 from 8x4 up to the 64-axis adjusted units, 1:4 at 16x4 and 32x8, plus 128-root halves tiled as squares) — the census gate `every_rect_transform_shape_the_census_lists_has_a_coefficient_table_and_scan` already carries this claim. ## Shape 3 — "a non-skip rectangular (HORZ/VERT/HORZ_B) strip needs rectangular residual coding" Guard: `decode.rs:30489` in `decode_inter_block`, firing only for a `write_w x write_h` footprint outside `rect_inter_residual_supported` (`decode.rs:21396`). 8 encodes (`s3a`..`s3h`): banded + busy content, inter, `--min-partition-size=4`, sb 64/128, `--max-partition-size=32`, 4-px band content, single-ref variant, cq 20..45, cpu-used 0..1. **No refusal; not reached.** Evidence: every rect strip the encoder produced is inside the supported set — `inter_rect: 32x8=8 64x32=2` (s3a/s3f), whole-block 32x8 rect TUs (`rect32x8_inter_tu: 32x8=4..6`), all 8/8 streams decode 4/4 frames OK. `inter_ab16`/`inter_ab64` all 0: this content never even picked an AB arm, so the HORZ_B-naming half of the string was not stressed, but the string can only fire on an *unsupported* footprint, and the supported list plus the walker's piece set (SB pieces 64x32/32x64/64x16/16x64 at 39895-39958, 32-level and 16-level rect/1:4/AB twins, 128 halves tiled as two TX_64X64) enumerate every rect footprint AV1 partitioning can present — 1:4 stops at 64 (the 128 root has no 1:4 symbol) [INFERENCE, source-read, matches the census gate `a_block_shape_census_over_three_real_streams_leaves_the_rect_residual_\ refusal_unreachable`]. ## Shape 4 — "a frame whose segmentation enables SEG_LVL_REF_FRAME/SKIP/GLOBALMV" Guard: `stream.rs:1483`, per frame header. This aomenc build has **no `--enable-segmentation` flag**; `--aq-mode` is the segmentation driver. 8 encodes (`s4a`..`s4h`): aq-mode 1/2/3 (4 is out of range for this build — `aq_mode out of range [..AQ_MODE_COUNT - 1]`, the slot's encode never ran), aq-mode 3 + `--delta-lf-mode=1`, aq-mode 2 + cq45, 4:4:4 aq-mode 3, banded aq-mode 3. **No refusal; not reached.** Evidence: segmentation was genuinely enabled in s4a/s4b (`EC_PROBE_HDR`: `seg=true` on 3/3 frames, aq-mode 1 and 2) and those streams decode clean — matching the PROVEN annotation ("What aomenc codes is SEG_LVL_ALT_Q tables and segment_id symbols, and nothing else"). Cyclic refresh (aq-mode 3) did not engage on this content (`seg=false`). No aq recipe made the encoder write any of the three mode/reference/skip segment features. ## Annex A — two real-stream panic defects found by the hunt (not fixed here) Both are 4:4:4-only; all sixteen 4:2:0 streams decoded clean. They are a distinct class from the hunted refusals — a crash, not a named refusal — and they bound every future 4:4:4 hunt: the probe dies mid-frame, so any parse-level refusal downstream of the panic point is untestable on such content until these are fixed. **P1 — `decode.rs:17631` assert in `decode_block_128rect`.** `assertion failed: lossless_frame || (chroma_w / chroma_tx, chroma_h / chroma_tx) == (nch_x, nch_y)` — the chroma tiling invariant of a 128-root HORZ/VERT strip at 4:4:4. Stream: `/tmp/av1w2/s1d.obu`, 595 bytes, sha256 `68773f2c6e01a2d211bf0213479accb4c2c360132c0e1bc3b326eab7861925b1`: ``` ffmpeg -f lavfi -i "nullsrc=s=320x256:rate=30:d=1,geq=lum='mod(floor((Y+T*160)/8)*67,255)':cb='128+20*sin(Y/17+T)':cr='128+20*sin(X/23+T*2)'" -pix_fmt yuv444p bands444.y4m aomenc --codec=av1 --obu -o /tmp/av1w2/s1d.obu --passes=1 --threads=1 bands444.y4m \ --limit=3 --kf-max-dist=1 --cpu-used=2 --end-usage=q --cq-level=20 --sb-size=128 \ --enable-rect-partitions=1 --enable-1to4-partitions=1 --min-partition-size=4 ``` **P2 — `decode.rs:3766` index OOB in `PlaneBuf::reconstruct`.** `index out of bounds: the len is 16 but the index is 16`, frames `reconstruct ← exec_intra ← push_intra_tx/read_plane ← decode_leaf8 ← decode_key_frame_tile_with_cdfs` — an 8x8 key-frame leaf whose prediction mode reaches the reconstruct dispatch outside its 16-entry table, 4:4:4 only. Smallest stream: `/tmp/av1w2/s1e.obu`, 3577 bytes, sha256 `72bed2791d1ceba8be7926a052c7838c5d96d4f9d56d28fb69789a753d3593af`: ``` ffmpeg -f lavfi -i testsrc2=size=320x256:rate=30:duration=1 -pix_fmt yuv444p busy444.y4m aomenc --codec=av1 --obu -o /tmp/av1w2/s1e.obu --passes=1 --threads=1 busy444.y4m \ --limit=3 --cpu-used=0 --end-usage=q --cq-level=45 --sb-size=64 \ --enable-rect-partitions=1 --enable-1to4-partitions=1 --min-partition-size=4 ``` Same panic also fires on `s1a.obu` (screen+intrabc recipe, sha256 `5cfcb15027947acddf9a74d26ac04a2dd95ee64b48434424ab48b54715ff19fb`) and `s2e.obu` (inter-grid recipe, sha256 `e5d89be7a394b470e57133372e4da32084dae546294f38430947902d85fc4221`). ## Per-shape summary | # | Guard | Encodes | Reached | Refusal fired | |---|---|---|---|---| | 1 | 64-axis strip chroma without table (`decode.rs:15233`) | 8 | no | none | | 2 | rect inter luma TU without table (`decode.rs:21541`) | 8 | no | none | | 3 | non-skip rect strip needs rect residual (`decode.rs:30489`) | 8 | no | none | | 4 | segmentation REF_FRAME/SKIP/GLOBALMV (`stream.rs:1483`) | 8 (7 valid) | no | none | No code edited; no fixtures committed. Repro streams and probe logs live under `/tmp/av1w2/`.