forge
Explore
Log in

Don't you dare go Hollow

Merge lane-vp9-f72: inter context write-back zeroes the window's tail

Browse files at this commit

177bb1930acc3e0b17db3582b4911ff83c0cae75Ahmet Kaan GümüşParent: 57e05066743870
The lane fixes the frame-72 tile desync: `write_tx_context` must narrow
libvpx's context spread to the transform window's width before applying
the frame-edge shift, so the shift zeroes the window's tail rather than
bytes past it. The odd-dims lane (e8152b9b) touched only RefPlane
extents/crop_picture; the two regions are disjoint and the merge is clean.

Fold in the reviewer's P3 nit: the `TDK` diagnostic (gated by
`EC_VP9_TOKDGB`) now prints the CLEARED window at the reset offset per
plane, mirroring the oracle's `SKIPCTX` print, instead of the whole
rolling left buffer from base index 0.
crates/ec-vp9/src/decode.rsmodified+73 -36
@@ -1675,7 +1675,6 @@ impl Decoder {
1675 let maxw = (n4w as i32 + (mb_to_right.min(0) >> (5 + s))).max(0) as usize;1675 let maxw = (n4w as i32 + (mb_to_right.min(0) >> (5 + s))).max(0) as usize;
1676 let maxh = (n4h as i32 + (mb_to_bottom.min(0) >> (5 + s))).max(0) as usize;1676 let maxh = (n4h as i32 + (mb_to_bottom.min(0) >> (5 + s))).max(0) as usize;
1677 let nblocks = 1usize << tx_size;1677 let nblocks = 1usize << tx_size;
1678- let eob_pos = usize::from(coef.eob > 0);
1679 let shift_a = if maxw > 0 && nblocks + tx_col > maxw {1678 let shift_a = if maxw > 0 && nblocks + tx_col > maxw {
1680 (nblocks - (maxw - tx_col)) * 81679 (nblocks - (maxw - tx_col)) * 8
1681 } else {1680 } else {
@@ -1686,35 +1685,16 @@ impl Decoder {
1686 } else {1685 } else {
1687 01686 0
1688 };1687 };
1689- match tx_size {1688+ write_tx_context(ectx, plane, tx_size, ax, ay, coef.eob > 0, shift_a, shift_l);
1690- TX_4X4 => {1689+ if crate::tokdbg_enabled() {
1691- ectx[plane].above[ax] = eob_pos as u8;1690+ eprintln!(
1692- ectx[plane].left[ay] = eob_pos as u8;1691+ "TDW row={mi_row} col={mi_col} plane={plane} brow={tx_row} bcol={tx_col} tx={tx_size} eob={} sa={} sl={} aw={:?} lw={:?} intra=1",
1693- }1692+ coef.eob,
1694- TX_8X8 => {1693+ shift_a,
1695- let va = ((eob_pos as u16) * 0x0101) >> shift_a;1694+ shift_l,
1696- ectx[plane].above[ax] = va as u8;1695+ &ectx[plane].above[ax..ax + nblocks],
1697- ectx[plane].above[ax + 1] = (va >> 8) as u8;1696+ &ectx[plane].left[ay..ay + nblocks],
1698- let vl = ((eob_pos as u16) * 0x0101) >> shift_l;1697+ );
1699- ectx[plane].left[ay] = vl as u8;
1700- ectx[plane].left[ay + 1] = (vl >> 8) as u8;
1701- }
1702- TX_16X16 => {
1703- for k in 0..4 {
1704- let va = ((eob_pos as u32) * 0x01010101) >> shift_a;
1705- ectx[plane].above[ax + k] = (va >> (8 * k)) as u8;
1706- let vl = ((eob_pos as u32) * 0x01010101) >> shift_l;
1707- ectx[plane].left[ay + k] = (vl >> (8 * k)) as u8;
1708- }
1709- }
1710- _ => {
1711- for k in 0..8 {
1712- let va = ((eob_pos as u64) * 0x0101010101010101) >> shift_a;
1713- ectx[plane].above[ax + k] = (va >> (8 * k)) as u8;
1714- let vl = ((eob_pos as u64) * 0x0101010101010101) >> shift_l;
1715- ectx[plane].left[ay + k] = (vl >> (8 * k)) as u8;
1716- }
1717- }
1718 }1698 }
1719 1699
1720 // 4. Residual add.1700 // 4. Residual add.
@@ -1847,6 +1827,59 @@ fn reset_skip_context(
1847 ectx[plane].left[(offy + i) % lrows] = 0;1827 ectx[plane].left[(offy + i) % lrows] = 0;
1848 }1828 }
1849 }1829 }
1830+ if crate::tokdbg_enabled() {
1831+ // Mirror the oracle's `SKIPCTX` print: the CLEARED window, indexed from
1832+ // the reset offset (libvpx's `left_context` is already offset to the
1833+ // block), not the whole rolling buffer from base index 0.
1834+ let mut line = format!("TDK row={row} col={col} n4w={n4w:?} n4h={n4h:?}");
1835+ for plane in 0..3usize {
1836+ let s = usize::from(plane != 0);
1837+ let offx = (col << 1) >> s;
1838+ let offy = (row << 1) >> s;
1839+ let lrows = 32usize >> s;
1840+ let a: Vec<u8> = (0..n4w[plane]).map(|i| ectx[plane].above[offx + i]).collect();
1841+ let l: Vec<u8> = (0..n4h[plane].min(lrows))
1842+ .map(|i| ectx[plane].left[(offy + i) % lrows])
1843+ .collect();
1844+ line.push_str(&format!(" p{plane} a={a:?} l={l:?}"));
1845+ }
1846+ eprintln!("{line}");
1847+ }
1848+}
1849+
1850+/// The entropy-context write-back of one transform block
1851+/// (`vp9_decode_block_tokens`, `vp9_detokenize.c:273-323`): the block's
1852+/// `eob` spreads over its `1 << tx_size` 4x4 slots, and `shift_a`/`shift_l`
1853+/// (the `get_ctx_shift` frame-edge rule) zero the slots past the frame edge.
1854+///
1855+/// libvpx applies the shift to a value whose WIDTH IS THE WINDOW'S — a
1856+/// `(uint16_t)` for `TX_8X8`, `(uint32_t)` for `TX_16X16`, `(uint64_t)` for
1857+/// `TX_32X32` — so the shift zeroes the window's TAIL. Shifting a 64-bit
1858+/// spread instead only zeroes bytes past the window and leaves the in-window
1859+/// tail set: the last-SB-row chroma blocks then hand a stale 1 to the next
1860+/// row's context read (the frame-72 desync).
1861+fn write_tx_context(
1862+ ectx: &mut [PlaneContexts; 3],
1863+ plane: usize,
1864+ tx_size: usize,
1865+ ax: usize,
1866+ ay: usize,
1867+ eob: bool,
1868+ shift_a: usize,
1869+ shift_l: usize,
1870+) {
1871+ const ONES: u64 = 0x0101_0101_0101_0101;
1872+ let nblocks = 1usize << tx_size;
1873+ let eob_pos = u64::from(eob);
1874+ // Narrow to the window first (libvpx's cast), then apply the edge shift;
1875+ // the clamp keeps a fully-outside window (libvpx: undefined shift) total.
1876+ let narrow = 64 - 8 * nblocks;
1877+ let spread_a = ((eob_pos * ONES) >> narrow) >> shift_a.min(8 * nblocks);
1878+ let spread_l = ((eob_pos * ONES) >> narrow) >> shift_l.min(8 * nblocks);
1879+ for k in 0..nblocks {
1880+ ectx[plane].above[ax + k] = (spread_a >> (8 * k)) as u8;
1881+ ectx[plane].left[ay + k] = (spread_l >> (8 * k)) as u8;
1882+ }
1850 }1883 }
1851 1884
1852 /// `mode_lf_lut` (`vp9/common/vp9_loopfilter.c:223`):1885 /// `mode_lf_lut` (`vp9/common/vp9_loopfilter.c:223`):
@@ -1937,7 +1970,6 @@ fn decode_inter_tx_tokens(
1937 let n4h_s = bh * 2 >> s;1970 let n4h_s = bh * 2 >> s;
1938 let maxw = (n4w_s as i32 + (mb_to_right.min(0) >> (5 + s))).max(0) as usize;1971 let maxw = (n4w_s as i32 + (mb_to_right.min(0) >> (5 + s))).max(0) as usize;
1939 let maxh = (n4h_s as i32 + (mb_to_bottom.min(0) >> (5 + s))).max(0) as usize;1972 let maxh = (n4h_s as i32 + (mb_to_bottom.min(0) >> (5 + s))).max(0) as usize;
1940- let eob_pos = u64::from(coef.eob > 0);
1941 let shift_a = if maxw > 0 && nblocks + bcol > maxw {1973 let shift_a = if maxw > 0 && nblocks + bcol > maxw {
1942 (nblocks - (maxw - bcol)) * 81974 (nblocks - (maxw - bcol)) * 8
1943 } else {1975 } else {
@@ -1948,11 +1980,16 @@ fn decode_inter_tx_tokens(
1948 } else {1980 } else {
1949 01981 0
1950 };1982 };
1951- let spread_a = (eob_pos * 0x0101_0101_0101_0101) >> shift_a;1983+ write_tx_context(ectx, plane, tx_size, ax, ay, coef.eob > 0, shift_a, shift_l);
1952- let spread_l = (eob_pos * 0x0101_0101_0101_0101) >> shift_l;1984+ if crate::tokdbg_enabled() {
1953- for k in 0..nblocks {1985+ eprintln!(
1954- ectx[plane].above[ax + k] = (spread_a >> (8 * k)) as u8;1986+ "TDW row={row} col={col} plane={plane} brow={brow} bcol={bcol} tx={tx_size} eob={} sa={} sl={} aw={:?} lw={:?}",
1955- ectx[plane].left[ay + k] = (spread_l >> (8 * k)) as u8;1987+ coef.eob,
1988+ shift_a,
1989+ shift_l,
1990+ &ectx[plane].above[ax..ax + nblocks],
1991+ &ectx[plane].left[ay..ay + nblocks],
1992+ );
1956 }1993 }
1957 coef1994 coef
1958 }1995 }
crates/ec-vp9/tests/inter_pixels_exact.rsmodified+27 -0
@@ -129,3 +129,30 @@ fn inter_gop_with_tile_columns_matches_ffmpeg() {
129 ensure_fixture(&path, 1);129 ensure_fixture(&path, 1);
130 assert!(compare(&path) >= 2);130 assert!(compare(&path) >= 2);
131 }131 }
132+
133+/// Real-content regression for the last-partial-SB-row context bug: this
134+/// 120-frame 1080p stream used to abort at input frame 72 with
135+/// `tile bool decoder desync`, because a chroma transform block whose
136+/// write-back window runs past the frame bottom edge kept the window's
137+/// TAIL slot set (`write_tx_context`), and the next row of blocks read it
138+/// as an entropy context. Every shown frame must match ffmpeg.
139+///
140+/// Media-gated: the corpus fixture is not versioned, so the witness skips
141+/// when `fixtures/bitstreams/vp9-1080p-60-8bit.ivf` is absent.
142+#[test]
143+fn corpus_1080p_60fps_matches_ffmpeg_past_frame_72() {
144+ let Some(dir) = ivf::fixture_dir() else {
145+ println!("SKIP: fixtures/bitstreams absent (media-gated witness)");
146+ return;
147+ };
148+ let path = dir.join("vp9-1080p-60-8bit.ivf");
149+ if !path.exists() {
150+ println!("SKIP: {} absent (media-gated witness)", path.display());
151+ return;
152+ }
153+ let shown = compare(&path);
154+ assert!(
155+ shown >= 73,
156+ "the witness must decode past input frame 72 (got {shown} shown frames)"
157+ );
158+}
lanes/vp9f72.report.mdadded+256 -0
@@ -0,0 +1,256 @@
1+# Lane vp9f72: the frame-72 tile desync — entropy-context write-back width
2+
3+Branch `lane-vp9-f72`, base `main e910d25b`. Crate scope: `crates/ec-vp9` only.
4+Worktree `/home/user/Documents/Code/Rust/edith_codecs-vp9f72`, private
5+`CARGO_TARGET_DIR=$HOME/.cache/cargo-target-vp9f72`.
6+
7+Deliverable: `vp9-1080p-60-8bit.ivf` (1920x1080, 120 frames) decodes **all 120
8+frames byte-identically** to the local libvpx 1.15 oracle, and the rest of the
9+corpus is unchanged; every other corpus stream stays byte-identical.
10+
11+## Baseline (milestone 0)
12+
13+ $ cd /home/user/Documents/Code/Rust/edith_codecs-vp9f72
14+ $ CARGO_TARGET_DIR=$HOME/.cache/cargo-target-vp9f72 cargo test -p ec-vp9
15+ -> 20 test binaries, 31 passed, 0 failed, 0 ignored
16+ $ cargo check -p ec-vp9 # warnings
17+ -> 5 warnings (modes.rs `partition_probs`/`x_mis`/`y_mis`, `read_partition`,
18+ tables `TM_PRED`) -- identical count on the base worktree
19+
20+## Symptom and reproduction
21+
22+ $ $HOME/.cache/vp9pix/sweep.sh vp9-1080p-60-8bit 1920 1080 # against the vp9pix worktree
23+ # on THIS lane's tree (see `$HOME/.cache/vp9f72/sweep_f72.sh`, same shape):
24+ -> 72 shown frames, `PIXERR input=72: corrupt bitstream: vp9: tile bool decoder desync`
25+
26+Frames 0..71 are byte-identical; frame 72 aborts. Reproduced on this lane's
27+build before any edit (72/120 shown, error at input 72).
28+
29+## Root cause
30+
31+**The entropy-context write-back of a transform block applied the frame-edge
32+shift to a 64-bit spread, so it zeroed bytes BEYOND the window instead of the
33+window's tail.**
34+
35+libvpx `vp9_detokenize.c:273-323` (`vp9_decode_block_tokens`) writes:
36+
37+ case TX_8X8:
38+ get_ctx_shift(xd, &ctx_shift_a, &ctx_shift_l, x, y, 1 << TX_8X8);
39+ ...
40+ *(uint16_t *)a = ((eob > 0) * 0x0101) >> ctx_shift_a;
41+ *(uint16_t *)l = ((eob > 0) * 0x0101) >> ctx_shift_l;
42+
43+The shift is applied to a value **whose width is the written window's** (u16
44+for `TX_8X8`, u32 for `TX_16X16`, u64 for `TX_32X32`), so `>> 8` on a two-byte
45+window yields `0x0001` — bytes `[1, 0]`. Our port shifted the full 64-bit
46+spread (`0x0101..01 >> 8` = `0x0001_0101_0101_0101`) and then took byte `k`,
47+which leaves bytes `[1, 1]`: the window's last slot keeps its old value.
48+
49+`get_ctx_shift` only fires when the block runs past an edge
50+(`xd->max_blocks_wide/high != 0`, i.e. `mb_to_*_edge < 0`), which needs an mi
51+extent that is not a multiple of the block size — for 1080 (mi_rows 135) that
52+is exactly the **last, partial superblock row**. So frames 0..~71 behave and
53+the defect shows up wherever a bottom-row chroma block's stale tail slot is
54+later read as an entropy context.
55+
56+Mechanism as an equation (the written window for `nblocks` slots):
57+
58+| | written bytes |
59+|---|---|
60+| libvpx | `mask(nblocks) >> shift` |
61+| our port (bug) | `(mask(8) >> shift)` truncated to `nblocks` bytes |
62+
63+`mask(n) = (eob>0) * 0x0101..01` over `n` bytes. The two agree only for
64+`shift == 0` (every other corpus stream, every non-edge block) — hence a
65+corpus-only defect.
66+
67+### The two-site oracle that pinned it
68+
69+A **fresh** instrumented libvpx 1.15.0 was built for this lane (the parse-time
70+`/tmp/vp9loss` build was gone; `$HOME/.cache/vp9pix/drv_pix` is a static
71+pixel-only driver and could not print contexts). Build + instruments:
72+
73+ $HOME/.cache/vp9f72/libvpx-1.15.0 # configure --disable-unit-tests --disable-vp8
74+ # --disable-vp9-encoder --disable-examples --disable-tools --enable-pic
75+ vp9/decoder/vp9_decodeframe.c : g_dbg_row/g_dbg_col/g_dbg_bsize set in decode_block;
76+ `SKIPCTX` print at the end of dec_reset_skip_context
77+ vp9/decoder/vp9_detokenize.c : `TXBW` print of (row, col, plane, x, y, tx, a[], l[]) before the switch;
78+ `TXBWC` print of (ctx, eob, shift_a, shift_l, written a[]/l[]) after it
79+ $HOME/.cache/vp9f72/drv_txbw # drv.c linked against that build
80+
81+Per-frame arming without rebuilding the driver: `$HOME/.cache/vp9f72/armtrace.c`
82+is an `LD_PRELOAD` that counts IVF header/size reads (`fread`) and sets/unsets
83+the instrument env vars at the requested frame (`TRACEFROM=72 TRACETO=73
84+ARMVARS="TXBW=1 SKIPCTX=1 MODEDUMP=1"`). Both sides' events are then compared
85+block by block.
86+
87+**First divergent event (pre-fix), tile 3, decode-order index 2076:**
88+
89+ O (132,180) plane 1 bcol=2 brow=2 tx=1 eob=3 sl=8 lw=[1, 0]
90+ M (132,180) plane 1 bcol=2 brow=2 tx=1 eob=3 sl=8 lw=[1, 1]
91+
92+Same shift (`sl=8`), different written window — the bug above, exactly.
93+
94+**First divergence that reads it** (same tile, block `(132,200)`):
95+
96+ O (132,200) p=1 bcol=0 brow=2 tx=1 a=[0, 0] l=[0, 0] ctx=0
97+ M (132,200) p=1 bcol=0 brow=2 tx=1 a=[0, 0] l=[0, 1] cin=1
98+
99+and in the bool trace the first differing read is the first coefficient bool
100+of that transform block: oracle prob **217** (band 0, ctx 0), ours prob **98**
101+(band 0, ctx 1) — the "same ordinal, different question" signature of a wrong
102+entropy context, 3 bools after the tile's marker read.
103+
104+## Fix
105+
106+One rule, one place: `write_tx_context` (`crates/ec-vp9/src/decode.rs`) now
107+mirrors libvpx's per-tx-size casts — narrow the spread to the window width
108+FIRST, then apply the edge shift:
109+
110+ let narrow = 64 - 8 * nblocks; // libvpx's cast
111+ let spread_a = ((eob_pos * ONES) >> narrow) >> shift_a.min(8 * nblocks);
112+ let spread_l = ((eob_pos * ONES) >> narrow) >> shift_l.min(8 * nblocks);
113+
114+The `.min(8 * nblocks)` clamp is the only liberty taken: libvpx shifts a wider
115+type by more than its own width there (undefined in C, 0 on x86); the clamp
116+makes the same intent total in Rust. It is unreachable from the walk (a block
117+entirely past the edge is never visited).
118+
119+Both call sites use it: the inter token path (`decode_inter_tx_tokens`) and
120+the intra-in-inter path (`predict_and_reconstruct`). The latter already had
121+per-width casts and was correct — sharing the helper keeps the class fixed in
122+one place instead of two.
123+
124+## Evidence
125+
126+### 1. State-event equality with libvpx on frame 72 (post-fix)
127+
128+Every transform-block context write (value, edge shift and the written
129+a[]/l[] window) and every skip-context reset, in decode order, per tile:
130+
131+| tile | writes ours | writes oracle | equals | skip resets ours | oracle |
132+|---|---|---|---|---|---|
133+| 0 | 705 | 705 | yes | 246 | 246 |
134+| 1 | 1449 | 1449 | yes | 246 | 246 |
135+| 2 | 2824 | 2824 | yes | 300 | 300 |
136+| 3 | 3511 | 3511 | yes | 308 | 308 |
137+
138+Pre-fix, the write streams diverged by exactly one window per edge block
139+(tile 3 index 2076) and the reset streams matched until the desync.
140+
141+### 2. Pixel byte-exactness (the acceptance gate)
142+
143+ $ $HOME/.cache/vp9f72/sweep_f72.sh <fixture> <w> <h> # oracle drv_pix + our dump + pixcmp.py
144+
145+| fixture | frames | identical |
146+|---|---|---|
147+| `vp9-1080p-60-8bit.ivf` (1920x1080) | 120 | **120/120** (was 72) |
148+| `vp9-1080p-23.976-8bit.ivf` | 48 | 48/48 |
149+| `vp9-2160p-23.976-8bit.ivf` (3840x2160) | 48 | 48/48 |
150+| `vp9-superframe-altref.ivf` (320x240) | 60 | 60/60 |
151+| `vp9-tiles-1280.ivf` (1280x720) | 30 | 30/30 |
152+| `/tmp/inter.ivf` (1080p, 2 tile cols) | 3 | 3/3 |
153+| `/tmp/inter1.ivf` (1080p, 1 tile col) | 3 | 3/3 |
154+| generated 1918x1080 60-frame-long GOP (even, non-multiple-of-8 width) | 120 | 120/120 |
155+
156+The 10-bit corpus members are refused by name as before
157+(`PIXERR input=0: unsupported: vp9 profile 2`).
158+
159+### 3. Fail-pre-fix / pass-post-fix
160+
161+New media-gated witness `corpus_1080p_60fps_matches_ffmpeg_past_frame_72`
162+(`tests/inter_pixels_exact.rs`, reuses the file's `compare()` against
163+ffmpeg's rawvideo):
164+
165+ # lane tree (fixed):
166+ $ CARGO_TARGET_DIR=$HOME/.cache/cargo-target-vp9f72 cargo test -p ec-vp9 --test inter_pixels_exact
167+ -> 3 passed (incl. corpus_1080p_60fps_matches_ffmpeg_past_frame_72)
168+
169+ # base worktree at e910d25b + the same test file (throwaway, removed):
170+ $ ... cargo test -p ec-vp9 --test inter_pixels_exact corpus_1080p
171+ -> panicked at inter_pixels_exact.rs:82: frame decodes:
172+ Corrupt { context: "vp9: tile bool decoder desync" }
173+ test result: FAILED. 0 passed; 1 failed
174+
175+Skipped (with a `SKIP:` line) when `fixtures/bitstreams/vp9-1080p-60-8bit.ivf`
176+is absent — the corpus fixtures are not versioned.
177+
178+### 4. Gates
179+
180+ $ CARGO_TARGET_DIR=$HOME/.cache/cargo-target-vp9f72 cargo test -p ec-vp9
181+ -> 20 test binaries, 31 passed, 0 failed, 0 ignored
182+ $ cargo check -p ec-vp9 | grep -c ^warning
183+ -> 6 (5 warnings + the summary line) -- equal to the base worktree
184+ $ rustfmt --edition 2021 --check crates/ec-vp9/src/decode.rs
185+ -> 6 diffs, exactly the pre-existing count on the base tree (import
186+ ordering + the repo's compact-argument style); my additions are clean
187+ $ rustfmt --edition 2021 --check crates/ec-vp9/tests/inter_pixels_exact.rs
188+ -> only ivf.rs (shared `mod ivf`) pre-existing diffs
189+
190+Named refusals unchanged (verified with the vp9pix scratch fixtures):
191+
192+ refusal_odd.ivf -> "vp9 inter odd frame dimensions (321x241 ...)"
193+ refusal_sizechange.ivf -> "vp9 inter reference size change (...)"
194+ vp9-1080p-23.976-10bit -> "vp9 profile 2 ..."
195+
196+## Deferred / limitations (explicit)
197+
198+- **The horizontal half of the class has no witness.** `shift_a` follows the
199+ same rule and uses the same helper, but `mb_to_right_edge < 0` needs an mi
200+ extent that is not a multiple of the block size in the COLUMN direction
201+ (mi_cols odd), which no corpus stream here reaches — a 1918x1080 stream
202+ (`mi_cols` 240, even) decodes 120/120 identically on BOTH the base and the
203+ fixed trees, so it is not a witness. `deferred(<no reachable width in the
204+ corpus>)`: the vertical half is what real content hits.
205+- **Cross-lane scope**: the odd-*coded*-extent path belongs to `lane-vp9-odd`
206+ (merged on main as `e8152b9b`, which does not touch the write-back). My fix
207+ is orthogonal — verified inert: `odd.ivf` decodes byte-identically on the
208+ base and this lane (460800 bytes, `cmp` equal). The odd-dims refusal is left
209+ in place.
210+- Diagnostics kept (gated by the existing scratch hook `EC_VP9_TOKDGB`):
211+ `TDB` (transform-block context read, pre-existing), `TDW` (write value +
212+ shift + written window, both token paths) and `TDK` (skip-context reset).
213+ They are the instruments that isolated this defect; a next context lane can
214+ re-derive any of the tables above from them.
215+
216+## Repro (all commands a verifier can re-run)
217+
218+ # 1. gate
219+ cd /home/user/Documents/Code/Rust/edith_codecs-vp9f72
220+ CARGO_TARGET_DIR=$HOME/.cache/cargo-target-vp9f72 cargo test -p ec-vp9
221+
222+ # 2. the acceptance sweep (120/120)
223+ $HOME/.cache/vp9f72/sweep_f72.sh vp9-1080p-60-8bit 1920 1080
224+
225+ # 3. oracle state-event equality for frame 72
226+ cd $HOME/.cache/vp9f72/libvpx-1.15.0 && make -j6
227+ gcc -O1 -g -o $HOME/.cache/vp9f72/drv_txbw $HOME/.cache/vp9pix/drv.c -I. -Ibuild/make -L. -lvpx -lm -lpthread
228+ gcc -O1 -shared -fPIC -o $HOME/.cache/vp9f72/armtrace.so $HOME/.cache/vp9f72/armtrace.c -ldl
229+ TRACEFROM=72 TRACETO=73 ARMVARS="TXBW=1 SKIPCTX=1" \
230+ LD_PRELOAD=$HOME/.cache/vp9f72/armtrace.so $HOME/.cache/vp9f72/drv_txbw \
231+ <fixtures>/vp9-1080p-60-8bit.ivf 2>or.txt
232+ cd /home/user/Documents/Code/Rust/edith_codecs-vp9f72
233+ CARGO_TARGET_DIR=$HOME/.cache/cargo-target-vp9f72 INTER_IVF=<fixtures>/vp9-1080p-60-8bit.ivf \
234+ EC_VP9_PIXDUMP=/dev/null EC_VP9_TOKDGB=1 \
235+ cargo test -p ec-vp9 --test scratch_pixdump -- --nocapture 2>&1 \
236+ | awk '/PIXFRAME input=71 /{on=1;next} /PIXFRAME input=72 /{exit} on' > ours.txt
237+ # then diff the TDW/TDK event streams per tile (scripts under $HOME/.cache/vp9f72)
238+
239+## VERDICT
240+
241+- GATE 1: `cargo test -p ec-vp9` — 20 binaries, 31 passed, 0 failed, 0 ignored: **PASS**
242+- GATE 2: `sweep_f72.sh vp9-1080p-60-8bit 1920 1080` — **120/120 byte-identical**: **PASS**
243+- GATE 3: corpus re-sweep (48/48, 48/48, 60/60, 30/30, 3/3, 3/3, 1918-wide 120/120): **PASS**
244+- GATE 4: state-event equality with libvpx (writes + skip resets, per tile): **PASS**
245+- GATE 5: fail-pre-fix / pass-post-fix witness, media-gated per house style: **PASS**
246+- GATE 6: warning parity (5) and scoped rustfmt parity with the base tree: **PASS**
247+- GATE 7: this report; deferred items named above: **PASS**
248+
249+## git log
250+
251+ cargo test / git log for this lane:
252+ * THIS COMMIT -- "vp9: inter context write-back zeroes the window's tail,
253+ not bytes past it" -- the only commit on lane-vp9-f72 above the base
254+ * e910d25b vp9pix: merge-side follow-ups -- ff merge verified, dependent
255+ sweep empty, gates re-run on main (base)
256+ $ git log --oneline lane-vp9-f72 ^e910d25b # -> exactly one line