forge
Explore
Log in

Don't you dare go Hollow

R2 report -- chroma edge-filter mi snap, the 108-recipe sweep and the fixture gate, 24-frame census 15/24 exact, suite 373/0

Browse files at this commit

edfa89ea97ed6eb15a310a3b6ab4720f034fbe61Ahmet Kaan GümüşParent: 589ba1a
  • docs
    • r2 report -- chroma edge-filter mi snap, the 108-recipe sweep and the fixture gate, 24-frame census 15/24 exact, suite 373/0
Show full message
docs(kf900): r2 report -- chroma edge-filter mi snap, the 108-recipe sweep and the fixture gate, 24-frame census 15/24 exact, suite 373/0
lanes/COMMON-20260901.mdmodified+6 -0
@@ -100,3 +100,9 @@ If you ran it: extract your own hunks, `git checkout -- crates/`, re-apply.
100 never two suites per lane; film extracts ≤2 s; a watchdog (`ec-memwatch` user unit, log100 never two suites per lane; film extracts ≤2 s; a watchdog (`ec-memwatch` user unit, log
101 `$HOME/.cache/ec-memwatch.log`) SIGKILLs any codec/test process above 6 GiB RSS or the largest one101 `$HOME/.cache/ec-memwatch.log`) SIGKILLs any codec/test process above 6 GiB RSS or the largest one
102 when MemAvailable < 3 GiB — a killed run means YOUR command exceeded the budget: bound it, do not retry as-is.102 when MemAvailable < 3 GiB — a killed run means YOUR command exceeded the budget: bound it, do not retry as-is.
103+
104+## WORKTREE SETUP (2026-09-02, three lanes lost a round to this)
105+A new worktree needs the TOP-LEVEL fixtures symlink: `ln -s /home/user/Documents/Code/Rust/edith_codecs/fixtures <worktree>/fixtures`.
106+Without it exactly one gate fails: a_real_aomenc_stream_with_film_grain_decodes_pixel_exact with Os NotFound — it is NOT a decode defect.
107+New files under crates/ec-av1/fixtures/ need `git add -f` (bare `fixtures` in .gitignore); verify with `git ls-files`.
108+Commit-msg hook rejects film titles / home paths: describe streams by codec/resolution/bit depth.
lanes/kf900-r2.report.mdadded+145 -0
@@ -0,0 +1,145 @@
1+# lane-kf900 r2 report -- the chroma edge-filter type reads the wrong mi
2+
3+Tip: `1fad25c` on `lane-kf900` (worktree `/home/user/Documents/Code/Rust/edith_codecs-kf900`,
4+base `18bf7dc`; main has since moved to `4eff3a1` -- NOT rebased, see residue).
5+
6+## 1. r1 suite
7+
8+`$HOME/.cache/kf900-suite-r1.log` was still running at round start and was stopped by me
9+(`systemctl --user stop kf900-suite-r1`) before the first rebuild, so it never printed a
10+`test result` line: 288 tests started, 229 `ok`, 0 `FAILED` at the stop point. Its two
11+known-failing arms were rewritten this round anyway; r2's suite below is the real number.
12+
13+## 2. The gate arms that asserted an unreachable counter -- 108 measured recipes, all zero
14+
15+`skip_split_tx_hits()` counts a SKIPPED 8x8 intra leaf whose `tx_depth` resolved to `TX_4X4`
16+(the r1 defect). Sweep (`$HOME/.cache/kf900/sweep/sweep.sh`, raw
17+`results.tsv` + `results10.tsv`): 4 sources (`geq` half-flat/half-noise, `mandelbrot`,
18+`testsrc2`, gray+`noise=all_seed=49`) x cq {55,59,63} x `--cpu-used` {0,1,2} x {8,10}-bit,
19+all with `--enable-tx-size-search=1 --min-partition-size=8 --enable-rect-partitions=1
20+--kf-max-dist=1 --limit=1`, 256x192. **72 8-bit + 36 10-bit = 108 attempts, `skip_split_tx: 0`
21+on every one that decoded.** Cause: libaom's encoder forces `tx_size` to the block maximum
22+once it picks `skip_txfm`, so aomenc never writes this combination. The film's encoder does.
23+
24+EVIDENCE: $HOME/.cache/kf900/sweep/results.tsv + results10.tsv | 108 aomenc encodes, each
25+decoded by `decode_probe` | `skip_split_tx: 0` in 108/108 (2 recipes at N=4 -- see residue 3)
26+
27+Fallback taken (charter-sanctioned): `crates/ec-av1/fixtures/reelb_kf900.obu`, the 484640-byte
28+1-frame extract, sha256 `a273ae99328388be14a1ff8fa1c5a6d391a9948159eaef120e1b50e02015eb83`
29+(two independent `ffmpeg -ss 900 -t 2 -c:v copy -f obu` extracts hashed identically, r1).
30+`git ls-files` shows it tracked. New gate
31+`stream.rs::a_10bit_key_frame_with_skipped_8x8_intra_leaves_that_split_their_transform_decodes_luma_exact`
32+hard-asserts `skip_split_tx_hits() >= 15` (actual 15) and compares the **luma** plane against
33+`ffmpeg -pix_fmt yuv420p10le`. U/V are the open residue, so the gate pins luma only and says so.
34+The two multi-tile arms keep their pixel-exact comparison and point at this gate.
35+
36+EVIDENCE: crates/ec-av1/fixtures/reelb_kf900.obu | `cargo test -p ec-av1 --lib skipped_8x8 chroma`
37+| 15 passed / 0 failed, `skip_split_tx: 15`, Y sha256
38+1ffd0c103368793762637b2152c2062042fe3a14af97045182adc4790c4b5c12 == ffmpeg's Y
39+
40+## 3. Chroma residue -- root cause found and fixed (one of at least two)
41+
42+`decode.rs`, `Neighbours::smooth_uv_neighbour` (now at :4640): added
43+`let (mi_r, mi_c) = (mi_r & !1, mi_c & !1);`.
44+
45+libaom `set_mi_row_col` (`blockd.h`) snaps to the chroma REFERENCE block first --
46+`base_mi = &xd->mi[-(mi_row & ss_y) * stride - (mi_col & ss_x)]` -- and only then takes
47+`chroma_above_mbmi = base_mi[-stride]` / `chroma_left_mbmi = base_mi[-1]`. A sub-8 pair codes
48+its chroma at the ODD mi, so we looked one mi row/column too far, the mi-exact slot never
49+matched, and the coarse SUB-grid fallback answered.
50+
51+Effect: `get_intra_edge_filter_type` (`reconintra.c`) 0 where libaom has 1, which flips
52+`av1_use_intra_edge_upsample(8, 4, -6, type)` (`blk_wh == 12`: false at type 1, TRUE at type 0).
53+We upsampled an edge libaom leaves alone.
54+
55+Ladder (chroma 8x4 at (688,100) = mi (51,344), V_PRED `p_angle=84`, `ft=1` in aomdec):
56+aomdec `EC_PREDOUT sum=15924`, ours `sum=15930`; per-sample +1 at rows 2/3, cols 1,2,4.
57+Hand-simulating both walks from the real above row (A[-1..7] = 495,495,496,497,498,498,499,499,499,
58+`dx = dr_intra_derivative(84) = 7`) reproduces 15924 unfiltered/un-upsampled and 15930 through
59+`av1_upsample_intra_edge_high` -- the upsample flag was the whole difference.
60+
61+EVIDENCE: $HOME/.cache/kf900/pred_aom.txt + pred_ours.txt | EC_PRED on aomdec and decode_probe
62+over reelb_kf900.obu | EC_PREDOUT 15924 vs OUR_PRED 15930; after the fix the block is 0-diff and
63+the frame's first chroma difference moves (102,688) -> (195,640)
64+
65+Not the cause (ruled out this round): per-plane quantizer deltas (`EC_AV1_TRACE` on the frame:
66+`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
67+chroma dequant call site anyway).
68+
69+Sibling gates re-run after the fix (`chroma` + `skipped_8x8` filters): 15 passed, 0 failed --
70+includes `..._chroma_edge_filter_reads_a_sub16_neighbours_uv_mode...`,
71+`..._directional_chroma...`, `..._smooth_paeth_chroma...`, `..._4to1_or_sub8_rect...`,
72+`the_chroma_rect_gates_excluded_seed_46...`.
73+
74+## 4. 24-key-frame census, post-fix (per-plane DIFFERING SAMPLES, not bytes)
75+
76+Recipe `$HOME/.cache/kf900/census_r2.sh` (r1's `census.sh` with a per-plane comparator):
77+`ffmpeg -ss <s> -t 2 -c:v copy -f obu`, truncated to 1 frame, `EC_PROBE_OUT16` vs
78+`ffmpeg -pix_fmt yuv420p10le`. Raw: `$HOME/.cache/kf900/census_r2.tsv`.
79+NOTE the metric changed from r1's all-plane differing BYTES to per-plane differing SAMPLES.
80+
81+| -ss | Y | U | V | max abs Y/U/V | r1 bytes_after |
82+|----:|--:|--:|--:|:--------------|---------------:|
83+| 0 | 0 | 0 | 0 | 0/0/0 | 0 |
84+| 300 | 0 | 219 | 220 | 0/8/7 | 463 |
85+| 600 | 0 | 0 | 0 | 0/0/0 | 0 |
86+| 900 | 0 | 221 | 47912 | 0/23/2 | 51272 |
87+| 1200 | 0 | 0 | 0 | 0/0/0 | 14 |
88+| 1500 | 0 | 0 | 0 | 0/0/0 | 108644 |
89+| 1800 | 0 | 0 | 0 | 0/0/0 | 248 |
90+| 2100 | 0 | 1041 | 1008 | 0/1/1 | 2383 |
91+| 2400 | 0 | 0 | 0 | 0/0/0 | 0 |
92+| 2700 | 0 | 442 | 800 | 0/7/3 | 1243 |
93+| 3000 | 0 | 0 | 0 | 0/0/0 | 0 |
94+| 3300 | 0 | 0 | 0 | 0/0/0 | 4529 |
95+| 3600 | 0 | 0 | 0 | 0/0/0 | 1 |
96+| 3900 | 0 | 4 | 4 | 0/1/1 | 8 |
97+| 4200 | 0 | 0 | 0 | 0/0/0 | 0 |
98+| 4500 | 0 | 0 | 0 | 0/0/0 | 0 |
99+| 4800 | 0 | 2316 | 5 | 0/3/1 | 2348 |
100+| 5100 | 0 | 0 | 0 | 0/0/0 | 0 |
101+| 5400 | 0 | 0 | 0 | 0/0/0 | 0 |
102+| 5700 | 0 | 0 | 0 | 0/0/0 | 0 |
103+| 6000 | 0 | 210 | 0 | 0/3/0 | 10207 |
104+| 6300 | 0 | 145195 | 0 | 0/38/0 | 146881 |
105+| 6600 | 0 | 30873 | 897 | 0/19/7 | 67588 |
106+| 6900 | 0 | 0 | 0 | 0/0/0 | 0 |
107+
108+**24/24 luma-exact; 15/24 now FULLY exact** (were 10/24 at r1: 1200, 1500, 1800, 3300, 3600
109+went to zero on all planes). Segments 1500 (108644 bytes) and 3300 (4529) collapsed to 0.
110+
111+EVIDENCE: $HOME/.cache/kf900/census_r2.tsv | 24 x (extract 2 s, truncate to 1 frame, decode
112+ours + ffmpeg, per-plane compare) | Y 0 on all 24, all-plane 0 on 15
113+
114+## 5. Suite
115+
116+`systemd-run --user --unit=kf900-suite-r2 -p MemoryMax=10G ... cargo test -p ec-av1 --lib -j3`
117+-> `$HOME/.cache/kf900-suite-r2.log`:
118+**`test result: ok. 373 passed; 0 failed; 32 ignored; 0 measured; 0 filtered out; 1073.65s`**
119+(r1's two committed-failing arms are gone: they now assert only what they can reach, and the
120+counter moved to the fixture gate. 373 = 371 on main's tip + the fixture gate + r1's arms.)
121+
122+## Residue
123+
124+1. **fix-now (next round): the chroma RESIDUAL defect.** First remaining difference on the
125+ s=900 frame is chroma (195,640) = mi (97,320). Its PREDICTION is bit-exact
126+ (`EC_PREDND mi_row=97 mi_col=320 plane=1 sum=16384 / plane=2 sum=16352` on both sides), so
127+ the divergence is dequant / inverse transform / chroma `tx_type` on an 8x4 chroma unit.
128+ Unblocked by an `EC_TRACE_COEFF` plane-1/2 ladder at mi (97,320) -- entropy is a fixed
129+ reference now (luma exact frame-wide). Suspect list unchanged apart from CfL and per-plane
130+ delta_q, both now ruled out for this frame.
131+2. **fix-now (own lane): a real aomenc 10-bit stream we decode WRONG with no refusal.**
132+ `testsrc2=s=256x192` at `--bit-depth=10 --cq-level=59 --cpu-used=0` (also `--cpu-used=1`),
133+ full recipe in `$HOME/.cache/kf900/sweep/sweep.sh`, stream md5
134+ `e5f033d8fe34e4418d8cca3ac9d2b595`: `decode_probe` reports `OK: 1 frames decoded` and
135+ `skip_split_tx: 4`, but 73687 of 73728 samples differ from ffmpeg, max |d| 933. This is the
136+ only pair of the 108 recipes with a non-zero counter, and it is a SILENT desync -- a
137+ pixel-exact gate for `skip_split_tx` becomes possible the moment it is fixed.
138+ Reproducer in `$HOME/.cache/kf900/sweep/{g.obu,g.yuv,r.yuv}`.
139+3. **deferred: rebase onto main `4eff3a1`** (lane branched at `18bf7dc`; main gained
140+ lane-sb128b in between) -- not done because the r1 suite was mid-run on this worktree at
141+ round start and the round's budget went to the two defects; unblocked by a clean
142+ `git rebase main` + one suite run.
143+4. **deferred (r1 carry-over): block-position printing on refusal in `decode_probe`** and
144+ `refusal_inventory.rs` / `gate_coverage.rs` updates -- this round lifted no refusal, so
145+ neither file changed; unblocked by ~10 min on `decode.rs`'s `unsupported()` call sites.