lanes/av1pins r5: the scanner, the 14 recovered pins, and a correction to r4
Browse files at this commit32ee762e129ec1de87595c6edfb0b59b247b7a33Parent: 60491401 changed file +153 -0
- lanes/av1pins.report.md +153 -0
lanes/av1pins.report.mdmodified+153 -0
| @@ -559,3 +559,156 @@ Follow-on handed back rather than folded in: the 14 `pinned_warp` pins, which ar | |||
| 559 | the same defect as r3's four and want the same `crate_pin` + committed-copy | 559 | the same defect as r3's four and want the same `crate_pin` + committed-copy |
| 560 | treatment. Not verified: a full `cargo test -p ec-av1` run (project-wide validation | 560 | treatment. Not verified: a full `cargo test -p ec-av1` run (project-wide validation |
| 561 | is Main's). | 561 | is Main's). |
| 562 | + | ||
| 563 | +--- | ||
| 564 | + | ||
| 565 | +# r5 — the scanner, the 14 pins, and a correction to r4 | ||
| 566 | + | ||
| 567 | +Branch `lane-av1pins5`, forked from the r4 tip `2e5509e9`. Commits `e200fede` | ||
| 568 | +(the 14 pins), `3eb90648` (scanner + sweep), plus this report. Tests and test | ||
| 569 | +helpers only. Not pushed; main untouched. | ||
| 570 | + | ||
| 571 | +**Authoritative location, as the batch-close audit asked:** this lane lives in | ||
| 572 | +`~/.cache/wt/av1pins5` (branch `lane-av1pins5`). It is **not** a stale duplicate of | ||
| 573 | +`~/.cache/wt/av1pinslive` — `av1pinslive` sits at the same tip `2e5509e9` but does | ||
| 574 | +**not** carry the 14 pins; they were only ever in `av1pins5`. All 14 were verified | ||
| 575 | +byte-identical in three independent locations (this worktree's staged copy, a | ||
| 576 | +local `/tmp` copy, and the runner library) before committing: **14/14 identical, | ||
| 577 | +0 mismatches**. They are now committed, so no worktree holds the only copy. | ||
| 578 | + | ||
| 579 | +## 1. The scanner | ||
| 580 | + | ||
| 581 | +`pin_inventory` in `gate_coverage.rs` resolves **five** shapes: | ||
| 582 | + | ||
| 583 | +| # | shape | example | | ||
| 584 | +|---|---|---| | ||
| 585 | +| (a) | single-name committed | `crate_pin("golden3-pin.obu")` | | ||
| 586 | +| (b) | single-name machine-local | `pin_dir().join("x.obu")` | | ||
| 587 | +| (c) | whole-file `concat!` literal | `concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures/x.obu")` | | ||
| 588 | +| (d) | directory literal + runtime name | `let fixtures = concat!(...); … format!("{fixtures}/{n}.obu")` | | ||
| 589 | +| (e) | committed + runtime name | `crate_pin(&format!("{n}.obu"))` | | ||
| 590 | + | ||
| 591 | +### Scanner before/after on the live tree | ||
| 592 | + | ||
| 593 | +``` | ||
| 594 | +BEFORE (r3 inventory): gate=pinned_warp_stream_decodes_pixel_exact reads=0 | ||
| 595 | +AFTER (r5 inventory): 14 pin(s) a gate reads have no committed copy under | ||
| 596 | + crates/ec-av1/fixtures/: | ||
| 597 | + pinned_warp_stream_decodes_pixel_exact:warp-mismatch.obu (concat_dir_runtime_name) | ||
| 598 | + … all 14 named, then 0 after the fix landed. | ||
| 599 | +``` | ||
| 600 | + | ||
| 601 | +### Shape (e) is the finding worth reading | ||
| 602 | + | ||
| 603 | +Rewriting the directory literal as a committed-path lookup made the gate | ||
| 604 | +**correct and simultaneously invisible**: `crate_pin("` no longer appears, shape | ||
| 605 | +(a) found nothing, and the enumerator reported a **clean tree while 14 pins were | ||
| 606 | +read**. A false pass is worse than the original gap — the original at least | ||
| 607 | +surfaced in a filesystem audit, which is exactly how the batch-close audit found | ||
| 608 | +it. It was caught by the `reads.len() >= 20` floor in the invariant test. That | ||
| 609 | +floor exists for this and I would not remove it. | ||
| 610 | + | ||
| 611 | +**The general lesson:** fixing a shape can blind the check that was watching it. | ||
| 612 | + | ||
| 613 | +### Two scanner bugs, both found by the capability tests | ||
| 614 | + | ||
| 615 | +* A `format!` brace escape emitted `{n` instead of `{n}`, so the marker never | ||
| 616 | + matched and shape (d) resolved 0 pins. | ||
| 617 | +* `args.find(')')` stopped at the `)` of `pictures.len()`, truncating the argument | ||
| 618 | + list and yielding **zero** sites overall — the sweep reported a clean tree. | ||
| 619 | + | ||
| 620 | +Capability tests therefore use **synthetic source**, never the live file. Asserting | ||
| 621 | +against the live tree would rot the moment the fix lands, which is precisely how a | ||
| 622 | +scanner loses its edge. | ||
| 623 | + | ||
| 624 | +**Ownership, stated because two lanes touch this:** the scanner owns the | ||
| 625 | +**enumeration** (which gates read which pins, from source). The fixture-preflight | ||
| 626 | +lane owns the **file inventory on a runner** (does each path exist on the box). | ||
| 627 | +The scanner is the stricter of the two — it fails on an uncommitted pin whether or | ||
| 628 | +not some runner happens to have a copy. | ||
| 629 | + | ||
| 630 | +## 2. The 14 pins — provenance `recovered-original` | ||
| 631 | + | ||
| 632 | +Fetched byte-for-byte from the runner library. **Not regenerated**: these are the | ||
| 633 | +actual historical mismatch witnesses, and a re-encode would be a different stream | ||
| 634 | +that must not be called the pin. | ||
| 635 | + | ||
| 636 | +| pin | size | sha256 | | ||
| 637 | +|---|---|---| | ||
| 638 | +| warp-mismatch.obu | 621 B | `24cca5beb41c1078f8109d8fa7e35f10cc1eefb67c6d1d1ea248a0b6842287bb` | | ||
| 639 | +| warp-flake-5.obu | 602 B | `1a99f9e5b257eed0ebae055441904d6c40962a26c0c2d63c3e051732569ff0a0` | | ||
| 640 | +| warp-flake-7.obu | 723 B | `c2f8b93f5a59c56b1c4453ea789e0fc955557ed9b63c0e2cb8683fa483eff2b5` | | ||
| 641 | +| ii-flake-1.obu | 579 B | `700ded3e61e15bc3573d339d7fcc6ab94500adb796c30021094d354306662238` | | ||
| 642 | +| ii-flake-2.obu | 581 B | `edc4ad3a6c00c6bc909c626fa24433ef31a88ed519ed57403f5373a160e590af` | | ||
| 643 | +| ii-flake-3.obu | 670 B | `994bfbdc952ecef18ae1560d5e7f121ba1000172e0bc2ad05e5b8cfaa17b15cb` | | ||
| 644 | +| ii-flake-5.obu | 681 B | `f43fe77ea0e8ddd9c1524b642e09f935921cb0d00c4a60061a52d2260af38b9a` | | ||
| 645 | +| ii-flake-6.obu | 632 B | `84a1f60011dfdb77ede98ce95a25d247d270b0af1cff2c44aa1e6b311ca63dce` | | ||
| 646 | +| ii-flake-7.obu | 654 B | `61ba4d114aa55ebcf95ae691abbce3307146a2d969c0627ea3ceea02f3875574` | | ||
| 647 | +| ii-flake-8.obu | 635 B | `f19d3d80ed564850cec02a26cfe7ab00e282afa7896821c535a117f5541bef5d` | | ||
| 648 | +| ii-flake-9.obu | 690 B | `0df4874737cc615258c0fdfb4bcb157c9a3663127cbf0a896af44d4deb83c653` | | ||
| 649 | +| rect-flake-1.obu | 607 B | `a3869b5d2bd8a8bc5413e0d039d5e3375a48601cdeb2edb8d4b732402926d357` | | ||
| 650 | +| rect-flake-2.obu | 601 B | `c780ddee1adf25cf63a6ba70ff449820f6f4474b23ef16615c1e843ad0c86adb` | | ||
| 651 | +| rect-flake-3.obu | 572 B | `3b23d204549b7bcfbd7166b1b3e2920580236c78de12e8f23f7fb64c1864f3e6` | | ||
| 652 | + | ||
| 653 | +`.gitignore`'s `!crates/*/fixtures/**` negation means a plain `git add` suffices — | ||
| 654 | +verified with `git check-ignore -q` (returns 1) and by staging with no `-f`. | ||
| 655 | + | ||
| 656 | +## 3. The gate is live | ||
| 657 | + | ||
| 658 | +`pinned_warp_stream_decodes_pixel_exact` reads all 14 from | ||
| 659 | +`crates/ec-av1/fixtures/`, via `crate_pin`, with `require_pin` in the helper. | ||
| 660 | +Plain run (no `--ignored`): **1 passed; 0 failed; 0 ignored; 744 filtered out; | ||
| 661 | +1.47 s**, printing each `pin: …/crates/ec-av1/fixtures/<name>`. | ||
| 662 | + | ||
| 663 | +The asserts live in `check_pinned_warp_stream`, which this gate delegates to — | ||
| 664 | +stated in the gate's doc comment, because a body-only scan reads as assert-free, | ||
| 665 | +which is how the r4 audit got it wrong. `#[ignore]` **36 → 35**. | ||
| 666 | + | ||
| 667 | +## 4. The count-vacuity sweep — and a CORRECTION to r4 | ||
| 668 | + | ||
| 669 | +`count_vacuity` enumerates every site passing a locally-derived count as the | ||
| 670 | +oracle's expected frame count: **61 sites, 13 spec-pinned by a prior assert, 48 | ||
| 671 | +not**. The floor (`>= 40`) stops the sweep silently shrinking. | ||
| 672 | + | ||
| 673 | +**r4 reported this shape as a "vacuous pass" and I told Main so. That was wrong.** | ||
| 674 | +Measured, by calling `ffmpeg_decode_sequence(&stream, 192, 128, 0)` on a real | ||
| 675 | +pinned stream under `catch_unwind`: | ||
| 676 | + | ||
| 677 | +``` | ||
| 678 | +panicked at crates/ec-av1/src/stream.rs:5110:9: | ||
| 679 | +expected 0 4:2:0 frames, ffmpeg said: | ||
| 680 | +``` | ||
| 681 | + | ||
| 682 | +The helper asserts `out.stdout.len() == frame_bytes * frames` unconditionally, so | ||
| 683 | +a wrong count **cannot pass silently** — it REDS, with a message that blames | ||
| 684 | +FFmpeg for a count our decoder chose. The consequence is a **misattributed red**, | ||
| 685 | +not a silent pass. | ||
| 686 | + | ||
| 687 | +r4's *fix* still stands (the count now comes from the fixture, so the red names the | ||
| 688 | +real cause). The *justification* was wrong, and a sweep repeating it would send | ||
| 689 | +the next reader after a bug that does not exist. | ||
| 690 | + | ||
| 691 | +| column | meaning | | ||
| 692 | +|---|---| | ||
| 693 | +| `stream.rs:3895` | `a_real_aomenc_segmentation_stream_with_map_inheritance_decodes_pixel_exact` — `pictures.len()`, not spec-pinned: a wrong count reds, blaming ffmpeg | | ||
| 694 | +| `stream.rs:5355` | `an_svt_screen_palette_block_with_a_split_transform_decodes_exactly` — `decoded.len()`, not spec-pinned | | ||
| 695 | +| `stream.rs:10287/10289` | `rect_tx_tool_gate` — `decoded.len()`, not spec-pinned | | ||
| 696 | +| … 48 total | full list printed by the test; the floor pins the count | | ||
| 697 | + | ||
| 698 | +**All 48 are reported, none fixed.** That is an unbounded change across gates this | ||
| 699 | +lane does not own, and dressing it as a fix would be dishonest. The pin-class gates | ||
| 700 | +are clean: **0** unpinned count sites in `pinned_lr_sgr`, | ||
| 701 | +`check_pinned_warp_stream`, `pinned_golden3`, `pinned_sbpart` and the film-grain | ||
| 702 | +gate. | ||
| 703 | + | ||
| 704 | +## 5. State | ||
| 705 | + | ||
| 706 | +`lane-av1pins5`, three commits on top of `2e5509e9`. `cargo check -p ec-av1 | ||
| 707 | +--all-targets` clean, **0 warnings**. `gate_coverage` **15 passed** (10 pre-existing | ||
| 708 | ++ 5 new scanner tests), `refusal_inventory` 15 passed. Not verified: a full | ||
| 709 | +`cargo test -p ec-av1` run (project-wide validation is Main's). | ||
| 710 | + | ||
| 711 | +The rule this lane earns, on top of r3's: **a fix can blind the check that was | ||
| 712 | +watching the shape it changed.** The pin inventory went from blind, to correct, to | ||
| 713 | +blind-again-in-a-new-guise, across three commits in three rounds. The floor and the | ||
| 714 | +synthetic capability tests are what make that survivable. | ||