Lane-hbd r2 report -- 42 -> 0 errors, 263/263 tests pass
Browse files at this commit29a3d63a8c55d48bb9268dda9f59fafae1bef3dcParent: 35100f3- docs
- lane-hbd r2 report -- 42 -> 0 errors, 263/263 tests pass
1 changed file +102 -0
- lanes/hbd-r2.report.md +102 -0
lanes/hbd-r2.report.mdadded+102 -0
| @@ -0,0 +1,102 @@ | |||
| 1 | +VERDICT: Done. `cargo check -p ec-av1 --lib --tests` reports 0 errors (42 -> 0), | ||
| 2 | +and `cargo test -p ec-av1` (`EC_AV1_REQUIRE_AOMENC=1`) is 263 passed, 0 failed, | ||
| 3 | +18 ignored -- 8-bit output is bit-exact. Real commit 213eeac on top of two | ||
| 4 | +`wip(hbd):` checkpoints (177aa1c at 42->5, 6e6dbbb at --lib clean/17 test | ||
| 5 | +errors left). | ||
| 6 | + | ||
| 7 | +## What actually needed doing | ||
| 8 | + | ||
| 9 | +r1's saved diff had already widened `PlaneBuf::data`, intra prediction, and | ||
| 10 | +all six of `mc.rs`'s prediction/blend functions to `u16` -- the charter's own | ||
| 11 | +"mc.rs last, it unlocks ~24 call sites" order was already moot; `mc.rs` was | ||
| 12 | +done. The 42 errors were all downstream call sites that hadn't caught up: | ||
| 13 | + | ||
| 14 | +- `warp.rs`'s `warp_affine` (`reference`/`dst` still `&[u8]`/`&mut [u8]`, | ||
| 15 | + only caller is 3 `decode.rs` sites) -- widened. | ||
| 16 | +- `decode.rs`'s OBMC chain (`obmc_neighbour_pred`, `obmc_blend_v`, | ||
| 17 | + `obmc_blend_h`, `obmc_blend`) and interintra chain (`interintra_blend`, | ||
| 18 | + its local `intra` scratch buffer) -- both fed by the same `pred_y`/ | ||
| 19 | + `pred_u`/`pred_v` buffers `read_inter_plane`'s call sites already needed | ||
| 20 | + widened, so one `vec![0u8; ...]` -> `vec![0u16; ...]` sweep across those | ||
| 21 | + buffer declarations (12 sites) plus the two function chains closed 37 of | ||
| 22 | + the 42 lib errors. | ||
| 23 | +- `read_inter_plane`'s own `prediction: &[u8]` parameter -> `&[u16]`. | ||
| 24 | +- `encode.rs` (3 call sites into `intra::predict`) and `motion.rs` (1 call | ||
| 25 | + site into `mc::predict`) -- see decision below. | ||
| 26 | + | ||
| 27 | +## The encoder decision (charter asked for one) | ||
| 28 | + | ||
| 29 | +The encoder's own buffers (`Plane::source`, `Plane::reconstruction`, the | ||
| 30 | +motion-search `reference`/`source`) stay `u8` -- this round does not widen | ||
| 31 | +the encoder, and nothing forces it to: the encoder is 8-bit-only by design | ||
| 32 | +(`Picture`'s `y`/`u`/`v` are still `Vec<u8>`, unchanged this round), so there | ||
| 33 | +is no wider content for it to ever hold. Widening those buffers to `u16` | ||
| 34 | +would have added real diff for zero behavioural change and speculative | ||
| 35 | +10-bit-encode plumbing nobody asked for. | ||
| 36 | + | ||
| 37 | +Instead, each of the 4 sites gets a local `u8<->u16` round-trip box right at | ||
| 38 | +the call into the now-widened shared `intra::predict`/`mc::predict`: | ||
| 39 | +- `encode.rs`: `intra_predict_u8` (new free fn, `crates/ec-av1/src/encode.rs` | ||
| 40 | + near `pad_plane`) wraps `intra::predict`, used at all 4 of encode.rs's | ||
| 41 | + `crate::intra::predict` call sites (`trial`, `intra_scores`, | ||
| 42 | + `search_block`, and a `#[cfg(test)]` micro-bench). | ||
| 43 | +- `encode.rs::mc_trial`: inline conversion around its one `mc::predict` call. | ||
| 44 | +- `motion.rs::search_traced_from_step`: `reference` converted once, outside | ||
| 45 | + the per-MV-candidate closure (not per-call), so the search's inner loop | ||
| 46 | + cost is unchanged. | ||
| 47 | + | ||
| 48 | +A block-sized `u8`->`u16`->`u8` round-trip is exact for 8-bit content (every | ||
| 49 | +value fits both ways with no rounding), so none of this changes encoder | ||
| 50 | +output -- and the RD-trial/motion-search test suite (`encoder::tests::*`, | ||
| 51 | +`motion` module) stayed green with no changes needed. | ||
| 52 | + | ||
| 53 | +## Test-only fixes (not caught by `--lib`) | ||
| 54 | + | ||
| 55 | +`--lib` hit 0 errors after the above; `--tests` still had 17, all fixture | ||
| 56 | +buffers in `mc.rs`'s and `decode.rs`'s own unit tests declared `Vec<u8>`/ | ||
| 57 | +`vec![0u8; ...]` and calling the now-`u16` `predict`/`predict_with_filter`/ | ||
| 58 | +`combine_compound`. Mechanical widen of the fixture types (one hand-written | ||
| 59 | +`u8` window array in `mc.rs`'s | ||
| 60 | +`smooth_filter_matches_aomdec_chroma_inter_block` stays `u8` as the aomdec | ||
| 61 | +dump's own literal shape, copied element-wise into a `u16` reference plane | ||
| 62 | +instead of `copy_from_slice`). No test assertion changed shape, only types. | ||
| 63 | + | ||
| 64 | +## Files touched | ||
| 65 | + | ||
| 66 | +- `crates/ec-av1/src/warp.rs` -- `warp_affine` signature. | ||
| 67 | +- `crates/ec-av1/src/decode.rs` -- `read_inter_plane` signature; OBMC chain; | ||
| 68 | + interintra chain; 12 `pred_y`/`pred_u`/`pred_v` buffer declarations across | ||
| 69 | + 4 near-identical inter-block-decode sites; one unit test's fixture types. | ||
| 70 | +- `crates/ec-av1/src/mc.rs` -- unit test fixture types only (functions were | ||
| 71 | + already widened). | ||
| 72 | +- `crates/ec-av1/src/encode.rs` -- new `intra_predict_u8` helper + 4 call | ||
| 73 | + sites; `mc_trial`'s inline conversion. | ||
| 74 | +- `crates/ec-av1/src/motion.rs` -- `search_traced_from_step`'s inline | ||
| 75 | + conversion. | ||
| 76 | + | ||
| 77 | +## Checks run | ||
| 78 | + | ||
| 79 | +- `cargo check -p ec-av1 --lib -j4` -- 0 errors (was 42 at round start). | ||
| 80 | +- `cargo check -p ec-av1 --tests -j4` -- 0 errors. | ||
| 81 | +- `cargo check -p ec-hw --lib -j4` -- 0 errors (only other in-tree crate | ||
| 82 | + depending on ec-av1; no `PlaneBuf`/`mc`/`intra` internals are exported | ||
| 83 | + across that boundary, confirmed by a clean check with no `ec-av1` diff | ||
| 84 | + visible to it). | ||
| 85 | +- `cargo test -p ec-av1 -j4` (`EC_AV1_REQUIRE_AOMENC=1`): **263 passed, 0 | ||
| 86 | + failed, 18 ignored**, 177.58s. Every real-aomenc gate (obmc, masked | ||
| 87 | + compound, reference-select, restoration, temporal MVs, warp, superres) | ||
| 88 | + still fires and still matches pixel-exact -- 8-bit decode/encode output is | ||
| 89 | + unchanged. | ||
| 90 | + | ||
| 91 | +## Scope respected | ||
| 92 | + | ||
| 93 | +`bit_depth != 8` refusal untouched (not searched for/touched this round); | ||
| 94 | +no 10-bit gate, no second `ffmpeg_decode_sequence` helper -- both explicitly | ||
| 95 | +next round's job per the charter. | ||
| 96 | + | ||
| 97 | +## Budget | ||
| 98 | + | ||
| 99 | +Landed well inside the 75-turn budget (checkpoint-then-converge discipline | ||
| 100 | +wasn't needed this round; the crate reached 0 errors and a green suite in | ||
| 101 | +one pass). Two `wip(hbd):` checkpoints exist on the branch per the round's | ||
| 102 | +policy even though the whole thing closed in one sitting. | ||