Merge branch 'lane-kf1200' (d44afba): second 10-bit key-frame fixture for the skipped-leaf transform grid
Browse files at this commit4 changed files +219 -4
- crates/ec-av1/fixtures/reelb_ss600_key_frame.obu +0 -0
- crates/ec-av1/src/decode.rs +13 -1
- crates/ec-av1/src/stream.rs +76 -3
- lanes/kf1200-r3.report.md +130 -0
crates/ec-av1/fixtures/reelb_ss600_key_frame.obuadded+0 -0
Binary file changed
crates/ec-av1/src/decode.rsmodified+13 -1
| @@ -2762,6 +2762,12 @@ const MAX_BR_LEVEL: i32 = NUM_BASE_LEVELS + COEFF_BASE_RANGE; | |||
| 2762 | const VERT_ALIKE: [usize; 6] = [2, PARTITION_SPLIT, 4, 6, 7, 9]; | 2762 | const VERT_ALIKE: [usize; 6] = [2, PARTITION_SPLIT, 4, 6, 7, 9]; |
| 2763 | const HORZ_ALIKE: [usize; 6] = [1, PARTITION_SPLIT, 4, 5, 6, 8]; | 2763 | const HORZ_ALIKE: [usize; 6] = [1, PARTITION_SPLIT, 4, 5, 6, 8]; |
| 2764 | 2764 | ||
| 2765 | +fn trace_edge(mi_r: usize, mi_c: usize, bsize: u32, ctx: usize, rng: u32) { | ||
| 2766 | + if std::env::var_os("EC_AV1_TRACE").is_some() { | ||
| 2767 | + eprintln!("OUR_PART mi_row={mi_r} mi_col={mi_c} bsize={bsize} ctx={ctx} rng={rng}"); | ||
| 2768 | + } | ||
| 2769 | +} | ||
| 2770 | + | ||
| 2765 | fn element_prob(cdf: &[u16], element: usize) -> u16 { | 2771 | fn element_prob(cdf: &[u16], element: usize) -> u16 { |
| 2766 | cdf[element] - if element > 0 { cdf[element - 1] } else { 0 } | 2772 | cdf[element] - if element > 0 { cdf[element - 1] } else { 0 } |
| 2767 | } | 2773 | } |
| @@ -13832,11 +13838,13 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( | |||
| 13832 | // the first block of that row. | 13838 | // the first block of that row. |
| 13833 | match (has_cols, has_rows) { | 13839 | match (has_cols, has_rows) { |
| 13834 | (true, false) => { | 13840 | (true, false) => { |
| 13841 | + trace_edge((sb_r * SB_MI) as usize, (sb_c * SB_MI) as usize, 12, ctx, dec.debug_state().0 as u32); | ||
| 13835 | let b = dec.symbol_fixed(&gather(&cdfs.partition_w64[ctx], VERT_ALIKE)); | 13842 | let b = dec.symbol_fixed(&gather(&cdfs.partition_w64[ctx], VERT_ALIKE)); |
| 13836 | bump_edge_part(b.min(1) as usize); | 13843 | bump_edge_part(b.min(1) as usize); |
| 13837 | if b == 1 { PARTITION_SPLIT } else { PARTITION_HORZ } | 13844 | if b == 1 { PARTITION_SPLIT } else { PARTITION_HORZ } |
| 13838 | } | 13845 | } |
| 13839 | (false, true) => { | 13846 | (false, true) => { |
| 13847 | + trace_edge((sb_r * SB_MI) as usize, (sb_c * SB_MI) as usize, 12, ctx, dec.debug_state().0 as u32); | ||
| 13840 | let b = dec.symbol_fixed(&gather(&cdfs.partition_w64[ctx], HORZ_ALIKE)); | 13848 | let b = dec.symbol_fixed(&gather(&cdfs.partition_w64[ctx], HORZ_ALIKE)); |
| 13841 | bump_edge_part(b.min(1) as usize); | 13849 | bump_edge_part(b.min(1) as usize); |
| 13842 | if b == 1 { PARTITION_SPLIT } else { PARTITION_VERT } | 13850 | if b == 1 { PARTITION_SPLIT } else { PARTITION_VERT } |
| @@ -13902,6 +13910,7 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( | |||
| 13902 | // superblock level above). | 13910 | // superblock level above). |
| 13903 | match (has_cols32, has_rows32) { | 13911 | match (has_cols32, has_rows32) { |
| 13904 | (true, false) => { | 13912 | (true, false) => { |
| 13913 | + trace_edge((r32 * BLOCK_MI) as usize, (c32 * BLOCK_MI) as usize, 9, ctx32, dec.debug_state().0 as u32); | ||
| 13905 | let b = dec.symbol_fixed(&gather( | 13914 | let b = dec.symbol_fixed(&gather( |
| 13906 | &cdfs.partition_w32[ctx32], | 13915 | &cdfs.partition_w32[ctx32], |
| 13907 | VERT_ALIKE, | 13916 | VERT_ALIKE, |
| @@ -13910,6 +13919,7 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( | |||
| 13910 | if b == 1 { PARTITION_SPLIT } else { PARTITION_HORZ } | 13919 | if b == 1 { PARTITION_SPLIT } else { PARTITION_HORZ } |
| 13911 | } | 13920 | } |
| 13912 | (false, true) => { | 13921 | (false, true) => { |
| 13922 | + trace_edge((r32 * BLOCK_MI) as usize, (c32 * BLOCK_MI) as usize, 9, ctx32, dec.debug_state().0 as u32); | ||
| 13913 | let b = dec.symbol_fixed(&gather( | 13923 | let b = dec.symbol_fixed(&gather( |
| 13914 | &cdfs.partition_w32[ctx32], | 13924 | &cdfs.partition_w32[ctx32], |
| 13915 | HORZ_ALIKE, | 13925 | HORZ_ALIKE, |
| @@ -14388,6 +14398,7 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( | |||
| 14388 | // This path can only walk the four SPLIT | 14398 | // This path can only walk the four SPLIT |
| 14389 | // leaves, so a 0 refuses by name instead | 14399 | // leaves, so a 0 refuses by name instead |
| 14390 | // of desyncing. | 14400 | // of desyncing. |
| 14401 | + trace_edge(sr * SUB_MI as usize, sc * SUB_MI as usize, 6, ctx16, dec.debug_state().0 as u32); | ||
| 14391 | let edge_split = if has_cols16 { | 14402 | let edge_split = if has_cols16 { |
| 14392 | dec.symbol_fixed(&gather( | 14403 | dec.symbol_fixed(&gather( |
| 14393 | &cdfs.partition_w16[ctx16], | 14404 | &cdfs.partition_w16[ctx16], |
| @@ -14468,10 +14479,11 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( | |||
| 14468 | } | 14479 | } |
| 14469 | } | 14480 | } |
| 14470 | let leaf_ctx = neighbours.partition_ctx_mi(leaf_mi, 8); | 14481 | let leaf_ctx = neighbours.partition_ctx_mi(leaf_mi, 8); |
| 14482 | + let pre8 = dec.debug_state().0; | ||
| 14471 | let part8 = dec.symbol(&mut cdfs.partition_w8[leaf_ctx]); | 14483 | let part8 = dec.symbol(&mut cdfs.partition_w8[leaf_ctx]); |
| 14472 | if std::env::var_os("EC_AV1_TRACE").is_some() { | 14484 | if std::env::var_os("EC_AV1_TRACE").is_some() { |
| 14473 | eprintln!( | 14485 | eprintln!( |
| 14474 | - "TRACE partition_w8 mi=({mr},{mc}) ctx={leaf_ctx} value={part8}" | 14486 | + "TRACE partition_w8 mi=({mr},{mc}) ctx={leaf_ctx} value={part8} pre_rng={pre8}" |
| 14475 | ); | 14487 | ); |
| 14476 | } | 14488 | } |
| 14477 | let leaf_mode = if part8 == PARTITION_NONE { | 14489 | let leaf_mode = if part8 == PARTITION_NONE { |
crates/ec-av1/src/stream.rsmodified+76 -3
| @@ -3667,6 +3667,50 @@ mod tests { | |||
| 3667 | assert_eq!(frames[0].y, ffmpeg_frames[0].y, "{NAME}: luma vs ffmpeg"); | 3667 | assert_eq!(frames[0].y, ffmpeg_frames[0].y, "{NAME}: luma vs ffmpeg"); |
| 3668 | } | 3668 | } |
| 3669 | 3669 | ||
| 3670 | + /// lane-kf1200 r3: the same film's `-ss 600` key frame (3840x1608, one | ||
| 3671 | + /// 8-px partial bottom superblock row), pinned because no aomenc recipe | ||
| 3672 | + /// reaches its shape -- a SKIPPED 8x8 intra leaf whose `tx_depth` resolved | ||
| 3673 | + /// to TX_4X4. (80 recipes swept this round: 4 frame shapes x 2 sources x | ||
| 3674 | + /// cq 32..63 x cpu-used 0/3 x 8/10-bit, all with | ||
| 3675 | + /// `--enable-tx-size-search=1 --enable-filter-intra=1`; every one came | ||
| 3676 | + /// back with `skip_split_tx_hits == 0`, `lanes/kf1200-r3.report.md`.) | ||
| 3677 | + /// An intra block reads `tx_depth` whether or not it is skipped, so the | ||
| 3678 | + /// leaf must record its resolved 4 -- not its 8x8 side -- in the txfm | ||
| 3679 | + /// context; recording 8 gave the NEXT block's `tx_depth` symbol the wrong | ||
| 3680 | + /// `tx_size_cdf` row (ctx 2 where libaom reads 1) and desynced the | ||
| 3681 | + /// entropy stream at mi (400,46). HARD-asserts `skip_split_tx_hits` moved. | ||
| 3682 | + #[test] | ||
| 3683 | + fn the_reelb_ss600_key_frame_skipped_split_tx_decodes_pixel_exact() { | ||
| 3684 | + const NAME: &str = "the_reelb_ss600_key_frame_skipped_split_tx_decodes_pixel_exact"; | ||
| 3685 | + if !have_ffmpeg() { | ||
| 3686 | + eprintln!("SKIP {NAME}: no ffmpeg"); | ||
| 3687 | + return; | ||
| 3688 | + } | ||
| 3689 | + let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) | ||
| 3690 | + .join("fixtures/reelb_ss600_key_frame.obu"); | ||
| 3691 | + let stream = std::fs::read(&path) | ||
| 3692 | + .unwrap_or_else(|e| panic!("{NAME}: reading {}: {e}", path.display())); | ||
| 3693 | + let (width, height) = (3840usize, 1608usize); | ||
| 3694 | + crate::decode::reset_skip_split_tx_hits(); | ||
| 3695 | + let frames = match decode_stream(&stream) { | ||
| 3696 | + Ok(frames) => frames, | ||
| 3697 | + Err(e) => panic!("{NAME}: decode_stream refused: {e}"), | ||
| 3698 | + }; | ||
| 3699 | + let skipped_split_tx = crate::decode::skip_split_tx_hits(); | ||
| 3700 | + assert!( | ||
| 3701 | + skipped_split_tx > 0, | ||
| 3702 | + "{NAME}: zero skipped 8x8 leaves with a split transform -- the fixture no longer \ | ||
| 3703 | + exercises the arm this test exists for" | ||
| 3704 | + ); | ||
| 3705 | + assert_eq!(frames.len(), 1, "{NAME}: one key frame"); | ||
| 3706 | + assert_eq!((frames[0].width, frames[0].height), (width, height)); | ||
| 3707 | + let ffmpeg_frames = ffmpeg_decode_sequence_10bit(&stream, width, height, 1); | ||
| 3708 | + assert_eq!(frames[0].y, ffmpeg_frames[0].y, "{NAME}: luma vs ffmpeg"); | ||
| 3709 | + assert_eq!(frames[0].u, ffmpeg_frames[0].u, "{NAME}: U vs ffmpeg"); | ||
| 3710 | + assert_eq!(frames[0].v, ffmpeg_frames[0].v, "{NAME}: V vs ffmpeg"); | ||
| 3711 | + eprintln!("{NAME}: {skipped_split_tx} skipped 8x8 TX_4X4 leaves, frame pixel-exact"); | ||
| 3712 | + } | ||
| 3713 | + | ||
| 3670 | /// lane-hbd10 r1: a real `aomenc --bit-depth=10 --superres-mode=1 | 3714 | /// lane-hbd10 r1: a real `aomenc --bit-depth=10 --superres-mode=1 |
| 3671 | /// --superres-denominator=12` key frame, decoded pixel-exact against | 3715 | /// --superres-denominator=12` key frame, decoded pixel-exact against |
| 3672 | /// ffmpeg's own 10-bit decode. Proves `superres::upscale_row`'s | 3716 | /// ffmpeg's own 10-bit decode. Proves `superres::upscale_row`'s |
| @@ -24392,16 +24436,29 @@ mod tests { | |||
| 24392 | let mut compared = 0usize; | 24436 | let mut compared = 0usize; |
| 24393 | let mut edge_horz_total = 0usize; | 24437 | let mut edge_horz_total = 0usize; |
| 24394 | let mut edge_sub_total = 0usize; | 24438 | let mut edge_sub_total = 0usize; |
| 24439 | + let mut skip_split_tx_total = 0usize; | ||
| 24395 | // The last two shapes are the ledger-measured 64-level pair: on a | 24440 | // The last two shapes are the ledger-measured 64-level pair: on a |
| 24396 | // flat band (192x80 / 80x192) real aomenc answers the bottom-edge | 24441 | // flat band (192x80 / 80x192) real aomenc answers the bottom-edge |
| 24397 | // superblock with the 64-level HORZ/VERT, which the 136 shapes above | 24442 | // superblock with the 64-level HORZ/VERT, which the 136 shapes above |
| 24398 | // never produce (their SBs always split down to the 32/16 levels). | 24443 | // never produce (their SBs always split down to the 32/16 levels). |
| 24444 | + // lane-kf1200 r3: the 2-/4-/6-mi partial bottom rows (h mod 64 == 8, | ||
| 24445 | + // 16, 24) with partial RIGHT columns as well (w mod 64 == 8), the | ||
| 24446 | + // geometry of the film key frames this lane chases. | ||
| 24399 | for (width, height, flat) in [ | 24447 | for (width, height, flat) in [ |
| 24400 | (192usize, 136usize, false), | 24448 | (192usize, 136usize, false), |
| 24401 | (136usize, 192usize, false), | 24449 | (136usize, 192usize, false), |
| 24402 | (192usize, 80usize, true), | 24450 | (192usize, 80usize, true), |
| 24403 | (80usize, 192usize, true), | 24451 | (80usize, 192usize, true), |
| 24452 | + (200usize, 72usize, false), | ||
| 24453 | + (136usize, 88usize, false), | ||
| 24454 | + (264usize, 104usize, false), | ||
| 24404 | ] { | 24455 | ] { |
| 24456 | + // lane-kf1200 r3 (class `tool-disabled-in-every-gate`): the whole | ||
| 24457 | + // recipe ran with `--enable-tx-size-search=0`, so no block ever | ||
| 24458 | + // carried a nonzero `tx_depth` and the SKIPPED 8x8 leaf that | ||
| 24459 | + // resolves to TX_4X4 -- whose txfm context this round fixed -- | ||
| 24460 | + // was unreachable by construction. The second arm turns it on. | ||
| 24461 | + for tx_search in [0usize, 1] { | ||
| 24405 | for depth in [8usize, 10] { | 24462 | for depth in [8usize, 10] { |
| 24406 | let pix = if depth == 10 { "yuv420p10le" } else { "yuv420p" }; | 24463 | let pix = if depth == 10 { "yuv420p10le" } else { "yuv420p" }; |
| 24407 | let y4m = Command::new("ffmpeg") | 24464 | let y4m = Command::new("ffmpeg") |
| @@ -24432,7 +24489,8 @@ mod tests { | |||
| 24432 | "--cpu-used=3", "--threads=1", "--row-mt=0", "--sb-size=64", | 24489 | "--cpu-used=3", "--threads=1", "--row-mt=0", "--sb-size=64", |
| 24433 | "--kf-max-dist=0", "--enable-rect-partitions=1", | 24490 | "--kf-max-dist=0", "--enable-rect-partitions=1", |
| 24434 | "--enable-ab-partitions=0", "--enable-1to4-partitions=0", | 24491 | "--enable-ab-partitions=0", "--enable-1to4-partitions=0", |
| 24435 | - "--enable-tx-size-search=0", "--reduced-tx-type-set=1", | 24492 | + &format!("--enable-tx-size-search={tx_search}"), |
| 24493 | + "--reduced-tx-type-set=1", | ||
| 24436 | "--min-partition-size=8", "--max-partition-size=64", | 24494 | "--min-partition-size=8", "--max-partition-size=64", |
| 24437 | &format!("--input-bit-depth={depth}"), | 24495 | &format!("--input-bit-depth={depth}"), |
| 24438 | &format!("--bit-depth={depth}"), | 24496 | &format!("--bit-depth={depth}"), |
| @@ -24464,6 +24522,7 @@ mod tests { | |||
| 24464 | "{NAME}: aomenc output is not reproducible ({width}x{height}, depth={depth})" | 24522 | "{NAME}: aomenc output is not reproducible ({width}x{height}, depth={depth})" |
| 24465 | ); | 24523 | ); |
| 24466 | crate::decode::reset_edge_part_hits(); | 24524 | crate::decode::reset_edge_part_hits(); |
| 24525 | + crate::decode::reset_skip_split_tx_hits(); | ||
| 24467 | let frames = match decode_stream(&stream) { | 24526 | let frames = match decode_stream(&stream) { |
| 24468 | Ok(frames) => frames, | 24527 | Ok(frames) => frames, |
| 24469 | Err(e) => { | 24528 | Err(e) => { |
| @@ -24479,6 +24538,7 @@ mod tests { | |||
| 24479 | } | 24538 | } |
| 24480 | }; | 24539 | }; |
| 24481 | let hits = crate::decode::edge_part_hits(); | 24540 | let hits = crate::decode::edge_part_hits(); |
| 24541 | + let skip_split_tx = crate::decode::skip_split_tx_hits(); | ||
| 24482 | let ffmpeg_frames = if depth == 10 { | 24542 | let ffmpeg_frames = if depth == 10 { |
| 24483 | ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()) | 24543 | ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()) |
| 24484 | } else { | 24544 | } else { |
| @@ -24504,13 +24564,16 @@ mod tests { | |||
| 24504 | compared += 1; | 24564 | compared += 1; |
| 24505 | edge_horz_total += hits[0]; | 24565 | edge_horz_total += hits[0]; |
| 24506 | edge_sub_total += hits[2]; | 24566 | edge_sub_total += hits[2]; |
| 24567 | + skip_split_tx_total += skip_split_tx; | ||
| 24507 | eprintln!( | 24568 | eprintln!( |
| 24508 | - "{NAME}: pixel-exact {width}x{height} at {depth}-bit, edge bits \ | 24569 | + "{NAME}: pixel-exact {width}x{height} at {depth}-bit tx_search={tx_search}, \ |
| 24509 | - 64-level horz/vert={} split={} sub-level horz/vert={} split={}", | 24570 | + edge bits 64-level horz/vert={} split={} sub-level horz/vert={} split={}, \ |
| 24571 | + skipped 8x8 leaves with TX_4X4 {skip_split_tx}", | ||
| 24510 | hits[0], hits[1], hits[2], hits[3] | 24572 | hits[0], hits[1], hits[2], hits[3] |
| 24511 | ); | 24573 | ); |
| 24512 | } | 24574 | } |
| 24513 | } | 24575 | } |
| 24576 | + } | ||
| 24514 | assert!( | 24577 | assert!( |
| 24515 | compared > 0, | 24578 | compared > 0, |
| 24516 | "{NAME}: every arm refused -- the gate compared no pixels at all" | 24579 | "{NAME}: every arm refused -- the gate compared no pixels at all" |
| @@ -24524,5 +24587,15 @@ mod tests { | |||
| 24524 | edge_sub_total > 0, | 24587 | edge_sub_total > 0, |
| 24525 | "{NAME}: no 32/16-level frame-edge bit was ever answered HORZ/VERT" | 24588 | "{NAME}: no 32/16-level frame-edge bit was ever answered HORZ/VERT" |
| 24526 | ); | 24589 | ); |
| 24590 | + // lane-kf1200 r3: the `--enable-tx-size-search=1` half of the window | ||
| 24591 | + // exists so a partial-row block can carry a nonzero `tx_depth` at all | ||
| 24592 | + // (the whole recipe ran with it OFF before -- class | ||
| 24593 | + // `tool-disabled-in-every-gate`). The SKIPPED 8x8 leaf that resolves | ||
| 24594 | + // to TX_4X4 -- whose txfm context this round fixed -- is NOT reachable | ||
| 24595 | + // from any synthetic source measured here (80 recipes, all zero), so | ||
| 24596 | + // that arm is asserted by the pinned film fixture | ||
| 24597 | + // `the_reelb_ss600_key_frame_skipped_split_tx_decodes_pixel_exact` | ||
| 24598 | + // instead; this counter is reported, not gated. | ||
| 24599 | + eprintln!("{NAME}: {skip_split_tx_total} skipped 8x8 TX_4X4 leaves across compared attempts"); | ||
| 24527 | } | 24600 | } |
| 24528 | } | 24601 | } |
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. | ||