forge
Explore
Log in

Don't you dare go Hollow

vp9kf: fix the stale tile-bounds pin in ec-vp9-syntax; record the merge follow-ups

Browse files at this commit

0f31b1dc2b3df3cae435a9a7de96269b18e41b2eAhmet Kaan GümüşParent: 2a10cb5
The lane's gates were crate-scoped (cargo test -p ec-vp9), so the merge into
main is what surfaced a stale in-lib test: tile_bounds_match_the_spec_formulas
still pinned the pre-lane model - (0,3)/(0,4)/(0,1) for 30/60/1 superblocks.
libvpx's get_max_log2_tile_cols returns max_log2 - 1 (vp9_tile_common.c:45-49),
so the values are (0,2)/(0,3)/(0,0), and a single-superblock frame reads NO
increment bit (setup_tile_info's `while (max_ones-- && vpx_rb_read_bit(rb))`
with max_ones == 0). The code was right; the test was old.

Gates on main: ec-vp9 14 binaries green; ec-vp9-syntax 13/13 + 3/3;
cargo check --workspace --all-targets clean; ec-hw lib 12/12.

Also records in lanes/vp9kf.report.md: the merged/branch/removed-worktree state,
the fixtures/vp9 copy main needed (fixtures/ is gitignored), the next-lane
candidates, and the trace-hook/scratch-harness cleanup still open.
crates/ec-vp9-syntax/src/header.rsmodified+10 -13
@@ -783,11 +783,7 @@ fn read_sync_code(r: &mut BitReader<'_>) -> Result<()> {
783783 /// `color_config` (spec 6.2).
784784 fn read_color_config(r: &mut BitReader<'_>, profile: u8, c: &mut ColorConfig) -> Result<()> {
785785 c.bit_depth = if profile >= 2 {
786- if r.read_bit()? {
787- 12
788- } else {
789- 10
790- }
786+ if r.read_bit()? { 12 } else { 10 }
791787 } else {
792788 8
793789 };
@@ -935,24 +931,25 @@ fn tile_cols_log2_bounds(sb64_cols: u32) -> (u8, u8) {
935931 mod tests {
936932 use super::*;
937933
938- /// Spec 6.2 worked bounds: 1920 wide is 30 superblocks; a column must stay
939- /// at least 4 superblocks wide, so up to 2^3 columns (8 bits consumed =
940- /// max - min = 3), and none are forced (up to 64 wide per column).
934+ /// Spec 6.2 worked bounds, with libvpx's `max_log2 - 1`
935+ /// (`vp9_tile_common.c:45-49`): 1920 wide is 30 superblocks; a column must
936+ /// stay at least 4 superblocks wide, so `max_log2_tile_cols` is 2 and the
937+ /// decoder consumes `max - min = 2` increment bits.
941938 #[test]
942939 fn tile_bounds_match_the_spec_formulas() {
943940 assert_eq!(
944941 tile_cols_log2_bounds(1920u32.div_ceil(8).div_ceil(8)),
945- (0, 3)
942+ (0, 2)
946943 );
947944 assert_eq!(
948945 tile_cols_log2_bounds(3840u32.div_ceil(8).div_ceil(8)),
949- (0, 4)
946+ (0, 3)
950947 );
951948 // 4096 superblocks wide forces at least 2^6 tile columns.
952949 assert_eq!(tile_cols_log2_bounds(4096).0, 6);
953- // A single-superblock frame still consumes one increment bit
954- // (libvpx get_max_log2(1) == 1): the terminating 0.
955- assert_eq!(tile_cols_log2_bounds(1), (0, 1));
950+ // A single-superblock frame consumes NO increment bit: libvpx loops
951+ // `while (max_ones-- && vpx_rb_read_bit(rb))` and `max_ones` is 0.
952+ assert_eq!(tile_cols_log2_bounds(1), (0, 0));
956953 }
957954
958955 #[test]
lanes/vp9kf.report.mdmodified+47 -1
@@ -3,7 +3,8 @@
33 Status: **LANE GOAL MET (2026-09-16) — `keyframes_match_ffmpeg` PASSES; both fixture
44 keyframes are byte-exact against ffmpeg on Y/U/V, pre-LF and post-LF. The path there
55 is HANDOFF #2 … #8 below (read #8 first for the closing state).**
6-Charter file: `lanes/vp9kf.charter.md`. Branch `lane-vp9-kf` (base 29f35b77).
6+Charter file: `lanes/vp9kf.charter.md`. Branch `lane-vp9-kf` (base 29f35b77) - MERGED
7+into `main` on 2026-09-16 (fast-forward `29f35b77..ce696cb8`), worktree removed.
78
89 ## What works (verified by running code)
910
@@ -409,3 +410,48 @@ evidence channel.
409410 when off; removing them would also unbuild the scratch harnesses above.
410411 - `tests/scratch_*.rs` (10 files, incl. the untracked `scratch_tok.rs`) — the lane's
411412 diff harnesses; kept because they are how the next codec lane will re-derive this.
413+
414+## MERGE-SIDE FOLLOW-UPS (2026-09-16, in `main`)
415+
416+The lane's gates were crate-scoped (`cargo test -p ec-vp9`), so three things only
417+surfaced once `main` ran the merged tree:
418+
419+1. **`crates/ec-vp9/src/decode.rsdecode.rs` deleted** (`b0aa9301`) - a stale 620-line
420+ duplicate of `decode.rs` committed by accident in the lane's first commit
421+ (`7b94a0dc`). Not in the module tree, referenced by nothing. Found by reading the
422+ merge's create list; no grep/caller would have found it, only `git status` of a
423+ clean tree would not either (it was tracked).
424+2. **`ec-vp9-syntax`'s in-lib test was stale** - `header::tests::
425+ tile_bounds_match_the_spec_formulas` still pinned the pre-lane tile-bound model
426+ (`(0,3)`/`(0,4)`/`(0,1)` for 30/60/1 superblocks). libvpx's
427+ `get_max_log2_tile_cols` returns `max_log2 - 1`, so the values are `(0,2)`/`(0,3)`/
428+ `(0,0)` and a 1-superblock frame reads **no** increment bit
429+ (`vp9_tile_common.c:45-49`, `setup_tile_info`'s `while (max_ones-- && ...)`).
430+ Code was right, test was old - updated to the libvpx values with the source cited.
431+ `cargo test -p ec-vp9-syntax` → 13/13 lib + 3/3 `streams`.
432+3. **`scratch_synth` no longer fails** (`d38a3446`): it skips with a printed SKIP line
433+ when its ad-hoc tmpfs dump is absent, so a scratch probe cannot look like a
434+ regression in a normal workspace run.
435+
436+Local fixture note: `fixtures/` is gitignored and the worktree kept its own copy, so
437+`main` needed `fixtures/vp9/{key-320,lossless-64}.ivf` copied in (from the removed
438+worktree) before `dump_probe` / `keyframe_exact` could run there. The generating
439+commands are the charter's ffmpeg invocations.
440+
441+### Verification on `main` after the merge
442+
443+- `cargo test -p ec-vp9` → 14 binaries green (lib 8/8, keyframe_exact 4/4, dump_probe,
444+ 9 scratch harnesses incl. the newly tracked `scratch_tok`, which passes).
445+- `cargo test -p ec-vp9-syntax` → 13/13 + 3/3.
446+- `cargo check --workspace --all-targets` → clean; `ec-vp9` warnings are the same 5 as
447+ at its base commit.
448+- `ec-hw` (the only consumer of `ec-vp9-syntax`) → lib 12/12 plus its GPU suite; the
449+ parser changes are exercised there only through header parsing.
450+
451+### Next lane candidates (unchanged from the report body, now the only vp9 work left)
452+
453+- real **inter** decode (`inter_is_named_unsupported` is a refusal pin, not a decoder);
454+- **segmentation** (rav1e-era AV1 finding, applies to vp9 too: it codes no segments);
455+- **non-420 / high-bitdepth / profiles 1 and 3** (only profile 0 8-bit is ported);
456+- the 12 trace hooks and 10 `scratch_*` harnesses from HANDOFF #8's "not cleaned up"
457+ list, if a future lane wants a bare tree.