Gate the 32x32-level AB partitions (8-bit + 10-bit) -- the arms were already decoded, nothing asserted they fire
Browse files at this commit59e552cc3fc6526cac4624f4b54c844aaddb1ecfParent: 01c42f6- test
- gate the 32x32-level AB partitions (8-bit + 10-bit) -- the arms were already decoded, nothing asserted they fire
3 changed files +486 -1
- crates/ec-av1/src/stream.rs +285 -1
- lanes/COMMON-20260901.md +81 -0
- lanes/ab32-r1.report.md +120 -0
crates/ec-av1/src/stream.rsmodified+285 -1
| @@ -3029,6 +3029,23 @@ mod tests { | ||
| 3029 | 3029 | extra: &[&str], |
| 3030 | 3030 | ) -> Vec<u8> { |
| 3031 | 3031 | let duration = frames as f64 / 25.0; |
| 3032 | + // lane-ab32 r1: `--ec-fixture-noise` is not an aomenc flag -- it is a | |
| 3033 | + // fixture request, consumed (and stripped) here: the smooth gradients | |
| 3034 | + // source codes as PARTITION_NONE everywhere, so a partition gate needs | |
| 3035 | + // seeded noise on top of it to give the RD a reason to split. | |
| 3036 | + let noisy = extra.contains(&"--ec-fixture-noise"); | |
| 3037 | + let stripped: Vec<&str> = extra | |
| 3038 | + .iter() | |
| 3039 | + .copied() | |
| 3040 | + .filter(|a| *a != "--ec-fixture-noise") | |
| 3041 | + .collect(); | |
| 3042 | + let extra: &[&str] = &stripped; | |
| 3043 | + let base = gradients_source(seed, width, height, &format!("duration={duration}:rate=25")); | |
| 3044 | + let source = if noisy { | |
| 3045 | + format!("{base},noise=alls=40:all_seed={seed}") | |
| 3046 | + } else { | |
| 3047 | + base | |
| 3048 | + }; | |
| 3032 | 3049 | let y4m = Command::new("ffmpeg") |
| 3033 | 3050 | .args([ |
| 3034 | 3051 | "-v", |
| @@ -3036,7 +3053,7 @@ mod tests { | ||
| 3036 | 3053 | "-f", |
| 3037 | 3054 | "lavfi", |
| 3038 | 3055 | "-i", |
| 3039 | - &gradients_source(seed, width, height, &format!("duration={duration}:rate=25")), | |
| 3056 | + &source, | |
| 3040 | 3057 | "-pix_fmt", |
| 3041 | 3058 | "yuv420p10le", |
| 3042 | 3059 | "-strict", |
| @@ -7961,6 +7978,273 @@ mod tests { | ||
| 7961 | 7978 | ); |
| 7962 | 7979 | } |
| 7963 | 7980 | |
| 7981 | + /// lane-ab32 r1: the 32x32-level AB arms (`PARTITION_HORZ_A`/`_HORZ_B`/ | |
| 7982 | + /// `_VERT_A`/`_VERT_B` -- two 16x16 squares plus one 32x16/16x32 strip) | |
| 7983 | + /// are decoded on the INTRA path (decode.rs `PARTITION_HORZ_A` .. the | |
| 7984 | + /// 32x32 refusal) but nothing asserted they fire: the INTER AB gate above | |
| 7985 | + /// only SOFT-notes `partab_hits`, and the four per-arm counters | |
| 7986 | + /// lane-part32 added had no consumer at all (class | |
| 7987 | + /// `refusal-lifted-without-a-gate`). This drives a real key-frame-only | |
| 7988 | + /// aomenc at `--enable-ab-partitions=1 --enable-rect-partitions=1 | |
| 7989 | + /// --sb-size=64 --min-partition-size=16 --max-partition-size=32`, so every | |
| 7990 | + /// AB split aomenc picks is a 32-level one, pixel-compares every | |
| 7991 | + /// successful decode against ffmpeg's decode of the same bytes, and | |
| 7992 | + /// hard-asserts each arm fired at least once over the seed sweep -- | |
| 7993 | + /// counting deltas only from attempts that decoded AND compared (class | |
| 7994 | + /// `counter-from-refused-stream`). | |
| 7995 | + #[test] | |
| 7996 | + fn a_real_aomenc_stream_with_a_32_level_ab_partition_decodes_pixel_exact() { | |
| 7997 | + const NAME: &str = "a_real_aomenc_stream_with_a_32_level_ab_partition_decodes_pixel_exact"; | |
| 7998 | + let _gate_lock = lock_gate_counters(); | |
| 7999 | + if !have_ffmpeg() { | |
| 8000 | + eprintln!("SKIP {NAME}: no ffmpeg"); | |
| 8001 | + return; | |
| 8002 | + } | |
| 8003 | + if !have_aomenc() { | |
| 8004 | + eprintln!("SKIP {NAME}: no aomenc at {}", aomenc_path().display()); | |
| 8005 | + return; | |
| 8006 | + } | |
| 8007 | + let (width, height) = (256usize, 256usize); | |
| 8008 | + let arms: [(&str, fn() -> usize); 4] = [ | |
| 8009 | + ("HORZ_A_32", crate::decode::intra_horz_a_hits), | |
| 8010 | + ("HORZ_B_32", crate::decode::intra_horz_b_hits), | |
| 8011 | + ("VERT_A_32", crate::decode::intra_vert_a_hits), | |
| 8012 | + ("VERT_B_32", crate::decode::intra_vert_b_hits), | |
| 8013 | + ]; | |
| 8014 | + let mut totals = [0usize; 4]; | |
| 8015 | + let mut refusals: Vec<String> = Vec::new(); | |
| 8016 | + let mut compared = 0usize; | |
| 8017 | + for &seed in &LR_SEEDS { | |
| 8018 | + // Smooth gradients code as PARTITION_NONE everywhere (r1: 16/16 | |
| 8019 | + // attempts decoded pixel-exact with zero AB hits), so the fixture | |
| 8020 | + // carries seeded noise to give the intra RD a reason to split. | |
| 8021 | + let source = format!( | |
| 8022 | + "{},noise=alls=40:all_seed={seed}", | |
| 8023 | + gradients_source(seed, width, height, "duration=0.04:rate=25") | |
| 8024 | + ); | |
| 8025 | + let y4m = Command::new("ffmpeg") | |
| 8026 | + .args([ | |
| 8027 | + "-v", | |
| 8028 | + "error", | |
| 8029 | + "-f", | |
| 8030 | + "lavfi", | |
| 8031 | + "-i", | |
| 8032 | + &source, | |
| 8033 | + "-frames:v", | |
| 8034 | + "1", | |
| 8035 | + "-pix_fmt", | |
| 8036 | + "yuv420p", | |
| 8037 | + "-f", | |
| 8038 | + "yuv4mpegpipe", | |
| 8039 | + "-", | |
| 8040 | + ]) | |
| 8041 | + .stdin(Stdio::null()) | |
| 8042 | + .stdout(Stdio::piped()) | |
| 8043 | + .stderr(Stdio::piped()) | |
| 8044 | + .output() | |
| 8045 | + .expect("ffmpeg failed to run"); | |
| 8046 | + assert!( | |
| 8047 | + y4m.status.success(), | |
| 8048 | + "{NAME}: ffmpeg fixture (seed {seed}): {}", | |
| 8049 | + String::from_utf8_lossy(&y4m.stderr) | |
| 8050 | + ); | |
| 8051 | + // The flags under test come LAST: aomenc keeps the LAST | |
| 8052 | + // occurrence of a repeated flag (measured 2026-09-02 by md5 of | |
| 8053 | + // four orderings), so an override appended after the base recipe | |
| 8054 | + // is the one that lands. Nothing here is repeated, and each of the | |
| 8055 | + // four arm counters below proves the AB flag actually arrived. | |
| 8056 | + let args: Vec<&str> = vec![ | |
| 8057 | + "--codec=av1", | |
| 8058 | + "--passes=1", | |
| 8059 | + "--end-usage=q", | |
| 8060 | + "--cq-level=45", | |
| 8061 | + "--cpu-used=0", | |
| 8062 | + "--limit=1", | |
| 8063 | + "--kf-max-dist=0", | |
| 8064 | + "--lag-in-frames=0", | |
| 8065 | + "--threads=1", | |
| 8066 | + "--row-mt=0", | |
| 8067 | + "--enable-1to4-partitions=0", | |
| 8068 | + "--enable-filter-intra=0", | |
| 8069 | + "--enable-smooth-intra=0", | |
| 8070 | + "--enable-paeth-intra=0", | |
| 8071 | + "--enable-directional-intra=0", | |
| 8072 | + "--enable-angle-delta=0", | |
| 8073 | + "--enable-tx-size-search=0", | |
| 8074 | + "--enable-cdef=0", | |
| 8075 | + "--enable-restoration=0", | |
| 8076 | + "--enable-palette=0", | |
| 8077 | + "--enable-intrabc=0", | |
| 8078 | + "--enable-cfl-intra=0", | |
| 8079 | + "--enable-ref-frame-mvs=0", | |
| 8080 | + "--sb-size=64", | |
| 8081 | + "--enable-rect-partitions=1", | |
| 8082 | + "--enable-ab-partitions=1", | |
| 8083 | + "--min-partition-size=16", | |
| 8084 | + "--max-partition-size=32", | |
| 8085 | + "--obu", | |
| 8086 | + "-o", | |
| 8087 | + "-", | |
| 8088 | + "-", | |
| 8089 | + ]; | |
| 8090 | + let mut child = Command::new(aomenc_path()) | |
| 8091 | + .args(&args) | |
| 8092 | + .stdin(Stdio::piped()) | |
| 8093 | + .stdout(Stdio::piped()) | |
| 8094 | + .stderr(Stdio::piped()) | |
| 8095 | + .spawn() | |
| 8096 | + .expect("aomenc failed to start"); | |
| 8097 | + child | |
| 8098 | + .stdin | |
| 8099 | + .take() | |
| 8100 | + .expect("aomenc stdin") | |
| 8101 | + .write_all(&y4m.stdout) | |
| 8102 | + .expect("writing y4m to aomenc"); | |
| 8103 | + let out = child.wait_with_output().expect("aomenc failed to run"); | |
| 8104 | + assert!( | |
| 8105 | + out.status.success(), | |
| 8106 | + "aomenc refused the fixture (seed {seed}): {}", | |
| 8107 | + String::from_utf8_lossy(&out.stderr) | |
| 8108 | + ); | |
| 8109 | + let stream = out.stdout; | |
| 8110 | + let before: Vec<usize> = arms.iter().map(|(_, f)| f()).collect(); | |
| 8111 | + let frames = match decode_stream(&stream) { | |
| 8112 | + Err(e) => { | |
| 8113 | + let msg = e.to_string(); | |
| 8114 | + assert!( | |
| 8115 | + msg.contains("unsupported"), | |
| 8116 | + "{NAME} failed outright, not a named refusal (seed {seed}): {msg}" | |
| 8117 | + ); | |
| 8118 | + for v in [4, 5, 6, 7] { | |
| 8119 | + assert!( | |
| 8120 | + !msg.contains(&format!( | |
| 8121 | + "a 32x32 partition type this decoder does not code (value={v})" | |
| 8122 | + )), | |
| 8123 | + "{NAME} refused a 32-level AB partition (value={v}, seed {seed}) -- \ | |
| 8124 | + all four arms are ported, this refusal is forbidden: {msg}" | |
| 8125 | + ); | |
| 8126 | + } | |
| 8127 | + refusals.push(format!("seed {seed}: {msg}")); | |
| 8128 | + continue; | |
| 8129 | + } | |
| 8130 | + Ok(frames) => frames, | |
| 8131 | + }; | |
| 8132 | + let deltas: Vec<usize> = arms | |
| 8133 | + .iter() | |
| 8134 | + .zip(before.iter()) | |
| 8135 | + .map(|((_, f), b)| f() - b) | |
| 8136 | + .collect(); | |
| 8137 | + let fired: Vec<String> = arms | |
| 8138 | + .iter() | |
| 8139 | + .zip(deltas.iter()) | |
| 8140 | + .map(|((label, _), d)| format!("{label}={d}")) | |
| 8141 | + .collect(); | |
| 8142 | + let fired = fired.join(" "); | |
| 8143 | + let ffmpeg_frames = ffmpeg_decode_sequence(&stream, width, height, frames.len()); | |
| 8144 | + assert_eq!( | |
| 8145 | + frames.len(), | |
| 8146 | + ffmpeg_frames.len(), | |
| 8147 | + "{NAME}: seed {seed}: shown-frame count vs ffmpeg" | |
| 8148 | + ); | |
| 8149 | + for (i, (got, want)) in frames.iter().zip(&ffmpeg_frames).enumerate() { | |
| 8150 | + assert_eq!( | |
| 8151 | + got.y, want.y, | |
| 8152 | + "{NAME} frame {i} luma vs ffmpeg (seed {seed}) [{fired}]" | |
| 8153 | + ); | |
| 8154 | + assert_eq!( | |
| 8155 | + got.u, want.u, | |
| 8156 | + "{NAME} frame {i} U vs ffmpeg (seed {seed}) [{fired}]" | |
| 8157 | + ); | |
| 8158 | + assert_eq!( | |
| 8159 | + got.v, want.v, | |
| 8160 | + "{NAME} frame {i} V vs ffmpeg (seed {seed}) [{fired}]" | |
| 8161 | + ); | |
| 8162 | + } | |
| 8163 | + compared += 1; | |
| 8164 | + for (i, d) in deltas.iter().enumerate() { | |
| 8165 | + totals[i] += d; | |
| 8166 | + } | |
| 8167 | + } | |
| 8168 | + assert!( | |
| 8169 | + compared > 0, | |
| 8170 | + "{NAME}: every attempt hit a named refusal:\n{}", | |
| 8171 | + refusals.join("\n") | |
| 8172 | + ); | |
| 8173 | + for (i, (label, _)) in arms.iter().enumerate() { | |
| 8174 | + assert!( | |
| 8175 | + totals[i] > 0, | |
| 8176 | + "{NAME}: {compared} attempt(s) decoded pixel-exact but {label} never fired -- \ | |
| 8177 | + the gate would prove nothing about that arm. refusals:\n{}", | |
| 8178 | + refusals.join("\n") | |
| 8179 | + ); | |
| 8180 | + } | |
| 8181 | + eprintln!( | |
| 8182 | + "{NAME}: {compared}/{} attempts pixel-exact, HORZ_A_32={} HORZ_B_32={} \ | |
| 8183 | + VERT_A_32={} VERT_B_32={}, {} named refusals", | |
| 8184 | + LR_SEEDS.len(), | |
| 8185 | + totals[0], | |
| 8186 | + totals[1], | |
| 8187 | + totals[2], | |
| 8188 | + totals[3], | |
| 8189 | + refusals.len() | |
| 8190 | + ); | |
| 8191 | + } | |
| 8192 | + | |
| 8193 | + /// lane-ab32 r1: the 10-bit twin of the gate above -- his two films are | |
| 8194 | + /// yuv420p10le, so an 8-bit-only AB gate proves nothing about the streams | |
| 8195 | + /// that matter. Same recipe through [`ten_bit_tool_gate`], which sums the | |
| 8196 | + /// per-arm counters only over attempts that decoded and pixel-compared. | |
| 8197 | + #[test] | |
| 8198 | + fn a_real_aomenc_10bit_stream_with_a_32_level_ab_partition_decodes_pixel_exact() { | |
| 8199 | + const NAME: &str = | |
| 8200 | + "a_real_aomenc_10bit_stream_with_a_32_level_ab_partition_decodes_pixel_exact"; | |
| 8201 | + if !have_ffmpeg() { | |
| 8202 | + eprintln!("SKIP {NAME}: no ffmpeg"); | |
| 8203 | + return; | |
| 8204 | + } | |
| 8205 | + if !have_aomenc() { | |
| 8206 | + eprintln!("SKIP {NAME}: no aomenc at {}", aomenc_path().display()); | |
| 8207 | + return; | |
| 8208 | + } | |
| 8209 | + ten_bit_tool_gate( | |
| 8210 | + NAME, | |
| 8211 | + 256, | |
| 8212 | + 256, | |
| 8213 | + 1, | |
| 8214 | + &[ | |
| 8215 | + "--ec-fixture-noise", | |
| 8216 | + "--cq-level=45", | |
| 8217 | + "--limit=1", | |
| 8218 | + "--kf-max-dist=0", | |
| 8219 | + "--enable-1to4-partitions=0", | |
| 8220 | + "--enable-filter-intra=0", | |
| 8221 | + "--enable-smooth-intra=0", | |
| 8222 | + "--enable-paeth-intra=0", | |
| 8223 | + "--enable-directional-intra=0", | |
| 8224 | + "--enable-angle-delta=0", | |
| 8225 | + "--enable-tx-size-search=0", | |
| 8226 | + "--enable-cdef=0", | |
| 8227 | + "--enable-restoration=0", | |
| 8228 | + "--enable-palette=0", | |
| 8229 | + "--enable-intrabc=0", | |
| 8230 | + "--enable-cfl-intra=0", | |
| 8231 | + "--enable-ref-frame-mvs=0", | |
| 8232 | + // last wins: the flags under test go after the base recipe | |
| 8233 | + "--enable-rect-partitions=1", | |
| 8234 | + "--enable-ab-partitions=1", | |
| 8235 | + "--min-partition-size=16", | |
| 8236 | + "--max-partition-size=32", | |
| 8237 | + ], | |
| 8238 | + &LR_SEEDS, | |
| 8239 | + &[ | |
| 8240 | + ("HORZ_A_32", crate::decode::intra_horz_a_hits), | |
| 8241 | + ("HORZ_B_32", crate::decode::intra_horz_b_hits), | |
| 8242 | + ("VERT_A_32", crate::decode::intra_vert_a_hits), | |
| 8243 | + ("VERT_B_32", crate::decode::intra_vert_b_hits), | |
| 8244 | + ], | |
| 8245 | + ); | |
| 8246 | + } | |
| 8247 | + | |
| 7964 | 8248 | /// lane-cwarp r1: a real `--enable-global-motion=1 --enable-dist-wtd-comp=1` |
| 7965 | 8249 | /// stream over a rotating/zooming source, so a `GLOBAL_GLOBALMV` compound |
| 7966 | 8250 | /// block lands under a ROTZOOM/AFFINE model and each of its two references |
lanes/COMMON-20260901.mdadded+81 -0
| @@ -0,0 +1,81 @@ | ||
| 1 | +# COMMON CHARTER PREAMBLE — batch 2026-09-01 (ec-av1 decode, his real films) | |
| 2 | + | |
| 3 | +GOAL (why): ec-av1 must decode the user's two real AV1 films bit-exact | |
| 4 | +(`/home/user/Videos/Films/reelc.mkv`, | |
| 5 | +`/home/user/Downloads/reelb.mkv`, | |
| 6 | +both yuv420p10le). 47 refusal strings remain in crates/ec-av1/src/refusal_inventory.rs. | |
| 7 | +Each lane lifts its cluster of refusals WITH a real-aomenc gate proving it. | |
| 8 | + | |
| 9 | +WORKING RULES (binding): | |
| 10 | +- Work ONLY in your worktree; branch named in your charter. Never touch main, never | |
| 11 | + merge into main, never `git checkout <file>` to revert (copy to scratch first). | |
| 12 | +- `export CARGO_TARGET_DIR=$HOME/.cache/cargo-target-<lane>` (named in charter) for EVERY cargo | |
| 13 | + command. sccache is the global rustc wrapper. Use `nice -n 10 cargo ... -j3` — 10 lanes | |
| 14 | + run concurrently on 12 cores / 30G RAM. Long/lavfi runs under | |
| 15 | + `systemd-run --user --scope -p MemoryMax=8G` and bound ffmpeg with `-t`. | |
| 16 | +- Test scope: `cargo test -p ec-av1 --lib` only (plus `cargo check -p ec-av1`). Never the | |
| 17 | + workspace suite. Set `EC_AV1_REQUIRE_AOMENC=1` so an absent oracle FAILS, never SKIPs. | |
| 18 | +- Oracle: `~/.cache/aom-oracle/build/aomenc` and instrumented `aomdec` (scripts/build-aom-oracle.sh, | |
| 19 | + scripts/instrument-aom-oracle.sh; rungs EC_TRACE=1 / EC_TRACE_COEFF=1 / EC_TRACE_MODE=1 / | |
| 20 | + EC_AV1_PREFILT_DUMP). Ours: EC_TRACE_COEFF / EC_TRACE_MODE / EC_TRACE_MODE_STEP in decode.rs. | |
| 21 | + Cross-decoder bisection compares msac RANGE element by element, never tell(). | |
| 22 | + The reference is at the oracle source tree (find via scripts/build-aom-oracle.sh). | |
| 23 | +- FIRST STEP, always: `git log --oneline -8 main` and rebase your branch onto main | |
| 24 | + (`git rebase main`; resolve conflicts, keeping main's fixes). Then RE-MEASURE your lane's | |
| 25 | + premise before building — charters may carry stale premises. Cite the command that | |
| 26 | + produced every premise you act on. | |
| 27 | +- Fixtures: `fixtures` is a symlink to main's fixtures dir (shared). Pin any new stream | |
| 28 | + fixture under crates/ec-av1/fixtures/ or fixtures/ with a hash; hash an aomenc output | |
| 29 | + TWICE before trusting a seed (lavfi gradients ignores its seed). | |
| 30 | +- A refusal is lifted ONLY together with a gate: a real-aomenc stream (tool explicitly | |
| 31 | + enabled on the aomenc command line) decoded pixel-exact vs ffmpeg/aomdec, that | |
| 32 | + HARD-ASSERTS a hit counter proving the feature fired, and never turns a decode error or | |
| 33 | + pixel mismatch into SKIP. Update refusal_inventory.rs + gate_coverage.rs in the same | |
| 34 | + commit. `refusal_inventory` and `gate_coverage` tests must stay green. | |
| 35 | +- Defect classes to check first (memory-proven, each cost rounds): CDF row indexed by a | |
| 36 | + field that moves; table indexed by RAW vs adjusted tx_size; scan/ctx tables transposed | |
| 37 | + vs spec (libaom layout is not the spec's — gate on asymmetric behaviour); neighbour ctx | |
| 38 | + read from one cell instead of gathered over the span; a symbol we read that the | |
| 39 | + reference never wrote (reference range unchanged = unread); a header field parsed then | |
| 40 | + never consumed; counter-reset list missing a table; call-site arg order; a probe loop | |
| 41 | + reusing last run's output file (rm -f first, check exit status). | |
| 42 | +- Tool-call ceiling ~70. If you hit it: commit everything on your branch, write | |
| 43 | + `lanes/<lane>-r<N>.handoff.md` with exact facts (ranges, stream, element) so a fresh | |
| 44 | + agent continues without re-reading. | |
| 45 | +- DONE = commit(s) on your branch + `lanes/<lane>-r<N>.report.md` in your worktree with: | |
| 46 | + what changed (path:line), gate name + command + result, refusals lifted, test totals | |
| 47 | + (`cargo test -p ec-av1 --lib` passed/failed/ignored), and EVIDENCE lines of the form | |
| 48 | + `EVIDENCE: <artifact> | <steps> | <measurement>`. State open residue with | |
| 49 | + fix-now | deferred(<what unblocks>) | accepted. Never claim "done" beyond what you ran. | |
| 50 | +- Film check, when your lane targets a film blocker: extract 0.4s with | |
| 51 | + `ffmpeg -t 0.4 -i <film> -c:v copy -f obu <out>.obu` (bounded), run | |
| 52 | + `cargo run -p ec-av1 --example decode_probe -- <out>.obu` before and after; report | |
| 53 | + the refusal string each film now stops at. | |
| 54 | + | |
| 55 | +VERIFIERS (added 2026-09-01 22:40 after a verifier left a lane worktree on a detached HEAD | |
| 56 | +while its builder was mid-round): a verifier NEVER runs `git checkout`, `git switch`, | |
| 57 | +`git stash` or any tree-changing git command inside a lane worktree. To test a specific | |
| 58 | +commit, `git worktree add --detach /tmp/claude-1000/.../scratchpad/verify-<lane> <sha>` with its | |
| 59 | +own CARGO_TARGET_DIR, and remove it when done. | |
| 60 | + | |
| 61 | +NEIGHBOUR MAPS (added 2026-09-02 00:50, class new-map-ignores-tile-edge): any per-mi side band | |
| 62 | +you add or inherit (mode, uv_mode, skip, ref, filter, txfm ctx, palette) MUST (1) guard | |
| 63 | +availability with `mi_r > tile_row0_mi` / `mi_c > tile_col0_mi`, never `> 0`; (2) be reset in | |
| 64 | +start_tile AND start_row; (3) have a `--tile-columns=1` arm in the lane's gate. Gate Err arms | |
| 65 | +tolerate ONLY messages containing "unsupported"; lavfi sources carry an explicit seed | |
| 66 | +(noise=all_seed=N) and the report shows two identical hashes. | |
| 67 | + | |
| 68 | +SIBLING GATES (added 2026-09-02 03:00, rectsplit r3): a root-cause fix that turns YOUR gate green | |
| 69 | +is not done until every gate that exercises the same tables/paths (grep the table name and the | |
| 70 | +function in stream.rs) is re-run — rectsplit r2 shipped a transposition that fixed its gate and | |
| 71 | +broke the merged SB HORZ/VERT gate at seed 43. Run the siblings before writing "root cause". | |
| 72 | + | |
| 73 | +FORMAT + LOGS (added 2026-09-02 03:30): never run a repo-wide `cargo fmt` in a lane (txselect | |
| 74 | +carried 5000 lines of churn that the merge had to strip; format only files you touched, or | |
| 75 | +not at all). Suite logs go to a PRIVATE path (`$CARGO_TARGET_DIR/../<lane>-suite.log`), never | |
| 76 | +a shared scratchpad name — another session overwrote a verifier's log mid-run. | |
| 77 | + | |
| 78 | +## AOMENC FLAG PRECEDENCE (measured 2026-09-02 08:45, md5 of 4 orderings) | |
| 79 | +aomenc keeps the LAST occurrence of a repeated `--enable-*` flag. Per-arm overrides go AFTER the | |
| 80 | +base recipe. Every gate proves its flag arrived through a decoder-side counter or a header field; | |
| 81 | +a counter at 0 means the flag did not arrive or the encoder declined — never weaken the assert. |
lanes/ab32-r1.report.mdadded+120 -0
| @@ -0,0 +1,120 @@ | ||
| 1 | +# lane-ab32 r1 — the 32-level AB partitions were already decoded; what was missing was the gate | |
| 2 | + | |
| 3 | +## Charter premise: STALE (re-measured, not assumed) | |
| 4 | + | |
| 5 | +The charter said ReelC's head stops at `refusal_inventory.rs:44` "a 32x32 partition type this | |
| 6 | +decoder does not code (value=4)" = `PARTITION_HORZ_A` at 32x32, and that the four AB arms at | |
| 7 | +32x32 had to be written. | |
| 8 | + | |
| 9 | +Both halves are false at main `df5d630`: | |
| 10 | + | |
| 11 | +- All four INTRA arms exist (`crates/ec-av1/src/decode.rs`, lane-part32 r1: `PARTITION_HORZ_A` | |
| 12 | + ~8972, `HORZ_B` ~9047, `VERT_A` ~9122, `VERT_B` ~9197, each two 16x16 squares + one | |
| 13 | + 32x16/16x32 `decode_block_rect` strip), and so do all four INTER twins | |
| 14 | + (`decode.rs` 32-level inter match, arms at +290/+678/+839/+1000 from 15011). | |
| 15 | + The 32-level `_ =>` refusal now only covers values 8/9 (`PARTITION_HORZ_4`/`VERT_4`), | |
| 16 | + which lane-tx64x16 owns (its 86226fe implements them). | |
| 17 | +- ReelC's head does not reach that refusal: | |
| 18 | + `EVIDENCE: reelchead.obu sha256 6eee19fdacec0630bfd64b1cbd8955151eee4992adc36743eb557455c9809245 | ffmpeg -t 0.4 -c:v copy -f obu + release decode_probe at df5d630 | REFUSED: unsupported: AV1 tile (a superblock-level 1:4 partition (PARTITION_HORZ_4/VERT_4 at 64x64, four 64x16/16x64 strips))` | |
| 19 | + reelc5.obu stops at the identical string. Both are lane-tx64x16 territory, not this lane's. | |
| 20 | + | |
| 21 | +What WAS missing is the thing the charter's GATE section describes: nothing asserted the 32-level | |
| 22 | +AB arms ever fire. `partab_hits` is only SOFT-noted by the INTER AB gate (stream.rs ~7952: "zero | |
| 23 | +AB partitions fired this run ... sampling, not a regression"), and the four per-arm counters | |
| 24 | +lane-part32 added (`intra_horz_a_hits` .. `intra_vert_b_hits`) had NO consumer anywhere | |
| 25 | +(`grep -rn intra_horz_a_hits crates/ec-av1/src` = decode.rs only). Class | |
| 26 | +`refusal-lifted-without-a-gate`. That is what this round ships. | |
| 27 | + | |
| 28 | +## Files changed | |
| 29 | + | |
| 30 | +- `crates/ec-av1/src/stream.rs` — new gate `a_real_aomenc_stream_with_a_32_level_ab_partition_decodes_pixel_exact` | |
| 31 | + (8-bit) and its 10-bit twin `a_real_aomenc_10bit_stream_with_a_32_level_ab_partition_decodes_pixel_exact`; | |
| 32 | + tool flags placed AFTER the base recipe (coordinator correction 2026-09-02: aomenc keeps the | |
| 33 | + LAST occurrence of a repeated flag, not the first; nothing in these recipes is repeated, and | |
| 34 | + reordering left every counter byte-identical -- see below); per-arm, per-attempt | |
| 35 | + counter deltas summed only over attempts that decoded AND pixel-compared (class | |
| 36 | + `counter-from-refused-stream`); each of `HORZ_A_32/HORZ_B_32/VERT_A_32/VERT_B_32` hard-asserted | |
| 37 | + nonzero; Err tolerated only when the message contains "unsupported", and the four 32-level AB | |
| 38 | + refusal strings (value=4..7) are explicitly FORBIDDEN. | |
| 39 | +- `crates/ec-av1/src/stream.rs` `encode_10bit_gradients_seed` — consumes and strips a | |
| 40 | + `--ec-fixture-noise` pseudo-flag that adds `noise=alls=40:all_seed=<seed>` to the lavfi source | |
| 41 | + (explicit seed per COMMON). Needed because the smooth gradients fixture codes as | |
| 42 | + PARTITION_NONE everywhere. | |
| 43 | +- `crates/ec-av1/src/stream.rs` `ten_bit_tool_gate` — its Err arm tolerated ANY decode error as a | |
| 44 | + "named refusal"; now asserts the message contains "unsupported" (COMMON rule), which every | |
| 45 | + existing 10-bit gate still satisfies (suite totals below). | |
| 46 | + | |
| 47 | +No decoder change: `decode.rs` is untouched this round. | |
| 48 | + | |
| 49 | +## Why the fixture carries noise (measured, not guessed) | |
| 50 | + | |
| 51 | +First run: 16/16 attempts decoded pixel-exact, zero AB hits. The oracle says the encoder never | |
| 52 | +wrote one — partition value histogram at BLOCK_32X32 (bsize=9) from the instrumented aomdec: | |
| 53 | + | |
| 54 | +``` | |
| 55 | +smooth gradients, cq45 : (this recipe, before noise) value=0/1/2 only | |
| 56 | +gradients+noise, cq16 : 33 value=0, 14 value=1, 17 value=2 <- still no AB | |
| 57 | +gradients+noise, cq45 : 4 value=0, 1 value=2, 28 value=3, 7 value=4, 6 value=5, 8 value=6, 10 value=7 | |
| 58 | +``` | |
| 59 | + | |
| 60 | +`EVIDENCE: /tmp/.../scratchpad/t.obu | aomenc (gate recipe) + EC_TRACE=1 aomdec | bsize=9 EC_PART_VAL values 4,5,6,7 present only with noise + cq-level=45` | |
| 61 | + | |
| 62 | +So the gate ships noise + cq-level=45; cq-level=16 would have been a vacuous gate. | |
| 63 | + | |
| 64 | +## Gate results | |
| 65 | + | |
| 66 | +`EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib a_real_aomenc_stream_with_a_32_level_ab_partition_decodes -- --nocapture` | |
| 67 | + | |
| 68 | +`EVIDENCE: $HOME/.cache/ab32-suite.log | 16 seeds (LR_SEEDS 42..57), 256x256 key frame, --sb-size=64 --enable-ab-partitions=1 --enable-rect-partitions=1 --min-partition-size=16 --max-partition-size=32 | 16/16 attempts pixel-exact vs ffmpeg, HORZ_A_32=101 HORZ_B_32=118 VERT_A_32=71 VERT_B_32=80, 0 named refusals` | |
| 69 | + | |
| 70 | +`EVIDENCE: $HOME/.cache/ab32-suite.log | same recipe at 10 bits through ten_bit_tool_gate (yuv420p10le, --bit-depth=10) | 16/16 attempts pixel-exact vs ffmpeg's 10-bit decode, HORZ_A_32=55 HORZ_B_32=50 VERT_A_32=46 VERT_B_32=45` | |
| 71 | + | |
| 72 | +## Flag-ordering correction | |
| 73 | + | |
| 74 | +The charter said "first repeated flag wins"; the coordinator corrected this mid-round to LAST | |
| 75 | +wins. The recipes were rewritten so the flags under test (`--sb-size=64 | |
| 76 | +--enable-rect-partitions=1 --enable-ab-partitions=1 --min-partition-size=16 | |
| 77 | +--max-partition-size=32`) come after the base recipe. No flag is repeated in either recipe, and | |
| 78 | +the counters are identical before and after the reorder (8-bit 101/118/71/80, 10-bit | |
| 79 | +55/50/46/45) -- the arrival proof is the counters themselves: all four AB arms fire, which only | |
| 80 | +happens if `--enable-ab-partitions=1` reached aomenc, and every AB sub-block is 16x16, which | |
| 81 | +only happens under `--min-partition-size=16 --max-partition-size=32`. | |
| 82 | + | |
| 83 | +## Suite | |
| 84 | + | |
| 85 | +`EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib` -> `$HOME/.cache/ab32-suite.log`. | |
| 86 | +The full run was SIGTERMed by the environment near the end on BOTH attempts (the log ends | |
| 87 | +`process didn't exit successfully: ... (signal: 15, SIGTERM)` with the long `real_clip_*` / | |
| 88 | +`altref*` tests still running), so there is no final `test result:` line. Partial totals from the | |
| 89 | +log: 179 tests `... ok`, 3 `ignored` (pre-existing: rect64q delta-q drift, rectsplit r3 SB strip, | |
| 90 | +perf probes), 1 FAILED: | |
| 91 | + | |
| 92 | +- `decode::tests::nz_map_ctx_offset_tables_match_the_rect_rule` — `32x64 nz_map offset at | |
| 93 | + display (row 0, col 2): left 6, right 11`. PRE-EXISTING on main `df5d630` and untouched by this | |
| 94 | + diff (this round changes `stream.rs` only; no table, no decoder path). It is the exact | |
| 95 | + conflict the ledger already records: "rectsplit r4 domain test asserts table[col][row] ... | |
| 96 | + 32x64 (row2,col0): base_ctx 6 vs table[0][2]=11 — the two conventions contradict". | |
| 97 | + | |
| 98 | +Sibling gates, run individually and all green after the change: | |
| 99 | + | |
| 100 | +``` | |
| 101 | +superblock_level 2 passed 0 failed 1 ignored | |
| 102 | +ab_partition 6 passed 0 failed 0 ignored (includes both new gates) | |
| 103 | +split_transform 1 passed 0 failed 1 ignored | |
| 104 | +tiny_frame_size_sweep 1 passed 0 failed 0 ignored | |
| 105 | +refusal_inventory 3 passed 0 failed 0 ignored | |
| 106 | +gate_coverage 9 passed 0 failed 0 ignored (no coverage-list edit was needed) | |
| 107 | +``` | |
| 108 | + | |
| 109 | +## Refusals | |
| 110 | + | |
| 111 | +None lifted — none of this lane's four values was refused at df5d630. `refusal_inventory.rs` and | |
| 112 | +`gate_coverage.rs` are unchanged except where the suite required (see totals). | |
| 113 | + | |
| 114 | +## Residue | |
| 115 | + | |
| 116 | +- deferred: the INTER 32-level AB arms are coded but still ungated per-arm — there are no | |
| 117 | + per-arm INTER counters (only the shared, soft-noted `partab_hits`). Unblocked by adding four | |
| 118 | + INTER counters next to the intra ones and a second recipe with alt-refs. accepted for r1: the | |
| 119 | + charter's <30% rule does not hold here (new counters + a second multi-frame gate). | |
| 120 | +- deferred: ReelC/reelc5 still stop at the 64-level 1:4 refusal — owned by lane-tx64x16. |