R1 handoff -- first diverging element, both root causes, cmp result
Browse files at this commitb72a9519a153cdfe934b0652fbe721c0b5480b03Parent: 52c91bc- docs
- r1 handoff -- first diverging element, both root causes, cmp result
1 changed file +72 -0
- lanes/vert46-r1.handoff.md +72 -0
lanes/vert46-r1.handoff.mdadded+72 -0
| @@ -0,0 +1,72 @@ | ||
| 1 | +# lane-vert46 r1 HANDOFF (tool-call cap) | |
| 2 | + | |
| 3 | +Tip: `ae16fec` on `lane-vert46` (base 103b66f = lane-sb128c r8). Two files | |
| 4 | +touched: `crates/ec-av1/src/decode.rs`, `crates/ec-av1/src/stream.rs`. | |
| 5 | + | |
| 6 | +## Stream | |
| 7 | + | |
| 8 | +192x256 8-bit `geq`-sinusoid source, `--sb-size=128 --min-partition-size=64 | |
| 9 | +--enable-rect-partitions=1 --enable-tx-size-search=0 --cq-level=55 | |
| 10 | +--cpu-used=0 --limit=5`, NO `--kf-max-dist=1`. Reproduced twice, md5 | |
| 11 | +`ccc3bafd6d1c42b1336a69e68482e54b`, identical to the r8 residue stream. | |
| 12 | +Recipe script: `$HOME/.cache/vert46-tmp/mk.sh`. mi 64x48 -> the RIGHT 128 | |
| 13 | +superblock column is partial (`mi_col + hbs == mi_cols`), so its 128 root | |
| 14 | +reads the gathered bit; frame 1 resolves it to PARTITION_VERT = one | |
| 15 | +BLOCK_64X128 inter block. | |
| 16 | + | |
| 17 | +## First diverging element (before the fix) | |
| 18 | + | |
| 19 | +Frame 1 (decode order), block mi(0,32) BLOCK_64X128, plane 1 (U), mu chunk 0, | |
| 20 | +32x32 chroma unit, the DC SIGN symbol: | |
| 21 | + | |
| 22 | + pre-symbol range 39712 (identical both sides) | |
| 23 | + aomdec dcctx=2, post-symbol range 41596 | |
| 24 | + ours ctx=1, post-symbol range 64592 | |
| 25 | + | |
| 26 | +Ours read the left neighbour band as the 128x128 block's mu-chunk (0,0) DC | |
| 27 | +(negative) where libaom reads its mu-chunk (0,16) DC (positive). | |
| 28 | + | |
| 29 | +After fixing that, the ladder's next divergence was the 128-root partition | |
| 30 | +symbol of the NEXT superblock: aomdec `EC_PART mi_row=32 mi_col=32 bsize=15 | |
| 31 | +ctx=19 rng=43152`, ours entered the 64 level at rng=35032 (ctx 16). | |
| 32 | + | |
| 33 | +## Root cause (two, same shape) | |
| 34 | + | |
| 35 | +1. `decode.rs` `decode_inter_block`, new `mu_chroma` flag + the per-unit | |
| 36 | + re-stamp loop before `record_inter_rect_mi` (~:20146): a block above 64 | |
| 37 | + codes its chroma as one 32x32 unit per 64x64 mu chunk and each unit stamps | |
| 38 | + its own DC sign/level (`record_mi_chroma`, libaom `av1_set_entropy_contexts` | |
| 39 | + inside `decode_reconstruct_tx`). The end-of-block record overwrote ALL of | |
| 40 | + them with `neighbour_state` of the assembled whole-block grid, i.e. with | |
| 41 | + the top-left unit's DC. Fix: collect the per-unit grids, re-stamp after the | |
| 42 | + block record, in mu-chunk order. | |
| 43 | +2. `decode.rs` `decode_inter_block` (~:20179): | |
| 44 | + `record_split_luma_rect_mi(at, side, side, ..)` stamped | |
| 45 | + `above_side`/`left_side` = 128 for a 64x128 var-tx block ("a var-tx block | |
| 46 | + is always square" stopped being true when the 128 root's HORZ/VERT arm | |
| 47 | + landed in sb128c r7). Fix: pass the block's own `write_w`/`write_h`. | |
| 48 | + | |
| 49 | +## cmp result (the only verification run) | |
| 50 | + | |
| 51 | +`EC_AV1_FINAL_DUMP` decode of the stream under | |
| 52 | +`systemd-run --user --scope -q -p MemoryMax=6G`, `cmp` per decode-order frame | |
| 53 | +against the instrumented aomdec's own `EC_AV1_FINAL_DUMP`: | |
| 54 | + | |
| 55 | + f0 same f1 same f2 same f3 same f4 same f5 same | |
| 56 | + | |
| 57 | +(before: f1/f2/f4/f5 differed, f1 at byte 12033, 36073 bytes.) | |
| 58 | +Counters on that decode: `sb128_rect: edge_vert=10 inter_64x128=9`. | |
| 59 | + | |
| 60 | +## What is left for the next agent | |
| 61 | + | |
| 62 | +- The full `cargo test -p ec-av1 --lib` suite was STARTED and then STOPPED by | |
| 63 | + the cap order; it has NOT been run to completion on this tip. Run it first. | |
| 64 | +- Gate arm 46 (smooth `geq` source) was added to | |
| 65 | + `a_real_aomenc_sb128_gathered_edge_horz_partition_decodes_pixel_exact` | |
| 66 | + (`stream.rs:~19005`) BEFORE the cap message and IS committed; it and the | |
| 67 | + sibling sb128 gates were run once, green: | |
| 68 | + arms 42..46 six decode-order frames pixel-exact each, arm 46 edge +20 / | |
| 69 | + inter 128-rect +18; `intra_rect_block` 5/5 arms exact. | |
| 70 | +- Oracle: `~/.cache/aom-oracle/src/av1/decoder/decodetxb.c` now prints | |
| 71 | + `dcctx=%d` on the `EC_COEFF_STEP tag=sign` line (env `EC_TRACE_COEFF`); | |
| 72 | + aomdec rebuilt with `ninja aomdec` (NOT `make`). Uncommitted, keep it. |