Merge branch 'lane-vartxsplit' (b1cc1c8): rect var-tx leaf gate re-recipe'd against aomdec (cq 44/46 product texture) with a pixel-compared firing assert
Browse files at this commit4 changed files +249 -28
- crates/ec-av1/src/decode.rs +13 -1
- crates/ec-av1/src/stream.rs +57 -27
- lanes/vartxsplit-r1.handoff.md +57 -0
- lanes/vartxsplit-r2.report.md +122 -0
crates/ec-av1/src/decode.rsmodified+13 -1
| @@ -1107,6 +1107,9 @@ pub(crate) fn vartx_rect_leaf4_hits() -> [usize; 2] { | |||
| 1107 | 1107 | ||
| 1108 | /// Records one rectangular var-tx leaf. | 1108 | /// Records one rectangular var-tx leaf. |
| 1109 | fn vartx_rect_leaf_hit(tw: usize, th: usize) { | 1109 | fn vartx_rect_leaf_hit(tw: usize, th: usize) { |
| 1110 | + if std::env::var_os("EC_VARTXLEAF").is_some() { | ||
| 1111 | + eprintln!("EC_VARTXLEAF tw={tw} th={th}"); | ||
| 1112 | + } | ||
| 1110 | let cell = if tw.min(th) == 4 { &VARTX_RECT_LEAF4_HITS } else { &VARTX_RECT_LEAF_HITS }; | 1113 | let cell = if tw.min(th) == 4 { &VARTX_RECT_LEAF4_HITS } else { &VARTX_RECT_LEAF_HITS }; |
| 1111 | cell.with(|c| { | 1114 | cell.with(|c| { |
| 1112 | let mut h = c.get(); | 1115 | let mut h = c.get(); |
| @@ -4338,7 +4341,7 @@ fn read_coeffs_rect( | |||
| 4338 | }; | 4341 | }; |
| 4339 | if rect_trace { | 4342 | if rect_trace { |
| 4340 | let (rng, _) = dec.debug_state(); | 4343 | let (rng, _) = dec.debug_state(); |
| 4341 | - eprintln!("EC_COEFF_STEP tag=sign_rect pos={pos} sign={} rng={rng}", u8::from(negative)); | 4344 | + eprintln!("EC_COEFF_STEP tag=sign_rect pos={pos} sign={} dcctx={sign_ctx} rng={rng}", u8::from(negative)); |
| 4342 | } | 4345 | } |
| 4343 | let level = if level.abs_diff(0) as i32 > MAX_BR_LEVEL { | 4346 | let level = if level.abs_diff(0) as i32 > MAX_BR_LEVEL { |
| 4344 | let g = read_golomb(dec)?; | 4347 | let g = read_golomb(dec)?; |
| @@ -5398,6 +5401,15 @@ impl Neighbours { | |||
| 5398 | left_coded |= left.level != 0; | 5401 | left_coded |= left.level != 0; |
| 5399 | vote += dc_vote(left.dc); | 5402 | vote += dc_vote(left.dc); |
| 5400 | } | 5403 | } |
| 5404 | + if plane == 0 && std::env::var_os("EC_DCDUMP").is_some() { | ||
| 5405 | + let ab: Vec<String> = (0..w_mi) | ||
| 5406 | + .map(|k| format!("{:?}/{}", self.above[mi_c + k][0].dc, self.above[mi_c + k][0].level)) | ||
| 5407 | + .collect(); | ||
| 5408 | + let lf: Vec<String> = (0..h_mi) | ||
| 5409 | + .map(|k| format!("{:?}/{}", self.left[mi_r + k][0].dc, self.left[mi_r + k][0].level)) | ||
| 5410 | + .collect(); | ||
| 5411 | + eprintln!("EC_DCDUMP mi=({mi_r},{mi_c}) wh=({w},{h}) vote={vote} above=[{}] left=[{}]", ab.join(","), lf.join(",")); | ||
| 5412 | + } | ||
| 5401 | (above_coded, left_coded, vote) | 5413 | (above_coded, left_coded, vote) |
| 5402 | }) | 5414 | }) |
| 5403 | } | 5415 | } |
crates/ec-av1/src/stream.rsmodified+57 -27
| @@ -8797,8 +8797,18 @@ mod tests { | |||
| 8797 | let (width, height) = | 8797 | let (width, height) = |
| 8798 | if firing { (384usize, 256usize) } else { (192usize, 128usize) }; | 8798 | if firing { (384usize, 256usize) } else { (192usize, 128usize) }; |
| 8799 | let vertical = attempt % 2 == 1; | 8799 | let vertical = attempt % 2 == 1; |
| 8800 | + // lane-vartxsplit r2, MEASURED against the oracle | ||
| 8801 | + // (`EC_VARTX` histogram, ~40 aomenc runs): at cq 10 this | ||
| 8802 | + // source splits NO rectangular transform at all -- aomdec | ||
| 8803 | + // reads only TX_8X8/TX_16X16/TX_8X16/TX_16X8 split symbols, | ||
| 8804 | + // so the leaves gaterecipe r1 counted here came out of a | ||
| 8805 | + // stream our decoder was already desynced on (class | ||
| 8806 | + // counter-from-refused-stream). cq 44 and 46 are the two | ||
| 8807 | + // quantisers of that sweep whose stream really carries | ||
| 8808 | + // `TX_32X8`/`TX_8X32` splits (16x8 and 8x16 rectangular | ||
| 8809 | + // var-tx leaves) AND decodes pixel-exact on all six frames. | ||
| 8800 | let cq = if firing { | 8810 | let cq = if firing { |
| 8801 | - 10 | 8811 | + if attempt == 16 { 44 } else { 46 } |
| 8802 | } else { | 8812 | } else { |
| 8803 | [30, 36, 44, 52][(attempt / 2 % 4) as usize] | 8813 | [30, 36, 44, 52][(attempt / 2 % 4) as usize] |
| 8804 | }; | 8814 | }; |
| @@ -8823,9 +8833,17 @@ mod tests { | |||
| 8823 | // the RD case for `txfm_partition`. | 8833 | // the RD case for `txfm_partition`. |
| 8824 | "128+90*sin((X+N*3)/6)*sin(Y/2)+50*sin((X*Y)/37)".to_string() | 8834 | "128+90*sin((X+N*3)/6)*sin(Y/2)+50*sin((X*Y)/37)".to_string() |
| 8825 | } else if firing { | 8835 | } else if firing { |
| 8826 | - // The transposed twin (a one-sided gate could never | 8836 | + // lane-vartxsplit r2: BOTH leaf orientations come out of |
| 8827 | - // separate 32x16 from 16x32). | 8837 | + // this one source (three 16x8 leaves and one 8x16 on |
| 8828 | - "128+90*sin((Y+N*3)/6)*sin(X/2)+50*sin((X*Y)/37)".to_string() | 8838 | + // attempt 16), so the firing pair is the same texture at |
| 8839 | + // two quantisers. Its transposed twin was measured over | ||
| 8840 | + // cq 40..56 and splits no rectangular transform at all; | ||
| 8841 | + // at cq 56 it also mismatches ffmpeg from decode-order | ||
| 8842 | + // frame 2 with ZERO rect var-tx leaves in it -- an open | ||
| 8843 | + // reconstruction defect (8-pixel-wide luma column, see | ||
| 8844 | + // lanes/vartxsplit-r2.report.md), not something to hide | ||
| 8845 | + // inside this gate's attempt list. | ||
| 8846 | + "128+90*sin((X+N*3)/6)*sin(Y/2)+50*sin((X*Y)/37)".to_string() | ||
| 8829 | } else if vertical { | 8847 | } else if vertical { |
| 8830 | format!( | 8848 | format!( |
| 8831 | "128+60*sin((Y+N*({sp}+9*mod(floor(X/16),2)))/7)+25*sin(X/11)" | 8849 | "128+60*sin((Y+N*({sp}+9*mod(floor(X/16),2)))/7)+25*sin(X/11)" |
| @@ -8979,24 +8997,27 @@ mod tests { | |||
| 8979 | compared + out_of_scope > 0, | 8997 | compared + out_of_scope > 0, |
| 8980 | "{NAME} ({bit_depth}-bit): every attempt refused -- the gate compared no pixels" | 8998 | "{NAME} ({bit_depth}-bit): every attempt refused -- the gate compared no pixels" |
| 8981 | ); | 8999 | ); |
| 8982 | - // The firing half. MEASURED on the merged tree (lane-r14 r4, ~70 | 9000 | + // The firing half. lane-vartxsplit r2 re-measured it against |
| 8983 | - // aomenc runs): the 8-bit 384x256 banded recipe codes BOTH | 9001 | + // the oracle: attempts 16/17 (384x256 product texture, cq 44/46, |
| 8984 | - // orientations of the split -- cq 38 gives four 32x16 leaves (out | 9002 | + // `--min-partition-size=8 --enable-tx-size-search=1`) are the only |
| 8985 | - // of four 64x16 strips), cq 32 one 16x32 leaf (out of four 16x64 | 9003 | + // recipes of a ~40-run sweep whose stream carries `TX_32X8` / |
| 8986 | - // strips). Those two streams stop LATER on another lane's live | 9004 | + // `TX_8X32` split symbols, i.e. RECTANGULAR var-tx leaves (16x8 |
| 8987 | - // refusal ("an inter 16x16-level AB or 1:4 partition", "a non-skip | 9005 | + // and 8x16, both orientations out of the same stream). They now |
| 8988 | - // rectangular (HORZ/VERT/HORZ_B) strip needs rectangular residual | 9006 | + // decode PIXEL-EXACT on all six frames, so the assert is on the |
| 8989 | - // coding"), so the leaves are proved DECODED, not proved | 9007 | + // pixel-compared tally, not on the "decoded anywhere" one -- |
| 8990 | - // pixel-exact; every attempt that ran to the end is compared | 9008 | + // `fired_*` stays only to separate a refused stream's leaves from |
| 8991 | - // frame by frame above. At 10 bits the same sweep fires nothing | 9009 | + // a proved one (class counter-from-refused-stream). At 10 bits |
| 8992 | - // (aomenc picks other shapes), so the firing assert is 8-bit only | 9010 | + // the same sweep either fires nothing or mismatches on a |
| 8993 | - // -- and it is a hard assert, never a print. | 9011 | + // reconstruction defect of another shape (report), so the firing |
| 9012 | + // assert stays 8-bit -- and it is a hard assert, never a print. | ||
| 8994 | if bit_depth == 8 { | 9013 | if bit_depth == 8 { |
| 8995 | assert!( | 9014 | assert!( |
| 8996 | - fired_32x16 > 0 && fired_16x32 > 0, | 9015 | + leaf_32x16 > 0 && leaf_16x32 > 0, |
| 8997 | - "{NAME}: the rectangular var-tx leaf arm never fired (32x16={fired_32x16}, \ | 9016 | + "{NAME}: the rectangular var-tx leaf arm never fired on a pixel-exact \ |
| 8998 | - 16x32={fired_16x32}, {named_refusals} refusals, {compared} compared) -- \ | 9017 | + attempt (pixel-compared 32x16={leaf_32x16}, 16x32={leaf_16x32}, decoded \ |
| 8999 | - `sub_tx_size_map[TX_64X16] == TX_32X16` is unproved by this gate" | 9018 | + anywhere 32x16={fired_32x16} 16x32={fired_16x32}, {named_refusals} \ |
| 9019 | + refusals, {compared} compared) -- the rectangular sub-transform path is \ | ||
| 9020 | + unproved by this gate" | ||
| 9000 | ); | 9021 | ); |
| 9001 | } | 9022 | } |
| 9002 | } | 9023 | } |
| @@ -11125,13 +11146,22 @@ mod tests { | |||
| 11125 | // this shape ever makes aomenc split a 16x4/4x16 strip's transform -- | 11146 | // this shape ever makes aomenc split a 16x4/4x16 strip's transform -- |
| 11126 | // an aomdec EC_TRACE_COEFF histogram of those streams carries whole | 11147 | // an aomdec EC_TRACE_COEFF histogram of those streams carries whole |
| 11127 | // TX_16X4/TX_4X16 units and no sub-transform. The one recipe that DOES | 11148 | // TX_16X4/TX_4X16 units and no sub-transform. The one recipe that DOES |
| 11128 | - // split it (384x256, `128+90*sin((X+N*3)/6)*sin(Y/2)+50*sin((X*Y)/37)`, | 11149 | + // split it (384x256 product texture, cq 10, --min-partition-size=8) |
| 11129 | - // cq 10, --min-partition-size=8 --max-partition-size=64 | 11150 | + // was RE-MEASURED by lane-vartxsplit r2 on the merged tree: that |
| 11130 | - // --enable-tx-size-search=1) fires 6 of these leaves and then | 11151 | + // stream now decodes PIXEL-EXACT on all six frames and fires ZERO |
| 11131 | - // MISMATCHES ffmpeg at decode-order frame 2 -- an open DECODE defect | 11152 | + // rectangular var-tx leaves of any size -- the "6 split-tx 8x4 leaves" |
| 11132 | - // handed off, not something to hide inside a passing gate. So the arm | 11153 | + // were counted out of an already-desynced decode (the desync is what |
| 11133 | - // is reported as unproven here instead of asserted on a stream nobody | 11154 | + // lane-sub8x4 fixed). r2 also swept THIS gate's own source family at |
| 11134 | - // has decoded exactly. | 11155 | + // cq 46/56/63 (12 streams, both orientations, both motion steps, |
| 11156 | + // --min-partition-size=4 --enable-tx-size-search=1): zero | ||
| 11157 | + // TX_16X4/TX_4X16 split symbols in aomdec's EC_VARTX histogram, all 12 | ||
| 11158 | + // pixel-exact. What does split a 16x4/4x16 transform is the product | ||
| 11159 | + // texture at --min-partition-size=4 (140 + 238 splits at cq 44), and | ||
| 11160 | + // every such stream either stops at a refusal our own desync raises or | ||
| 11161 | + // mismatches ffmpeg from decode-order frame 1 -- an open defect handed | ||
| 11162 | + // off in lanes/vartxsplit-r2.report.md. So the arm stays | ||
| 11163 | + // reported-unproven instead of asserted on a stream nobody has decoded | ||
| 11164 | + // exactly. | ||
| 11135 | eprintln!( | 11165 | eprintln!( |
| 11136 | "{NAME}: split-tx-8x4 arm unproven (arms {arms_total:?}) -- no recipe of this \ | 11166 | "{NAME}: split-tx-8x4 arm unproven (arms {arms_total:?}) -- no recipe of this \ |
| 11137 | sweep produces a split 16x4/4x16 transform; see lanes/gaterecipe-r1.report.md" | 11167 | sweep produces a split 16x4/4x16 transform; see lanes/gaterecipe-r1.report.md" |
lanes/vartxsplit-r1.handoff.mdadded+57 -0
| @@ -0,0 +1,57 @@ | |||
| 1 | +# lane-vartxsplit r1 — handoff (root cause FOUND and FIXED; gate work not done) | ||
| 2 | + | ||
| 3 | +## Pinned stream (reproducible: two runs, identical md5) | ||
| 4 | +`~/.cache/vartxsplit-tmp/s8.obu`, md5 `842355ef494455ead0352f62f84f2c56` | ||
| 5 | +(generator `~/.cache/vartxsplit-tmp/gen.sh`), 8-bit 384x256 6 frames @25, | ||
| 6 | +source `128+90*sin((X+N*3)/6)*sin(Y/2)+50*sin((X*Y)/37)`, oracle aomenc: | ||
| 7 | +`--codec=av1 --passes=1 --end-usage=q --cq-level=10 --cpu-used=0 --threads=1 --row-mt=0 | ||
| 8 | + --sb-size=64 --bit-depth=8 --input-bit-depth=8 --enable-restoration=0 --enable-palette=0 | ||
| 9 | + --deltaq-mode=0 --enable-filter-intra=0 --enable-cfl-intra=0 --enable-intrabc=0 | ||
| 10 | + --lag-in-frames=0 --kf-max-dist=9999 --tile-columns=0 --enable-tx-size-search=1 | ||
| 11 | + --enable-rect-partitions=1 --enable-ab-partitions=1 --enable-1to4-partitions=1 | ||
| 12 | + --min-partition-size=8 --max-partition-size=64 --obu` | ||
| 13 | +(gaterecipe r1's recipe 1; the 10-bit 16x32 twin was NOT re-measured this round.) | ||
| 14 | + | ||
| 15 | +## First diverging element (before the fix) | ||
| 16 | +Decode-order frame 2, luma, block mi(8,16) (8x16, TX_8X16), the FIRST DC-sign symbol | ||
| 17 | +of its plane-0 transform unit: | ||
| 18 | +- entry range 43680 in both decoders; | ||
| 19 | +- aomdec `EC_COEFF_STEP tag=sign c=0 sign=1 dcctx=0 rng=41828` | ||
| 20 | +- ours `EC_COEFF_STEP tag=sign_rect pos=0 sign=1 dcctx=1 rng=41148` | ||
| 21 | +i.e. same value, wrong CDF row: our DC-sign context was 1 (negative vote) where libaom's | ||
| 22 | +is 0. Everything before it — partitions, var-tx `txfm_split` ladder (1362 lines of frame 1 | ||
| 23 | +byte-identical; 92 lines of frame 2), coefficients — matched. | ||
| 24 | + | ||
| 25 | +## Root cause (fixed, decode.rs) | ||
| 26 | +`EC_DCDUMP mi=(8,16) wh=(8,16) vote=-2 above=[Some(true)/7,Some(false)/7] | ||
| 27 | +left=[None/0,None/0,Some(true)/7,Some(true)/7]`: the two left cells at mi rows 8-9 were | ||
| 28 | +EMPTY. They belong to the compound 8x8 leaf at mi(8,14) whose transform SPLIT into four | ||
| 29 | +4x4 TUs. `read_inter_luma8` returns an all-zero placeholder `luma_grid` in the split case | ||
| 30 | +because each 4x4 TU already wrote its own plane-0 state via `record_mi_luma`; the compound | ||
| 31 | +leaf arm then called `neighbours.record_mi(leaf_mi, 8, ...)`, which rewrites all three | ||
| 32 | +planes of those cells and erased the four per-TU cul_level/DC-sign records. The | ||
| 33 | +single-ref twin (`decode_leaf8`, decode.rs:25091) already had the `saved_luma_ctx` | ||
| 34 | +save/restore around exactly this call; the compound arm never got it (class: | ||
| 35 | +twin-functions-drift / mvstack-compound-tpl-extension). | ||
| 36 | + | ||
| 37 | +Fix: same save/restore around `record_mi` in the compound arm (decode.rs, the | ||
| 38 | +`neighbours.record_mi(leaf_mi, 8, ...)` at the end of the compound 8x8 leaf). | ||
| 39 | + | ||
| 40 | +## Result | ||
| 41 | +`dump_yuv s8.obu` vs `ffmpeg -pix_fmt yuv420p`: all 6 frames byte-identical | ||
| 42 | +(was: frames 2-5 differ, 91201 luma samples on frame 2). | ||
| 43 | + | ||
| 44 | +## NOT done (next steps, in order) | ||
| 45 | +1. Full suite (`systemd-run --user --unit=vartxsplit-suite-... cargo test -p ec-av1 --lib`). | ||
| 46 | +2. Re-measure the 10-bit 16x32 arm (gaterecipe recipe 2: gate A's flag set, | ||
| 47 | + `--enable-ab-partitions=0 --enable-dual-filter=0 --enable-obmc=0 --enable-tx64=1`, | ||
| 48 | + attempt 16/17) — it may be the same defect or a second one; recipe 1's compound leaf | ||
| 49 | + only exists because THIS recipe leaves `--enable-obmc`/dual-filter on. | ||
| 50 | +3. Turn the gate B `split-tx-8x4` arm (stream.rs ~11036, marked unproven by gaterecipe r1) | ||
| 51 | + back into a hard assert, and add the 10-bit 16x32 arm to | ||
| 52 | + `real_aomenc_1to4_streams_decode_pixel_exact_and_rect_vartx_leaves_fire_before_a_named_refusal`. | ||
| 53 | +4. refusal_inventory + gate_coverage untouched this round (no refusal lifted). | ||
| 54 | + | ||
| 55 | +## Instrumentation left in the tree (env-gated, cheap) | ||
| 56 | +- `EC_DCDUMP=1`: `around_mi_rect` prints per-cell above/left DC state + vote (plane 0). | ||
| 57 | +- `EC_TRACE_COEFF` rect sign line now carries `dcctx=`. | ||
lanes/vartxsplit-r2.report.mdadded+122 -0
| @@ -0,0 +1,122 @@ | |||
| 1 | +# lane-vartxsplit r2 — the 10-bit case was stale; the gate's firing recipe was vacuous | ||
| 2 | + | ||
| 3 | +Branch `lane-vartxsplit`, merged with main (beecb64) at `335ccdc` (the r1 compound-8x8 | ||
| 4 | +`saved_luma_ctx` fix landed independently on main via lane-sub8x4; the merge kept main's | ||
| 5 | +copy — same semantics, same call site). | ||
| 6 | + | ||
| 7 | +## (1) The 10-bit 16x32 case (gaterecipe recipe 2) — VERDICT: already fixed by the merge | ||
| 8 | + | ||
| 9 | +Streams (each hashed twice, identical): `~/.cache/vartxsplit-tmp/s10.obu` | ||
| 10 | +md5 `99980afd5945c61621d38c4e5c104db9`, transposed twin `s10v.obu` | ||
| 11 | +md5 `93890af7b420886beb5394bf30f6f805` (384x256, 6 frames @25, yuv420p10le, cq 10, | ||
| 12 | +gate A's flag set, `--min-partition-size=8 --max-partition-size=64`, generator | ||
| 13 | +`~/.cache/vartxsplit-tmp/gen10.sh` / `gen10v.sh`). | ||
| 14 | + | ||
| 15 | +- At `cba81e6` (pre-merge): `s10` differed from ffmpeg at decode-order frames 4-5, | ||
| 16 | + `s10v` at frames 2-5. | ||
| 17 | +- At `335ccdc` (post-merge): **all six frames of both streams are byte-identical to | ||
| 18 | + `ffmpeg -pix_fmt yuv420p10le`, Y/U/V** — no new fix was needed. The premise expired | ||
| 19 | + with lane-sub8x4 (class stale-premise-lanes). | ||
| 20 | +- The recipe also carries **no 16x32 var-tx leaf at all**: aomdec's `EC_VARTX` histogram | ||
| 21 | + of both streams reads only tx_size 1/2/7/8 split symbols — zero `TX_16X64`/`TX_64X16` | ||
| 22 | + (and zero `TX_8X32`/`TX_32X8`). The "46 16x32 leaves" gaterecipe r1 recorded were | ||
| 23 | + counted inside an already-desynced decode. | ||
| 24 | + | ||
| 25 | +EVIDENCE: ~/.cache/vartxsplit-tmp/s10.obu + s10v.obu | aomenc (twice, equal md5) -> dump_yuv -> ffmpeg yuv420p10le rawvideo compare, 6 frames x 3 planes | 12/12 frames byte-identical, oracle EC_VARTX 16x32/32x16 split symbols = 0 | ||
| 26 | + | ||
| 27 | +Same-shape sweep asked for in the charter (`record_mi` with a placeholder grid after a | ||
| 28 | +split): `grep -n "saved_luma_ctx"` in decode.rs shows both 8x8 leaf arms (single-ref | ||
| 29 | +`decode_leaf8` and the compound arm) now save/restore, and they are the only | ||
| 30 | +`record_mi(..., 8, ...)` call sites that follow a `split8` transform; the rect strip and | ||
| 31 | +sub8 rect2/split4 arms publish their own per-TU state and never rewrite a placeholder | ||
| 32 | +grid over it. | ||
| 33 | + | ||
| 34 | +## (2) Gate A — `real_aomenc_1to4_streams_..._rect_vartx_leaves_fire_before_a_named_refusal` | ||
| 35 | + | ||
| 36 | +RED on the merged tree with "leaves decoded anywhere 32x16=0 16x32=0". Root cause is the | ||
| 37 | +RECIPE, not a counter placement: the firing attempts' cq-10 stream contains **no | ||
| 38 | +rectangular sub-transform** (oracle `EC_VARTX`, above), so the counter is right and the | ||
| 39 | +old 21/15 reading came from a desynced decode (class counter-from-refused-stream, second | ||
| 40 | +instance in this gate). | ||
| 41 | + | ||
| 42 | +Re-measured (`~/.cache/vartxsplit-tmp/sweep2.sh`, `sweep3.sh`, ~40 aomenc runs; oracle | ||
| 43 | +histogram of tx_size 15/16/17/18 with val=1): the same product texture at **cq 44 and 46** | ||
| 44 | +is what splits a rectangular transform — `TX_32X8`/`TX_8X32` splits giving **16x8 and 8x16 | ||
| 45 | +rect var-tx leaves**, both orientations out of one stream — and both streams decode | ||
| 46 | +pixel-exact. So attempts 16/17 now run cq 44 / cq 46 on the horizontal source, and the | ||
| 47 | +firing assert was **strengthened**: it asserts the PIXEL-COMPARED tally | ||
| 48 | +(`leaf_32x16 > 0 && leaf_16x32 > 0`), not "decoded anywhere". | ||
| 49 | + | ||
| 50 | +EVIDENCE: ~/.cache/vartxsplit-tmp/p_44.obu, p_46.obu | aomenc -> EC_VARTXLEAF decode -> ffmpeg yuv420p compare | ours 3x 16x8 + 1x 8x16 leaves each, 6/6 frames exact (oracle: tx15/1=1 tx16/1=3 at cq 44) | ||
| 51 | + | ||
| 52 | +## (3) Gate B — the split-tx-8x4 arm stays reported-unproven (DEVIATION from the charter) | ||
| 53 | + | ||
| 54 | +The charter asked for a hard assert. It cannot be honest today, and this is measured, not | ||
| 55 | +assumed: | ||
| 56 | +- gate B's own source family never splits a 16x4/4x16 transform at ANY quantiser: 12 fresh | ||
| 57 | + streams (both orientations, both motion steps, cq 46/56/63, `--min-partition-size=4 | ||
| 58 | + --max-partition-size=16 --enable-tx-size-search=1`) carry **zero** TX_16X4/TX_4X16 split | ||
| 59 | + symbols in aomdec's `EC_VARTX` histogram, and all 12 decode pixel-exact; | ||
| 60 | +- the recipe gaterecipe r1 credited with 6 split-tx 8x4 leaves (`s8.obu`, md5 | ||
| 61 | + `842355ef494455ead0352f62f84f2c56`) now decodes **pixel-exact on all six frames with | ||
| 62 | + ZERO rect var-tx leaves** — those 6 were read out of the desync lane-sub8x4 fixed; | ||
| 63 | +- the product texture at `--min-partition-size=4` DOES split it heavily (140 TX_16X4 + | ||
| 64 | + 238 TX_4X16 at cq 44), but every one of those streams either raises a refusal our own | ||
| 65 | + desync produces ("an OBMC neighbour whose switchable interp filter…", "a Golomb tail | ||
| 66 | + longer than this decoder reads" — both with `--enable-obmc=0 --enable-dual-filter=0` on | ||
| 67 | + the command line, i.e. class refusal-from-own-desync) or mismatches ffmpeg from | ||
| 68 | + decode-order frame 1. | ||
| 69 | + | ||
| 70 | +EVIDENCE: ~/.cache/vartxsplit-tmp/sweep5.sh + sweep6.sh logs | 24 aomenc streams -> aomdec EC_VARTX histogram + our decode + ffmpeg compare | gate-B family 12/12 exact with 0 TX_16X4 splits; product-texture min-part-4 family 0/12 exact | ||
| 71 | + | ||
| 72 | +The gate's comment now carries this measurement instead of gaterecipe's stale one. | ||
| 73 | + | ||
| 74 | +## (4) Open defect handed off (not mine to close this round) | ||
| 75 | + | ||
| 76 | +384x256 product texture, `--min-partition-size=8 --max-partition-size=64`, transposed | ||
| 77 | +source at cq 56 (`pv_56.obu`) — 8-bit, mismatches ffmpeg from decode-order frame 2 with | ||
| 78 | +ZERO rect var-tx leaves. Triaged: | ||
| 79 | +- **entropy is EXACT**: the deduped msac range sequence of frames 0-2 vs instrumented | ||
| 80 | + aomdec has 243696 insertions (our extra `br` prints after `base_eob`) and **0 deletions** | ||
| 81 | + — we read exactly the symbols the reference wrote. It is a RECONSTRUCTION defect. | ||
| 82 | +- shape: luma columns **8..15** (one 8-pixel-wide strip), rows 124..224, 241 samples, | ||
| 83 | + delta -17..+2, plus one 8x4 chroma unit at (108,88) in both U and V, delta -16. | ||
| 84 | +The 10-bit twins behave the same way (`t10_46`, `t10v_48`, `t10v_52`: mismatch with zero | ||
| 85 | +rect leaves; `t10v_40` fires 2+2 leaves and mismatches only on frame 5). This is why no | ||
| 86 | +10-bit firing arm was added to gate A — deferred(the 8-wide-strip reconstruction defect | ||
| 87 | +above), it would make the gate's own `oos_mismatch` assert red. | ||
| 88 | + | ||
| 89 | +## Instrumentation added | ||
| 90 | +`EC_VARTXLEAF=1` (decode.rs `vartx_rect_leaf_hit`): prints `tw=`/`th=` per rectangular | ||
| 91 | +var-tx leaf — this is what separated "our counter moved" from "the recipe never coded the | ||
| 92 | +shape" in one run. | ||
| 93 | + | ||
| 94 | +## Gate + suite results (merged tree, `335ccdc` + this lane's two commits) | ||
| 95 | + | ||
| 96 | +``` | ||
| 97 | +real_aomenc_1to4_streams_decode_pixel_exact_and_rect_vartx_leaves_fire_before_a_named_refusal | ||
| 98 | + (8-bit): 0 named refusals, 2 pixel-exact attempts carrying the arm, | ||
| 99 | + pixel-compared rect var-tx leaves 32x16=6 16x32=2, leaves decoded anywhere 32x16=6 16x32=2, | ||
| 100 | + 16 attempts carried none (0 of them mismatched) | ||
| 101 | + (10-bit): 0 named refusals, ... 16 attempts carried none (0 of them mismatched) | ||
| 102 | +a_real_aomenc_inter_sequence_with_16x16_level_1to4_partitions_decodes_pixel_exact | ||
| 103 | + (8-bit): 0 named refusals, 2 pixel-exact attempts, per-arm | ||
| 104 | + HORZ_4/VERT_4/chroma-pair/sub8x8-chroma/split-tx-8x4=[1, 1, 2, 2, 0], 30 carried none (0 mismatched) | ||
| 105 | + split-tx-8x4 arm unproven (arms [1, 1, 2, 2, 0]) | ||
| 106 | +named gates + refusal_inventory + gate_coverage + sub8 + obmc: | ||
| 107 | + test result: ok. 26 passed; 0 failed; 0 ignored; 435 filtered out; 135.30s | ||
| 108 | +full suite: test result: ok. 424 passed; 0 failed; 37 ignored; 0 measured; 855.00s | ||
| 109 | +``` | ||
| 110 | + | ||
| 111 | +EVIDENCE: /home/user/.cache/vartxsplit-gates.log + /home/user/.cache/vartxsplit-suite.log | cargo test -p ec-av1 --lib (named gates, then whole lib, both as systemd user units) | 26/26 named green, suite 424 passed 0 failed 37 ignored | ||
| 112 | + | ||
| 113 | +## Residue | ||
| 114 | +- deferred: the 8-pixel-wide-column reconstruction defect (section 4) — entropy proved | ||
| 115 | + exact, so it is a prediction/filter-stage bug — unblocked by a lane that owns the | ||
| 116 | + 8xN inter reconstruction path; it is what keeps a 10-bit firing arm out of gate A. | ||
| 117 | +- deferred: the split-tx-8x4 hard assert — unblocked by that same defect (it is what | ||
| 118 | + makes every `--min-partition-size=4` product-texture stream red). | ||
| 119 | +- accepted: gate A's leaves are 16x8/8x16 (`TX_32X8`/`TX_8X32` splits), not the 32x16/16x32 | ||
| 120 | + its variable names say; no `TX_64X16`/`TX_16X64` split exists in any recipe measured in | ||
| 121 | + ~70 aomenc runs across r1+r2. The counter is one generic "rect var-tx leaf with both | ||
| 122 | + sides >= 8" pair; renaming it is churn this lane did not spend. | ||