Lane-lr r5 report -- 06ba9af compiles/is complete, 235/236
Browse files at this commitbd8da13e29095574d1471957e61f0d760ffbcbeeParent: ea29f07- docs
- lane-lr r5 report -- 06ba9af compiles/is complete, 235/236
- one real 1px SGR rounding defect isolated, root cause not found
1 changed file +75 -0
- lanes/lr.report.md +75 -0
lanes/lr.report.mdmodified+75 -0
| @@ -227,6 +227,81 @@ dropping the refusal) NOT started -- out of turn budget. | |||
| 227 | didn't change; report this in case main's guard checks call-site order | 227 | didn't change; report this in case main's guard checks call-site order |
| 228 | too. | 228 | too. |
| 229 | 229 | ||
| 230 | +## r5 -- VERDICT: not green. 06ba9af compiles clean and was NOT a | ||
| 231 | +mid-edit wip; r4 finished all four charter steps (Wiener + SGR pixel | ||
| 232 | +filters wired at both call sites, gate widened to assert `Ok` + | ||
| 233 | +pixel-exact, `stream.rs` refusal dropped). Suite: 235/236 -- one real, | ||
| 234 | +reproducible (not flake) defect in | ||
| 235 | +`a_real_aomenc_stream_with_restoration_reads_lr_symbols_correctly`: | ||
| 236 | +`V mismatch (seed 46 frame 0)`, exactly 1 pixel of 6144 in the V plane, | ||
| 237 | +off by 1 (ours=195, ffmpeg reference=194), at absolute (row=61,col=6), | ||
| 238 | +inside chroma's last/partial restoration stripe `[60,64)` (unit spans | ||
| 239 | +the whole 64px plane height, `--sb-size=64` 192x128 fixture), filter | ||
| 240 | +`Sgrproj{ep:6, xqd:[-16,-32]}` (both radii active, `r0=2` "fast" + | ||
| 241 | +`r1=1` "dense"). Ran 235/236 with `EC_AV1_REQUIRE_AOMENC=1`, | ||
| 242 | +`CARGO_TARGET_DIR=$HOME/.cache/cargo-target-lr`, `-j4`, 600000ms timeout. | ||
| 243 | + | ||
| 244 | +Did NOT commit anything this round -- the tree was already clean at | ||
| 245 | +06ba9af (nothing left mid-edit; the orchestrator's "unverified" label | ||
| 246 | +undersold r4's actual state). All edits made this round were temporary | ||
| 247 | +`eprintln!`/dump instrumentation, reverted with `git checkout --` before | ||
| 248 | +finishing (tree is bit-identical to 06ba9af). | ||
| 249 | + | ||
| 250 | +Diagnosis done, inconclusive on root cause: | ||
| 251 | +- Confirmed NOT a flake -- same failure every run, same seed/pixel. | ||
| 252 | +- Confirmed NOT an above/below stripe-boundary substitution bug -- | ||
| 253 | + hand-traced `lr_sample`'s doc-commented rules | ||
| 254 | + (`stripe_v_start-1`→exact, `-2`/`-3`→both duplicate `stripe_v_start-2`; | ||
| 255 | + `stripe_v_end==plane_h`→frame-edge replicate) against libaom's real | ||
| 256 | + `setup_processing_stripe_boundary`/`save_deblock_boundary_lines` | ||
| 257 | + (`~/.cache/aom-oracle/src/av1/common/restoration.c` ~249-410, | ||
| 258 | + 1355-1490) line by line -- they match exactly for this stripe | ||
| 259 | + (`use_deblock_above=true` since `stripe_idx=2>0`, `use_deblock_below= | ||
| 260 | + false` since it's the plane's last stripe). | ||
| 261 | +- Wrote a live dump harness (env-gated `eprintln!`+file dump inside | ||
| 262 | + `apply_sgrproj_stripe`/`filter_restoration_unit`, since reverted) that | ||
| 263 | + extracted the REAL cdef/deblocked V-plane bytes for the failing | ||
| 264 | + attempt to `/tmp/lr_cdef.bin`/`/tmp/lr_deblocked.bin` (both files | ||
| 265 | + byte-identical, as expected -- gate runs `--enable-cdef=0`). | ||
| 266 | + Instrumented the live Rust `apply_sgrproj_stripe`/`compute_ab` to | ||
| 267 | + print the actual A/B grid values it computes for the failing pixel's | ||
| 268 | + 5-neighbour dense (`r1`) read: `a_u=254 b_u=303 a_c=251 b_c=922 | ||
| 269 | + a_d=224 b_d=6502 a_l=252 b_l=700 a_r=249 b_r=1344`, and the final | ||
| 270 | + combine: `a1=7674 b1=103359 flt1=3110 xq0=-16 xq1=176`. Hand-verified | ||
| 271 | + every one of these numbers independently in Python against the raw | ||
| 272 | + 9-tap box sums read back from the dumped buffers via `lr_sample` -- | ||
| 273 | + ALL MATCH; the dense-radius arm's math is provably correct for this | ||
| 274 | + pixel. Did not get to instrument the fast (`r0=2`) arm's actual grid | ||
| 275 | + reads the same way before the turn cap forced a stop (only its | ||
| 276 | + `a=4000 b=16759 flt0=3097` final numbers were captured, not the 5 | ||
| 277 | + underlying A/B neighbour reads) -- **the fast arm is the one unverified | ||
| 278 | + half**; check that first. | ||
| 279 | +- A hand-written standalone C transcription of libaom's real algorithm | ||
| 280 | + (`/tmp/lr_ref.c`, hex box-sum + av1_x_by_xplus1/av1_one_by_x tables | ||
| 281 | + copied verbatim from `restoration.c`) produced 194 (matching ffmpeg) | ||
| 282 | + against the same dumped buffers -- but a *second*, differently-scoped | ||
| 283 | + probe (`/tmp/lr_probe.c`) printing individual A/B taps gave | ||
| 284 | + self-inconsistent numbers across separate runs of what should be | ||
| 285 | + identical code, so that C reproduction is NOT trustworthy evidence of | ||
| 286 | + a real Rust bug; treat both `/tmp/lr_ref.c` divergence claims as | ||
| 287 | + unconfirmed, not as a finding. The live-Rust-instrumented numbers | ||
| 288 | + above are the reliable data. | ||
| 289 | +- Next agent: re-run this round's dump harness (recreate the 3 | ||
| 290 | + env-gated `eprintln!` blocks -- see this section's description, they | ||
| 291 | + were reverted, not left in the tree) to print the FAST (`r0=2`) arm's | ||
| 292 | + 5 individual A/B neighbour reads (`a_um1/b_um1`, `a_up1/b_up1`, | ||
| 293 | + `a_uml`, `a_umr`, `a_upl`, `a_upr` for the row-61 ODD-branch case -- | ||
| 294 | + wait, row61 is ODD relative to `v_start=60`, so it's actually the | ||
| 295 | + OTHER branch: own-row `a_c/b_c` + `a_l/a_r` neighbours, matching | ||
| 296 | + `restoration.rs`'s `else` arm ~line 738) and hand-verify those 3 | ||
| 297 | + numbers the same way the dense arm was verified above. If those also | ||
| 298 | + check out, the bug is not in `apply_sgrproj_stripe` at all and the | ||
| 299 | + next place to look is upstream: whether the V-plane's CDEF/deblocked | ||
| 300 | + pixel data feeding `lr_sample` is itself off by something that only | ||
| 301 | + this specific rounding-sensitive combination surfaces (Y and U match | ||
| 302 | + bit-exact on every attempt; only V, only this one pixel, only this | ||
| 303 | + one `(ep,xqd)` combination, across the whole 40-attempt run). | ||
| 304 | + | ||
| 230 | ## Next lever (r3 -> r4) | 305 | ## Next lever (r3 -> r4) |
| 231 | 1. Wiener pixel filter (charter step 2): `apply_loop_restoration` after | 306 | 1. Wiener pixel filter (charter step 2): `apply_loop_restoration` after |
| 232 | `apply_cdef` in `decode.rs` (two call sites, ~4983/10502), driven by | 307 | `apply_cdef` in `decode.rs` (two call sites, ~4983/10502), driven by |