forge
Explore
Log in

Don't you dare go Hollow

lanes/av1pins r6: the frame-count diagnosis, the two defect classes, and the 44 reported

Browse files at this commit

23576c3d1df275402e2239b7b58e1c605d896f67Ahmet Kaan GümüşParent: e107603
The helper change is the deliverable: the failure now names the caller's count,
ffmpeg's actual count, the byte arithmetic, and says the disagreement is OURS if
the count came from our own decode. That converts most of the 44 from confusing
to diagnosable without touching a caller.

count_vacuity keeps its floor and gains the misattributed-red vs silent-pass
distinction so r4's mistake is not repeated. 61 sites, 17 spec-pinned, 44 not,
30 gates -- after fixing two detection bugs of mine (a rustfmt-split assert_eq!
missed by one-line containment, and a brace walk that did not skip string
literals).

The pixel_comparing column is approximate and under-reports; three sampled gates
it marks false all compare planes. Reported rather than tabulated, because a
44-row table on an untrustworthy column sends a lane after the wrong gates.

Canonical branch is lane-av1pins5; av1pinslive is a stale duplicate at 2e5509e9
and can be dropped. No pins at risk: all 18 are committed.
lanes/av1pins.report.mdmodified+117 -0
@@ -712,3 +712,120 @@ 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, to712 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 the713 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.714 synthetic capability tests are what make that survivable.
715+
716+---
717+
718+# r6 — name the real cause, classify the defect, and report the 44
719+
720+Branch `lane-av1pins5`. Commit `02c8e7a8`. Tests and test helpers only. Not
721+pushed; main untouched.
722+
723+**Canonical branch: `lane-av1pins5`.** `av1pinslive` is a **stale duplicate** at
724+`2e5509e9` with no work of its own beyond r4; every r5/r6 commit is here only.
725+`av1pinslive` can be dropped. No pins are at risk either way — all 18 recovered
726+pins are committed.
727+
728+## 1. The change that matters: the failure now names the real cause
729+
730+Before, a caller passing our own decode's length got:
731+
732+```
733+expected N 4:2:0 frames, ffmpeg said: <empty>
734+```
735+
736+Empty tail, because ffmpeg runs at `-v error` and succeeds. It named ffmpeg, said
737+nothing about where `N` came from, and sent the reader hunting ffmpeg for a count
738+ffmpeg never chose.
739+
740+All three helpers (`ffmpeg_decode_sequence`, `_10bit`, `_444`) now share
741+`frame_count_diagnosis`. Measured with the same probe r5 used:
742+
743+```
744+FRAME COUNT MISMATCH (4:2:0 192x128): the caller passed `frames=0`, ffmpeg produced
745+1 frame(s) (36864 bytes, 0 byte(s) not a whole frame, at 36864 B/frame).
746+`frames` is the EXPECTED count the CALLER asserted -- it is NOT measured from ffmpeg,
747+so it never had ffmpeg's agreement. If it came from our own decode_stream(), this is
748+OUR decoder disagreeing with ffmpeg about how many frames the stream holds, and the
749+fix is on OUR side, not ffmpeg's. ffmpeg itself exited cleanly with no diagnostics.
750+```
751+
752+**This converts most of the 44 from confusing to diagnosable without touching a
753+single caller** — which is exactly the de-risking Main asked for, since "48 edits
754+of unclear value" was the risk.
755+
756+## 2. Two defect classes, named so r4 is not repeated
757+
758+The sweep's doc comment now states:
759+
760+* **MISATTRIBUTED RED** — a wrong count reds, and the old message blamed ffmpeg.
761+ **This is what these sites are.** The `stdout.len() == frame_bytes * frames`
762+ assert is unconditional, so a wrong count cannot pass silently.
763+* **SILENT PASS** — the compare is skipped or truncated and the gate reports green.
764+ A *different* defect with a *different* fix. **These sites are not that.**
765+
766+## 3. The sweep: 61 sites, 17 spec-pinned, 44 not, 30 distinct gates
767+
768+Two detection bugs of mine, both inflating the number:
769+
770+* `assert_eq!` is split across lines by rustfmt (`assert_eq!(` then
771+ `frames.len(),`), so a one-line containment check missed every multi-line
772+ spelling. Now matched over a two-line window: **13 → 17** spec-pinned.
773+* The body slice used to classify each gate is a hand-rolled brace walk, and raw
774+ byte counting treats a `}` inside a format string as a closing brace — the same
775+ trap that made `stream.rs` look two braces short in the first review of this wave.
776+
777+**The `pixel_comparing` column is APPROXIMATE and under-reports, and I am not
778+building the 44-row table on it.** I sampled three gates it marks `false` and all
779+three plainly compare planes (`a_real_aomenc_stream_with_rect_palette…` 4
780+plane-compare lines, `…palette_stream_with_8x8_leaves…` 5,
781+`a_16x4_intrabc_pair_strip…` 1). The column's `line`, `gate` and `count_expr`
782+are exact — a line-based scan with no body slicing — but whether a gate
783+pixel-compares needs a reader, not a regex.
784+
785+## 4. The table — 44 sites, exact columns
786+
787+`file:line | gate | count source before | fixture's own count known? | status`
788+
789+| file:line | gate | count source before → after | fixture count known? | status |
790+|---|---|---|---|---|
791+| 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 |
792+| 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 |
793+| 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 |
794+| stream.rs:10354, :10356 | `rect_tx_tool_gate` | `decoded.len()` ×2 → unchanged | yes (encode frame count) | reported |
795+| stream.rs:10834 | `a_real_aomenc_screen_key_frame_reads_use_intrabc_on_rect_strips` | `frames.len()` → unchanged | yes | reported |
796+| stream.rs:11005 | `a_16x4_intrabc_pair_strip_decodes_pixel_exact` | `frames.len()` → unchanged | yes (pinned fixture) | reported |
797+| stream.rs:11077 | `a_lossless_16x4_chroma_pair_repairs_the_measured_site` | `frames.len()` → unchanged | yes (pinned fixture) | reported |
798+| stream.rs:11465, :11608 | `a_coded_rect_intrabc_block_reconstructs_in_both_orientations` | `frames.len()` ×2 → unchanged | yes | reported |
799+| stream.rs:11851, :11853 | `an_sb128_screen_stream_with_intrabc_decodes_pixel_exact` | `frames.len()` ×2 → unchanged | yes | reported |
800+| stream.rs:12239 | `a_sub8_leaf_census_over_intrabc_screen_streams_measures_the_sub8_refusal` | `frames.len()` → unchanged | n/a (census/probe) | report-only |
801+| stream.rs:12314 | `an_intrabc_vartx_census_measures_the_mixed_leaf_refusal` | `frames.len()` → unchanged | n/a (census/probe) | report-only |
802+| stream.rs:12418 | `a_real_aomenc_intrabc_mixed_vartx_tree_decodes_without_the_mixed_leaf_refusal` | `frames.len()` → unchanged | no (live aomenc) | reported |
803+| stream.rs:12720 | `an_intrabc_block_under_tx_mode_select_decodes_pixel_exact` | `frames.len()` → unchanged | yes | reported |
804+| stream.rs:12781 | `a_real_aomenc_stream_with_cdf_update_disabled_decodes_pixel_exact` | `frames.len()` → unchanged | no (live aomenc) | reported |
805+| stream.rs:12987, :12989 | `a_real_aomenc_stream_with_rect_strip_palette_decodes_pixel_exact` | `frames.len()` ×2 → unchanged | no (live aomenc) | reported |
806+| stream.rs:15126 | `first_diff` (helper) | `decoded.len()` → unchanged | n/a (diagnostic helper) | report-only |
807+| … 27 more across 15 gates | — | `frames.len()` / `decoded.len()` | mixed | reported |
808+
809+The full 44-line list is printed by `every_locally_derived_oracle_count_is_reported`
810+on every run, so it cannot drift from the source.
811+
812+**None fixed in this commit beyond r4's.** The per-site fix is to derive each count
813+from the fixture — a recorded frame count, a parsed OBU frame count, a length
814+assert on the pinned stream — or, for a live-aomenc gate, from **the encoder's own
815+frame count**, not from our decode. That is 30 gates of real work and it is the
816+next lane.
817+
818+## 5. State
819+
820+`lane-av1pins5`, four commits on top of `2e5509e9`. `cargo check -p ec-av1
821+--all-targets` clean, **0 warnings**. `gate_coverage` 15 passed,
822+`refusal_inventory` 15, `count_vacuity` 2, `pin_inventory` 3, `pinned_golden3`
823+green. `#[ignore]` unchanged at 34. Not verified: a full `cargo test -p ec-av1`
824+run (project-wide validation is Main's).
825+
826+The rule r6 adds, on top of r3's and r5's: **a scanner's own columns are only as
827+trustworthy as the slice it parsed, and a column that is "approximately right" is
828+worse than no column** — because a 44-row table built on it would send a lane
829+after the wrong gates. Two of the four bugs in this lane's scanners were exactly
830+this: a slice that stopped at `len()`'s own paren, and a brace count that did not
831+skip string literals.