R3 report -- txfm-ctx root cause, range ladder, gates, census 17/24 exact and luma exact on all 24
Browse files at this commit4ac57e0d674021c7596bd48c8d9e4644d7ec7d26Parent: 94961f4- docs
- r3 report -- txfm-ctx root cause, range ladder, gates, census 17/24 exact and luma exact on all 24
1 changed file +130 -0
- lanes/kf1200-r3.report.md +130 -0
lanes/kf1200-r3.report.mdadded+130 -0
| @@ -0,0 +1,130 @@ | ||
| 1 | +# lane-kf1200 r3 report — the partial-bottom-row desync, root cause found and fixed | |
| 2 | + | |
| 3 | +Tip `9d18288` on `lane-kf1200` (parent `bee8ec0`, main merged at `d85d7d2`). | |
| 4 | + | |
| 5 | +## Root cause (ONE symbol, not the partition path the charter suspected) | |
| 6 | + | |
| 7 | +The charter's premise — "our 32-level gathered `split_or_horz` CDF/ctx differs" — | |
| 8 | +is REFUTED by measurement. A cross-decoder range ladder over the whole partial | |
| 9 | +bottom superblock row shows every partition symbol of mi_row=400 in sync, | |
| 10 | +including the gathered ones (our `ctx` values equal libaom's | |
| 11 | +`partition_plane_context` minus its `bsl * PARTITION_PLOFFSET` offset, and every | |
| 12 | +`rng` matches): | |
| 13 | + | |
| 14 | + aomdec EC_PART mi_row=400 mi_col=44 bsize=6 ctx=6 rng=55482 value=3 (SPLIT) | |
| 15 | + ours OUR_PART mi_row=400 mi_col=44 bsize=6 ctx=2 rng=55482 | |
| 16 | + aomdec EC_PART mi_row=400 mi_col=44 bsize=3 ctx=0 rng=52288 | |
| 17 | + ours TRACE partition_w8 mi=(400,44) ctx=0 value=0 pre_rng=52288 | |
| 18 | + aomdec EC_PART mi_row=400 mi_col=46 bsize=3 ctx=0 rng=53128 | |
| 19 | + ours TRACE partition_w8 mi=(400,46) ctx=0 value=0 pre_rng=53128 | |
| 20 | + | |
| 21 | +The first differing element is the `tx_depth` symbol of the SECOND 8x8 leaf: | |
| 22 | + | |
| 23 | + aomdec EC_ISTEP mi_row=400 mi_col=46 name=tx_depth val=0 ctx=1 rng=42998 | |
| 24 | + ours EC_ISTEP mi_row=400 mi_col=46 name=tx_depth val=0 ctx=2 rng=54191 | |
| 25 | + | |
| 26 | +Same decoded value, different CDF row, therefore a different interval narrowing: | |
| 27 | +the entropy stream is desynced from there on, and the rest of the row (and the | |
| 28 | +1595..1607 deblock spill) decodes as garbage. What the charter saw as "aomdec | |
| 29 | +reads a 16x8 where we read 32x16" was our *already desynced* reader at | |
| 30 | +mi (400,48), one block later. | |
| 31 | + | |
| 32 | +`ctx` comes from libaom `get_tx_size_context`: `above_txfm_context[0] >= | |
| 33 | +max_tx_wide` + `left_txfm_context[0] >= max_tx_high`. The left neighbour of | |
| 34 | +(400,46) is the 8x8 leaf at (400,44), which is `skip=1` and whose `tx_depth` | |
| 35 | +resolved to TX_4X4 — so libaom's `set_txfm_ctxs` published 4 and its left term | |
| 36 | +is 0. Our `decode_leaf8` skip branch fell through to a hardcoded | |
| 37 | +`fill_lf_grid(leaf_mi, 2, 8, 0)`, publishing 8, so our left term read 1. | |
| 38 | + | |
| 39 | +An intra block reads `tx_depth` whether or not it is skipped (libaom | |
| 40 | +`read_intra_frame_mode_info` calls `read_tx_size` above the skip branch); only a | |
| 41 | +skipped *inter* block records its block size instead of its transform. | |
| 42 | + | |
| 43 | +## Change | |
| 44 | + | |
| 45 | +- `crates/ec-av1/src/decode.rs:10330` — `fill_lf_grid(leaf_mi, 2, resolved as u8, 0)` | |
| 46 | + (was the literal `8`). The non-skip TX_4X4 branch already returned early with 4; | |
| 47 | + only the skip path was wrong. One line. | |
| 48 | +- `crates/ec-av1/src/decode.rs:2652` `trace_edge()` + 5 call sites — `OUR_PART | |
| 49 | + mi_row/mi_col/bsize/ctx/rng` under `EC_AV1_TRACE` for the three gathered | |
| 50 | + frame-edge partition reads (there was no emitter for them, only for the full | |
| 51 | + alphabet reads), plus `pre_rng` on the 8x8 partition trace. Instrument only. | |
| 52 | +- `crates/ec-av1/examples/decode_probe.rs:34` — prints `skip_split_tx`. | |
| 53 | + | |
| 54 | +Sibling sweep for the same shape (a skip branch publishing the block side where | |
| 55 | +the resolved transform belongs): `fill_lf_grid` has 6 call sites. | |
| 56 | +`decode_block` (9872) already passes `logical_tx`; the inter 8x8 leaf (20449) | |
| 57 | +passes `if split8 {4} else {8}`; the inter-leaf skip early-return (19644) passes | |
| 58 | +8, which is CORRECT — a skipped inter block records its block size. The 4x4 leaf | |
| 59 | +(10541) passes 4. Only 10330 was wrong. | |
| 60 | + | |
| 61 | +## Gates | |
| 62 | + | |
| 63 | +1. NEW `the_reelb_ss600_key_frame_skipped_split_tx_decodes_pixel_exact` | |
| 64 | + (`crates/ec-av1/src/stream.rs`), pinning | |
| 65 | + `crates/ec-av1/fixtures/reelb_ss600_key_frame.obu` (94717 B, sha256 | |
| 66 | + `36de46676ed7de7049d4dabe8571d8cd31c8a1f53d72011c0ee532a7c6725cd6`, hashed | |
| 67 | + twice, `git add -f`, present in `git ls-files`): one 3840x1608 yuv420p10le key | |
| 68 | + frame. HARD-asserts `skip_split_tx_hits > 0` (24 in this frame) then Y/U/V vs | |
| 69 | + ffmpeg's 10-bit decode. Fixture, not aomenc, because the shape is not | |
| 70 | + synthetically reachable: 80 recipes this round (4 frame shapes x 2 lavfi | |
| 71 | + sources x cq 32/35/40/45/48/50/55/58/63 x cpu-used 0/3 x 8/10-bit, all with | |
| 72 | + `--enable-tx-size-search=1 --enable-filter-intra=1 --min-partition-size=8`) | |
| 73 | + returned `skip_split_tx_hits == 0` every time. Widths with a partial right | |
| 74 | + column (200, 264, 136, 776, 1288) additionally hit the existing named refusal | |
| 75 | + "a 16x16 block whose true edge cuts through both axes", so the charter's | |
| 76 | + 200x72 / 72x200 / 136x104 / 264x136 shapes cannot be compared at all today. | |
| 77 | +2. WIDENED `a_real_aomenc_stream_whose_frame_edge_partition_bit_is_horz_decodes_pixel_exact`: | |
| 78 | + three more partial-bottom-row shapes (200x72, 136x88, 264x104 — 2/4/6 mi rows) | |
| 79 | + and an `--enable-tx-size-search=1` arm. The whole recipe ran with | |
| 80 | + `--enable-tx-size-search=0`, so no block in it could carry a nonzero | |
| 81 | + `tx_depth` at all (class `tool-disabled-in-every-gate`) — that is why 8 green | |
| 82 | + arms never saw this defect. 18 arms compared pixel-exact, 10 named refusals | |
| 83 | + (all the double-axis 16x16 one), `edge_horz_total`/`edge_sub_total` still | |
| 84 | + hard-asserted; the `skip_split_tx` counter is reported, not gated, there. | |
| 85 | + | |
| 86 | +## 24-key-frame census (1 frame each, ours vs ffmpeg 10-bit, differing BYTES) | |
| 87 | + | |
| 88 | +r2: 11/24 exact, four multi-million-byte rows. r3: 17/24 exact, **luma exact on | |
| 89 | +all 24**, every remaining row chroma-only. | |
| 90 | + | |
| 91 | +| -ss | Y | U | V | r2 total | | |
| 92 | +|---|---|---|---|---| | |
| 93 | +| 0,300,600,1200,1500,1800,2400,3000,3300,3600,4200,4500,5100,5400,5700,6900 | 0 | 0 | 0 | 4 of these were 16.6M/48771/42343/39971/16375 | | |
| 94 | +| 900 | 0 | 40 | 50980 | 14057191 | | |
| 95 | +| 2100 | 0 | 1289 | 1067 | 15148697 | | |
| 96 | +| 2700 | 0 | 231 | 739 | 7726168 | | |
| 97 | +| 3900 | 0 | 4 | 4 | 7554023 | | |
| 98 | +| 4800 | 0 | 29 | 5 | 34 | | |
| 99 | +| 6000 | 0 | 210 | 0 | 15449720 | | |
| 100 | +| 6300 | 0 | 4 | 0 | 15410664 | | |
| 101 | +| 6600 | 0 | 124 | 124 | 15180826 | | |
| 102 | + | |
| 103 | +The four charter segments (600/2400/3300/5700) are all 0/0/0. | |
| 104 | + | |
| 105 | +## EVIDENCE | |
| 106 | + | |
| 107 | +EVIDENCE: /home/user/.cache/kf1200-tmp/a600s.part + o600s.trace | aomdec EC_TRACE=1 EC_TRACE_MODE_STEP=1 vs our EC_AV1_TRACE=1 EC_TRACE_MODE_STEP=1 on the pinned 1-frame stream | first differing element mi(400,46) tx_depth ctx 2 vs 1, rng 54191 vs 42998; after the fix ours reads ctx=1 rng=42998 | |
| 108 | +EVIDENCE: /home/user/.cache/kf1200-tmp/ours600.yuv vs ref600.yuv | EC_PROBE_OUT16 decode vs `ffmpeg -pix_fmt yuv420p10le` | cmp -l = 0 differing bytes of 18524160 (was 48771) | |
| 109 | +EVIDENCE: /home/user/.cache/kf1200-census-r3.log | 24 key frames extracted with `-frames:v 1 -c:v copy`, per-plane byte diff vs ffmpeg | 17/24 all-zero, luma zero on 24/24 | |
| 110 | +EVIDENCE: cargo test -p ec-av1 --lib a_real_aomenc_stream_whose_frame_edge_partition_bit_is_horz -- --nocapture | 7 shapes x 2 tx arms x 2 depths | 18 arms pixel-exact, 10 named refusals, edge bits 64-level horz/vert up to 3, sub-level up to 9 | |
| 111 | +EVIDENCE: cargo test -p ec-av1 --lib the_reelb_ss600_key_frame -- --nocapture | pinned fixture decode vs ffmpeg 10-bit | "24 skipped 8x8 TX_4X4 leaves, frame pixel-exact" | |
| 112 | + | |
| 113 | +## Suite | |
| 114 | + | |
| 115 | +`cargo test -p ec-av1 --lib` (systemd unit, EC_AV1_REQUIRE_AOMENC=1): **379 passed, 0 failed, | |
| 116 | +33 ignored**, 514.26 s — `/home/user/.cache/kf1200-suite-r3.log`. | |
| 117 | + | |
| 118 | +## Residue | |
| 119 | + | |
| 120 | +- deferred(-ss 4800, U=29/V=5): chroma-only, 8x4 chroma patch at (540,1200) — | |
| 121 | + unchanged by this round, still the r2 pair-mi sibling hypothesis. Unblocked by | |
| 122 | + an `EC_IMODE_VAL`/`EC_PRED` ladder at luma mi ~(270,600); I ran out of turn | |
| 123 | + budget after the census. Same for the other six chroma-only rows (900 V=50980 | |
| 124 | + is the largest and the only one big enough to be a second desync rather than a | |
| 125 | + prediction/edge-filter off-by-one). | |
| 126 | +- accepted: the charter's partial-RIGHT-column gate shapes (200x72 etc.) cannot | |
| 127 | + be compared until the "16x16 block whose true edge cuts through both axes" | |
| 128 | + refusal is lifted; they are in the gate and currently take the refusal arm. | |
| 129 | +- No refusal was lifted this round; `refusal_inventory.rs` / `gate_coverage.rs` | |
| 130 | + untouched. |