lane-av1-witness2: Wave-2 census-shape witness hunt report
Browse files at this commit334b43a17bcbe4c6475b93f8a228a35d4904aabbParent: 38b69191 changed file +155 -0
- lanes/av1witness2.report.md +155 -0
lanes/av1witness2.report.mdadded+155 -0
| @@ -0,0 +1,155 @@ | |||
| 1 | +# lane-av1-witness2: Wave-2 census-shape witness hunt | ||
| 2 | + | ||
| 3 | +Branch `lane-av1-witness2` at `fe3e8418`. Hunt, not a fix lane: run real aomenc | ||
| 4 | +streams at the four Wave-2 census refusals (lanes/av1decode.report.md §4, | ||
| 5 | +Wave 2), watch for the refusal string on `decode_probe`, stop each shape after | ||
| 6 | +8 encodes. **Verdict: 0 / 4 guards reached** in 31 valid encodes (one slot | ||
| 7 | +spent on an invalid `--aq-mode=4` that this aomenc build rejects). Two | ||
| 8 | +real-stream PANIC defects were found instead (Annex A) — both 4:4:4-only, both | ||
| 9 | +in `decode_block_128rect`'s / `decode_leaf8`'s execution stages, and they cut | ||
| 10 | +the 4:4:4 hunting domain short before any parse-level refusal can be evaluated. | ||
| 11 | + | ||
| 12 | +Method shared by every shape: content generated by ffmpeg 8.1.2 lavfi into | ||
| 13 | +`/tmp/av1w2/*.y4m` (busy `testsrc2`, moving banded `geq` content at 8-px and | ||
| 14 | +4-px period, mandelbrot `tile=2x2` as screen-ish content), one `aomenc | ||
| 15 | +--obu --passes=1 --threads=1` encode per recipe, then | ||
| 16 | +`decode_probe <stream.obu>` grepping for the exact refusal string; probe | ||
| 17 | +stdout per stream kept as `/tmp/av1w2/<name>.probe`. Encoder: | ||
| 18 | +`$HOME/.cache/aom-oracle/build/aomenc`. No fixtures committed; nothing under | ||
| 19 | +`crates/ec-av1/fixtures/`. | ||
| 20 | + | ||
| 21 | +## Shape 1 — "a 64-axis strip whose chroma unit has no coefficient table" | ||
| 22 | + | ||
| 23 | +Guard: `decode.rs:15233`, the `_` arm of the chroma-unit match in | ||
| 24 | +`decode_block_rect64` (reached only for depth==0, non-skip, non-lossless | ||
| 25 | +superblock-level HORZ/VERT/1:4 strips). 8 encodes (`s1a`..`s1h`): 4:4:4 | ||
| 26 | +keyframes, `--tune-content=screen --enable-intrabc=1 --enable-palette=0`, | ||
| 27 | +rect+1:4 partitions on, `--min-partition-size=4`, sb 64 and 128, cq 10..63, | ||
| 28 | +cpu-used 0..2, `--allintra`, `--kf-max-dist=1` all-key variants. **No refusal; | ||
| 29 | +not reached.** | ||
| 30 | + | ||
| 31 | +Evidence, two parts: | ||
| 32 | + | ||
| 33 | +1. The three streams that decode to completion (`s1b` bands cq45, `s1f` | ||
| 34 | + bands allintra cq10, `s1h` bands cq63 ×3 keyframes) never enter | ||
| 35 | + `decode_block_rect64` at all: `rect64_corner_tu: 64x32=0 32x64=0` in all | ||
| 36 | + three probes (the strips that fire are the 32-level `rect4_32` | ||
| 37 | + horz=7..16 / vert=8..32, and `intrabc_rect: 1..2`). The five remaining | ||
| 38 | + streams panic before completing (Annex A). | ||
| 39 | +2. Static reduction [INFERENCE, source-read]: the handled arms | ||
| 40 | + `(32,32) (32,16) (16,32) (32,8) (8,32)` cover every conformant chroma | ||
| 41 | + footprint of a 64-axis strip in both supported chroma formats — at 4:4:4 | ||
| 42 | + the strip set is 64x32/32x64/64x16/16x64 → units (32,32)/(32,16)/(16,32); | ||
| 43 | + at 4:2:0 the halved footprints land on (32,16)/(16,32)/(32,8)/(8,32). | ||
| 44 | + There is no conformant strip whose unit misses the table, which is why no | ||
| 45 | + recipe can reach the arm. A 128-root half (128x64) is a different function | ||
| 46 | + (`decode_block_128rect`), and the 128 root has no 1:4 arm. | ||
| 47 | + | ||
| 48 | +## Shape 2 — "a rectangular inter luma transform unit whose shape has no coefficient table set here" | ||
| 49 | + | ||
| 50 | +Guard: `decode.rs:21541`, the `_` arm of `rect_inter_luma_set`. 8 encodes | ||
| 51 | +(`s2a`..`s2h`): inter frames, `--enable-tx-size-search=1`, rect+1:4 on, | ||
| 52 | +`--min-partition-size=4`, one `--max-partition-size=16` sub-16-only recipe, | ||
| 53 | +one single-ref-only recipe (lag 0 + all compound off), 4:2:0 and 4:4:4, | ||
| 54 | +cq 10..45, cpu-used 0..2, sb 64/128. **No refusal; not reached.** | ||
| 55 | + | ||
| 56 | +Evidence: the rect-TU domain was genuinely exercised — `rect_inter: tu=5..10` | ||
| 57 | +and whole-block rectangular 32x8 inter TUs decoded (`rect32x8_inter_tu: | ||
| 58 | +32x8=3/1` in s2b/s2g, the shape that stopped the pre-lane-rectres film cuts), | ||
| 59 | +sub-8 rect pieces `sub8_inter_rect: horz8x4=41 vert4x8=19` (s2g). Static | ||
| 60 | +reduction [INFERENCE, source-read]: the match covers all fourteen rect shapes | ||
| 61 | +the census lists (2:1 from 8x4 up to the 64-axis adjusted units, 1:4 at 16x4 | ||
| 62 | +and 32x8, plus 128-root halves tiled as squares) — the census gate | ||
| 63 | +`every_rect_transform_shape_the_census_lists_has_a_coefficient_table_and_scan` | ||
| 64 | +already carries this claim. | ||
| 65 | + | ||
| 66 | +## Shape 3 — "a non-skip rectangular (HORZ/VERT/HORZ_B) strip needs rectangular residual coding" | ||
| 67 | + | ||
| 68 | +Guard: `decode.rs:30489` in `decode_inter_block`, firing only for a | ||
| 69 | +`write_w x write_h` footprint outside `rect_inter_residual_supported` | ||
| 70 | +(`decode.rs:21396`). 8 encodes (`s3a`..`s3h`): banded + busy content, inter, | ||
| 71 | +`--min-partition-size=4`, sb 64/128, `--max-partition-size=32`, 4-px band | ||
| 72 | +content, single-ref variant, cq 20..45, cpu-used 0..1. **No refusal; not | ||
| 73 | +reached.** | ||
| 74 | + | ||
| 75 | +Evidence: every rect strip the encoder produced is inside the supported set — | ||
| 76 | +`inter_rect: 32x8=8 64x32=2` (s3a/s3f), whole-block 32x8 rect TUs | ||
| 77 | +(`rect32x8_inter_tu: 32x8=4..6`), all 8/8 streams decode 4/4 frames OK. | ||
| 78 | +`inter_ab16`/`inter_ab64` all 0: this content never even picked an AB arm, so | ||
| 79 | +the HORZ_B-naming half of the string was not stressed, but the string can only | ||
| 80 | +fire on an *unsupported* footprint, and the supported list plus the walker's | ||
| 81 | +piece set (SB pieces 64x32/32x64/64x16/16x64 at 39895-39958, 32-level and | ||
| 82 | +16-level rect/1:4/AB twins, 128 halves tiled as two TX_64X64) enumerate every | ||
| 83 | +rect footprint AV1 partitioning can present — 1:4 stops at 64 (the 128 root | ||
| 84 | +has no 1:4 symbol) [INFERENCE, source-read, matches the census gate | ||
| 85 | +`a_block_shape_census_over_three_real_streams_leaves_the_rect_residual_\ | ||
| 86 | +refusal_unreachable`]. | ||
| 87 | + | ||
| 88 | +## Shape 4 — "a frame whose segmentation enables SEG_LVL_REF_FRAME/SKIP/GLOBALMV" | ||
| 89 | + | ||
| 90 | +Guard: `stream.rs:1483`, per frame header. This aomenc build has **no | ||
| 91 | +`--enable-segmentation` flag**; `--aq-mode` is the segmentation driver. 8 | ||
| 92 | +encodes (`s4a`..`s4h`): aq-mode 1/2/3 (4 is out of range for this build — | ||
| 93 | +`aq_mode out of range [..AQ_MODE_COUNT - 1]`, the slot's encode never ran), | ||
| 94 | +aq-mode 3 + `--delta-lf-mode=1`, aq-mode 2 + cq45, 4:4:4 aq-mode 3, banded | ||
| 95 | +aq-mode 3. **No refusal; not reached.** | ||
| 96 | + | ||
| 97 | +Evidence: segmentation was genuinely enabled in s4a/s4b (`EC_PROBE_HDR`: | ||
| 98 | +`seg=true` on 3/3 frames, aq-mode 1 and 2) and those streams decode clean — | ||
| 99 | +matching the PROVEN annotation ("What aomenc codes is SEG_LVL_ALT_Q tables and | ||
| 100 | +segment_id symbols, and nothing else"). Cyclic refresh (aq-mode 3) did not | ||
| 101 | +engage on this content (`seg=false`). No aq recipe made the encoder write any | ||
| 102 | +of the three mode/reference/skip segment features. | ||
| 103 | + | ||
| 104 | +## Annex A — two real-stream panic defects found by the hunt (not fixed here) | ||
| 105 | + | ||
| 106 | +Both are 4:4:4-only; all sixteen 4:2:0 streams decoded clean. They are a | ||
| 107 | +distinct class from the hunted refusals — a crash, not a named refusal — and | ||
| 108 | +they bound every future 4:4:4 hunt: the probe dies mid-frame, so any | ||
| 109 | +parse-level refusal downstream of the panic point is untestable on such | ||
| 110 | +content until these are fixed. | ||
| 111 | + | ||
| 112 | +**P1 — `decode.rs:17631` assert in `decode_block_128rect`.** | ||
| 113 | +`assertion failed: lossless_frame || (chroma_w / chroma_tx, chroma_h / | ||
| 114 | +chroma_tx) == (nch_x, nch_y)` — the chroma tiling invariant of a 128-root | ||
| 115 | +HORZ/VERT strip at 4:4:4. Stream: `/tmp/av1w2/s1d.obu`, 595 bytes, | ||
| 116 | +sha256 `68773f2c6e01a2d211bf0213479accb4c2c360132c0e1bc3b326eab7861925b1`: | ||
| 117 | + | ||
| 118 | +``` | ||
| 119 | +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 | ||
| 120 | +aomenc --codec=av1 --obu -o /tmp/av1w2/s1d.obu --passes=1 --threads=1 bands444.y4m \ | ||
| 121 | + --limit=3 --kf-max-dist=1 --cpu-used=2 --end-usage=q --cq-level=20 --sb-size=128 \ | ||
| 122 | + --enable-rect-partitions=1 --enable-1to4-partitions=1 --min-partition-size=4 | ||
| 123 | +``` | ||
| 124 | + | ||
| 125 | +**P2 — `decode.rs:3766` index OOB in `PlaneBuf::reconstruct`.** | ||
| 126 | +`index out of bounds: the len is 16 but the index is 16`, frames | ||
| 127 | +`reconstruct ← exec_intra ← push_intra_tx/read_plane ← decode_leaf8 ← | ||
| 128 | +decode_key_frame_tile_with_cdfs` — an 8x8 key-frame leaf whose prediction | ||
| 129 | +mode reaches the reconstruct dispatch outside its 16-entry table, 4:4:4 only. | ||
| 130 | +Smallest stream: `/tmp/av1w2/s1e.obu`, 3577 bytes, sha256 | ||
| 131 | +`72bed2791d1ceba8be7926a052c7838c5d96d4f9d56d28fb69789a753d3593af`: | ||
| 132 | + | ||
| 133 | +``` | ||
| 134 | +ffmpeg -f lavfi -i testsrc2=size=320x256:rate=30:duration=1 -pix_fmt yuv444p busy444.y4m | ||
| 135 | +aomenc --codec=av1 --obu -o /tmp/av1w2/s1e.obu --passes=1 --threads=1 busy444.y4m \ | ||
| 136 | + --limit=3 --cpu-used=0 --end-usage=q --cq-level=45 --sb-size=64 \ | ||
| 137 | + --enable-rect-partitions=1 --enable-1to4-partitions=1 --min-partition-size=4 | ||
| 138 | +``` | ||
| 139 | + | ||
| 140 | +Same panic also fires on `s1a.obu` (screen+intrabc recipe, sha256 | ||
| 141 | +`5cfcb15027947acddf9a74d26ac04a2dd95ee64b48434424ab48b54715ff19fb`) and | ||
| 142 | +`s2e.obu` (inter-grid recipe, sha256 | ||
| 143 | +`e5d89be7a394b470e57133372e4da32084dae546294f38430947902d85fc4221`). | ||
| 144 | + | ||
| 145 | +## Per-shape summary | ||
| 146 | + | ||
| 147 | +| # | Guard | Encodes | Reached | Refusal fired | | ||
| 148 | +|---|---|---|---|---| | ||
| 149 | +| 1 | 64-axis strip chroma without table (`decode.rs:15233`) | 8 | no | none | | ||
| 150 | +| 2 | rect inter luma TU without table (`decode.rs:21541`) | 8 | no | none | | ||
| 151 | +| 3 | non-skip rect strip needs rect residual (`decode.rs:30489`) | 8 | no | none | | ||
| 152 | +| 4 | segmentation REF_FRAME/SKIP/GLOBALMV (`stream.rs:1483`) | 8 (7 valid) | no | none | | ||
| 153 | + | ||
| 154 | +No code edited; no fixtures committed. Repro streams and probe logs live under | ||
| 155 | +`/tmp/av1w2/`. | ||