R4 report -- merge with main + the 32x32 edge cross-product isolated to mi(16,32) picture 2
Browse files at this commit7e48ae368e17590910ad949483b881082c00cf68Parent: 121056b- docs
- r4 report -- merge with main + the 32x32 edge cross-product isolated to mi(16,32) picture 2
1 changed file +87 -0
- lanes/golomb-r4.report.md +87 -0
lanes/golomb-r4.report.mdadded+87 -0
| @@ -0,0 +1,87 @@ | |||
| 1 | +# lane-golomb r4 — merge with main, and the 32x32-frame-edge cross-product isolated (NOT fixed) | ||
| 2 | + | ||
| 3 | +## STEP 1 — merge (DONE, commit 17fc2a7 `Merge branch 'main' into lane-golomb`) | ||
| 4 | + | ||
| 5 | +`git merge main` (main b51719f) conflicted in 4 files; 14 hunks in `decode.rs`. | ||
| 6 | +Resolution (all by hand, no `cargo fmt`): | ||
| 7 | + | ||
| 8 | +* `crates/ec-av1/src/cdf.rs`, `crates/ec-av1/src/cdf_state.rs` — main's, whole. | ||
| 9 | +* `crates/ec-av1/src/decode.rs` | ||
| 10 | + * fi32x8 rows `(32,8)=>10 / (8,32)=>11` in `filter_intra_size_class`: main's. | ||
| 11 | + * `decode_rect_split`'s TU loop: main's rect `tx_w`/`tx_h` form, with golomb r3's | ||
| 12 | + TU-ORIGIN CLIP re-applied per axis inside it | ||
| 13 | + (`if tu_px >= y.true_width || tu_py >= y.true_height { continue; }`). | ||
| 14 | + * oddh's 16-level edge HORZ/VERT strip (replaces golomb's refusal): main's. | ||
| 15 | + * golomb's 6 edge-bit counter sites (`bump_edge32` / `bump_edge32_bit`) and the | ||
| 16 | + 64-level + 32-level SECOND-HALF guards: kept, re-applied on top of inter4's | ||
| 17 | + MI-unit `decode_inter_block` signature (`sub16_to_mi(...)`) at both inter | ||
| 18 | + SB-level HORZ (`edge32` slot 2) and VERT (slot 3) arms. | ||
| 19 | +* `lanes/golomb-r1.report.md` — lane's. | ||
| 20 | + | ||
| 21 | +`cargo check -p ec-av1` + `cargo test -p ec-av1 --lib --no-run`: clean. | ||
| 22 | + | ||
| 23 | +## STEP 2 — the cross-product: ISOLATED to one block, root cause NOT yet found | ||
| 24 | + | ||
| 25 | +Gate `a_real_aomenc_stream_with_a_32x32_frame_edge_rect_partition_decodes_pixel_exact` | ||
| 26 | +still FAILS on the merged tree, identically to merge-E's report: | ||
| 27 | +`192x80 cq59 frames=5 8-bit frame 1 plane Y: 90 pixels differ, first at row 61 col 174 | ||
| 28 | +(ours 175 vs ffmpeg 174) [edge32=[1, 35, 1, 0, 0, 18, 0, 0]]`. | ||
| 29 | + | ||
| 30 | +Stream reproduced standalone (md5 `48e1d78f31a4eb6a6ef5a67df9bd36fe`, 971 B): | ||
| 31 | +`ffmpeg -f lavfi -i "testsrc2=size=192x80:duration=0.2:rate=25,noise=alls=6:allf=t+u:all_seed=59" | ||
| 32 | + -pix_fmt yuv420p ... | aomenc <the gate's flags> --cq-level=59` (script in the handoff). | ||
| 33 | + | ||
| 34 | +### What the facts say (each with its command) | ||
| 35 | + | ||
| 36 | +1. **The first divergent picture is DECODE-order picture 2, not shown-frame 1.** | ||
| 37 | + `EC_AV1_PREFILT_DUMP` on both decoders, luma compared per picture: | ||
| 38 | + f0 0 diffs, f1 0, **f2 130**, f3 84, f4 110. The shown-frame-1 report is the | ||
| 39 | + propagated copy. (Class `gate-blind-to-hidden-frames` applies to the READING of | ||
| 40 | + the gate message, not to the gate.) | ||
| 41 | +2. **The wrong pixels are exactly one 16x16 block**: picture 2, rows 64..79 x | ||
| 42 | + cols 160..175 = mi(16,40), max |delta| 36 — a prediction-scale error, not rounding. | ||
| 43 | +3. **libaom decodes mi(16,40) as SPLIT into two 16x16 leaves in every picture** | ||
| 44 | + (`EC_TRACE=1 aomdec | grep 'mi_row=16 mi_col=40 bsize=9'` → `value=3` x6); | ||
| 45 | + **we decode a 32-wide HORZ strip there in picture 2 only** | ||
| 46 | + (`EC_AV1_COMPIDX_DUMP=1` → `mi_row=16 mi_col=40 bsize=32 mode=0 mv0=(-30,-20) | ||
| 47 | + mv1=(16,0) ref0=1 ref1=7`, where libaom has `mode=18 (NEAR_NEARMV) mv0=(-16,0)`). | ||
| 48 | + That is inter4's SB/32-level inter rect arm consuming golomb's frame-edge bit — | ||
| 49 | + a path neither parent could reach. | ||
| 50 | +4. **The edge bit is NOT the defect.** Instrumented pre-read state at the 32-level | ||
| 51 | + gathered read (temporary `DBG32PRE`, reverted): ctx = 2 (= libaom's 10 = bsl 2 * 4 + 2), | ||
| 52 | + CDF row and 2-entry gather identical in all 6 pictures, and the pre-read RANGE | ||
| 53 | + matches aomdec's `EC_PART ... rng=` in 11 of 12 reads. The one mismatch is | ||
| 54 | + picture 2 at mi(16,40): ours 39967, libaom 64226 — i.e. **we arrive at the bit | ||
| 55 | + already desynced**, and the wrong HORZ is the consequence. | ||
| 56 | +5. **The desync starts inside the 16x16 INTER block at mi(16,32), picture 2.** | ||
| 57 | + Range ladder (ours `EC_AV1_TELL`/`EC_TRACE_MODE` vs aomdec `EC_TRACE_MODE`): | ||
| 58 | + * mi(16,32) entry / post_is_inter: ours 52732 == libaom `EC_MODE ... rng=52732`. | ||
| 59 | + * libaom then reads compound NEAR_NEARMV `ref0=1 ref1=7 mv0=(0,0) stack=3` | ||
| 60 | + (`EC_MODE_MV rng=39839`, `EC_MODE_VAL rng=56231`) and leaves the block at 62618. | ||
| 61 | + * ours leaves the block at 35347 (`TELL ... label=block_end tell=232 range=35347`), | ||
| 62 | + having consumed ~1 bit: no `EC_MODE_VAL` (single-ref print) and no `EC_COMPIDX` | ||
| 63 | + line for that block at all. | ||
| 64 | + So we read FEWER symbols than libaom for a `skip=true`, `is_inter=true` compound | ||
| 65 | + block at the bottom frame edge. First divergent element: the symbol(s) after | ||
| 66 | + `intra_inter` in `decode_inter_block` at mi(16,32) (ref-frame / compound-mode | ||
| 67 | + group), picture 2. | ||
| 68 | +6. Coefficient ladders are otherwise identical (6426 aligned | ||
| 69 | + `EC_COEFF_STEP tag=base|sign|all_zero|eob|base_eob|after_bases|post_golomb` rng | ||
| 70 | + values, `diff` empty), so this is a LOCAL symbol-count divergence in one block | ||
| 71 | + that re-converges, not a whole-tile desync. | ||
| 72 | + | ||
| 73 | +EVIDENCE: /tmp/.../scratchpad/{ours,aom}.f0..f5 | `EC_AV1_PREFILT_DUMP` both decoders on g4.obu | first divergent picture = 2, diff box rows 64..79 x cols 160..175 (130 px, max 36) | ||
| 74 | +EVIDENCE: /tmp/.../scratchpad/{o,a}-cf.txt | `EC_TRACE_COEFF=1` both decoders, aligned tags | 6426 == 6426 lines, `diff` empty (entropy re-converges) | ||
| 75 | +EVIDENCE: /tmp/.../scratchpad/{ours,aom}-mode.txt + tell.txt | `EC_TRACE_MODE` / `EC_AV1_TELL` ours vs aomdec | mi(16,32) p2 entry 52732 == 52732, exit ours 35347 vs libaom 62618 | ||
| 76 | + | ||
| 77 | +## Status / disposition | ||
| 78 | + | ||
| 79 | +* merge: DONE and committed. | ||
| 80 | +* the 32x32-frame-edge cross-product: **OPEN — fix-now, next round**, isolated to | ||
| 81 | + the symbol group read after `intra_inter` for the compound block at mi(16,32) in | ||
| 82 | + picture 2. Not a golomb-side defect in the edge bit (fact 4). | ||
| 83 | +* verifier's r3 item (no `max_blocks_wide/high` clip on the INTER var-tx leaf loops | ||
| 84 | + at `decode.rs` ~14135 / ~14970, plus a 192x68 / 68x192 gate arm with a | ||
| 85 | + straddling-TU counter): **deferred — turn budget spent on the cross-product | ||
| 86 | + isolation above — unblocked by a fresh round; nothing about it is contradicted | ||
| 87 | + by this round's findings.** | ||