R1 report + handoff
Browse files at this commitea3c0df85aa612e66d2b2f1871d801ff4ef2cba2Parent: 343ce49- docs
- r1 report + handoff
2 changed files +113 -0
lanes/intrainter-r1.handoff.mdadded+70 -0
| @@ -0,0 +1,70 @@ | |||
| 1 | +# lane-intrainter r1 handoff | ||
| 2 | + | ||
| 3 | +Branch `lane-intrainter`, based on main `c729a38` (worktree was already at main's head; no rebase needed). | ||
| 4 | +Code commit: `955ecf9` (`feat(av1): intra blocks in inter frames may split their luma transform`). | ||
| 5 | + | ||
| 6 | +## Implemented (all in `crates/ec-av1/src/decode.rs`) | ||
| 7 | + | ||
| 8 | +- `read_block_tx_size` (~9470): intra branch no longer refuses a split `tx_depth`. It calls | ||
| 9 | + `set_txfm_ctxs` with the RESOLVED transform (so later blocks' txfm ctx is right) and returns | ||
| 10 | + the transform-unit leaf list `(row_mi, col_mi, tx_px)` in raster order — the same shape the | ||
| 11 | + inter var-tx tree returns. | ||
| 12 | +- `decode_inter_block` intra arm (~15490): the leaves ride the existing `vartx_leaves` slot; a | ||
| 13 | + per-TU loop predicts + codes each unit with `txbset_for(tx_px, reduced)` (INTRA tx set), | ||
| 14 | + `default_scan(tx_px)`, `Reach::of_tu` (block-relative availability), `luma_skip_ctx` | ||
| 15 | + (neighbour-magnitude txb_skip ctx, not the lone-TU 0), `around_mi`, `record_mi_luma`. | ||
| 16 | + Skip blocks predict PER UNIT too (an intra block reads tx_depth even when skip). | ||
| 17 | + Chroma is unchanged (its transform is not split). The function tail already ran | ||
| 18 | + `record_split_luma` + per-TU deblock edges whenever `vartx_leaves.is_some()`. | ||
| 19 | +- Inter-frame intra syntax differences all pre-existed in that arm and are unchanged: | ||
| 20 | + `y_mode_cdf[size_group]` (not kf_y_mode), `uv_mode_cfl[mode]`, angle deltas, CfL alphas, | ||
| 21 | + palette-mode probes; angle_delta_y is refused nonzero, filter intra is not read in this arm. | ||
| 22 | +- Counter `INTRA_IN_INTER_SPLIT_TX_HITS` + `intra_in_inter_split_tx_hits() -> [usize;4]` | ||
| 23 | + bucketed by block side 8/16/32/64, one increment per split block. | ||
| 24 | + | ||
| 25 | +## Sizes / refusals | ||
| 26 | + | ||
| 27 | +- Squares 16x16..64x64 through `decode_inter_block` are lifted (the code is size-generic). | ||
| 28 | + OBSERVED FIRING: 16x16 only (12 blocks 8-bit, 1 block 10-bit). 32/64 buckets stayed 0 under | ||
| 29 | + `--min/max-partition-size=16/32`; unproven above 16x16. | ||
| 30 | +- NEW refusal (`decode_inter_block8`, ~17070, listed in refusal_inventory.rs:63 replacing the | ||
| 31 | + lifted string): "an 8x8 intra leaf in an inter frame whose tx_depth splits it into 4x4 | ||
| 32 | + transform units" — that leaf path has no per-TU intra prediction loop. | ||
| 33 | +- RECT intra strips in inter frames stay refused earlier ("an intra-coded HORZ/VERT strip needs | ||
| 34 | + rectangular intra prediction this decoder does not code yet"), so no rect work was needed. | ||
| 35 | + | ||
| 36 | +## Gate state — PASSING, both depths | ||
| 37 | + | ||
| 38 | +`a_real_aomenc_inter_sequence_with_a_split_transform_intra_block_decodes_pixel_exact` and | ||
| 39 | +`a_real_aomenc_10bit_...` (`intra_in_inter_split_tx_gate` in stream.rs). | ||
| 40 | +Real aomenc, 64x64, 8 frames, mandelbrot zoom with a HARD CUT at frame 4 | ||
| 41 | +(`overlay=enable='gte(n,4)'`), `--kf-min-dist=1000 --kf-max-dist=1000` (stops the scene-cut | ||
| 42 | +detector inserting a second key frame), cq 30, overrides appended LAST. All frames Y/U/V vs | ||
| 43 | +ffmpeg; decode errors only continue if they contain "unsupported"; exhausting 40 attempts panics. | ||
| 44 | + | ||
| 45 | +Run: | ||
| 46 | +`EC_NOMEMGUARD=1 EC_AV1_REQUIRE_AOMENC=1 CARGO_TARGET_DIR=$HOME/.cache/cargo-target-intrainter cargo test -p ec-av1 --lib -- split_transform_intra_block --nocapture` | ||
| 47 | + | ||
| 48 | +Result: 8-bit seed 45 `16x16=12`, 10-bit seed 72 `16x16=1`, 0 differing samples, both `ok`. | ||
| 49 | +No entropy ladder was needed — no divergence was ever observed. | ||
| 50 | + | ||
| 51 | +## Suite | ||
| 52 | + | ||
| 53 | +`$HOME/.cache/intrainter-suite.log` (unit `intrainter-suite-1788315424.service`). At turn cap it | ||
| 54 | +was still running (~250/372 tests, no FAILED line so far, currently inside the aomenc gates). | ||
| 55 | +NEXT AGENT: `grep -E "^test result|FAILED" $HOME/.cache/intrainter-suite.log` — 0 failed is the | ||
| 56 | +merge precondition; nothing else is owed. | ||
| 57 | + | ||
| 58 | +## Film | ||
| 59 | + | ||
| 60 | +Both `.../b6d8a07f.../scratchpad/reelc-head.obu` and `.../cdc46329.../scratchpad/reelc5.obu` stop at | ||
| 61 | +"a coded HORZ/VERT strip whose chroma transform has no rect coefficient tables here" (lane-rectchroma | ||
| 62 | +territory), NOT at this lane's refusal — the wall string in the charter was not reproducible on | ||
| 63 | +these extracts (matches an existing ledger dead-end line). | ||
| 64 | + | ||
| 65 | +## Exact next step | ||
| 66 | + | ||
| 67 | +1. Read the suite result line; if green, merge. | ||
| 68 | +2. Optional follow-up round: prove 32x32/64x64 split intra-in-inter blocks (raise | ||
| 69 | + `--max-partition-size` to 64 and lower cq, assert the 32/64 buckets), and lift the 8x8 leaf's | ||
| 70 | + TX_4X4 2x2 grid in `decode_inter_block8`. | ||
lanes/intrainter-r1.report.mdadded+43 -0
| @@ -0,0 +1,43 @@ | |||
| 1 | +# lane-intrainter r1 — intra blocks in inter frames with a split luma transform | ||
| 2 | + | ||
| 3 | +Branch `lane-intrainter` off main `c729a38` (worktree already at main's head; no rebase needed). | ||
| 4 | +Commit: `955ecf9`. | ||
| 5 | + | ||
| 6 | +## What changed | ||
| 7 | + | ||
| 8 | +- `crates/ec-av1/src/decode.rs` `read_block_tx_size` (~9470): the intra branch no longer | ||
| 9 | + refuses a `tx_depth` that resolves below the block side. It runs `set_txfm_ctxs` with the | ||
| 10 | + resolved transform (so later blocks' txfm ctx is right) and returns the transform-unit leaf | ||
| 11 | + list in the same `(row_mi, col_mi, tx_px)` shape the inter var-tx tree uses, raster order. | ||
| 12 | +- `crates/ec-av1/src/decode.rs` `decode_inter_block` intra arm (~15490): the returned leaves ride | ||
| 13 | + the existing `vartx_leaves` slot, and a per-TU loop predicts + codes each unit | ||
| 14 | + (`txbset_for(tx_px, reduced)`, `default_scan(tx_px)`, `Reach::of_tu`, `luma_skip_ctx`, | ||
| 15 | + `around_mi`, `record_mi_luma`) exactly as `decode_block`'s key-frame multi-TU branch does — | ||
| 16 | + including the skip case, which predicts per unit rather than whole-block. Chroma is unchanged | ||
| 17 | + (its transform is not split). The function tail already did `record_split_luma` and per-TU | ||
| 18 | + deblock edges whenever `vartx_leaves.is_some()`, so intra split blocks inherit both. | ||
| 19 | +- `crates/ec-av1/src/decode.rs` counter `INTRA_IN_INTER_SPLIT_TX_HITS` + | ||
| 20 | + `intra_in_inter_split_tx_hits() -> [usize; 4]` (bucketed 8/16/32/64), incremented once per | ||
| 21 | + split intra-in-inter block. | ||
| 22 | +- `crates/ec-av1/src/decode.rs` `decode_inter_block8` (~17070): an 8x8 intra leaf whose depth | ||
| 23 | + resolves to TX_4X4 has no per-TU intra loop in that path — refused by name. | ||
| 24 | +- `crates/ec-av1/src/refusal_inventory.rs:63`: lifted string replaced by the narrower | ||
| 25 | + `"an 8x8 intra leaf in an inter frame whose tx_depth splits it into 4x4 transform units"`. | ||
| 26 | +- `crates/ec-av1/src/stream.rs`: new gate `intra_in_inter_split_tx_gate` + its 8/10-bit tests. | ||
| 27 | + | ||
| 28 | +## Gate | ||
| 29 | + | ||
| 30 | +`a_real_aomenc_inter_sequence_with_a_split_transform_intra_block_decodes_pixel_exact` | ||
| 31 | +and `..._10bit_...`. Real aomenc, 64x64, 8 frames, mandelbrot zoom with a HARD CUT at frame 4 | ||
| 32 | +(`overlay=enable='gte(n,4)'` of a second fractal) so aomenc codes intra blocks inside an inter | ||
| 33 | +frame; `--kf-min-dist=1000 --kf-max-dist=1000` stops the scene-cut detector inserting a second | ||
| 34 | +key frame. Overrides (`--enable-tx-size-search=1`, `--enable-rect-partitions=0`, | ||
| 35 | +`--max-partition-size=32`, `--min-partition-size=16`) are appended AFTER the base recipe | ||
| 36 | +(last occurrence wins). Every decoded frame's Y, U and V are compared with ffmpeg; a decode | ||
| 37 | +error only continues the attempt loop if it contains "unsupported"; exhausting all 40 attempts | ||
| 38 | +is a panic, never a SKIP. | ||
| 39 | + | ||
| 40 | +Run: | ||
| 41 | +`EC_NOMEMGUARD=1 EC_AV1_REQUIRE_AOMENC=1 CARGO_TARGET_DIR=$HOME/.cache/cargo-target-intrainter cargo test -p ec-av1 --lib -- split_transform_intra_block --nocapture` | ||
| 42 | + | ||
| 43 | +EVIDENCE: $HOME/.cache/intrainter-suite.log | aomenc cut-fractal stream, ours vs ffmpeg, all 8 frames Y/U/V | 8-bit seed 45: 12 split intra-in-inter 16x16 blocks, 0 differing samples; 10-bit seed 72: 1 such block, 0 differing samples | ||