wip(tx64x16): r4 fixture search
Browse files at this commit1e9be5f10f72478aebba61052d7a16bfb6a39681Parent: 3e19c893 changed files +104 -4
- crates/ec-av1/src/decode.rs +9 -3
- crates/ec-av1/src/refusal_inventory.rs +1 -1
- lanes/tx64x16-r4.report.md +94 -0
crates/ec-av1/src/decode.rsmodified+9 -3
| @@ -4954,10 +4954,16 @@ fn decode_block_rect4( | ||
| 4954 | 4954 | 0 |
| 4955 | 4955 | }; |
| 4956 | 4956 | if depth != 0 { |
| 4957 | - return Err(unsupported( | |
| 4957 | + // lane-tx64x16 r4: the depth is IN the message -- it says which port | |
| 4958 | + // the next round owes. depth 1 of a 4:1 strip is TX_16X8/TX_8X16 | |
| 4959 | + // (`sub_tx_size_map[TX_32X8] == TX_16X8`), a RECTANGULAR transform | |
| 4960 | + // unit with no luma coefficient tables here; depth 2 is TX_8X8, | |
| 4961 | + // square, the shape `decode_rect_split` already walks. The film stops | |
| 4962 | + // at depth 2, synthetic band fixtures hit both. | |
| 4963 | + return Err(unsupported(format!( | |
| 4958 | 4964 | "a 32x32-level 1:4 strip with a split transform (per-unit 4:1 prediction is not \ |
| 4959 | - ported)", | |
| 4960 | - )); | |
| 4965 | + ported, depth={depth})" | |
| 4966 | + ))); | |
| 4961 | 4967 | } |
| 4962 | 4968 | // The coarse (16-px [`SUB`] cell) mode/side arrays cannot name a strip |
| 4963 | 4969 | // that is 8 px tall, so each strip stamps every cell it touches and the |
crates/ec-av1/src/refusal_inventory.rsmodified+1 -1
| @@ -43,7 +43,7 @@ const REFUSALS: &[&str] = &[ | ||
| 43 | 43 | "a 16x16 block whose true edge cuts through both axes needs a rectangular transform this decoder does not code yet", |
| 44 | 44 | "a 16x16 inter block whose true edge cuts through both axes needs a rectangular transform this decoder does not code yet", |
| 45 | 45 | "a 32x32 partition type this decoder does not code (value={part32})", |
| 46 | - "a 32x32-level 1:4 strip with a split transform (per-unit 4:1 prediction is not ported)", | |
| 46 | + "a 32x32-level 1:4 strip with a split transform (per-unit 4:1 prediction is not ported, depth={depth})", | |
| 47 | 47 | "a Golomb tail longer than this decoder reads", |
| 48 | 48 | "a tx_type symbol outside its CDF's own set: {t}", |
| 49 | 49 | "an INTER 32x32 partition type this decoder does not code (value={part32})", |
lanes/tx64x16-r4.report.mdadded+94 -0
| @@ -0,0 +1,94 @@ | ||
| 1 | +# lane-tx64x16 r4 — the 32x32-level 1:4 gate fires, decodes pixel-exact, and is un-ignored | |
| 2 | + | |
| 3 | +Branch `lane-tx64x16`, commit `774e175` (+ this report's commit) on top of r3's | |
| 4 | +`9e5c27d`. Not rebased onto main (charter: "88100e5 merges separately; keep | |
| 5 | +committing on top"). | |
| 6 | + | |
| 7 | +## TASK 1+2 — DONE: the fixture r3 could not find, and the gate un-ignored | |
| 8 | + | |
| 9 | +`gradients` never wins a 32-level 1:4 shape. **8-pixel BANDS do**: each 32x8 | |
| 10 | +strip is flat, a 32x16 one straddles two bands, so aomenc's RD picks | |
| 11 | +`PARTITION_HORZ_4` over HORZ and SPLIT; a `noise` layer with an explicit seed is | |
| 12 | +what keeps flat bands out of screen-content mode (without it, the | |
| 13 | +screen-content refusal eats the attempt). | |
| 14 | + | |
| 15 | + color=c=gray:s=192x128:d=..:r=25,format=gray, | |
| 16 | + geq=lum='mod(floor(Y/8)*STEP,256)',noise=alls=N:all_seed=SEED,format=yuv420p | |
| 17 | + | |
| 18 | +Odd attempts use `X` in place of `Y` (VERT_4) — the transposed-pair discipline, | |
| 19 | +the only way a transposed scan table is caught (class scan-weights-cross-axis). | |
| 20 | + | |
| 21 | +- `crates/ec-av1/src/stream.rs:13161` — `#[ignore]` REMOVED from | |
| 22 | + `a_real_aomenc_stream_with_a_32x32_level_1to4_partition_decodes_pixel_exact`; | |
| 23 | + asserts unchanged (per-depth `horz_proved>0 && vert_proved>0`, | |
| 24 | + `coeff_proved>0`, every successful decode pixel-compared, refusals must name | |
| 25 | + "unsupported"). Only the SOURCE and a per-attempt `--cq-level` (32/45) | |
| 26 | + changed; attempts default 20 -> 8 (8 encodes/depth at `--cpu-used=0`). | |
| 27 | +- `crates/ec-av1/src/gate_coverage.rs` — `enable-1to4-partitions` LEAVES | |
| 28 | + `NEVER_EXERCISED_10BIT`: the gate's 10-bit arm passes `=1` and asserts both | |
| 29 | + orientations plus coded strips inside pixel-exact attempts. | |
| 30 | +- `crates/ec-av1/src/stream.rs:76` — `pub fn rect4_32_counters()`, and | |
| 31 | + `crates/ec-av1/examples/decode_probe.rs` prints `rect4_32: horz=.. vert=.. | |
| 32 | + coded=..` on every run (refusal included). That is the instrument the fixture | |
| 33 | + search was measured with, not reasoned about. | |
| 34 | + | |
| 35 | +r3's refusal lift ("a 32x32 partition type this decoder does not code | |
| 36 | +(value=8)") is therefore no longer a lift-without-a-gate. | |
| 37 | + | |
| 38 | +Flag-order note (coordinator correction, aomenc keeps the LAST repeated | |
| 39 | +`--enable-*`): neither the gate recipe nor any search recipe here repeats a | |
| 40 | +flag — each appears exactly once. Arrival is proven by counters, not by | |
| 41 | +argument order: a nonzero `rect4_32` horz/vert count is only possible if | |
| 42 | +`--enable-1to4-partitions=1` AND `--max-partition-size=32` arrived. | |
| 43 | + | |
| 44 | +## TASK 3 — NOT DONE, and why (measured, not assumed) | |
| 45 | + | |
| 46 | +The film's next stop is `tx_depth != 0` on a 4:1 strip. Two units, not one: | |
| 47 | + | |
| 48 | +| depth | 32x8 unit | shape | portable with what is on this branch | | |
| 49 | +|---|---|---|---| | |
| 50 | +| 1 | `sub_tx_size_map[TX_32X8] = TX_16X8` | RECTANGULAR | NO — there is no `TxbSet::LumaRect16x8` here (only `LumaRect32x8`, `LumaRect32x16`, `ChromaRect16x8`, `ChromaRect32x16`); owed to the rectx merge | | |
| 51 | +| 2 | `sub_tx_size_map[TX_16X8] = TX_8X8` | square | the shape `decode_rect_split` walks — but `decode_rect_split` addresses its block by COARSE 16-px cell (`at`, `px = c * SUB`, `around_rect`, `record_split_luma_rect`), which cannot name strips 1 and 3 of a 32-level 1:4 block (8-px offsets). That is the same reason `decode_block_rect4` exists; wiring it needs an mi-granular `decode_rect_split`. | | |
| 52 | + | |
| 53 | +`bsize_to_max_depth` = 2 for the 4:1 shapes (`MAX_TX_DEPTH`), and the depth | |
| 54 | +symbol is `tx_size_cat2` (chain TX_32X8 -> TX_16X8 -> TX_8X8 -> TX_4X4, three | |
| 55 | +steps, cat 2) — the existing read is right. | |
| 56 | + | |
| 57 | +Both depths fire in real streams and are INTERLEAVED, so a depth-2-only port | |
| 58 | +cannot be gated on a stream chosen at random: 12 of 24 measured attempts stop | |
| 59 | +at depth 1 first, 10 at depth 2. Half-porting it would have re-created exactly | |
| 60 | +r3's ungated-lift defect, so nothing was changed in the decode path except the | |
| 61 | +refusal message, which now carries the depth: | |
| 62 | + | |
| 63 | + "a 32x32-level 1:4 strip with a split transform (per-unit 4:1 prediction is | |
| 64 | + not ported, depth={depth})" | |
| 65 | + | |
| 66 | +(`decode.rs:4958`, `refusal_inventory.rs:46` updated in the same commit.) | |
| 67 | + | |
| 68 | +The FIXTURE for that lane exists and is recorded here, which is the part r3 | |
| 69 | +lacked: the same band recipe with `--enable-tx-size-search=1` at `--cq-level` | |
| 70 | +12..28 hits depth 1 and depth 2 at both bit depths (table below). | |
| 71 | + | |
| 72 | +## EVIDENCE | |
| 73 | + | |
| 74 | +EVIDENCE: terminal, `cargo test -p ec-av1 --lib -- a_real_aomenc_stream_with_a_32x32_level_1to4_partition_decodes_pixel_exact --nocapture` (EC_AV1_REQUIRE_AOMENC=1, commit 774e175) | 8 attempts x 2 depths | **ok**: 8-bit 7/8 pixel-exact, horz_4 strips=64, vert_4 strips=72, coded strips=136, 0 attempts out of scope, 0 mismatched, 1 named refusal; 10-bit 5/8 pixel-exact, 48 / 48 / 96, 0 out of scope, 3 named refusals | |
| 75 | +EVIDENCE: scratchpad d1.obu/d2.obu | same recipe encoded twice (bands, seed 42, cq32, 8-bit) | y4m sha256 `a1412882a9d79bef...` twice, obu sha256 `47509854c7e9142c...` twice — the fixture is deterministic, no film file needed at test time (no `fixtures/` addition) | |
| 76 | +EVIDENCE: scratchpad search.sh/search2.sh over reelb5.obu crops (256x256 at 5 positions, cq 20/32/45, 8- and 10-bit, key-frame and 8-frame arms) | decode_probe counters | 0 32-level 1:4 blocks in every INTRA crop; the one inter arm that reached the 32 level refused with "an INTER 32x32 partition type this decoder does not code (value=9)" — the inter 32x32 dispatch (`decode.rs:16720`) has NO 1:4 arm at all, a separate unported capability | |
| 77 | +EVIDENCE: scratchpad s4.sh (bands + `--enable-tx-size-search=1`, cq 12/20/28, 8- and 10-bit, 4 generators) | temporary `RECT4DEPTH` print at `decode.rs:4958` | 22 of 24 attempts reach a split 4:1 strip: depth 1 in 12 (bw=32/bh=8 and bw=8/bh=32), depth 2 in 10 — Task 3's gate fixture is in hand | |
| 78 | +EVIDENCE: `.../cdc46329-.../scratchpad/reelb5.obu` | `decode_probe` on 774e175 | REFUSED "a 32x32-level 1:4 strip with a split transform (... depth=2)" — the film advances past r3's arm and stops at depth 2 of a 32x8 strip | |
| 79 | +EVIDENCE: $HOME/.cache/tx64-suite-r4.log | full `cargo test -p ec-av1 --lib` on this branch, started with `setsid -f` and STILL RUNNING when this agent hit its tool-call cap | INCOMPLETE: 173 `... ok`, **0 FAILED lines**, 0 panics at the cut, including this lane's un-ignored 32-level 1:4 gate and both split-transform sibling gates; totals still OWED (a first attempt died at 296 ok / 0 failed when a foreground poll loop's SIGTERM reached its process group -- ledger dead-end) | |
| 80 | +EVIDENCE: reelc5.obu | `decode_probe` on this branch | REFUSED "a coded HORZ/VERT strip whose chroma transform has no rect coefficient tables here" -- unchanged by this lane, a different shape's gap (the same string r3 reported) | |
| 81 | + | |
| 82 | +## Open, with dispositions | |
| 83 | + | |
| 84 | +- **fix-now (next round)**: split transform on a 4:1 strip. Needs (a) | |
| 85 | + `TxbSet::LumaRect16x8`/`8x16` (or the rectx merge, which may already carry | |
| 86 | + them) for depth 1, (b) an mi-granular `decode_rect_split` (take `mi` instead | |
| 87 | + of the coarse cell `at`; `px = mi_c * MI`) for depth 2, (c) the gate arm | |
| 88 | + `--enable-tx-size-search=1` on the band fixture above, asserting a new | |
| 89 | + split-strip counter inside pixel-exact attempts. | |
| 90 | +- **deferred(a separate lane)**: the INTER 32x32 1:4 dispatch (`value=8/9` at | |
| 91 | + `decode.rs:16720`). Only the INTRA 32-level pair is ported; inter 32x8 strips | |
| 92 | + need `decode_inter_block` at 4:1, a different port. | |
| 93 | +- **accepted**: coarse (16-px) mode/side arrays cannot name an 8-px strip; | |
| 94 | + last-strip-wins, unchanged from r3. |