diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index 55b33814..fd338598 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -512,7 +512,7 @@ mod tests { /// stays DC. Proves the CfL port this round added, not just DC-chroma /// decode: pixel-exact against ffmpeg's own decode, not just "decoded". #[test] - #[ignore = "r4: NOT the TX_64X64 corner-padding path (that path is proven pixel-exact by a_real_libaom_gradients_stream_decodes_pixel_exact, side=64/tx_side=32, real non-skip content) -- this stream's one block is TX32-on-side-32 (tx_side==side, the trivial no-padding branch), luma_set=TxbSet::Luma32, cfl=true. Independently cross-checked with a from-scratch Python spec-8.2.6 MSAC decoder against the raw tile bytes: partition_w32/skip/kf_y_mode/uv_mode_cfl/txb_skip_luma_32_q1/eob_pt_1024_luma_q1 all match our Rust decode's symbols bit-for-bit (partition=NONE, skip=false, y_mode=DC_PRED, uv_mode=DC_PRED, all_zero=false, eob group=5 i.e. eob in 9..=12) -- so the desync (if any) is not in decode_block's mode/uv_mode reads nor in read_eob's group symbol. dq_denom(32*32=1024)=2 and dq_denom(64*64=4096)=4 both match spec 7.12.3 and both are covered by the passing the_inverse_network_is_an_orthonormal_dct_over_eight unit test. Remaining candidates, unverified this round: (a) the base/base_eob/br coefficient-level symbols past eob group (not traced), (b) TxbSet::Luma32's coefficient CDF tables specifically at q-context 1 (only skip/eob_pt were cross-checked, not base/br), (c) the ffmpeg reference decode itself for a 32x32-only frame (possible harness mismatch, unverified). r5 should extend the python cross-check through the full coefficient loop (base/base_eob/br/dc_sign) using the q1 tables, and/or dump ffmpeg's own frame_size/superres fields for this specific OBU to rule out (c)"] + #[ignore = "r5: harness ruled OUT as the cause -- ffprobe/the raw yuv size confirm the pinned/regenerated stream really is 32x32 (1536-byte yuv420p frame), and this test already compared at 32x32; scratch_isolate_pinned_mismatch's separate 64x64 hardcode was a real bug (fixed this round) but was never what this gate test's own failure came from. CDF tables ruled OUT: TXB_SKIP_LUMA_32_Q1, EOB_PT_1024_LUMA_Q1, EOB_EXTRA_LUMA_32_Q1, COEFF_BASE_LUMA_32_Q1 (all 42 rows), COEFF_BASE_EOB_LUMA_32_Q1, COEFF_BR_LUMA_32_Q1 (all 21 rows) and DC_SIGN_LUMA (q-context-invariant in libaom itself) all diffed byte-for-byte against /tmp/libaom-src/av1/common/token_cdfs.h at q_ctx=1, tx=TX_32X32, plane=luma -- exact matches, zero mismatches. Context arithmetic ruled OUT algorithmically: this crate's base_ctx/br_ctx/eob_coeff_ctx and NZ_MAP_CTX_OFFSET_32 were hand-verified line-by-line against libaom's get_nz_mag/get_br_ctx/get_lower_levels_ctx_eob/get_nz_map_ctx_from_stats (av1/common/txb_common.h) for the square (TX_CLASS_2D, width==height) case this decoder's shapes always use -- offset table's row+col<2/<4/else bands (1/6/21) match the table's own generation-algorithm comment exactly. A live trace (EC_AV1_TRACE temp instrumentation, stripped before commit) found: (1) this run's block decodes uv_mode=DC_PRED, not UV_CFL_PRED -- libaom cpu-used 8's mode search is the already-documented run-to-run nondeterminism (dead-end: 'libaom-av1 cpu-used 8 mode decisions are NOT stable'), so this fixture does not reliably exercise real CfL chroma and the CfL judgement task is BLOCKED on a deterministic CfL-selecting fixture, not on this bug; (2) the luma mismatch is present regardless (uv_mode is DC_PRED here, cfl is irrelevant to luma), and the decoded coefficient grid at eob=15 has real energy only in frequency row 0 (levels[0][0..4]=[-2,-2,-2,0,1], every other row in the 32x32 grid all zero) which, run through the (separately gradient-proven-exact) 2D inverse transform, mathematically produces exactly the observed row-invariant/column-varying pixel pattern -- so the defect is a genuine wrong-symbol decode inside read_coeffs's base/br loop for a TxbSet::Luma32 BLOCK-granularity (32x32 quadrant of a split 64x64 SB, not a whole-SB TxbSet::Luma64 transform) transform block, a shape a_real_libaom_gradients_stream_decodes_pixel_exact's whole-SB Luma64 path never exercises. r6 should extend the python cross-check (scratchpad msac.py has the CDF_TOP/EC_PROB_SHIFT MSAC core already) symbol-by-symbol through read_coeffs's base/base_eob/br/dc_sign/golomb reads against a freshly-dumped tile-byte hex for THIS block, comparing context index and decoded value at every step against a temporary Rust trace, to find the first index where context or value disagrees -- the earlier r4 python check (parse.py/msac.py) only verified up to the eob-group symbol, never entered the base/br loop this bug lives in."] fn a_real_libaom_cfl_stream_decodes_pixel_exact() { if !have_ffmpeg() { eprintln!("SKIP a_real_libaom_cfl_stream_decodes_pixel_exact: no ffmpeg"); @@ -562,8 +562,8 @@ mod tests { } } } - let width = 64; - let height = 64; + let width = 32; + let height = 32; let frames = decode_stream(&stream).expect("our decode"); let ffmpeg_frames = ffmpeg_decode_sequence(&stream, width, height, 1); let ours = &frames[0];