diff --git a/crates/ec-av1/fixtures/420_intrabc_rect4_witness.obu b/crates/ec-av1/fixtures/420_intrabc_rect4_witness.obu new file mode 100644 index 0000000000000000000000000000000000000000..af76b0b6afdc1930f7e817ea07074148754855be GIT binary patch literal 890 zcmV-=1BLt&015{gCMW*;U=T9w22Ah(^IGH)(&|`xJP-_ateX>`xvya8ut&`pEZLPb z^9EQ=6s-YC#W-Pg+UJVJ5u$0qQ@=5r%`ufj1dREcuVf}V{MiW+Go}#2c2ab9wN$s9 zU>+cZ%WKDfsn|tuH;;0eO|Z~pDaow@gk7{v1ZLu1i^Ih#cbND!HfGj;P@|iEo@+Ge#qloVr9o3<^tm1}CcvWyI!Af}f5cejv zb~s{B*|Y~R6~uh8Mr=sL06iUik8BA8tdlw51y{A~WVN5TH3cp^U;{Nq9G7}A4_~|CnY@F7A z;z;nWSTY|`s$!Ij#^%Ya&YU|d_sMQY=*vf5P;pbk{Q(E4A<4)2;vG!Alc8goeit2N zD>V{lwX|AnpEOv_{k0Gd61lX2P`b@q-JAR^`GJKGctd6u$RP*}F5mivM8uk&+N91F zjL~016dH(RXGNq5GIItz^K0VEa_ZB5mstMOx{;Je91{r5WJKFZurgb4UwTNwODJTo zt8DbtSI{6td39Nxl4Jmk78~!jweUu)R-@0kJAZ4xP>8}A0=szuZEC>hHVsfQdtph4 zcrSF#IVYMb!YoTKknL@dc%8eOp7j0ngVP-=r}N_I*Vlp|P~Jo=uUzJvesQYDfvn2B z4m8yl`vZG1eRKH&KD3`eedh^-a$=ldLFta^TPhvLie?6aWR5j1KSjCc%tV#t%Tw)? z(O?VW`=5n?3(g`tH1JwjlsjHTp+pytm-_Slc4rGuJ)i_E{=!`6t-_0HhlPFXoOH|_B2(xXbn~_Xm9gw(t z!OUS==|VmRP4E*Vp$LT(??!R?JfaoO?@|x8kk!c1vczW$DnG*mPheR zelR9(R%2^mC(XM#2obe414z-xHYy_bbbkQyQV{bl$p#JDS2-7$9%a32>&h84MF(=` zOj^j_Xg3e-KuidoT6Q!UZvx;v6@F{u*$GTSo%X&S=$wA`ID-d_U>`(d!TqKRjw*yK zDv*>zK?vkQT=Dkm`9I{)*yJ)BC`^y`7=a$VXqQq{-+G| z5PlAbHnX_Y?peQFr}EeIX6sa8vsD_p44?kEks7}m4U5d5jJO6q`zm*kurwtE=TKM7 z#QTsjoFAI=7~D}FSgKRMqy_}~A9x^aglX3k0p#EA=MQ7O@-s8>P^ief)6>5_E&1LN z>JZKFNpS1RB0VzR!Vc%?Q+#JDq9H%6K`FBotIG<%K04#MHTg`r+M+a_UUWA-M=KO+5+Mqu zORDz!*x^uI*H-~;ansLJX|pxp=o+?66JY+Wb1MHUqJH}?j}mUXF_1LgbE^ln(O7+7 zF85}6VE&jGnv%G%*1`k;>azFkWrI;BsX)wJm%4RF(?`1nab4e17^Rak1Li2!U|&)~ zR$|HVgj(YK7z{P&f77N=XJry3bEOrGPRjnf5 zXnZ@e-b4c!bfw3lqM^p1Y#kBc39%f-&9$;5eygSntsB1*&G-@o#*jR+Vi_YAD>lRj z(?&i5z{M{0dUVr`uvU~>fVph$Fu0NUvK{fQk)%>&bj8U2dk+i1pW3e}bVf7((C+tA2XlePhuw=Fe;W_%nADQ3q z7HXRu>>(_A!-U;G-!VENwif<)eZ4Ez)o7`Ws-i#vKrUK2P^jJf+!U-WFq2YlYf0{; mo?*LnVS@6>Z;PVve7UxN^U2xSnna-sKJp1n5z)>hH7Hn<0q)}f literal 0 HcmV?d00001 diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index 133157a1..41e61206 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -5526,6 +5526,26 @@ pub(crate) fn reset_rect4_inter_own_chroma444_hits() { RECT4_INTER_OWN_CHROMA444_HITS.with(|c| c.set(0)); } +// lane-av1444rect r2: how many intra-BC 1:4 strips at `ss (0,0)` coded their +// OWN 16x4 / 4x16 chroma plane block instead of the 4:2:0 pair's 8x4 (see +// [`decode_rect4_16_intrabc`]'s `own444`). A 4:2:0 / 4:2:2 stream of the same +// recipe leaves it at 0, which is what makes it the 4:4:4-only route. +thread_local! { + static INTRABC_RECT4_OWN_CHROMA444_HITS: std::cell::Cell = const { std::cell::Cell::new(0) }; +} + +/// Current value of [`INTRABC_RECT4_OWN_CHROMA444_HITS`]. +#[allow(dead_code)] // read only from the `#[cfg(test)]` gates +pub(crate) fn intrabc_rect4_own_chroma444_hits() -> usize { + INTRABC_RECT4_OWN_CHROMA444_HITS.with(std::cell::Cell::get) +} + +/// Resets [`INTRABC_RECT4_OWN_CHROMA444_HITS`] before a decode. +#[allow(dead_code)] // read only from the `#[cfg(test)]` gates +pub(crate) fn reset_intrabc_rect4_own_chroma444_hits() { + INTRABC_RECT4_OWN_CHROMA444_HITS.with(|c| c.set(0)); +} + // lane-intra14 r1: set while an INTRA block of an INTER frame is decoded // through one of the key-frame rect readers ([`decode_block_rect4`], // [`decode_block_rect64`]). `Some((size_group, skip))` tells @@ -16483,10 +16503,42 @@ fn decode_rect4_16_intrabc( pred_y[row * side..][..bw].copy_from_slice(&pred_y_dense[row * bw..][..bw]); } - let (pw, ph) = if horz { (16usize, 8usize) } else { (8, 16) }; - let (cw, ch) = (pw / 2, ph / 2); + // lane-av1444rect r2 (the class this lane named, second instance): the + // pair geometry below is the 4:2:0 one and was applied at every `ss`. At + // ss (0,0) `is_chroma_reference` (av1_common_int.h:1454) is + // unconditionally true -- the strip is its own chroma reference, there is + // no pair, and its chroma plane block IS the strip: 16x4 (HORZ_4) / 4x16 + // (VERT_4) at the strip's own origin, with its coefficient context read + // over that same extent. The old constants instead predicted and coded an + // 8x4 block at `(lmi - 1) * MI / 2`, a quarter of the position. + // + // MEASURED on a `testsrc2` 640x480 `--tune-content=screen --enable-intrabc=1 + // --enable-palette=1 --cq-level=60 --min-partition-size=4 + // --max-partition-size=64 --sb-size=64 --profile=1` stream (1016 B, 17 + // intrabc 16x4 strips at ss (0,0)): 455240 of 921600 samples wrong, the + // entropy fork at read 11750 (`decodetxb.c:158`, the chroma `txb_skip`). + // `--enable-intrabc=0` at the same settings is byte-exact, and the 4:2:0 + // twin of the same recipe is byte-exact. + // + // 4:2:0 and 4:2:2 keep every constant below verbatim -- the arm is gated on + // the full ss (0,0), not on a per-axis shift, so `pw / 2` and the literal + // halving are untouched for both. + let own444 = ss_x(fctx) == 0 && ss_y(fctx) == 0; + if ss_x(fctx) == 0 && ss_y(fctx) == 0 && has_chroma { + hit!(INTRABC_RECT4_OWN_CHROMA444_HITS); + } + let (pw, ph) = if own444 { + (bw, bh) + } else if horz { + (16usize, 8usize) + } else { + (8, 16) + }; + let (cw, ch) = if own444 { (bw, bh) } else { (pw / 2, ph / 2) }; let pair_mi = if has_chroma { - if horz { + if own444 { + lmi + } else if horz { (lmi.0 - 1, lmi.1) } else { (lmi.0, lmi.1 - 1) @@ -16495,7 +16547,11 @@ fn decode_rect4_16_intrabc( lmi }; let (cpx, cpy) = if has_chroma { - (pair_mi.1 * MI / 2, pair_mi.0 * MI / 2) + if own444 { + (px, py) + } else { + (pair_mi.1 * MI / 2, pair_mi.0 * MI / 2) + } } else { (0, 0) }; diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index 406c9de6..b2e8ca93 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -7108,6 +7108,157 @@ pub(crate) mod tests { eprintln!("{NAME}: 4:2:0 control {h4} HORZ_4 / {v4} VERT_4 strips, 0 own-extent gathers"); } + /// lane-av1444rect r2 — the SAME class as the gate above, second + /// instance: `decode_rect4_16_intrabc` applied the 4:2:0 pair geometry at + /// ss (0,0), where `is_chroma_reference` makes an intra-BC 1:4 strip its + /// own chroma reference. It predicted and coded an 8x4 chroma block at + /// `(lmi - 1) * MI / 2` where libaom codes 16x4 at the strip's origin. + /// + /// **This is a PROGRESS gate, not an exactness gate, and it says so.** The + /// 4:4:4 intra-BC cell is still divergent: after the ss gate the LUMA + /// plane is exact to sample 205264 (it was 164416) and the entropy fork + /// moves from read 11750 to 12465, but both CHROMA planes still first + /// diverge at index 20532 and 390380 of 921600 samples are wrong. So the + /// assertion is a prefix floor on the plane the gate actually moved — + /// which only ever grows, and which the next lane's fix cannot turn red — + /// and the untouched chroma divergence is named, never asserted exact. + /// + /// Recipe (both fixtures, one frame, `testsrc2 640x480 r=25`): + /// ```text + /// aomenc --codec=av1 --bit-depth=8 --input-bit-depth=8 --passes=1 + /// --end-usage=q --cpu-used=0 --lag-in-frames=0 --kf-max-dist=1 + /// --limit=1 --threads=1 --enable-rect-partitions=1 + /// --enable-1to4-partitions=1 --min-partition-size=4 + /// --max-partition-size=64 --sb-size=64 --tune-content=screen + /// --enable-intrabc=1 --enable-palette=1 --cq-level=60 + /// --enable-tx-size-search=0 --obu [--profile=1] -o out.obu src.y4m + /// ``` + /// 4:4:4 (1016 B, sha256 7fe888ed…) carries 17 intrabc 16x4 strips at + /// ss (0,0); the 4:2:0 twin (890 B, sha256 d01352af…) is byte-exact and + /// is the identity arm — the ss gate cannot reach it, and the whole frame + /// is compared with the length asserted first. + #[test] + fn a_444_intrabc_rect4_reads_its_own_chroma_plane_block() { + const NAME: &str = "a_444_intrabc_rect4_reads_its_own_chroma_plane_block"; + const W: usize = 640; + const H: usize = 480; + const PS: usize = W * H; + /// The luma prefix the ss gate makes exact (measured: 205264, i.e. + /// Y(464,320); before the gate the first wrong luma sample was 164416, + /// Y(576,256)). A floor, not a pin: fixing the open chroma divergence + /// moves this later, never earlier. + const LUMA_EXACT_PREFIX: usize = 205264; + let read = |name: &str, file: &str, len: usize, fnv: u64| -> Vec { + let path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join(format!("fixtures/{file}")); + let bytes = std::fs::read(&path).unwrap_or_else(|e| { + panic!( + "{name}: pinned fixture {} is missing ({e}) -- a failure, not a skip", + path.display() + ) + }); + assert_eq!(bytes.len(), len, "{name}: {file} length moved"); + assert_eq!(fnv1a64(&bytes), fnv, "{name}: {file} bytes moved"); + bytes + }; + let stream444 = read( + NAME, + "444_intrabc_rect4_witness.obu", + 1016, + 0x27c2_fad5_4047_2994, + ); + let stream420 = read( + NAME, + "420_intrabc_rect4_witness.obu", + 890, + 0x57ec_3da2_a63b_403a, + ); + + let _guard = lock_gate_counters(); + crate::decode::reset_intrabc_rect4_own_chroma444_hits(); + let frames = decode_stream(&stream444) + .unwrap_or_else(|e| panic!("{NAME}: the pinned 4:4:4 stream was refused: {e}")); + let own = crate::decode::intrabc_rect4_own_chroma444_hits(); + assert!( + own > 0, + "{NAME}: no intra-BC 1:4 strip coded its own chroma plane block -- the \ + corrected route never ran (class gate-blind-to-feature)" + ); + assert_eq!(frames.len(), 1, "{NAME}: frame count"); + + // The identity arm FIRST and in full: the 4:2:0 twin must stay + // byte-exact. `decode_all_frames_vs_oracle` asserts the two frame + // lengths match before it compares anything -- the check whose absence + // turned an out-of-window divergence into a reported EXACT in this + // lane's own round 1. + if aomdec_path().is_file() { + decode_all_frames_vs_oracle(&stream420, &format!("{NAME}-420")); + crate::decode::reset_intrabc_rect4_own_chroma444_hits(); + decode_stream(&stream420) + .unwrap_or_else(|e| panic!("{NAME}: the 4:2:0 twin was refused: {e}")); + assert_eq!( + crate::decode::intrabc_rect4_own_chroma444_hits(), + 0, + "{NAME}: the 4:2:0 twin fired the ss (0,0)-only route" + ); + + // The 4:4:4 prefix claim. Same length-first discipline: an + // unequal-length compare would silently become a prefix compare + // and pass for the wrong reason. + let dir = std::env::temp_dir().join(format!("ec-av1-ibc444-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(&dir).expect("scratch dir"); + let obu = dir.join("in.obu"); + std::fs::write(&obu, &stream444).expect("write stream"); + let out = Command::new(aomdec_path()) + .args(["--codec=av1", "-o"]) + .arg(dir.join("out.y4m")) + .arg(&obu) + .env("EC_AV1_FINAL_DUMP", dir.join("aom")) + .stdin(Stdio::null()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .output() + .expect("aomdec failed to run"); + assert!( + out.status.success(), + "{NAME}: the oracle aomdec refused the stream: {}", + String::from_utf8_lossy(&out.stderr) + ); + let reference = std::fs::read(dir.join("aom.f0")).expect("oracle dump"); + assert_eq!( + reference.len(), + 3 * PS, + "{NAME}: the oracle dump is {} bytes, the 4:4:4 frame is {} -- a \ + compare across different lengths is a PREFIX compare and passes \ + for the wrong reason", + reference.len(), + 3 * PS + ); + let ours = &frames[0]; + let at = (0..LUMA_EXACT_PREFIX) + .find(|&k| ours.y[k] != u16::from(reference[k])) + .unwrap_or(LUMA_EXACT_PREFIX); + assert_eq!( + at, + LUMA_EXACT_PREFIX, + "{NAME}: the luma plane first differs from the oracle at sample {at} \ + (Y({},{})), inside the {LUMA_EXACT_PREFIX}-sample prefix this \ + gate covers -- the intra-BC own-chroma ss gate regressed", + at % W, + at / W + ); + let _ = std::fs::remove_dir_all(&dir); + eprintln!( + "{NAME}: {own} own-chroma intra-BC strip(s); luma exact to \ + {LUMA_EXACT_PREFIX}; chroma still diverges from index 20532 \ + (OPEN, see lanes/av1444rect.report.md §6)" + ); + } else { + eprintln!("{NAME}: no oracle aomdec, pixel arm skipped"); + } + } + /// lane-av1lrflush: the pipelined loop-restoration band release flushes /// RU row 0 on the inter frame whose top superblock row carries a /// 128-root rect -- the exact shape lanes/av1444sb.report.md r2 named as diff --git a/lanes/av1444rect.report.md b/lanes/av1444rect.report.md index 6e2ae352..19b01885 100644 --- a/lanes/av1444rect.report.md +++ b/lanes/av1444rect.report.md @@ -1,7 +1,10 @@ -# lane-av1444rect — H1: 4:4:4 lossy + a 1:4 (RECT) partition +# lane-av1444rect — H1 (4:4:4 lossy + a 1:4 partition) and the class, round 2 **Tree.** `lane-av1444rect` off `4155c7c7`, worktree `~/.cache/wt/av1444rect`. -Fix commit `f92776ba`. One decode.rs hunk, one gate, one pinned fixture. +Round 1: `f92776ba` (H1 fix + gate + fixture), `bd0d0c37` (report). +Round 2: the class's second instance, `decode_rect4_16_intrabc`, plus a +retraction (§5) and a progress gate (§6). Read §5 before quoting any H3 number +from this report. ## 1. Root cause @@ -187,40 +190,132 @@ clamp on a 4:4:4 chroma TX_32X64 is still the prime suspect. Re-measured here to prove the class claim above: H2's numbers are bit-identical before and after, so this fix neither caused nor cured it. -**H3**: with the sweep's full flag set -(`--profile=1 --passes=1 --lossless=1 --end-usage=q --cq-level=20 ---cpu-used=2 --threads=1 --row-mt=0 --lag-in-frames=0 --kf-max-dist=100 ---limit=6 --tile-columns=1`) the 6-frame 77847-byte stream is byte-exact. -Without those flags the same source diverges hard, so the sweep's H3 recipe -was under-specified; the tile-column defect does not reproduce on the -recipe as re-derived here. Flagging, not claiming. +**H3: RETRACTED — my first claim was void, Agent142-2's measurement stands.** +I reported this stream "byte-exact 6/6". It is not. My throwaway compare +script hardcoded the frame geometry to 128x96 (the H1 fixture's) and +derived the sample count as 3·128·96 = 36864; I fed it a 256×128 witness +without overriding the size, so it compared only the **top-left 36864 +samples** of each 98304-sample frame and declared the frame exact. The +defect sits at x ≥ 108, outside the window. A prefix compare passes +exactly when the defect is outside the prefix. + +- fixture sha256 `87b0d1a5b3044552fc1fae839e868c30fdc0bebe79f8b3a3104030ffea24ab50`, + 77847 B, `testsrc2 256x128 rate=25` yuv444p, `--limit=6 --kf-max-dist=100 + --threads=1 --row-mt=0 --lag-in-frames=0 --passes=1 --end-usage=q + --lossless=1 --tile-columns=1 --cpu-used=2` — byte-identical to + Agent142-2's witness A, so this is a harness bug, not a different-ffmpeg + story; +- re-measured with the correct geometry on this tip: **63–162 wrong chroma + samples in every one of the six frames, first at U(110,26)**, luma exact + — Agent142-2's "29–103 wrong, x ≥ 108, luma exact", reproduced; +- their second witness (75446 B, no `--cpu-used`, + `65e94e91c56178d21f5c8441877d0dbfbee17bce0916e971fbe6c51677c9891e`) + reproduces the sweep's original H3 signature (frame 0 only, 12 U + 40 V, + first U(237,58)) and is bit-identical before and after this fix. + +**H3 is not cured by this fix and is not in this lane.** No H3 gate is +pinned here. Agent142-2 owns it. The lesson is in §7: a per-frame byte +compare must assert the two frame lengths match before comparing, and must +not be handed a fixture whose geometry it does not know. **H5 (lane-av1h5, Agent06-3): out of scope and structurally disjoint.** The new arm lives inside `match strip_chroma`, which is `Some` only from the single setter the PARTITION_HORZ_4 / VERT_4 16x4 / 4x16 `inter_piece` loop runs; a BLOCK_128X128 unsplit root never reaches it. -## 6. Residue handed on, not fixed here - -- **`decode_rect4_16_intrabc` (`decode.rs:16466`) — same class, still - open.** The intra-BC 16x4 / 4x16 strip reader hardcodes the 4:2:0 pair - with no `ss` gate at all: - `let (pw, ph) = if horz { (16, 8) } else { (8, 16) };`, - `pair_mi = (lmi.0 - 1, lmi.1) | (lmi.0, lmi.1 - 1)`, and - `cpx = pair_mi.1 * MI / 2` (a literal 4:2:0 halving). At ss (0,0) that - decodes an 8x4 chroma block at a halved anchor where libaom codes a - 16x4 at the strip's own. I did not fix it: it needs a 4:4:4 witness with - screen-content tools on (aomenc sets `allow_screen_content_tools` for - `testsrc2` yuv444p by default), which I had no budget to produce, and - fixing an unreproduced branch here would be a guess. The pinned H1 fixture - decodes exactly, so it does not reach that reader. +## 6. The same class, second instance: `decode_rect4_16_intrabc` + +Round 1 left this open on inspection, noting it "needs a 4:4:4 witness I had +no budget to produce". Round 2 produced the witness. **It is live, not +latent.** + +**Witness.** `testsrc2 640x480 r=25` yuv444p, `aomenc --tune-content=screen +--enable-intrabc=1 --enable-palette=1 --cq-level=60 --enable-tx-size-search=0 +--min-partition-size=4 --max-partition-size=64 --sb-size=64 +--enable-rect-partitions=1 --enable-1to4-partitions=1 --cpu-used=0 +--kf-max-dist=1 --limit=1 --profile=1` — 1016 B, sha256 `7fe888ed…`, carrying +**17 intrabc 16x4 strips at ss (0,0)**. + +**Controls, same recipe each:** + +| arm | verdict | +|---|---| +| 4:4:4, intrabc on | 455240 / 921600 wrong, first Y(576,256) | +| 4:4:4, `--enable-intrabc=0` | **byte-exact** | +| 4:2:0 twin, intrabc on (890 B, sha256 `d01352af…`) | **byte-exact** | +| 4:4:4 with `--enable-1to4-partitions=0` and `--enable-rect-partitions=0` | 455240 wrong — the defect does NOT need a 1:4 or rect partition | + +So the divergence is intra-BC-at-4:4:4 in general; `decode_rect4_16_intrabc` +is one site in it, not all of it. + +**The site.** `decode.rs:16489`: `(pw, ph) = if horz { (16, 8) } else { (8, 16) }`, +`pair_mi = lmi - 1`, `cpx = pair_mi.1 * MI / 2`. At ss (0,0) that predicts and +codes an 8x4 chroma block a quarter of the way off, where libaom codes a 16x4 +at the strip's own origin. + +**Round 2's change.** One `own444 = ss_x == 0 && ss_y == 0` gate on +`(pw, ph)`, `(cw, ch)`, `pair_mi` and `(cpx, cpy)`. 4:2:0 and 4:2:2 keep every +constant verbatim, so the arm cannot reach them. + +**Measured, per plane:** + +| | before | after | +|---|---|---| +| first entropy fork | read **11750**, mi (78,128) | read **12465**, mi (90,108) | +| luma first wrong | 164416 (Y 576,256) | **205264** (Y 464,320) | +| luma differing | 95872 | 51716 | +| U first wrong | 20532 | 20532 (untouched) | +| V first wrong | 20532 | 20532 (untouched) | +| total differing | 455240 | 390380 | + +**A partial improvement, NOT a fix, and the report says so.** The ss gate +moves the luma divergence 40948 samples later and the entropy fork 715 reads +later; both chroma planes are untouched. 390380 of 921600 samples are still +wrong. No exactness is claimed — "the divergence moved" is evidence that the +geometry was wrong, not that the new geometry is right. + +### Gate + +`a_444_intrabc_rect4_reads_its_own_chroma_plane_block` — a **progress gate, +deliberately not an exactness gate**: + +- both fixtures pinned (length + FNV); +- non-vacuity: `intrabc_rect4_own_chroma444_hits()` must be non-zero (18 on + the 4:4:4 witness, 0 on the 4:2:0 twin), armed OUTSIDE the mutated + expression so the mutation test below fails on the pixel arm, not on the + counter; +- identity: the 4:2:0 twin is compared byte-for-byte through + `decode_all_frames_vs_oracle`, which asserts the two frame lengths match + before comparing; +- the 4:4:4 claim is a **prefix floor** on the plane the gate moved: the luma + plane must be byte-exact to sample 205264. A floor only ever grows, so the + next lane's fix cannot turn this gate red; +- the untouched chroma divergence (U/V from index 20532) is printed and named, + never asserted exact. + +**Mutation proof.** `own444 = false` (the old geometry, counter untouched) — +the assert fires with the first luma difference at 164416 against a floor of +205264. + +**Handed on, precisely:** the 4:4:4 intra-BC cell's remaining divergence is +**in chroma, first at U/V index 20532 (x=52, y=32)**, and the entropy fork is +read 12465 at mi (90,108) — same signature as the first (oracle +`decodetxb.c:158`, the chroma `txb_skip`, symbol 1). Not localized to a line +yet. Unverified candidates: `sub8_leaf_chroma444`'s single +`around_mi_rect(lmi, bw, bh)` reused for both planes, and its non-lossless +rect arm's context offset. + +## 7. Residue handed on, not fixed here + +- **4:4:4 intra-BC chroma** — read 12465, mi (90,108), U/V first wrong at + index 20532. Per §6. - **H2** — 4:4:4 lossy + tx-size-search chroma ±1, entropy-clean. Own lane. +- **H3** — 4:4:4 lossless + tile columns. Agent142-2 (see §5's retraction). - **H4** — 4:4:4 lossless + tile rows, hard divergence. Own lane; untouched. - **H5** — 4:4:4 10-bit lossless 128 root, chroma band/offset term. Agent06-3. -- **H6** — 12-bit 4:4:4 needs a smoothed source. Coverage caveat, not a - defect. +- **H6** — 12-bit 4:4:4 needs a smoothed source. Coverage caveat, not a defect. -## 7. Method notes for the next lane +## 8. Method notes for the next lane - `testsrc2` is time-parameterised: any sweep recipe quoting it must pin `rate`, or the fixture is not reproducible. `rate=1` vs `rate=25` on @@ -238,3 +333,15 @@ runs; a BLOCK_128X128 unsplit root never reaches it. - `EC_DCDUMP` already dumps the above/left entropy contexts per plane; `#[track_caller]` on `Neighbours::around_mi_rect` names the gather site in one line if you ever need to attribute one again. +- **A byte compare that truncates to `min(len(ours), len(ref))` is a PREFIX + compare, and a prefix compare passes exactly when the defect is outside the + prefix.** This lane reported an H3 stream "byte-exact 6/6" that way: the + throwaway script carried the H1 fixture's 128x96 geometry, so it compared + 36864 of 98304 samples and the divergence at x >= 108 was invisible. Agent142-2 + caught it. **Every ours-vs-oracle compare must assert the two lengths are + equal before it compares anything**, must not be handed a fixture whose + geometry it does not know, and must clear BOTH sides' scratch files between + runs (mine cleared `aom.*` and not `ours.*`, a stale-file hazard sitting right + next to the truncation bug). The crate's own + `decode_all_frames_vs_oracle` does assert `got.len() != want.len()`, which is + why the committed gates in this lane were never exposed to it.