forge
Explore
Log in

Don't you dare go Hollow

edith_codecs

Clone
★ 0

0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits

av1pins.report.md62.0 KiBHistoryRawDownload

lane-av1pins — recover three lost pins, correct a stale blocker comment, measure the mandelbrot claim

Branch lane-av1pins, worktree ~/.cache/wt/av1pins, base a21f3680 (the merged seven-lane main). Comment, fixture and test changes only — no decoder logic. Commits: 78c805bd (pins + gate rewiring + comment correction), plus this report.

The headline is that the third of those reversed my own prior conclusion: the mandelbrot blocker is measurably cleared, and the comment that recorded it as the live blocker was the stale artefact, not the #[ignore] string.


0. The root cause, which is structural and not per-pin

.gitignore:2 is a bare fixtures, which git matches at any depth — so it covers crates/ec-av1/fixtures/ too, not just the root. The 48 pins already tracked there were force-added. Any new pin therefore has to be git add -f'd or it is silently uncommittable, and any pin written to the root fixtures/ is uncommittable by construction.

pin_dir() resolves to the root (../../fixtures, gitignored), which is where all three dead pins were written. lanes/av1skipfix.report.md had already recorded this and had listed exactly these three as "missing on this box". So the diagnosis predates this lane; what was missing was the recovery.

The fix is crate_pin(name) (crates/ec-av1/src/stream.rs:8670): prefer the committed crates/ec-av1/fixtures/<name>, fall back to pin_dir() so a locally re-captured stream still overrides. The committed copy is what runs by default.


1. Recovered pins

path sha256 size
crates/ec-av1/fixtures/golden3-pin.obu 11c9d5331cffa6614c8265ad5fa685d5ce9155db8439949b48ec4a652ace95cf 159 B
crates/ec-av1/fixtures/sbpart-pin.obu 62238fc077f45d89745d4d254b9c0465464003529da3b42d0a65631fbb7e16e9 238 B
crates/ec-av1/fixtures/ll444-lossless-key.obu f496ef0a1171c2bc66d411cc60db05db547dcdb49cd834d4e0543de9db441374 7845 B

All three from aomenc (~/.cache/aom-oracle/build/aomenc), all --threads=1 --row-mt=0.

golden3-pin.obu — FRESH capture, with a numeric tie to its source gate

