Lane-lr r3 report -- gate landed, check-before-decode bug found+fixed
Browse files at this commitf9cac18748ee884f0deb502659b45ca9c822ac80Parent: 74cb98d- docs
- lane-lr r3 report -- gate landed, check-before-decode bug found+fixed
1 changed file +64 -0
- lanes/lr.report.md +64 -0
lanes/lr.report.mdmodified+64 -0
| @@ -185,6 +185,70 @@ EC_AV1_REQUIRE_AOMENC=1, `232` baseline + 3 new tests) | ||
| 185 | 185 | 4. Once both filters are wired, drop the `stream.rs` refusal entirely |
| 186 | 186 | (stage 5) -- gate should then assert `Ok`, never `Err`. |
| 187 | 187 | |
| 188 | +## r3 (committed on `lane-lr`, 0cfe9d6; 236 passed / 0 failed, 17 | |
| 189 | +ignored, EC_AV1_REQUIRE_AOMENC=1) -- VERDICT: step 1 (the gate) landed | |
| 190 | +and, in the process of landing it, found and fixed a real gap r2's own | |
| 191 | +report had flagged as unverified. Steps 2-4 (Wiener/SGR pixel filters, | |
| 192 | +dropping the refusal) NOT started -- out of turn budget. | |
| 193 | + | |
| 194 | +- New gate `a_real_aomenc_stream_with_restoration_reads_lr_symbols_correctly` | |
| 195 | + (`crates/ec-av1/src/stream.rs`): real aomenc `--enable-restoration=1 | |
| 196 | + --sb-size=64` stream, multi-superblock fixture (192x128 = 3x2 SBs of | |
| 197 | + 64px -- charter's own trap warning), 40 attempts, `cq-level=15` (r2's | |
| 198 | + sibling gates' usual `cq-level=45` never landed `uses_lr=true` for | |
| 199 | + this content -- sampled live before picking 15). Self-pinned | |
| 200 | + `WIENER_HITS`/`SGRPROJ_HITS`/`SWITCHABLE_HITS` thread-local counters | |
| 201 | + added to `restoration.rs`'s `read_lr_unit`, hard-asserted `sum > 0`. | |
| 202 | +- **The gate found a real bug**: `stream.rs`'s `header.loop_restoration.uses_lr` | |
| 203 | + refusal check ran BEFORE the `decode_key_frame_tile_with_cdfs`/ | |
| 204 | + `decode_inter_frame_tile_with_cdfs` call, so `read_lr` was NEVER | |
| 205 | + actually invoked through `decode_stream` -- despite r2's report | |
| 206 | + describing "the symbols are read", no real stream had ever exercised | |
| 207 | + that claim end to end. First gate run: 40/40 attempts hit the refusal | |
| 208 | + with `wiener_hits=sgrproj_hits=switchable_hits=0`. Fixed by moving the | |
| 209 | + check to run AFTER the tile-decode call succeeds (same refusal string, | |
| 210 | + new position) -- this both proves the superblock walk survives | |
| 211 | + `read_lr` without desyncing (the charter's actual step-1 ask) and now | |
| 212 | + genuinely exercises the reader. Also needed `--sb-size=64` in the gate | |
| 213 | + recipe (without it, aomenc's default sb128 choice hit the unrelated, | |
| 214 | + already-dead-ended `lane-sb128` partition-desync gap and ate the whole | |
| 215 | + attempt window with "a partition type this encoder never writes"). | |
| 216 | +- Final gate result: 39 LR refusals / 0 other refusals out of 40 | |
| 217 | + attempts, `wiener_hits=19 sgrproj_hits=72 switchable_hits=0` (this | |
| 218 | + fixture's RD only ever picked a fixed frame-level `Wiener`/`Sgrproj` | |
| 219 | + type, never `Switchable` -- both non-switchable arms proven live; the | |
| 220 | + switchable arm is still symbol-code-reviewed only, unexercised by any | |
| 221 | + gate this round). | |
| 222 | +- Refusal string: UNCHANGED text ("a frame with loop restoration enabled | |
| 223 | + (the per-unit lr symbols are read but the Wiener/self-guided filters | |
| 224 | + are not yet applied to pixels)"), only its position in `decode_stream` | |
| 225 | + moved (was before the tile-decode call, now after) -- `refusal_inventory.rs` | |
| 226 | + on main should not need updating for this move since the string itself | |
| 227 | + didn't change; report this in case main's guard checks call-site order | |
| 228 | + too. | |
| 229 | + | |
| 230 | +## Next lever (r3 -> r4) | |
| 231 | +1. Wiener pixel filter (charter step 2): `apply_loop_restoration` after | |
| 232 | + `apply_cdef` in `decode.rs` (two call sites, ~4983/10502), driven by | |
| 233 | + the `RestorationGrid`/`(WienerInfo, SgrprojInfo)` this round's gate | |
| 234 | + proved decode correctly. Watch the 3-pixel stripe boundary save/ | |
| 235 | + restore (`rlbs`) -- not investigated this round. | |
| 236 | +2. Self-guided (SGR) filter (charter step 3): box-sum radii from | |
| 237 | + `SGR_PARAMS`. | |
| 238 | +3. Once both are wired and this gate's LR frames start decoding | |
| 239 | + pixel-exact, widen the gate to assert `Ok` + pixel match instead of | |
| 240 | + the named refusal, then drop the `stream.rs` refusal (charter step 4). | |
| 241 | + | |
| 242 | +## Turn budget (r3) | |
| 243 | +Spent on: reading the charter + r2 section, writing the gate, and | |
| 244 | +(unplanned but necessary) diagnosing + fixing the check-before-decode | |
| 245 | +bug the gate exposed -- confirming it via a scratch `EC_AV1_PIN` decode | |
| 246 | +of a hand-built fixture (`loop_restoration.uses_lr=true`, `frame_restoration_type` | |
| 247 | +`Sgrproj`) before touching `stream.rs`. Did not reach either pixel | |
| 248 | +filter; r4 should start directly at Wiener (`decode.rs`'s two | |
| 249 | +`apply_cdef` call sites), no further libaom recon needed this report | |
| 250 | +plus `restoration.rs`'s own doc comments don't already cover. | |
| 251 | + | |
| 188 | 252 | ## Turn budget (r2) |
| 189 | 253 | Spent the full 75-turn allowance on: recon of libaom's exact `k`-per-tap |
| 190 | 254 | subexp/SGR-table/read_lr_unit shape (not fully covered by r1's report -- |