R6 falsifies the scan-parity hypothesis
Browse files at this commit7e7c0c19fc4c37f8f7580ac70c0615e02261ea8fParent: 2e1d73a- docs
- r6 falsifies the scan-parity hypothesis
- note the empirical test and reopen for a symbol-level trace
1 changed file +2 -1
crates/ec-av1/src/stream.rsmodified+2 -1
| @@ -511,8 +511,9 @@ mod tests { | ||
| 511 | 511 | /// `UV_CFL_PRED` (`uv_mode=13`) across a crf sweep -- `testsrc2` there |
| 512 | 512 | /// stays DC. Proves the CfL port this round added, not just DC-chroma |
| 513 | 513 | /// decode: pixel-exact against ffmpeg's own decode, not just "decoded". |
| 514 | + /// | |
| 514 | 515 | #[test] |
| 515 | - #[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."] | |
| 516 | + #[ignore = "r6: scan-transposition hypothesis FALSIFIED empirically, not by re-derivation. Read `default_scan_4x4/8x8/32x32` in /tmp/libaom-src/av1/common/scan.c as raster indices (value = row*side+col) and found the odd/even diagonal-walk parity backwards vs this crate's default_scan in both tile.rs and decode.rs; swapped both. Result: a_real_libaom_gradients_stream_decodes_pixel_exact (the whole-SB Luma64/TX32 case, previously ground-truth pixel-exact against ffmpeg per r5) REGRESSED to failing, and this CfL test's failure was UNCHANGED (still wrong, same row-0-only energy shape) -- reverted both files back to HEAD (5232eff). Two readings are possible: either libaom's default_scan_NxN array is not read as row-major (row*side+col) the way I assumed -- e.g. it may be column-major (col*side+row) or defined over a transposed coefficient buffer relative to this crate's grid[row*side+col] -- or the parity truly is backwards but only for Luma32 BLOCK-granularity quadrants specifically, not the Luma64 whole-SB case, meaning a single default_scan() cannot serve both correctly and the bug is a missing quadrant-position transform (block-relative vs SB-relative row/col), not the scan generator itself. r7 should NOT re-attempt a source-transcription parity re-derivation without first re-confirming against gradients (known-good, keep it green) on every candidate; instead resume r6's extend-the-python-cross-check plan (msac.py has the CDF_TOP/EC_PROB_SHIFT MSAC core through the eob-group symbol already) through base/base_eob/br/dc_sign/golomb for the pinned CfL block, comparing context index and decoded value at every step against a temporary Rust trace (EC_AV1_TRACE pattern, strip before commit), to find the first (ctx, value) divergence directly rather than guessing at table conventions."] | |
| 516 | 517 | fn a_real_libaom_cfl_stream_decodes_pixel_exact() { |
| 517 | 518 | if !have_ffmpeg() { |
| 518 | 519 | eprintln!("SKIP a_real_libaom_cfl_stream_decodes_pixel_exact: no ffmpeg"); |