forge
Explore
Log in

Don't you dare go Hollow

edith_codecs

Clone
★ 0

0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits

kf900-r2.report.md8.6 KiBHistoryRawDownload

lane-kf900 r2 report -- the chroma edge-filter type reads the wrong mi

Tip: 1fad25c on lane-kf900 (worktree /home/user/Documents/Code/Rust/edith_codecs-kf900, base 18bf7dc; main has since moved to 4eff3a1 -- NOT rebased, see residue).

1. r1 suite

$HOME/.cache/kf900-suite-r1.log was still running at round start and was stopped by me (systemctl --user stop kf900-suite-r1) before the first rebuild, so it never printed a test result line: 288 tests started, 229 ok, 0 FAILED at the stop point. Its two known-failing arms were rewritten this round anyway; r2's suite below is the real number.

2. The gate arms that asserted an unreachable counter -- 108 measured recipes, all zero

skip_split_tx_hits() counts a SKIPPED 8x8 intra leaf whose tx_depth resolved to TX_4X4 (the r1 defect). Sweep ($HOME/.cache/kf900/sweep/sweep.sh, raw results.tsv + results10.tsv): 4 sources (geq half-flat/half-noise, mandelbrot, testsrc2, gray+noise=all_seed=49) x cq {55,59,63} x --cpu-used {0,1,2} x {8,10}-bit, all with --enable-tx-size-search=1 --min-partition-size=8 --enable-rect-partitions=1 --kf-max-dist=1 --limit=1, 256x192. 72 8-bit + 36 10-bit = 108 attempts, skip_split_tx: 0 on every one that decoded. Cause: libaom's encoder forces tx_size to the block maximum once it picks skip_txfm, so aomenc never writes this combination. The film's encoder does.

EVIDENCE: $HOME/.cache/kf900/sweep/results.tsv + results10.tsv | 108 aomenc encodes, each decoded by decode_probe | skip_split_tx: 0 in 108/108 (2 recipes at N=4 -- see residue 3)

Fallback taken (charter-sanctioned): crates/ec-av1/fixtures/reelb_kf900.obu, the 484640-byte 1-frame extract, sha256 a273ae99328388be14a1ff8fa1c5a6d391a9948159eaef120e1b50e02015eb83 (two independent ffmpeg -ss 900 -t 2 -c:v copy -f obu extracts hashed identically, r1). git ls-files shows it tracked. New gate stream.rs::a_10bit_key_frame_with_skipped_8x8_intra_leaves_that_split_their_transform_decodes_luma_exact hard-asserts skip_split_tx_hits() >= 15 (actual 15) and compares the luma plane against ffmpeg -pix_fmt yuv420p10le. U/V are the open residue, so the gate pins luma only and says so. The two multi-tile arms keep their pixel-exact comparison and point at this gate.

EVIDENCE: crates/ec-av1/fixtures/reelb_kf900.obu | cargo test -p ec-av1 --lib skipped_8x8 chroma | 15 passed / 0 failed, skip_split_tx: 15, Y sha256 1ffd0c103368793762637b2152c2062042fe3a14af97045182adc4790c4b5c12 == ffmpeg's Y

3. Chroma residue -- root cause found and fixed (one of at least two)

decode.rs, Neighbours::smooth_uv_neighbour (now at :4640): added let (mi_r, mi_c) = (mi_r & !1, mi_c & !1);.

libaom set_mi_row_col (blockd.h) snaps to the chroma REFERENCE block first -- base_mi = &xd->mi[-(mi_row & ss_y) * stride - (mi_col & ss_x)] -- and only then takes chroma_above_mbmi = base_mi[-stride] / chroma_left_mbmi = base_mi[-1]. A sub-8 pair codes its chroma at the ODD mi, so we looked one mi row/column too far, the mi-exact slot never matched, and the coarse SUB-grid fallback answered.

Effect: get_intra_edge_filter_type (reconintra.c) 0 where libaom has 1, which flips av1_use_intra_edge_upsample(8, 4, -6, type) (blk_wh == 12: false at type 1, TRUE at type 0). We upsampled an edge libaom leaves alone.

Ladder (chroma 8x4 at (688,100) = mi (51,344), V_PRED p_angle=84, ft=1 in aomdec): aomdec EC_PREDOUT sum=15924, ours sum=15930; per-sample +1 at rows 2/3, cols 1,2,4. Hand-simulating both walks from the real above row (A[-1..7] = 495,495,496,497,498,498,499,499,499, dx = dr_intra_derivative(84) = 7) reproduces 15924 unfiltered/un-upsampled and 15930 through av1_upsample_intra_edge_high -- the upsample flag was the whole difference.

EVIDENCE: $HOME/.cache/kf900/pred_aom.txt + pred_ours.txt | EC_PRED on aomdec and decode_probe over reelb_kf900.obu | EC_PREDOUT 15924 vs OUR_PRED 15930; after the fix the block is 0-diff and the frame's first chroma difference moves (102,688) -> (195,640)

