Lane-sbpart r11 charter -- per-plane quantizer deltas are parsed then discarded
Browse files at this commitadd0a25e1f9911778a03fa319eeefd6a05a02336Parent: b615bdc- docs
- lane-sbpart r11 charter -- per-plane quantizer deltas are parsed then discarded
1 changed file +71 -0
- lanes/sbpart-r11.charter.md +71 -0
lanes/sbpart-r11.charter.mdadded+71 -0
| @@ -0,0 +1,71 @@ | |||
| 1 | +# lane-sbpart r11 — per-plane quantizer deltas are read and thrown away | ||
| 2 | + | ||
| 3 | +At 40225bc. r10 hit its cap without committing; I committed its `EC_SBPART_DUMP64` | ||
| 4 | +trace, stripped its throwaway transform probe, and moved its scratch fixtures to | ||
| 5 | +`fixtures/sbpart/`. Its report is the task notification, not a file — the facts | ||
| 6 | +you need are below. | ||
| 7 | + | ||
| 8 | +## What r10 established, and what I confirmed myself | ||
| 9 | +The defect is **not** in `decode_block_rect64`. Seed 42's superblock 0 is a plain | ||
| 10 | +`PARTITION_NONE` 64x64 block going through `decode_block`/`read_plane`, and it | ||
| 11 | +reconstructs px 64..95 of row 0 as flat **81** where ffmpeg and aomdec both give | ||
| 12 | +flat **76**. | ||
| 13 | + | ||
| 14 | +- The coefficient is right: level -81, DC-only, `eob=1`, matching aomdec's | ||
| 15 | + `EC_TRACE_COEFF` exactly. Symbol reading is not the bug. | ||
| 16 | +- The transform is right: r10 hand-derived the whole fixed-point DC-only 64x64 | ||
| 17 | + inverse-DCT chain (`cospi(32)=2896`, `row_shift_wh(64,64)=2`, final column | ||
| 18 | + shift 4, cross-checked against libaom's `inv_shift_64x64 = {-2,-4}`) and it | ||
| 19 | + reproduces our own -47 residual exactly. `inverse_dct` / `row_shift_wh` / | ||
| 20 | + `dequant_coeff_wh` are ruled out. | ||
| 21 | +- So the DEQUANT INPUT is wrong: we need -52, we produce -47. | ||
| 22 | + | ||
| 23 | +**I checked r10's suspect myself and it holds.** `crates/ec-av1-syntax/src/frame.rs` | ||
| 24 | +DOES read the per-plane quantizer deltas — `delta_q_y_dc` at line ~1401, | ||
| 25 | +`delta_q_u_dc`/`u_ac` at ~1408, `delta_q_v_*` at ~1414 — so there is no bit | ||
| 26 | +desync. They are stored on the header and then used for **exactly one thing**: | ||
| 27 | +the `lossless[segment_id]` determination at ~1027. Grep `crates/ec-av1/src` for | ||
| 28 | +`delta_q_y_dc`, `delta_q_u_ac`, `delta_q_v_dc` outside the writer and the | ||
| 29 | +lossless check: nothing. `quant.rs`'s `dequant_coeff_wh` takes only | ||
| 30 | +`bit_depth + q_idx + w + h`. **We read the deltas and throw them away.** | ||
| 31 | + | ||
| 32 | +Spec 5.9.12: the DC quantizer index is `base_q_idx + delta_q_y_dc` for luma, | ||
| 33 | +and chroma uses `delta_q_u_dc`/`u_ac` (and `v_*` when `separate_uv_delta_q`). | ||
| 34 | +A nonzero `y_dc_delta_q` is a frame-wide, DC-only offset — exactly the shape of | ||
| 35 | +what r10 measured. | ||
| 36 | + | ||
| 37 | +## The job | ||
| 38 | +1. **Measure the blast radius FIRST**, before fixing anything: print the five | ||
| 39 | + deltas for the streams our existing gates encode. If they are nonzero on | ||
| 40 | + streams whose gates currently pass, then those gates are passing for the | ||
| 41 | + wrong reason and you have found something bigger than this lane. If they are | ||
| 42 | + zero everywhere except this recipe, say so — that is the honest scope. | ||
| 43 | +2. Thread the deltas: a per-plane delta into `dc_q`/`ac_q`/`dequant_coeff_wh`/ | ||
| 44 | + `dequant_wh` and every `decode.rs` call site (r10 counted ~15, and its | ||
| 45 | + `base_q_idx` grep list is the map). Y delta for luma; U/V DC and AC for | ||
| 46 | + chroma, respecting `separate_uv_delta_q`. | ||
| 47 | +3. Verify with r10's standalone repro — no full-gate re-encode needed: | ||
| 48 | + `EC_AV1_GATE_DUMP_PIN=fixtures/sbpart/seed42.obu EC_SBPART_DUMP64=1 \ | ||
| 49 | + cargo test -p ec-av1 --lib pinned_sbpart_stream_decodes_pixel_exact -- \ | ||
| 50 | + --ignored --nocapture --test-threads=1` | ||
| 51 | + Expect row 0 px 64..95 to flip from 81 to 76. | ||
| 52 | +4. Then the full suite, then the lane's own gate. | ||
| 53 | + | ||
| 54 | +Do not re-derive the transform math — it is proven correct and ruled out. | ||
| 55 | + | ||
| 56 | +If the deltas turn out to be zero for this stream after all, then the suspect is | ||
| 57 | +wrong and the next question is where else `q_idx` could differ: segmentation | ||
| 58 | +qindex, or the `CURRENT_Q_IDX` delta-q state. Say so rather than forcing the | ||
| 59 | +hypothesis. | ||
| 60 | + | ||
| 61 | +## Budget discipline | ||
| 62 | +75 turns, no reset on resume. At about turn 55, stop starting new work, COMMIT | ||
| 63 | +(red gate is fine, name it), and write `lanes/sbpart-r11.report.md`. Two rounds | ||
| 64 | +running have ended with no commit and no report file; the report is the one | ||
| 65 | +artifact I cannot reconstruct. | ||
| 66 | + | ||
| 67 | +Hard rules: `CARGO_TARGET_DIR=$HOME/.cache/cargo-target-sbpart`; foreground | ||
| 68 | +`nice -n 19 cargo ... -j4`; every `cargo test` a timeout >= 600000 ms; | ||
| 69 | +`EC_AV1_REQUIRE_AOMENC=1`; aomenc `--threads=1 --row-mt=0 --sb-size=64`. Oracle | ||
| 70 | +rung 11 is yours. Sibling worktrees have live agents — never build in or edit | ||
| 71 | +them. Never push, never merge into main. | ||