vp9kf: fix the stale tile-bounds pin in ec-vp9-syntax; record the merge follow-ups
Browse files at this commit0f31b1dc2b3df3cae435a9a7de96269b18e41b2eParent: 2a10cb52 changed files +57 -14
- crates/ec-vp9-syntax/src/header.rs +10 -13
- lanes/vp9kf.report.md +47 -1
crates/ec-vp9-syntax/src/header.rsmodified+10 -13
| @@ -783,11 +783,7 @@ fn read_sync_code(r: &mut BitReader<'_>) -> Result<()> { | |||
| 783 | /// `color_config` (spec 6.2). | 783 | /// `color_config` (spec 6.2). |
| 784 | fn read_color_config(r: &mut BitReader<'_>, profile: u8, c: &mut ColorConfig) -> Result<()> { | 784 | fn read_color_config(r: &mut BitReader<'_>, profile: u8, c: &mut ColorConfig) -> Result<()> { |
| 785 | c.bit_depth = if profile >= 2 { | 785 | c.bit_depth = if profile >= 2 { |
| 786 | - if r.read_bit()? { | 786 | + if r.read_bit()? { 12 } else { 10 } |
| 787 | - 12 | ||
| 788 | - } else { | ||
| 789 | - 10 | ||
| 790 | - } | ||
| 791 | } else { | 787 | } else { |
| 792 | 8 | 788 | 8 |
| 793 | }; | 789 | }; |
| @@ -935,24 +931,25 @@ fn tile_cols_log2_bounds(sb64_cols: u32) -> (u8, u8) { | |||
| 935 | mod tests { | 931 | mod tests { |
| 936 | use super::*; | 932 | use super::*; |
| 937 | 933 | ||
| 938 | - /// Spec 6.2 worked bounds: 1920 wide is 30 superblocks; a column must stay | 934 | + /// Spec 6.2 worked bounds, with libvpx's `max_log2 - 1` |
| 939 | - /// at least 4 superblocks wide, so up to 2^3 columns (8 bits consumed = | 935 | + /// (`vp9_tile_common.c:45-49`): 1920 wide is 30 superblocks; a column must |
| 940 | - /// max - min = 3), and none are forced (up to 64 wide per column). | 936 | + /// stay at least 4 superblocks wide, so `max_log2_tile_cols` is 2 and the |
| 937 | + /// decoder consumes `max - min = 2` increment bits. | ||
| 941 | #[test] | 938 | #[test] |
| 942 | fn tile_bounds_match_the_spec_formulas() { | 939 | fn tile_bounds_match_the_spec_formulas() { |
| 943 | assert_eq!( | 940 | assert_eq!( |
| 944 | tile_cols_log2_bounds(1920u32.div_ceil(8).div_ceil(8)), | 941 | tile_cols_log2_bounds(1920u32.div_ceil(8).div_ceil(8)), |
| 945 | - (0, 3) | 942 | + (0, 2) |
| 946 | ); | 943 | ); |
| 947 | assert_eq!( | 944 | assert_eq!( |
| 948 | tile_cols_log2_bounds(3840u32.div_ceil(8).div_ceil(8)), | 945 | tile_cols_log2_bounds(3840u32.div_ceil(8).div_ceil(8)), |
| 949 | - (0, 4) | 946 | + (0, 3) |
| 950 | ); | 947 | ); |
| 951 | // 4096 superblocks wide forces at least 2^6 tile columns. | 948 | // 4096 superblocks wide forces at least 2^6 tile columns. |
| 952 | assert_eq!(tile_cols_log2_bounds(4096).0, 6); | 949 | assert_eq!(tile_cols_log2_bounds(4096).0, 6); |
| 953 | - // A single-superblock frame still consumes one increment bit | 950 | + // A single-superblock frame consumes NO increment bit: libvpx loops |
| 954 | - // (libvpx get_max_log2(1) == 1): the terminating 0. | 951 | + // `while (max_ones-- && vpx_rb_read_bit(rb))` and `max_ones` is 0. |
| 955 | - assert_eq!(tile_cols_log2_bounds(1), (0, 1)); | 952 | + assert_eq!(tile_cols_log2_bounds(1), (0, 0)); |
| 956 | } | 953 | } |
| 957 | 954 | ||
| 958 | #[test] | 955 | #[test] |
lanes/vp9kf.report.mdmodified+47 -1
| @@ -3,7 +3,8 @@ | |||
| 3 | Status: **LANE GOAL MET (2026-09-16) — `keyframes_match_ffmpeg` PASSES; both fixture | 3 | Status: **LANE GOAL MET (2026-09-16) — `keyframes_match_ffmpeg` PASSES; both fixture |
| 4 | keyframes are byte-exact against ffmpeg on Y/U/V, pre-LF and post-LF. The path there | 4 | keyframes are byte-exact against ffmpeg on Y/U/V, pre-LF and post-LF. The path there |
| 5 | is HANDOFF #2 … #8 below (read #8 first for the closing state).** | 5 | 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. | ||
| 7 | 8 | ||
| 8 | ## What works (verified by running code) | 9 | ## What works (verified by running code) |
| 9 | 10 | ||
| @@ -409,3 +410,48 @@ evidence channel. | |||
| 409 | when off; removing them would also unbuild the scratch harnesses above. | 410 | when off; removing them would also unbuild the scratch harnesses above. |
| 410 | - `tests/scratch_*.rs` (10 files, incl. the untracked `scratch_tok.rs`) — the lane's | 411 | - `tests/scratch_*.rs` (10 files, incl. the untracked `scratch_tok.rs`) — the lane's |
| 411 | diff harnesses; kept because they are how the next codec lane will re-derive this. | 412 | 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. | ||