forge
Explore
Log in

Don't you dare go Hollow

Lane-hbd r5 report -- steps 1-5 done, 10-bit gate lands red

Browse files at this commit

f49a7af3e8a0519088b2fcad787a6f6aac8a3f1bAhmet Kaan GümüşParent: 4112c99
  • docs
    • lane-hbd r5 report -- steps 1-5 done, 10-bit gate lands red
Show full message
docs(av1): lane-hbd r5 report -- steps 1-5 done, 10-bit gate lands red
lanes/hbd-r5.report.mdadded+92 -0
@@ -0,0 +1,92 @@
1+# lane-hbd r5 report
2+
3+Branch `lane-hbd`, worktree `edith_codecs-hbd`. All 5 charter steps attempted,
4+in order, each its own commit. `cargo check --workspace --all-targets` is
5+clean. Landing red on this branch (the 10-bit gate fails) per charter
6+permission -- not merged, not asked to be.
7+
8+## Commits this round
9+1. `3478044` feat(av1): wire decode::set_bit_depth from stream.rs per frame
10+2. `147a2ea` feat(av1): narrow bit_depth != 8 refusals for film_grain and superres
11+3. `0ce7fef` feat(av1): 10-bit gate + lift the blanket bit_depth refusal
12+
13+## Step 1 -- wire set_bit_depth (DONE)
14+`stream.rs` now reads `seq.color_config.bit_depth` per frame (defaulting to 8
15+with no sequence header yet) and calls `decode::set_bit_depth`, right next to
16+the existing `set_enable_edge_filter` call, for the identical
17+cross-sequence-on-one-thread reason. `BIT_DEPTH` is no longer dead code.
18+
19+## Step 2 -- narrow refusals (DONE)
20+Two new named refusals in `stream.rs`, both guarding the exact unported code:
21+- `film_grain.rs`'s grain LUT/blend (`[i32; 256]`, clamps at 255) -- checked at
22+ both `apply_grain` call sites (`show_existing_frame` and the normal
23+ `show_frame` path).
24+- `superres.rs`'s `upscale_row` (`&[u8]`, clamps at 255) -- checked before the
25+ `use_superres` key-frame branch.
26+
27+Both declared in `refusal_inventory.rs`'s `REFUSALS` list;
28+`the_decode_path_refuses_exactly_the_listed_cases` passes.
29+
30+## Step 3 -- the 10-bit gate (DONE, gate is RED)
31+`ffmpeg_decode_sequence_10bit` (stream.rs, next to the existing 8-bit
32+`ffmpeg_decode_sequence`, which is untouched) parses `yuv420p10le` rawvideo as
33+u16 LE. `a_real_aomenc_10bit_stream_decodes_pixel_exact` drives a real
34+`aomenc --input-bit-depth=10 --bit-depth=10 --threads=1 --row-mt=0
35+--sb-size=64` stream (gradients content, ffmpeg y4m into aomenc's stdin, same
36+recipe as the existing palette-Y gate), parses the produced stream's own
37+sequence header and hard-asserts `bit_depth == 10` *before* trusting any
38+pixel comparison, then compares `decode_stream`'s output against
39+`ffmpeg_decode_sequence_10bit` on the identical bytes.
40+
41+The gate runs for real -- aomenc wrote a genuine 10-bit sequence header, not a
42+SKIP -- and fails on the pixel comparison: this decoder's luma comes out
43+~82-117, ffmpeg's own 10-bit decode of the same bytes is ~331-471 for the same
44+gradient content, roughly a factor of 4 apart (2^(10-8) squared, or two
45+missed left-shifts by `bit_depth - 8`). This is NOT the "small rounding
46+delta" the charter expected from unclamped intermediate math -- it is a
47+systematic magnitude defect, most likely a fixed `<< (bit_depth - 8)` /
48+`>> (bit_depth - 8)` this decoder never applies anywhere (DC pred's initial
49+value, a reconstruction clamp, or dequant), still written as if every stream
50+were 8-bit. Root-cause bisection (which stage first drops the scale) is next
51+round's first job -- I did not spend remaining budget chasing it live.
52+
53+## Step 4 -- lift the blanket refusal (DONE, same commit as the gate)
54+The old `stream.rs` blanket `"a stream whose bit depth is not 8..."` check is
55+gone; `refusal_inventory.rs` updated to match (still green). The narrow
56+film_grain/superres refusals from step 2 are the only bit-depth gates left.
57+
58+## Step 5 -- his own films (DONE)
59+Extracted 3s of each into this worktree's `fixtures/hbd-r5/` (outside the
60+repo via the `fixtures` symlink, so durable):
61+- `ffmpeg -i ".../reelb.mkv" -t 3 -c:v copy -an -f obu reelb.obu`
62+- `ffmpeg -i ".../reelcmkv" -t 3 -c:v copy -an -f obu reelc.obu`
63+
64+Probed with `cargo run -p ec-av1 --example decode_probe -- <file>`:
65+
66+- **ReelB** (Ballad of ReelB and Snakes, 2160p HDR10):
67+ `REFUSED: unsupported: AV1 tile (a partition below 8x8 (this decoder codes
68+ no leaf smaller than 8x8))`
69+- **ReelC** (Director's Cut, 1080p):
70+ `REFUSED: unsupported: AV1 tile (a 32x32 partition type this decoder does
71+ not code (value=4))`
72+
73+Neither refusal is the bit-depth wall anymore -- lifting the blanket refusal
74+is real, verified progress: both real 10-bit films now reach genuine
75+partition-coverage gaps instead of being stopped before decode even starts.
76+**These two refusal strings, verbatim, are the next lane's charter starting
77+point** -- sub-8x8 leaf partitions (ReelB) and 32x32 partition
78+type=4 (ReelC, likely `PARTITION_VERT_4` or similar AB/1-to-4 type this
79+decoder's part32 match arm doesn't cover), on top of fixing the 10-bit scale
80+defect found in step 3.
81+
82+## What's owed next round
83+1. Root-cause and fix the ~4x luma scale defect the 10-bit gate found
84+ (bisect against the oracle per-stage, not by inspection, per the
85+ charter's own warning).
86+2. Sub-8x8 partition leaves (ReelB' real gap).
87+3. 32x32 partition value=4 (ReelC's real gap) -- check against `decode.rs`'s
88+ part32 match arm coverage.
89+
90+## Deferred
91+- deferred: 10-bit gate root-cause fix — turn budget (charter's step-3/4/5
92+ ordering + report-writing left no room this round) — next lane's first job.