Lane-superres r7 charter -- test the margin hypotheses before hunting dispatch
Browse files at this commit23731fae274037af2519391bfb76927506490e2bParent: f8ce070- docs
- lane-superres r7 charter -- test the margin hypotheses before hunting dispatch
1 changed file +65 -0
- lanes/superres-r7.charter.md +65 -0
lanes/superres-r7.charter.mdadded+65 -0
| @@ -0,0 +1,65 @@ | |||
| 1 | +# lane-superres r7 — is that edge filtered at all? | ||
| 2 | + | ||
| 3 | +Read `lanes/superres-r6.report.md`. r5's decode work is verified green (237 | ||
| 4 | +passed, the target gate the only failure). | ||
| 5 | + | ||
| 6 | +## Where the search stands | ||
| 7 | +r6 localized the 2-pixel residue precisely: horizontal-edge deblocking at the | ||
| 8 | +CODED frame's rightmost mi column, x0 = 44..47. It re-derived `filter14` / | ||
| 9 | +`filter8` in Python against the bit-exact pre-deblock dump and reproduced our | ||
| 10 | +Rust output exactly — **our filter arithmetic is spec-correct**, so the bug is | ||
| 11 | +in edge/level SELECTION, not in the filter. It then instrumented two libaom | ||
| 12 | +candidates (`set_lpf_parameters`, `set_one_param_for_line_luma` / | ||
| 13 | +`set_lpf_parameters_for_line_luma`) and confirmed neither fires, and ran out of | ||
| 14 | +budget hunting a third dispatch path. | ||
| 15 | + | ||
| 16 | +## Before hunting libaom's dispatch further, test this hypothesis | ||
| 17 | +The coded frame width here is 43; the mi grid is 48 wide. **x = 44..47 is the | ||
| 18 | +mi-alignment margin, beyond `frame_width`.** Two things follow, and either would | ||
| 19 | +produce exactly this shape: | ||
| 20 | +1. We may be deblocking an edge libaom never filters, because it clips the loop | ||
| 21 | + to the coded width. "Neither candidate fires" is consistent with libaom | ||
| 22 | + simply not filtering there — an absent call is evidence, not a dead end | ||
| 23 | + (class `equal-range-means-unread`, applied to pixels). | ||
| 24 | +2. We may be FEEDING the upscaler decoded margin pixels where libaom feeds | ||
| 25 | + replicated ones: `av1_superres_upscale` calls `av1_extend_frame_borders` | ||
| 26 | + first, which replicates from column `y_crop_width - 1`. r3's margin threading | ||
| 27 | + moved the count 5 -> 2, which looks like progress but is equally consistent | ||
| 28 | + with trading one wrong source for another. | ||
| 29 | + | ||
| 30 | +Both are cheap to test and neither needs libaom's dispatch: clip our deblock to | ||
| 31 | +the coded width and see; then feed the upscaler a replicate of column 42 instead | ||
| 32 | +of decoded margin and see. Run them as experiments, not as a rewrite — one at a | ||
| 33 | +time, reverting between, and report both results even if neither closes it. | ||
| 34 | + | ||
| 35 | +If both fail, then go after the dispatch path with gdb as r6 planned, using its | ||
| 36 | +reproduction: `EC_SUPERRES_STREAM_DUMP=<path>.obu cargo test -p ec-av1 --lib | ||
| 37 | +stream::tests::a_real_aomenc_superres_key_frame_sequence_decodes_pixel_exact -- | ||
| 38 | +--nocapture`, then that `.obu` through `~/.cache/aom-oracle/build/aomdec` with | ||
| 39 | +`EC_AV1_PREFILT_WIDE_DUMP` / `EC_AV1_POSTDEBLOCK_DUMP`, diffing frame 2 columns | ||
| 40 | +44-47. | ||
| 41 | + | ||
| 42 | +## Housekeeping this round owes | ||
| 43 | +r6 left throwaway `EC_LF_TRACE` diagnostics in | ||
| 44 | +`~/.cache/aom-oracle/src/av1/common/av1_loopfilter.c` — outside this repo and | ||
| 45 | +uncommitted. Either fold them into `scripts/instrument-aom-oracle.sh` as a | ||
| 46 | +proper env-gated rung (the shape every other rung uses, and then they survive an | ||
| 47 | +oracle rebuild) or revert them. Do not leave edits sitting in the oracle's source | ||
| 48 | +tree where the next lane will not know they are there. | ||
| 49 | + | ||
| 50 | +## Then | ||
| 51 | +Stage 4: inter-frame superres — scaled-reference MC, spec 7.11.3.3, libaom | ||
| 52 | +`av1_setup_scale_factors_for_frame` / `av1_convolve_2d_scale`. | ||
| 53 | + | ||
| 54 | +Merge note: main is at 92d8beb and has moved a long way (multi-tile decode | ||
| 55 | +gated, CDEF index, chroma modes, a `bit_depth != 8` refusal, three reworded | ||
| 56 | +partition refusals, and three guard tests that pin the never-exercised aomenc | ||
| 57 | +tools, every decode-path refusal string, and the gates that swallow a decode | ||
| 58 | +error). Consider `git merge main` here and resolving it yourself. Report every | ||
| 59 | +refusal string you add, rename or remove, verbatim. | ||
| 60 | + | ||
| 61 | +Hard rules: `CARGO_TARGET_DIR=$HOME/.cache/cargo-target-superres`; foreground | ||
| 62 | +`nice -n 19 cargo ... -j4`; every `cargo test` a timeout >= 600000 ms. Sibling | ||
| 63 | +worktrees have live agents — never build in or edit them. Never push, never | ||
| 64 | +merge into `main`. 75-turn cap, does not reset: COMMIT AT EVERY GREEN STEP. | ||
| 65 | +End with `lanes/superres-r7.report.md`, VERDICT on line 1. | ||