Source: gradients_source(42, 64, 64, "duration=0.16:rate=25") (c0..c3 from the crate's hash_color, seed=42 passed through) via ffmpeg -pix_fmt yuv420p -f yuv4mpegpipe; then aomenc:

--codec=av1 --passes=1 --end-usage=q --cq-level=55 --cpu-used=0
--lag-in-frames=0 --auto-alt-ref=0 --kf-max-dist=1000 --threads=1 --row-mt=0
--enable-order-hint=0 --enable-warped-motion=0 --enable-obmc=0
--enable-masked-comp=0 --enable-interintra-comp=0 --enable-dist-wtd-comp=0
--enable-diff-wtd-comp=0 --enable-onesided-comp=0 --enable-interintra-wedge=0
--enable-smooth-interintra=0 --enable-rect-partitions=0 --enable-ab-partitions=0
--enable-1to4-partitions=0 --enable-filter-intra=0 --enable-smooth-intra=0
--enable-paeth-intra=0 --enable-directional-intra=0 --enable-angle-delta=0
--enable-tx-size-search=0 --enable-cdef=0 --enable-restoration=0
--max-partition-size=32 --enable-palette=0 --enable-intrabc=0
--enable-cfl-intra=0 --enable-ref-frame-mvs=0 --obu

The tie to the source gate is a number, not a claim. The live a_real_aomenc_inter_sequence_with_cdf_forwarding_decodes_pixel_exact prints cdfflake attempt seed=42: ... stream_hash=89c4089148d51c04 .... This re-encode's FNV-1a-64 is 89c4089148d51c04 — identical, same 159 bytes.

Fresh capture, not a replay; the original is unrecoverable. The original was taken at bec27414 (2026-08-28); gradients_source only became byte-reproducible at 5ae053d3 (2026-08-30). git merge-base --is-ancestor bec27414 5ae053d3 is true, so at capture time the source left c4..c7 to ffmpeg's random default — those bytes cannot be regenerated by any re-encode. What is recovered is a same-family stream the gate decodes and compares exact. The gate's doc comment says so, so nobody later reads it as a replay.

sbpart-pin.obu — FRESH capture from the source gate's recipe

smptebars=size=192x128:rate=25, -t 0.04 -pix_fmt yuv420p -f yuv4mpegpipe, then

aomenc --codec=av1 --passes=1 --end-usage=q --cq-level=55 --cpu-used=4
       --threads=1 --row-mt=0 --sb-size=64 --enable-palette=1
       --min-partition-size=16 --max-partition-size=64 --obu

The source gate's size list is [(64,128),(128,64),(128,128),(128,192),(192,192)] — it has no 192x128 cell, while pinned_sbpart_stream_decodes_pixel_exact compares at 192x128. So this is a 192x128 re-run of that recipe, not a cell of it; recorded in the gate's doc comment. cq 55 chosen from a 7-cq sweep (15, 25, 63 also pass).

ll444-lossless-key.obu — replay of the recipe the gate's own SKIP line records

testsrc2=s=128x96:r=25, -frames:v 6 -pix_fmt yuv444p -f yuv4mpegpipe, then

aomenc --codec=av1 --profile=1 --lossless=1 --enable-palette=0
       --enable-intrabc=0 --bit-depth=8 --input-bit-depth=8 --passes=1
       --end-usage=q --cq-level=20 --cpu-used=0 --threads=1 --row-mt=0
       --lag-in-frames=0 --kf-max-dist=100 --limit=1 --obu

The recorded remedy was "6 frames ... cut to the key frame's OBUs". --limit=1 gives the same result without OBU surgery: aomenc emits the key frame and stops, and the gate asserts ours.len() == 1 anyway. testsrc2 is deterministic, so this one is a genuine replay.


2. Before / after, per gate

All runs --release, --test-threads=1, oracle present.

gate before after
pinned_golden3_stream_decodes_pixel_exact SKIP ... no pinned bytes, 0.00s, rc=0 1 passed, 0.15s, prints 4 frame(s) byte-exact vs ffmpeg from .../crates/ec-av1/fixtures/golden3-pin.obu
pinned_sbpart_stream_decodes_pixel_exact SKIP ... no pinned bytes, 0.00s, rc=0 1 passed, 0.15s; EC_SBPART_DIAG=1: DIAG frame 0: 0 luma mismatches, bbox ... of 192x128 + per-SB-column counts for cols 0..64, 64..128, 128..192
a_real_aomenc_lossless_444_key_frame_decodes_sample_exact SKIP ... no pinned bytes, 0.05s, rc=0 1 passed, 0.11s

Real work, not a stop-skipping — three independent proofs.

  1. Self-evidencing output. sbpart's EC_SBPART_DIAG walks all 192*128 = 24576 luma samples and reports per-superblock-column mismatch counts. golden3 prints its frame count and the path it read. A skip prints none of it.
  2. Non-vacuity assertions that had to hold. ll444 passes assert!(lossless) on the parsed frame header and assert!(rect_split_lossless_chroma444_hits() > before) — the 4:4:4 chroma rect-split walk provably ran, or the gate would be red. That is what makes it a verdict rather than a decode.
  3. Mutation. One byte flipped mid-pin turns all three RED: golden3 stream.rs:5106 (left: 12288, right: 24576), sbpart stream.rs:5099, ll444 stream.rs:6537. Stated precisely: these die in the ffmpeg decode step, not the pixel compare — a bit-flipped arithmetic-coded stream does not decode. So the mutation proves the bytes are READ and PROCESSED (a skip returns ok at 0.00s and never reaches any of it); it does not prove the pixel compare is what catches a bit flip. Proof 1 covers the compare.

One assertion added per gate on the way. Each of the three compared frames.iter().zip(&ffmpeg_frames) with no length check — the exact cmpaudit class, where a short side truncates the walk silently. Each now asserts frames.len() == ffmpeg_frames.len() first, naming the mis-pairing in the message.

The #[ignore] reasons changed from "reads a pinned fixture path outside the repo; run manually" to "bisect aid, not a suite gate; run it with --ignored" — still ignored, but the old text claimed a property (outside the repo) that is no longer true.


3. The stale comment, and the measurement that reversed my own call

Last turn I reported to Main that the two 1:4 gates' #[ignore] strings were wrong and the 22-line comment above them was right. That was backwards, and the re-run says so.

The r2 comment recorded, as these gates' blocker, an unowned mandelbrot inter-frame defect: "decode-order frame 3/4 luma ~3.7-4.5k samples, max |d| 6..17, then frames 5-7 drift to ~24k samples, max |d| ~220", plus "seeds 46 and 54 fire ZERO 1:4 strips ... and mismatch ffmpeg the same way as the firing seed 52".

Measured on a21f3680, release, the r2 recipe set re-run in full — 40 attempts per bit depth, from the gate's own parameters (mandelbrot 192x128, start_scale = 5.0 - attempt*0.06, end_pts=8, hue=s=0, -t 0.32, --enable-rect-partitions=1 --enable-1to4-partitions=1 --min-partition-size=32 --max-partition-size=64 --enable-tx-size-search=0 --enable-filter-intra=1 --enable-intra-edge-filter=1 --kf-min-dist=1000 --kf-max-dist=1000 plus the standard disable set, --cpu-used = 1 + attempt%4, --cq-level = [63,55,45,35][(attempt/4)%4]):

8-bit 10-bit
attempts decoded + pixel-compared 40 40
gate's own tally counted-exact=0 uncounted-exact=40 named-refusals=0 identical
first diff at / samples differ / max |d| lines in the full log 0 0
1:4 strips in inter frames 64x16=0 16x64=0 32x8=0 8x32=0 identical

Both the frame range and the byte counts r2 named are simply absent: no frame 3/4 counts, no max |d|, no drift. The mandelbrot inter-frame defect is cleared on this tree — 80 streams compared, 80 exact. A positive measurement, not the absence-of-evidence I flagged last turn.

And the recipe moved the other way: zero 1:4 strips fire now across all 42 counted attempts per arm, where r2 had one attempt firing 64x16=4 16x64=3. The gates went from "fires sometimes, compare fails" to "never fires", and now trip their own non-vacuity precondition at stream.rs:40653 rather than any pixel.

Therefore: the #[ignore] strings are correct for this tree and the comment was the stale artefact. Both gates stay ignored — a source that is baseline-exact and fires a 32-level intra 1:4 strip in an inter frame still does not exist — and the comment now records the cleared blocker and the zero-strip recipe regression, dated, with the reason for the correction.

What I did not claim: I did not identify which commit cleared the mandelbrot defect. The 7-lane wave is the obvious suspect and the measurement is consistent with it, but "the wave fixed it" is a correlation across a merge, not an attribution. Closing that needs an ablation, which is a bisect, not a comment fix.


4. State

Two commits on lane-av1pins, base a21f3680. cargo check -p ec-av1 --all-targets clean, no warnings. Not pushed, not merged; main untouched.

Verified here: the three gates pass from the committed pins with real-work output and mutation proof; the mandelbrot sweep measures 80/80 exact at both bit depths. Not verified: a full cargo test -p ec-av1 run (out of scope for a fixture/comment lane; project-wide validation is Main's), and the 35 probes/benchmarks excluded from the earlier release triage.

Procedure saved as managed skills stale-ignore-reason-vs-stale-comment and fixture-absent-silent-skip-class.


r2 — the two pins were still #[ignore]d, so a plain run executed nothing

Branch lane-av1pinslive off current main a5867794. Commit 2e9086c0. Tests only, no decoder change, no push.

A clean-checkout verification (13 branches, 39 gates) reported that the two gates lane-av1pins recovered are #[ignore]d: they pass under --ignored and their pins are committed, but in a plain suite run they do not execute. That is correct and it is the same hole in a different costume. r1's before/after table was measured with --ignored and did not say so, which made it read as a fix when it was only a fix under a flag.

1. The facts

gate #[ignore] on main a5867794? reason string
pinned_golden3_stream_decodes_pixel_exact yes bisect aid, not a suite gate; run it with --ignored
pinned_sbpart_stream_decodes_pixel_exact yes bisect aid, not a suite gate; run it with --ignored
a_real_aomenc_lossless_444_key_frame_decodes_sample_exact no — already live —

The reason string is stale, and it went stale twice. It was introduced at c9fede5d (2026-08-28, lane-av1golden3) as reads a pinned fixture path outside the repo; run manually, with the doc comment giving the real cause: "the file only exists on this machine's scratchpad". True then. It stopped being true at 78c805bd (lane-av1pins), which committed both pins under crates/ec-av1/fixtures/ — a path that travels in the runner tarball, so the bytes are on every runner.

The second staleness is mine. lane-av1pins replaced the reason with "bisect aid, not a suite gate" — a judgement, not a fact, and wrong on this tree: with the bytes committed these are ordinary decode-exactness gates that cost 0.10–0.15 s, not bisect aids. A clean-checkout run cannot see a committed pin, so the lane that fixed the pin hole left the ignore hole standing in the same commit.

2. No condition that makes this crate ignore a gate applies

Measured on a5867794, both gate bodies:

  • no process-global — neither calls force_sb128 nor knob_write. This is the condition that legitimately earns 11 other ignores in this crate.
  • no counter, no lock_gate_counters() — so --test-threads=1 is not required of them either.
  • no aomenc — they decode committed bytes and compare to ffmpeg, so they are not real-aomenc gates and stay out of the gate_coverage census either way.
  • not slow — 0.10–0.15 s each, against 9 ignored siblings that declare minutes-per-item.
  • ffmpeg guarded — have_ffmpeg() already honours EC_AV1_REQUIRE_FFMPEG, so a missing ffmpeg is a hard failure, not a silent skip.

Precedent in-tree: gate_coverage.rs records the 10-bit LR gate "was #[ignore]d on that branch and passes un-ignored on main, which carries the fix" — the same un-ignore-once-the-blocker-clears move.

3. Before / after, plain run

Both commands are plain — no --ignored, no --exact needed to select them:

cargo test -p ec-av1 --lib --release -- --exact stream::tests::pinned_golden3_stream_decodes_pixel_exact --test-threads=1 --nocapture
  test ...pinned_golden3_stream_decodes_pixel_exact ... pinned_golden3_stream_decodes_pixel_exact:
        4 frame(s) byte-exact vs ffmpeg from .../crates/ec-av1/fixtures/golden3-pin.obu
  test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 730 filtered out; finished in 0.15s

cargo test -p ec-av1 --lib --release -- --exact stream::tests::pinned_sbpart_stream_decodes_pixel_exact --test-threads=1 --nocapture
  test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 730 filtered out; finished in 0.10s
     (EC_SBPART_DIAG=1 additionally prints "DIAG frame 0: 0 luma mismatches ... of 192x128"
      plus per-SB-column counts — all 24576 luma samples walked)
main a5867794 plain run branch 2e9086c0 plain run
pinned_golden3 not executed (ignored) 1 passed, 0.15s, prints 4 frames byte-exact
pinned_sbpart not executed (ignored) 1 passed, 0.10s
a_real_aomenc_lossless_444_key_frame... 1 passed, 0.21s 1 passed, 0.21s (unchanged)

Three further confirmations that they are genuinely live rather than merely un-flagged: they execute under a plain substring filter (-- pinned_, no --exact, no --ignored); neither appears in -- --ignored any more (0 matches); and #[ignore] in stream.rs drops 41 → 39.

4. A regression I caused and then disproved — recorded because it nearly shipped

The first gate_coverage run on this branch showed FAILED. 8 passed; 2 failed (never_exercised_8bit_matches_the_gate_recipes, never_exercised_10bit_matches_the_gate_recipes), while the same filter on main passed 10/10. Un-ignoring changes the census input, so I took that as a regression I had introduced.

It was not. A 554-second --ignored full-suite run was executing against the same worktree and the same CARGO_TARGET_DIR at that moment. Re-run after it finished: gate_coverage 10 passed / 0 failed on 6 consecutive runs, and alone with --exact it also passes. These are compile-time source scans (include_str!), which cannot be perturbed by runtime state — consistent with a build/link race on the shared target dir, not with a logic change. Recorded because "I broke a meta-gate" was the correct reading of the evidence at the time, and the reason it was wrong is worth keeping.

Final meta-gate state after the change: gate_coverage 10 passed, refusal_inventory 15 passed, both green.

5. Follow-on found, NOT done here

Three sibling pin gates carry the same stale reason and still read pins that are not committed — so in a clean checkout each either skips or panics:

gate pin committed? failure mode if un-ignored as-is
pinned_golden4_stream_decodes_pixel_exact golden4-pin.obu no silent skip
pinned_golden7_stream_decodes_pixel_exact golden7-forwarding-mismatch.obu no silent skip
pinned_lr_sgr_stream_call_unique_dump lr-sgr-r7.obu no panic — std::fs::read(path).expect(...), no graceful skip

All three read through pin_dir() or a concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures/...") literal, i.e. the gitignored root. golden6-mismatch.obu is a fourth untracked pin. These are the same defect and the same fix; recovering them is mechanical from the r1 recipes (golden4 and golden7 are siblings of golden3 off the cdf-forwarding gate). Left out of this commit to keep it a reason-removal, and handed back rather than folded in silently.


r3 — the four remaining untracked pins, and the class closed

Branch lane-av1pinslive, rebased onto current main eccbd6c6. Commit f99a5ff9. Tests only, no decoder change, no push.

r2 fixed two gates and handed back three siblings. All four untracked pins are now committed, three gates are live, and one earns a factual ignore.

1. The pins — RECOVERED, not re-encoded

path sha256 size
crates/ec-av1/fixtures/golden4-pin.obu 1754023e44e46edaebc2c05065bf1c65db1a41354577cbf71c0e8ebe737ae14a 137 B
crates/ec-av1/fixtures/golden6-mismatch.obu c56909b98542192b03f3a945e153475aa57a58a1586bf166513297296cb225b3 452 B
crates/ec-av1/fixtures/golden7-forwarding-mismatch.obu 81b3bf657a85e95085287b30d97dee93ba5aea0ed1db1e1f4fcd19a06afc17be 152 B
crates/ec-av1/fixtures/lr-sgr-r7.obu 6b95b20e3377430ffae0b2ce86fad9502e0dedf13cd6c38ab7f5af4a8b21f33d 192 B

.gitignore verified as Main described. main:.gitignore:12 is !crates/*/fixtures/** — a negation, so git check-ignore -v printing that line means NOT ignored. Confirmed by exit code and by the decisive test: a plain git add crates/ec-av1/fixtures/<pin> staged all four with no -f.

Recovered, not re-encoded — and the order matters for provenance. I first reproduced golden4 and golden7 from the cdf-forwarding recipe (seeds 43–48, all of which decode exact) and captured golden6 through a throwaway harness built on the crate's own panned_test_card (the real recipe needs that Rust helper, not a lavfi source). Then I found the original bytes still on the runner libraries and fetched those instead. They are the actual historical mismatch witnesses; a re-encode is a different stream that happens to exercise the same path, and labelling it as the pin would be a false provenance claim.

The originals also self-validate, which is the check a re-encode cannot pass: pinned_golden7's committed doc records non_last_ref_hits delta=2 for this stream, and the recovered pin reproduces exactly 0->2 in a plain run.

The throwaway capture harness was deleted before the commit (grep -c zz_throwaway = 0).

2. Three gates go live — same bar as r2

gate on main eccbd6c6 on branch, PLAIN run
pinned_golden4_stream_decodes_pixel_exact ignored, not executed 1 passed, 0 failed, 0 ignored, 0.11s — prints non_last_ref_hits before=0 after=1
pinned_golden7_stream_decodes_pixel_exact ignored, not executed 1 passed, 0 failed, 0 ignored, 0.10s — prints non_last_ref_hits before=0 after=2
a_real_aomenc_stream_with_film_grain_decodes_pixel_exact live and PANICKING 1 passed, 0 failed, 0 ignored, 0.10s

None touches a process-global, none calls aomenc, and the counter each reads (non_last_ref_hits) is printed, never asserted — so there is no counter-race exposure to justify an ignore. #[ignore] in stream.rs: 41 → 37.

The film-grain gate was the worst shape in the class and was already LIVE. It read its pin through concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures/...") and .unwrap() — the gitignored root, with no graceful skip. A clean checkout with no runner library panics, it does not skip. That shape can never be satisfied by a committed pin at all, which is exactly why it is now crate_pin.

3. require_pin — the new shared shape

fn require_pin(path: &std::path::Path, name: &str) -> Vec<u8> {
    std::fs::read(path).unwrap_or_else(|e| panic!(
        "no pinned bytes at {} ({e}) -- set EC_AV1_GATE_DUMP_PIN to a freshly \
         captured stream, or restore the committed copy at \
         crates/ec-av1/fixtures/{name}",
        path.display()
    ))
}

A missing pin is a hard failure naming the path and the generator, never a raw io panic and never a silent skip. Those are the two shapes this class has taken (golden4 skipped; the film-grain gate panicked), and both are now impossible.

4. One gate stays ignored, on facts

pinned_lr_sgr_stream_call_unique_dump — reason replaced with the two reasons that are still true:

diagnostic only -- asserts nothing, so it cannot fail on a decode regression; run with --ignored and EC_LR_CALL_DUMP=1 for the Sgrproj window

The fact: the body eprintln!s per-frame mismatch counts and returns. There is no assert! anywhere in it, so it cannot go red on a decode regression; un-ignoring it would add a test that reports pass unconditionally. Its pin is now committed too, so the old reason ("reads a pinned fixture under the gitignored fixtures dir") was false and is gone. Measured plain run under --ignored for the record: 1 passed, 0.10s, frame 0: y_mismatch=false u_mismatch=false v_mismatch=false.

What would close it: give it the pixel asserts its three siblings have (the compare loop is already there, it only prints), then un-ignore. That is a real change with a real verdict, so it is not folded in here.

5. State

lane-av1pinslive, three commits on top of eccbd6c6: c7ea69c1 (r2 un-ignore), f99a5ff9 (r3 siblings), plus report commits. cargo check -p ec-av1 --all-targets clean, no warnings. Meta-gates after the change: gate_coverage 10 passed, refusal_inventory 15 passed. r2's two gates re-verified green (1 passed, 0.15s each). Not pushed; main untouched.

Not verified: a full cargo test -p ec-av1 run (project-wide validation is Main's), and the remaining ignored set — now 37 tests, of which these four were the machine-local-pin population.

The class rule this lane earns, in the shape Main is adopting as a batch rule: an #[ignore] reason must state a fact (what the gate needs, what it costs), never a judgement ("bisect aid", "not a suite gate"). A judgement cannot be checked against reality, so it cannot go stale loudly — and that is exactly how the r1 reason survived into a tree where it was false.


r4 — the last assert-free gate, and two corrections to my own r3 claims

Branch lane-av1pinslive, rebased onto main aa0ac8c2. Commit 9a29c974. Tests only, no decoder change.

1. What changed

pinned_lr_sgr_stream_call_unique_dump now asserts. r3 left it #[ignore]d on the fact that it asserted nothing; that is fixed and the ignore is gone.

The substantive fix is the frame count, not the asserts. The old body passed our own decode's length as ffmpeg's expected count:

let reference = ffmpeg_decode_sequence(&stream, 192, 128, pics.len());

so a decoder emitting zero frames asked ffmpeg for zero frames, the zip compared no pairs, and the gate passed having proved nothing — the cmpaudit vacuous-pass shape, in the one gate that was already #[ignore]d for asserting nothing. The count now comes from the fixture (FRAMES = 1, measured), so a lost frame reds on the count.

Also added, matching the three sibling pins: a dimensions assert per frame, an explicit reference.len() == FRAMES before the zip, and per-plane per-frame pixel asserts. The diagnostic print is kept and now runs before the asserts, so a failure still names the shape of the divergence.

On "does it compare only frame 0?" — it does not

The loop always visited every frame; it is unchanged in that respect. This pin simply holds one frame, which is why the pre-r4 run printed frame 0 and nothing else. So that particular worry is unfounded, and the real gap was the vacuous count above.

2. Red-before, on a pixel assertion

Method used: mutating the decoder arithmetic the pin exercises, not a faked expectation — restoration.rs::apply_sgrproj_stripe, +1 on its first output sample. The pin is a loop-restoration stream, so Sgrproj is on its path.

frame 0: y_mismatch=false u_mismatch=true v_mismatch=true
panicked at crates/ec-av1/src/stream.rs:30374:13:
  assertion `left == right` failed:
  pinned_lr_sgr_stream_call_unique_dump frame 0 U vs ffmpeg (pinned lr-sgr)
test result: FAILED. 0 passed; 1 failed; 0 ignored

It reds on a pixel assert, not on a shape or counter assert. Worth recording: the mutation landed in a chroma plane, so the gate caught it on the U assert while luma stayed clean — a luma-only compare would have missed it entirely. That is the capability the three per-plane asserts buy.

Reverted (git status on restoration.rs empty) and the gate returns green.

The count assert is proven separately: setting FRAMES = 2 reds at stream.rs:30328 with "decoded 1 frame(s), the pinned stream holds 2 -- a short decode would otherwise ask ffmpeg for the same short count and compare nothing" — on the count, not on a pixel. Both halves proven independently.

3. Plain-run evidence

cargo test -p ec-av1 --lib --release -- --exact stream::tests::pinned_lr_sgr_stream_call_unique_dump --test-threads=1 --nocapture
  frame 0: y_mismatch=false u_mismatch=false v_mismatch=false
  pinned_lr_sgr_stream_call_unique_dump: 1 frame(s) byte-exact vs ffmpeg from .../crates/ec-av1/fixtures/lr-sgr-r7.obu
  test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 741 filtered out; finished in 0.10s

#[ignore] in stream.rs 37 → 36. gate_coverage 10 passed, refusal_inventory 15 passed.

The ignore was never justified by cost: it measured 0.10 s under --ignored too. The only honest reason it carried was the missing asserts, which is now gone.

4. TWO CORRECTIONS TO MY OWN r3 CLAIMS

Both are scanner blind spots of mine, found by auditing the class after this change. Neither is a new defect in the tree; both are wrong things I told you.

Correction 1 — "the machine-local-pin population is zero in ec-av1" is FALSE. It is zero for the gates I fixed, and there is one more pin gate with 14 uncommitted pins:

pinned_warp_stream_decodes_pixel_exact (still #[ignore]d, reason "reads pinned fixture paths under the gitignored fixtures dir; run manually") reads 14 pins — warp-mismatch, warp-flake-5, warp-flake-7, ii-flake-1/2/3/5/6/7/8/9, rect-flake-1/2/3 — through a directory concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures") literal plus a name list, and formats {fixtures}/{n}.obu at runtime. 0 of 14 are committed under the crate.

My r3 scanner matched only crate_pin("X") and pin_dir().join("X") — single-name call shapes. A directory literal plus a runtime-formatted name list does not match either, so this gate was invisible to it. The r3 invariant I proposed to the preflight lane ("every crate_pin("X") must have crates/ec-av1/fixtures/X in the tree") is too weak to catch this, and the preflight lane should be told so: the scan must also resolve concat! directory literals and any {fixtures}/{n} runtime format.

Correction 2 — "4 ignored gates assert nothing" is wrong for one of them. My body-only scan reported pinned_warp_stream_decodes_pixel_exact as assert-free. It is not: the gate delegates to check_pinned_warp_stream (stream.rs:31226), which carries assert_eq! on all three planes per frame. The scan looked at the gate body and missed the delegation.

The other three are correct and are diagnostics by name: probe_tiny_fixture_trace, scratch_decode_pinned_stream_once, scratch_isolate_pinned_mismatch — 0 asserts each, all probe_*/scratch_*.

So the accurate statement is: no ignored gate named pinned_* asserts nothing, after this change — but that took checking the helpers, not the bodies.

5. State

lane-av1pinslive, four work commits on top of aa0ac8c2. cargo check -p ec-av1 --all-targets clean, no warnings. Not pushed; main untouched.

Follow-on handed back rather than folded in: the 14 pinned_warp pins, which are the same defect as r3's four and want the same crate_pin + committed-copy treatment. Not verified: a full cargo test -p ec-av1 run (project-wide validation is Main's).


r5 — the scanner, the 14 pins, and a correction to r4

Branch lane-av1pins5, forked from the r4 tip 2e5509e9. Commits e200fede (the 14 pins), 3eb90648 (scanner + sweep), plus this report. Tests and test helpers only. Not pushed; main untouched.

Authoritative location, as the batch-close audit asked: this lane lives in ~/.cache/wt/av1pins5 (branch lane-av1pins5). It is not a stale duplicate of ~/.cache/wt/av1pinslive — av1pinslive sits at the same tip 2e5509e9 but does not carry the 14 pins; they were only ever in av1pins5. All 14 were verified byte-identical in three independent locations (this worktree's staged copy, a local /tmp copy, and the runner library) before committing: 14/14 identical, 0 mismatches. They are now committed, so no worktree holds the only copy.

1. The scanner

pin_inventory in gate_coverage.rs resolves five shapes:

# shape example
(a) single-name committed crate_pin("golden3-pin.obu")
(b) single-name machine-local pin_dir().join("x.obu")
(c) whole-file concat! literal concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures/x.obu")
(d) directory literal + runtime name let fixtures = concat!(...); … format!("{fixtures}/{n}.obu")
(e) committed + runtime name crate_pin(&format!("{n}.obu"))

Scanner before/after on the live tree

BEFORE (r3 inventory):  gate=pinned_warp_stream_decodes_pixel_exact  reads=0
AFTER  (r5 inventory):  14 pin(s) a gate reads have no committed copy under
                        crates/ec-av1/fixtures/:
  pinned_warp_stream_decodes_pixel_exact:warp-mismatch.obu (concat_dir_runtime_name)
  … all 14 named, then 0 after the fix landed.

Shape (e) is the finding worth reading

Rewriting the directory literal as a committed-path lookup made the gate correct and simultaneously invisible: crate_pin(" no longer appears, shape (a) found nothing, and the enumerator reported a clean tree while 14 pins were read. A false pass is worse than the original gap — the original at least surfaced in a filesystem audit, which is exactly how the batch-close audit found it. It was caught by the reads.len() >= 20 floor in the invariant test. That floor exists for this and I would not remove it.

The general lesson: fixing a shape can blind the check that was watching it.

Two scanner bugs, both found by the capability tests

  • A format! brace escape emitted {n instead of {n}, so the marker never matched and shape (d) resolved 0 pins.
  • args.find(')') stopped at the ) of pictures.len(), truncating the argument list and yielding zero sites overall — the sweep reported a clean tree.

Capability tests therefore use synthetic source, never the live file. Asserting against the live tree would rot the moment the fix lands, which is precisely how a scanner loses its edge.

Ownership, stated because two lanes touch this: the scanner owns the enumeration (which gates read which pins, from source). The fixture-preflight lane owns the file inventory on a runner (does each path exist on the box). The scanner is the stricter of the two — it fails on an uncommitted pin whether or not some runner happens to have a copy.

2. The 14 pins — provenance recovered-original

Fetched byte-for-byte from the runner library. Not regenerated: these are the actual historical mismatch witnesses, and a re-encode would be a different stream that must not be called the pin.

pin size sha256
warp-mismatch.obu 621 B 24cca5beb41c1078f8109d8fa7e35f10cc1eefb67c6d1d1ea248a0b6842287bb
warp-flake-5.obu 602 B 1a99f9e5b257eed0ebae055441904d6c40962a26c0c2d63c3e051732569ff0a0
warp-flake-7.obu 723 B c2f8b93f5a59c56b1c4453ea789e0fc955557ed9b63c0e2cb8683fa483eff2b5
ii-flake-1.obu 579 B 700ded3e61e15bc3573d339d7fcc6ab94500adb796c30021094d354306662238
ii-flake-2.obu 581 B edc4ad3a6c00c6bc909c626fa24433ef31a88ed519ed57403f5373a160e590af
ii-flake-3.obu 670 B 994bfbdc952ecef18ae1560d5e7f121ba1000172e0bc2ad05e5b8cfaa17b15cb
ii-flake-5.obu 681 B f43fe77ea0e8ddd9c1524b642e09f935921cb0d00c4a60061a52d2260af38b9a
ii-flake-6.obu 632 B 84a1f60011dfdb77ede98ce95a25d247d270b0af1cff2c44aa1e6b311ca63dce
ii-flake-7.obu 654 B 61ba4d114aa55ebcf95ae691abbce3307146a2d969c0627ea3ceea02f3875574
ii-flake-8.obu 635 B f19d3d80ed564850cec02a26cfe7ab00e282afa7896821c535a117f5541bef5d
ii-flake-9.obu 690 B 0df4874737cc615258c0fdfb4bcb157c9a3663127cbf0a896af44d4deb83c653
rect-flake-1.obu 607 B a3869b5d2bd8a8bc5413e0d039d5e3375a48601cdeb2edb8d4b732402926d357
rect-flake-2.obu 601 B c780ddee1adf25cf63a6ba70ff449820f6f4474b23ef16615c1e843ad0c86adb
rect-flake-3.obu 572 B 3b23d204549b7bcfbd7166b1b3e2920580236c78de12e8f23f7fb64c1864f3e6

.gitignore's !crates/*/fixtures/** negation means a plain git add suffices — verified with git check-ignore -q (returns 1) and by staging with no -f.

3. The gate is live

pinned_warp_stream_decodes_pixel_exact reads all 14 from crates/ec-av1/fixtures/, via crate_pin, with require_pin in the helper. Plain run (no --ignored): 1 passed; 0 failed; 0 ignored; 744 filtered out; 1.47 s, printing each pin: …/crates/ec-av1/fixtures/<name>.

The asserts live in check_pinned_warp_stream, which this gate delegates to — stated in the gate's doc comment, because a body-only scan reads as assert-free, which is how the r4 audit got it wrong. #[ignore] 36 → 35.

4. The count-vacuity sweep — and a CORRECTION to r4

count_vacuity enumerates every site passing a locally-derived count as the oracle's expected frame count: 61 sites, 13 spec-pinned by a prior assert, 48 not. The floor (>= 40) stops the sweep silently shrinking.

r4 reported this shape as a "vacuous pass" and I told Main so. That was wrong. Measured, by calling ffmpeg_decode_sequence(&stream, 192, 128, 0) on a real pinned stream under catch_unwind:

panicked at crates/ec-av1/src/stream.rs:5110:9:
expected 0 4:2:0 frames, ffmpeg said:

The helper asserts out.stdout.len() == frame_bytes * frames unconditionally, so a wrong count cannot pass silently — it REDS, with a message that blames FFmpeg for a count our decoder chose. The consequence is a misattributed red, not a silent pass.

r4's fix still stands (the count now comes from the fixture, so the red names the real cause). The justification was wrong, and a sweep repeating it would send the next reader after a bug that does not exist.

column meaning
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
stream.rs:5355 an_svt_screen_palette_block_with_a_split_transform_decodes_exactly — decoded.len(), not spec-pinned
stream.rs:10287/10289 rect_tx_tool_gate — decoded.len(), not spec-pinned
… 48 total full list printed by the test; the floor pins the count

All 48 are reported, none fixed. That is an unbounded change across gates this lane does not own, and dressing it as a fix would be dishonest. The pin-class gates are clean: 0 unpinned count sites in pinned_lr_sgr, check_pinned_warp_stream, pinned_golden3, pinned_sbpart and the film-grain gate.

5. State

lane-av1pins5, three commits on top of 2e5509e9. cargo check -p ec-av1 --all-targets clean, 0 warnings. gate_coverage 15 passed (10 pre-existing

  • 5 new scanner tests), refusal_inventory 15 passed. Not verified: a full cargo test -p ec-av1 run (project-wide validation is Main's).

The rule this lane earns, on top of r3's: a fix can blind the check that was watching the shape it changed. The pin inventory went from blind, to correct, to blind-again-in-a-new-guise, across three commits in three rounds. The floor and the synthetic capability tests are what make that survivable.


r6 — name the real cause, classify the defect, and report the 44

Branch lane-av1pins5. Commit 02c8e7a8. Tests and test helpers only. Not pushed; main untouched.

Canonical branch: lane-av1pins5. av1pinslive is a stale duplicate at 2e5509e9 with no work of its own beyond r4; every r5/r6 commit is here only. av1pinslive can be dropped. No pins are at risk either way — all 18 recovered pins are committed.

1. The change that matters: the failure now names the real cause

Before, a caller passing our own decode's length got:

expected N 4:2:0 frames, ffmpeg said: <empty>

Empty tail, because ffmpeg runs at -v error and succeeds. It named ffmpeg, said nothing about where N came from, and sent the reader hunting ffmpeg for a count ffmpeg never chose.

All three helpers (ffmpeg_decode_sequence, _10bit, _444) now share frame_count_diagnosis. Measured with the same probe r5 used:

FRAME COUNT MISMATCH (4:2:0 192x128): the caller passed `frames=0`, ffmpeg produced
1 frame(s) (36864 bytes, 0 byte(s) not a whole frame, at 36864 B/frame).
`frames` is the EXPECTED count the CALLER asserted -- it is NOT measured from ffmpeg,
so it never had ffmpeg's agreement. If it came from our own decode_stream(), this is
OUR decoder disagreeing with ffmpeg about how many frames the stream holds, and the
fix is on OUR side, not ffmpeg's. ffmpeg itself exited cleanly with no diagnostics.

This converts most of the 44 from confusing to diagnosable without touching a single caller — which is exactly the de-risking Main asked for, since "48 edits of unclear value" was the risk.

2. Two defect classes, named so r4 is not repeated

The sweep's doc comment now states:

  • MISATTRIBUTED RED — a wrong count reds, and the old message blamed ffmpeg. This is what these sites are. The stdout.len() == frame_bytes * frames assert is unconditional, so a wrong count cannot pass silently.
  • SILENT PASS — the compare is skipped or truncated and the gate reports green. A different defect with a different fix. These sites are not that.

3. The sweep: 61 sites, 17 spec-pinned, 44 not, 30 distinct gates

Two detection bugs of mine, both inflating the number:

  • assert_eq! is split across lines by rustfmt (assert_eq!( then frames.len(),), so a one-line containment check missed every multi-line spelling. Now matched over a two-line window: 13 → 17 spec-pinned.
  • The body slice used to classify each gate is a hand-rolled brace walk, and raw byte counting treats a } inside a format string as a closing brace — the same trap that made stream.rs look two braces short in the first review of this wave.

The pixel_comparing column is APPROXIMATE and under-reports, and I am not building the 44-row table on it. I sampled three gates it marks false and all three plainly compare planes (a_real_aomenc_stream_with_rect_palette… 4 plane-compare lines, …palette_stream_with_8x8_leaves… 5, a_16x4_intrabc_pair_strip… 1). The column's line, gate and count_expr are exact — a line-based scan with no body slicing — but whether a gate pixel-compares needs a reader, not a regex.

4. The table — 44 sites, exact columns

file:line | gate | count source before | fixture's own count known? | status

file:line gate count source before → after fixture count known? status
stream.rs:3895 a_real_aomenc_segmentation_stream_with_map_inheritance_decodes_pixel_exact pictures.len() → unchanged no (live aomenc; use the encode's frame count) reported
stream.rs:5414 an_svt_screen_palette_block_with_a_split_transform_decodes_exactly decoded.len() → unchanged no (SVT stream read from a file) reported
stream.rs:10135 a_real_aomenc_palette_stream_with_8x8_leaves_decodes_pixel_exact frames.len() → unchanged yes (the gate's own frames const) reported
stream.rs:10354, :10356 rect_tx_tool_gate decoded.len() ×2 → unchanged yes (encode frame count) reported
stream.rs:10834 a_real_aomenc_screen_key_frame_reads_use_intrabc_on_rect_strips frames.len() → unchanged yes reported
stream.rs:11005 a_16x4_intrabc_pair_strip_decodes_pixel_exact frames.len() → unchanged yes (pinned fixture) reported
stream.rs:11077 a_lossless_16x4_chroma_pair_repairs_the_measured_site frames.len() → unchanged yes (pinned fixture) reported
stream.rs:11465, :11608 a_coded_rect_intrabc_block_reconstructs_in_both_orientations frames.len() ×2 → unchanged yes reported
stream.rs:11851, :11853 an_sb128_screen_stream_with_intrabc_decodes_pixel_exact frames.len() ×2 → unchanged yes reported
stream.rs:12239 a_sub8_leaf_census_over_intrabc_screen_streams_measures_the_sub8_refusal frames.len() → unchanged n/a (census/probe) report-only
stream.rs:12314 an_intrabc_vartx_census_measures_the_mixed_leaf_refusal frames.len() → unchanged n/a (census/probe) report-only
stream.rs:12418 a_real_aomenc_intrabc_mixed_vartx_tree_decodes_without_the_mixed_leaf_refusal frames.len() → unchanged no (live aomenc) reported
stream.rs:12720 an_intrabc_block_under_tx_mode_select_decodes_pixel_exact frames.len() → unchanged yes reported
stream.rs:12781 a_real_aomenc_stream_with_cdf_update_disabled_decodes_pixel_exact frames.len() → unchanged no (live aomenc) reported
stream.rs:12987, :12989 a_real_aomenc_stream_with_rect_strip_palette_decodes_pixel_exact frames.len() ×2 → unchanged no (live aomenc) reported
stream.rs:15126 first_diff (helper) decoded.len() → unchanged n/a (diagnostic helper) report-only
… 27 more across 15 gates — frames.len() / decoded.len() mixed reported

The full 44-line list is printed by every_locally_derived_oracle_count_is_reported on every run, so it cannot drift from the source.

None fixed in this commit beyond r4's. The per-site fix is to derive each count from the fixture — a recorded frame count, a parsed OBU frame count, a length assert on the pinned stream — or, for a live-aomenc gate, from the encoder's own frame count, not from our decode. That is 30 gates of real work and it is the next lane.

5. State

lane-av1pins5, four commits on top of 2e5509e9. cargo check -p ec-av1 --all-targets clean, 0 warnings. gate_coverage 15 passed, refusal_inventory 15, count_vacuity 2, pin_inventory 3, pinned_golden3 green. #[ignore] unchanged at 34. Not verified: a full cargo test -p ec-av1 run (project-wide validation is Main's).

The rule r6 adds, on top of r3's and r5's: a scanner's own columns are only as trustworthy as the slice it parsed, and a column that is "approximately right" is worse than no column — because a 44-row table built on it would send a lane after the wrong gates. Two of the four bugs in this lane's scanners were exactly this: a slice that stopped at len()'s own paren, and a brace count that did not skip string literals.


r7 — classify by reading, fix the first, hand back 38

Branch lane-av1pins5. Commit 71afc8c9. Tests and test helpers only. Not pushed. Canonical branch: lane-av1pins5; av1pinslive is dropped.

1. The classification, printed per site so it is auditable

The sweep now emits, on every run:

ROW <line> | <gate> | <count expr> | bucket | candidate | spec_in_scope | <reason> | pixel_comparing
bucket sites rule
b 37 live aomenc encode → the count belongs to the encoder
a 1 stream read from disk → the count belongs to the pin
c 4 census/probe → report only, never fix
? 1 unclassified, with the reason printed rather than a guess

Each gate is classified from its own body, over a string-aware extent. Two details that changed the answer: 21 of the bucket-b gates encode through a helper (screen_intrabc_stream_at_depth, run_multi_tile_gate, edge32_gate, rect_tx_tool_gate, …) rather than calling aomenc_path() directly, so a first pass that only looked for aomenc_path() called six plainly-encoding gates "unclassified".

A third offset bug, same family as the two r6 caught. The sweep handed its body-walk a line index where a byte offset was required, so every body-dependent classification read "unclassified" — 40 of 44, all looking like a legitimate result. It is the third time in this lane that a line/byte or slice-boundary confusion has silently produced a plausible clean output.

2. Fixed: stream.rs:3895

a_real_aomenc_segmentation_stream_with_map_inheritance_decodes_pixel_exact: ffmpeg_decode_sequence(..., pictures.len()) → ENCODED_FRAMES (40), the count its own encode_aomenc_stream(source, w, h, 40, &extra) call encodes. Our decode's length is the thing under test, so using it as the oracle's expected count was circular. Gate green, 2.05 s, now comparing 40 frames against ffmpeg's 40 rather than a self-fulfilling number.

The sweep's "known site" anchor moved with the fix. It used to assert that pictures.len() was still present, which went red the moment the fix landed — a guard that punishes the fix. It now asserts the opposite (no site may pass pictures.len() again) and that the dominant frames.len() shape is still found, so the sweep cannot go quiet by either route.

3. NOT DONE: 38 of the 39 fixable sites

The sweep prints a candidate — the numeric frame count in the gate's own encode call — and it resolves for exactly one gate. The rest encode inside loops or through per-gate helpers whose frame-count argument has to be read per gate, and only 3 of 44 are a clean one-line swap to something already in scope.

I am handing those back with the method rather than editing 38 call sites on a guess, for the same reason r6 refused the 44-row table on an untrustworthy column: a plausible-looking bulk edit built on a heuristic I have now shown wrong three times in this lane would send the next reader after the wrong lines.

Per-gate recipe for whoever takes it:

  • bucket b — bind the encoder's frame count to a named const at the encode call (const ENCODED_FRAMES: usize = <n>;) and pass that to ffmpeg_decode_sequence, exactly as stream.rs:3895 now does. Where the encode is inside a loop over cq/depth, the count is the helper's frame-count argument and must be read from that call.
  • bucket a — the count is the pinned stream's; take it from the pin's recorded frame count or a length assert on the pinned bytes, not from decode_stream.
  • bucket c — leave. A census reports; it asserts no verdict, so a wrong count there is not a wrong count.

The sweep prints the full 44-row table on every run, so the ledger cannot drift from the source, and the >= 40 floor plus the two-direction anchor stop the class from quietly shrinking or from being "fixed" away.

4. State

lane-av1pins5, five commits on top of 2e5509e9. cargo check -p ec-av1 --all-targets clean, 0 warnings. gate_coverage 15, refusal_inventory 15, count_vacuity 2, pin_inventory 3, and the fixed gate all green. #[ignore] unchanged at 34. Lane-scoped CARGO_TARGET_DIR with touch-first, per the observation that the shared target dir served another worktree's binary.

Not verified: a full cargo test -p ec-av1 run (project-wide validation is Main's).

The rule r7 adds: a scanner that classifies by reading must print its reasoning per row. Every unclassifiable row in this table carries the sentence that disqualified it, so a reader can disagree with a bucket instead of inheriting it — and the one ? in the table is more useful than a confident guess would have been.


r7 closeout — rebased onto main, ledger handed forward

Rebased onto main 97b4ee04. One conflict worth recording: the fixture-preflight lane had, independently, already landed the r5 work — the 14 pins are committed under crates/ec-av1/fixtures/ and pinned_warp_stream_decodes_pixel_exact was rewired to crate_pin with string literals, which is a better shape than my crate_pin(&format!("{n}.ext")): a literal is resolvable name-by-name, so it does not create the shape-(e) blind spot at all. All three conflicted hunks resolved to main's side; my duplicate pin commit became a no-op.

Ownership, settled: main's scripts/pin-gate-audit.py owns the standalone census (a human/agent runs it); pin_inventory in gate_coverage.rs owns the CI-enforced invariant (it fails the suite when a pin is uncommitted). Different jobs, same question, both run.

git diff main --stat: 3 files, 1215 insertions, 8 deletions — pure additions. gate_coverage 18, refusal_inventory 19, count_vacuity 2, pin_inventory 3, cargo check --all-targets 0 warnings.

1. Merge readiness

branch lane-av1pins5 (canonical), rebased onto main 97b4ee04
diff vs main 3 files, +1215 / −8 — additions only
test-count delta branch carries +5 CI tests over main (pin_inventory 3, count_vacuity 2); the 18/19 gate_coverage/refusal_inventory totals include the preflight lane's
sweep floor holds: 61 sites ≥ 40; unpinned ceiling 43 holds
warnings 0

2. The class note — stop the next reader chasing a nonexistent bug

A wrong count here cannot pass silently. ffmpeg_decode_sequence's out.stdout.len() == frame_bytes * frames assert is unconditional, so a wrong count REDS. The defect is a misattributed red: the old message (expected N 4:2:0 frames, ffmpeg said: <empty>) named ffmpeg for a count ffmpeg never chose. frame_count_diagnosis — the class-level fix — reports the caller's count, ffmpeg's actual count, the byte arithmetic, and states that the fix is on OUR side. That single change converts the class from confusing to diagnosable without touching a caller. This, not the 38 sites, is what the branch is for.

3. The three detection bugs, each of which produced a plausible clean output

  1. A line index handed to a byte-offset walk (r7). The sweep computed each gate's body by indexing src.as_bytes() with a LINE number. 40 of 44 rows read "unclassified" — and "unclassified" looks like a finding, not a bug.
  2. assert_eq! split by rustfmt (r6). The lookback required assert_eq!(frames.len() on one line, but rustfmt emits assert_eq!( then frames.len(), on the next. Every multi-line spelling was missed, inflating the unpinned count 48 → 44 once a two-line window was used.
  3. A } inside a format string counted as a closing brace (r6). The body walk counted raw bytes, so a brace in a message truncated the slice and every compare-detection read false. Same trap that made stream.rs look two braces short in the first review of this wave.

Each was caught by a floor or a synthetic-input capability test, and each would have survived an honest-looking table. The rules they earn: walk offsets in the units you index; match a call across the line breaks rustfmt introduces; and never count braces without skipping string literals. A scanner column derived from a hand-rolled slice is a hypothesis, not a measurement.

4. The ledger — 43 sites, handed forward

file:line gate count expr before bucket candidate spec_in_scope disposition
stream.rs:5631 an_svt_screen_palette_block_with_a_split_transform_decodes_exactly decoded.len() a candidate=- spec_in_scope=- deferred(bucket a first: count from the PIN)
stream.rs:10513 a_real_aomenc_palette_stream_with_8x8_leaves_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:10732 rect_tx_tool_gate decoded.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:10734 rect_tx_tool_gate decoded.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:11212 a_real_aomenc_screen_key_frame_reads_use_intrabc_on_rect_strips frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:11383 a_16x4_intrabc_pair_strip_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:11455 a_lossless_16x4_chroma_pair_repairs_the_measured_site frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:11838 a_coded_rect_intrabc_block_reconstructs_in_both_orientations frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:11981 a_coded_rect_intrabc_block_reconstructs_in_both_orientations frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:12224 an_sb128_screen_stream_with_intrabc_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:12226 an_sb128_screen_stream_with_intrabc_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:12612 a_sub8_leaf_census_over_intrabc_screen_streams_measures_the_sub8_refusal frames.len() c candidate=- spec_in_scope=- report-only (census/probe asserts no verdict)
stream.rs:12687 an_intrabc_vartx_census_measures_the_mixed_leaf_refusal frames.len() c candidate=- spec_in_scope=- report-only (census/probe asserts no verdict)
stream.rs:12791 a_real_aomenc_intrabc_mixed_vartx_tree_decodes_without_the_mixed_leaf_refusal frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:13093 an_intrabc_block_under_tx_mode_select_decodes_pixel_exact frames.len() ? candidate=- spec_in_scope=- UNCLASSIFIED - needs a reader
stream.rs:13154 a_real_aomenc_stream_with_cdf_update_disabled_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:13360 a_real_aomenc_rect_strip_palette_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:13362 a_real_aomenc_rect_strip_palette_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:15497 first_diff decoded.len() c candidate=- spec_in_scope=- report-only (census/probe asserts no verdict)
stream.rs:27636 a_real_aomenc_stream_with_a_coded_rect_strip_below_16x16_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:27764 a_real_aomenc_stream_whose_square_block_reads_a_sub16_neighbours_mode_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:27933 a_real_aomenc_stream_whose_chroma_edge_filter_reads_a_sub16_neighbours_uv_mode_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:27935 a_real_aomenc_stream_whose_chroma_edge_filter_reads_a_sub16_neighbours_uv_mode_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:28129 a_real_aomenc_sb128_stream_whose_skipped_cfl_and_1to4_chroma_pairs_decode_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:28131 a_real_aomenc_sb128_stream_whose_skipped_cfl_and_1to4_chroma_pairs_decode_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:28456 a_real_aomenc_stream_with_ab_partitions_below_16x16_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:28458 a_real_aomenc_stream_with_ab_partitions_below_16x16_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:28609 sweep_rectx_recipes frames.len() c candidate=- spec_in_scope=- report-only (census/probe asserts no verdict)
stream.rs:29212 a_real_aomenc_stream_with_a_32_level_ab_partition_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:30646 a_real_aomenc_stream_with_restoration_reads_lr_symbols_correctly pics.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:30744 a_real_aomenc_stream_with_restoration_reads_lr_symbols_correctly pics.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:38033 edge32_gate decoded.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:38035 edge32_gate decoded.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:41761 a_real_aomenc_stream_with_a_coded_strip_whose_chroma_is_a_4to1_or_sub8_rect_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:41763 a_real_aomenc_stream_with_a_coded_strip_whose_chroma_is_a_4to1_or_sub8_rect_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:41998 the_chroma_rect_gates_excluded_seed_46_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:42000 the_chroma_rect_gates_excluded_seed_46_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:42167 a_real_aomenc_band_stream_seed46_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:42169 a_real_aomenc_band_stream_seed46_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:42376 a_real_aomenc_stream_whose_frame_edge_partition_bit_is_horz_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:42378 a_real_aomenc_stream_whose_frame_edge_partition_bit_is_horz_decodes_pixel_exact frames.len() b candidate=- spec_in_scope=- deferred(bucket b: count from the ENCODER)
stream.rs:42602 a_real_aomenc_rect_inter_block_predicts_chroma_with_the_narrow_kernel_pixel_exact frames.len() b candidate=- spec_in_scope=FRAMES deferred(bucket b: count from the ENCODER)
stream.rs:42604 a_real_aomenc_rect_inter_block_predicts_chroma_with_the_narrow_kernel_pixel_exact frames.len() b candidate=- spec_in_scope=FRAMES deferred(bucket b: count from the ENCODER)

TOTALS: a=1 b=37 c=4 ?=1 total=43

Totals: a=1, b=37, c=4, ?=1.

The ? row is genuinely unclassified, not a guess: an_intrabc_block_under_tx_mode_select_decodes_pixel_exact neither drives aomenc in its own body nor reads from disk, and is not a probe. It most likely encodes through a path the helper list does not name. Left as ? with the reason rather than assigned a bucket I cannot justify.

Per-gate recipe. Bucket a first (1 site): take the count from the pinned stream's recorded frame count or a length assert on the pinned bytes. Then bucket b (37 sites): bind the encoder's frame count to a named const at the encode call and pass that, exactly as stream.rs:3895 does (const ENCODED_FRAMES: usize = 40; from its own encode_aomenc_stream(source, w, h, 40, …)). Where the encode is inside a cq/depth loop, the count is the helper's frame-count argument and must be read from that call — the sweep's candidate column resolves for only one gate, which is exactly why these were not bulk-edited. Bucket c: leave; a census reports and asserts no verdict, so a wrong count there is not a wrong count.

DISPOSITION: deferred(needs a lane that classifies by READING each gate, bucket a then bucket b). Not a merge blocker: with frame_count_diagnosis in place, a wrong count is now loud and self-explaining, so the 43 are diagnosable rather than mysterious.

5. The guard, generalized

The r7 anchor asserted one literal (pictures.len()) at the fixed gate, which would go quiet as other sites are fixed. It now asserts the general rule:

  • no decode-derived count (pictures.len() / decoded.len() / frames.len()) may reappear at the gate r7 fixed, under any binding name; and
  • an unpinned ceiling of 43 — a NEW site is an immediate red, and the ceiling is lowered as sites are actually fixed.

The >= 40 floor on total sites stays, so the class cannot shrink unnoticed.