Not the cause (ruled out this round): per-plane quantizer deltas (EC_AV1_TRACE on the frame: base_q_idx=35 y_dc=0 u_dc=0 u_ac=0 v_dc=0 v_ac=0, and plane_q_delta() is applied at every chroma dequant call site anyway).

Sibling gates re-run after the fix (chroma + skipped_8x8 filters): 15 passed, 0 failed -- includes ..._chroma_edge_filter_reads_a_sub16_neighbours_uv_mode..., ..._directional_chroma..., ..._smooth_paeth_chroma..., ..._4to1_or_sub8_rect..., the_chroma_rect_gates_excluded_seed_46....

4. 24-key-frame census, post-fix (per-plane DIFFERING SAMPLES, not bytes)

Recipe $HOME/.cache/kf900/census_r2.sh (r1's census.sh with a per-plane comparator): ffmpeg -ss <s> -t 2 -c:v copy -f obu, truncated to 1 frame, EC_PROBE_OUT16 vs ffmpeg -pix_fmt yuv420p10le. Raw: $HOME/.cache/kf900/census_r2.tsv. NOTE the metric changed from r1's all-plane differing BYTES to per-plane differing SAMPLES.

-ss Y U V max abs Y/U/V r1 bytes_after
0 0 0 0 0/0/0 0
300 0 219 220 0/8/7 463
600 0 0 0 0/0/0 0
900 0 221 47912 0/23/2 51272
1200 0 0 0 0/0/0 14
1500 0 0 0 0/0/0 108644
1800 0 0 0 0/0/0 248
2100 0 1041 1008 0/1/1 2383
2400 0 0 0 0/0/0 0
2700 0 442 800 0/7/3 1243
3000 0 0 0 0/0/0 0
3300 0 0 0 0/0/0 4529
3600 0 0 0 0/0/0 1
3900 0 4 4 0/1/1 8
4200 0 0 0 0/0/0 0
4500 0 0 0 0/0/0 0
4800 0 2316 5 0/3/1 2348
5100 0 0 0 0/0/0 0
5400 0 0 0 0/0/0 0
5700 0 0 0 0/0/0 0
6000 0 210 0 0/3/0 10207
6300 0 145195 0 0/38/0 146881
6600 0 30873 897 0/19/7 67588
6900 0 0 0 0/0/0 0

24/24 luma-exact; 15/24 now FULLY exact (were 10/24 at r1: 1200, 1500, 1800, 3300, 3600 went to zero on all planes). Segments 1500 (108644 bytes) and 3300 (4529) collapsed to 0.

EVIDENCE: $HOME/.cache/kf900/census_r2.tsv | 24 x (extract 2 s, truncate to 1 frame, decode ours + ffmpeg, per-plane compare) | Y 0 on all 24, all-plane 0 on 15

5. Suite

systemd-run --user --unit=kf900-suite-r2 -p MemoryMax=10G ... cargo test -p ec-av1 --lib -j3 -> $HOME/.cache/kf900-suite-r2.log: test result: ok. 373 passed; 0 failed; 32 ignored; 0 measured; 0 filtered out; 1073.65s (r1's two committed-failing arms are gone: they now assert only what they can reach, and the counter moved to the fixture gate. 373 = 371 on main's tip + the fixture gate + r1's arms.)

Residue

  1. fix-now (next round): the chroma RESIDUAL defect. First remaining difference on the s=900 frame is chroma (195,640) = mi (97,320). Its PREDICTION is bit-exact (EC_PREDND mi_row=97 mi_col=320 plane=1 sum=16384 / plane=2 sum=16352 on both sides), so the divergence is dequant / inverse transform / chroma tx_type on an 8x4 chroma unit. Unblocked by an EC_TRACE_COEFF plane-1/2 ladder at mi (97,320) -- entropy is a fixed reference now (luma exact frame-wide). Suspect list unchanged apart from CfL and per-plane delta_q, both now ruled out for this frame.
  2. fix-now (own lane): a real aomenc 10-bit stream we decode WRONG with no refusal. testsrc2=s=256x192 at --bit-depth=10 --cq-level=59 --cpu-used=0 (also --cpu-used=1), full recipe in $HOME/.cache/kf900/sweep/sweep.sh, stream md5 e5f033d8fe34e4418d8cca3ac9d2b595: decode_probe reports OK: 1 frames decoded and skip_split_tx: 4, but 73687 of 73728 samples differ from ffmpeg, max |d| 933. This is the only pair of the 108 recipes with a non-zero counter, and it is a SILENT desync -- a pixel-exact gate for skip_split_tx becomes possible the moment it is fixed. Reproducer in $HOME/.cache/kf900/sweep/{g.obu,g.yuv,r.yuv}.
  3. deferred: rebase onto main 4eff3a1 (lane branched at 18bf7dc; main gained lane-sb128b in between) -- not done because the r1 suite was mid-run on this worktree at round start and the round's budget went to the two defects; unblocked by a clean git rebase main + one suite run.
  4. deferred (r1 carry-over): block-position printing on refusal in decode_probe and refusal_inventory.rs / gate_coverage.rs updates -- this round lifted no refusal, so neither file changed; unblocked by ~10 min on decode.rs's unsupported() call sites.