report(lane-lr): r7 section -- VERDICT not green, SGR still one pixel
Browse files at this commitdd702f001524900b3cde2a21d3ce953625503f00Parent: fb35afc1 changed file +87 -0
- lanes/lr.report.md +87 -0
lanes/lr.report.mdmodified+87 -0
| @@ -440,3 +440,90 @@ lesson: rerun a "found the bug" number at least once before trusting | ||
| 440 | 440 | it, both false positives here were stale/mistyped variable state, not |
| 441 | 441 | real). Ran out of budget before pinning the exact source-level cause; |
| 442 | 442 | r7 should start at option (a) above, not redo any of the ruled-out list. |
| 443 | + | |
| 444 | +## r7 -- VERDICT: not green, still one pixel. Built the ground-truth | |
| 445 | +instrument r6 asked for, but it could not reproduce r6's own "254 vs | |
| 446 | +253" divergence this round -- open, needs r8 to re-derive with a | |
| 447 | +uniquely-identified call (see below). Committed `ff1e62f` (harness + | |
| 448 | +oracle rung + gate pin, all forward progress, no behaviour change to | |
| 449 | +the decoder). | |
| 450 | + | |
| 451 | +**Built** (option (a) from r6, done): | |
| 452 | +- `scripts/instrument-aom-oracle.sh` rung 6: drops `static` from | |
| 453 | + libaom's `calculate_intermediate_result` (restoration.c) so an | |
| 454 | + external harness can call it directly. Rebuilt | |
| 455 | + `~/.cache/aom-oracle/build/libaom.a` with it (`ninja libaom.a`). | |
| 456 | +- `scripts/lr-sgr-pin-harness.c` extended: replicates | |
| 457 | + `av1_selfguided_restoration_c`'s own uint8->int32 border-extend copy, | |
| 458 | + then calls `calculate_intermediate_result` directly with | |
| 459 | + `sgr_params_idx=6, radius_idx=1, pass=0` and prints the real A/B for | |
| 460 | + all 9 dense-arm neighbour taps of the r6 failing pixel. | |
| 461 | +- Wired `EC_AV1_GATE_DUMP` into | |
| 462 | + `a_real_aomenc_stream_with_restoration_reads_lr_symbols_correctly` | |
| 463 | + (stream.rs ~4791), mirroring the masked-compound gate's existing | |
| 464 | + pattern -- pins the exact mismatching stream instead of only | |
| 465 | + asserting. Ran once, wrote seed 46's stream to | |
| 466 | + `fixtures/lr-sgr-r7.obu` (gitignored, not in the commit -- copy | |
| 467 | + survives in this worktree only; regenerate with | |
| 468 | + `EC_AV1_GATE_DUMP=fixtures/lr-sgr-r7.obu EC_LR_GATE_ATTEMPTS=10` if | |
| 469 | + it's gone). | |
| 470 | + | |
| 471 | +**Result — real ground truth for the "u" tap**: `av1_x_by_xplus1`/ | |
| 472 | +`av1_one_by_x` real compiled tables, real box sum, real | |
| 473 | +`ROUND_POWER_OF_TWO` all say the "u" tap (physical row 60, the box | |
| 474 | +centred one row above the failing pixel) is `(A,B) = (253,454)`, not | |
| 475 | +the `(254,303)` r6's report recorded. Hand-verified twice (once by | |
| 476 | +reading libaom's source directly with these exact numbers -- z=101, | |
| 477 | +`av1_x_by_xplus1[101]=253`, `av1_one_by_x[8]=455`, | |
| 478 | +`ROUND_POWER_OF_TWO(3*1362*455,12)=454` -- and once independently via | |
| 479 | +the harness's compiled call). The other 8 taps r6 already trusted are | |
| 480 | +untouched this round. | |
| 481 | + | |
| 482 | +**Could not reproduce r6's divergence.** Added a temporary | |
| 483 | +`EC_LR_SAMPLE_DUMP` env-gated `eprintln!` to `lr_sample` (reverted, | |
| 484 | +not in the commit) and reran the live gate at `EC_LR_GATE_ATTEMPTS=5` | |
| 485 | +(seeds 42-46, the one that panics is 46): the raw bytes our own | |
| 486 | +`compute_ab` actually reads for the "u" tap's 3x3 window at column 6 | |
| 487 | +across the three box rows are `111` (row 59, deblocked-boundary read), | |
| 488 | +`154` (row 60), `194` (row 61) -- these match `/tmp/lr_full.bin`'s | |
| 489 | +bytes at the same physical positions bit for bit, and an independent | |
| 490 | +Python replica of `compute_ab`'s exact box-sum/`z`/`A`/`B` formula fed | |
| 491 | +the full real 9-byte window (100,111,117/140,154,163/182,194,201) | |
| 492 | +reproduces `(253,454)` exactly -- i.e. this round could not find *any* | |
| 493 | +wrong input or wrong arithmetic for the "u" tap; both check out | |
| 494 | +against the real answer independently. r6's `(254,303)` number was not | |
| 495 | +re-derived from a uniquely-identified call this round (the dump filter | |
| 496 | +matched on `v_start==60` only, which several different seeds/frames in | |
| 497 | +the 5-attempt window share, so the samples confirmed above are not | |
| 498 | +provably from the exact same call r6's `eprintln!` captured, only from | |
| 499 | +*a* call at the same coordinates producing the same real bytes). | |
| 500 | + | |
| 501 | +**Do not re-suspect** (unchanged from r6, now doubly confirmed): `lr_sample` | |
| 502 | +boundary substitution, the box-sum inputs themselves, the fast/r0 arm, | |
| 503 | +`compute_ab`'s formula in the abstract (matches source + a from-scratch | |
| 504 | +Python replica bit for bit for these 9 real bytes). | |
| 505 | + | |
| 506 | +**r8 should**: use the now-committed `EC_AV1_GATE_DUMP` wiring plus | |
| 507 | +`fixtures/lr-sgr-r7.obu` to decode the *single pinned seed-46 stream* | |
| 508 | +directly (not the live 40-attempt sweep, which reuses coordinates | |
| 509 | +across unrelated frames), and re-add a debug dump keyed to a value | |
| 510 | +unique to this one call (e.g. tag the print with a per-call sequence | |
| 511 | +counter, or gate on the exact `xqd=[-16,-32]` this pixel uses) so the | |
| 512 | +9 bytes it captures are provably the same call r6's original 3110-vs-3109 | |
| 513 | +mismatch came from. If that live-captured 9-byte window differs at all | |
| 514 | +from `100,111,117,140,154,163,182,194,201`, that's the real bug; if it | |
| 515 | +matches, the (254,303) transcription itself was wrong and the fix is | |
| 516 | +elsewhere (recheck `flt1`'s combine step in `apply_sgrproj_stripe` | |
| 517 | +directly, not `compute_ab`, since r6 also independently reproduced | |
| 518 | +`3110` by hand from the taps it recorded -- meaning either the taps or | |
| 519 | +the combine, not both, are broken, and this round's evidence points | |
| 520 | +at the taps). | |
| 521 | + | |
| 522 | +## Turn budget (r7) | |
| 523 | +Spent on: building + verifying the rung 6 harness/oracle patch, | |
| 524 | +capturing a fresh 9-tap real-libaom answer (all matches r6's 8 except | |
| 525 | +the "u" tap), a live `EC_LR_SAMPLE_DUMP` trace to try to falsify | |
| 526 | +r6's claim, and wiring + exercising `EC_AV1_GATE_DUMP` for the gate | |
| 527 | +(new, reusable). Ran out of budget chasing down the coordinate-vs-call | |
| 528 | +ambiguity above; r8 should start there, not redo any of this round's | |
| 529 | +ground-truth derivation. |