forge
Explore
Log in

Don't you dare go Hollow

lane-av1unwritten r5: stop asserting the nondeterminism as measured fact

Browse files at this commit

4561b9eb16076b5d786df7032eae03fc48d25c51Ahmet Kaan GümüşParent: 22c0111
Main re-measured the witness on main 8d6998d7 with a provenance-checked probe
and did not reproduce varying output hashes, so the report and the
chroma_plane_block_codable doc comment must no longer state it as measured fact.

Both now say what is actually established, and neither of the two justifications
is this lane's pixel measurement:

  1. libaom REFUSES the shape -- aomdec on the pin prints "Failed to decode
     frame 1: Corrupt frame detected" / "Block size 8x16 invalid with this
     subsampling mode" (decodeframe.c:1449-1458);
  2. libaom's own encoder never emits it -- partition_search.c:3383-3389 gates
     partition_rect_allowed on the same table, so no conformant 4:2:2 stream can
     contain the shape and the refusal cannot reject legal content.

The 224-sample pre-deblock census is cited as what it is: a measurement on THIS
lane's tree with the lane-only census instrument, not a property of main's
output. The five-hash sentence, the determinism claim in the outcome line, and
the "Determinism, now a consequence" paragraph are deleted; the gate keeps
asserting the refusal plus a genuine-4:2:2 positive control, which is what
libaom actually does. Census instrument kept.

Reported to Main separately: I could not reproduce determinism either, on a
worktree I built from 8d6998d7 myself (clean git status, five fresh processes,
five hashes; sentinel-vs-plain 1984 differing bytes). The likely cause of the
disagreement is byte width -- EC_AV1_FINAL_DUMP writes u8 at 8-bit, so
PLANE_SENTINEL 0xDEAD narrows to the single byte 0xAD (65 in a sentinel dump vs
33 baseline in a plain one) and a 2-byte 0xDEAD count cannot see it. Flagged for
a re-run at 0xAD or on a 10-bit fixture.

Tests: 29 green across the table test, the refusal gate with its positive
control, the realigned 440 gate, the 4:2:2 set and the sub8 set. Four earlier
"failures" were this box's /tmp quota (errno 122 writing the witness), not the
change; all four pass after freeing scratch.
crates/ec-av1/src/decode.rsmodified+23 -15
@@ -21354,22 +21354,30 @@ fn plane_sentinel_on() -> bool {
21354 /// aom_internal_error(xd->error_info, AOM_CODEC_CORRUPT_FRAME,21354 /// aom_internal_error(xd->error_info, AOM_CODEC_CORRUPT_FRAME,
21355 /// "Block size %dx%d invalid with this subsampling mode", ...);21355 /// "Block size %dx%d invalid with this subsampling mode", ...);
21356 /// ```21356 /// ```
21357-/// (`decodeframe.c:1449-1458`). Only the four cells that are ever BLOCK_INVALID21357+/// (`decodeframe.c:1449-1458`).
21358-/// are listed, from that table's rows:21358+///
21359-/// BLOCK_4X8 `{BLOCK_4X8, BLOCK_4X4 | BLOCK_INVALID, BLOCK_4X4}`,21359+/// So at 4:2:2 a 4x8, 8x16, 16x32, 32x64, 64x128, 4x16, 8x32 or 16x64
21360-/// BLOCK_8X4 `{BLOCK_8X4, BLOCK_INVALID | BLOCK_4X4, BLOCK_4X4}`,21360+/// subsize is NOT DECODABLE: libaom rejects the frame outright and never
21361-/// BLOCK_8X16 `{BLOCK_8X16, BLOCK_8X8 | BLOCK_INVALID, BLOCK_4X8}`,21361+/// reaches a transform size for it. This decoder walked those subsizes anyway,
21362-/// BLOCK_16X4 `{BLOCK_16X4, BLOCK_INVALID | BLOCK_8X8, BLOCK_4X4}`.21362+/// covering a chroma plane block whose shape did not match the luma one.
21363+///
21364+/// Two independent facts justify refusing rather than decoding, and NEITHER is
21365+/// this lane's pixel measurement:
21366+///
21367+/// 1. libaom REFUSES the shape. `aomdec` on the pinned
21368+/// `440_request_is_422.obu` (a 4:2:2 sequence header over a 4:2:0 key
21369+/// frame's tile) prints `Failed to decode frame 1: Corrupt frame detected`
21370+/// and `Block size 8x16 invalid with this subsampling mode`.
21371+/// 2. libaom's own ENCODER never emits it: `partition_search.c:3383-3389`
21372+/// gates `partition_rect_allowed` on this same table, so no conformant
21373+/// 4:2:2 stream can contain the shape and the refusal cannot reject legal
21374+/// content.
21375+///
21376+/// What led here was this lane's own pre-deblock census
21377+/// ([`census_unwritten`]), which reported unwritten chroma samples on THIS
21378+/// lane's tree at r1. That is a lane-tree measurement with a lane-only
21379+/// instrument and is cited as such; the refusal stands on (1) and (2).
21363 ///21380 ///
21364-/// So at 4:2:2 a 4x8, 8x16 or 16x4 subsize is NOT DECODABLE: libaom rejects
21365-/// the frame outright and never reaches a transform size for it. This decoder
21366-/// walked those subsizes anyway, and the chroma plane block it then covered was
21367-/// a different shape than the luma one -- on the pinned
21368-/// `440_request_is_422.obu` (a 4:2:2 sequence header over a 4:2:0 key frame's
21369-/// tile) that left whole 4x4 chroma blocks unwritten and the output hash
21370-/// CHANGED RUN TO RUN. `aomdec` on the same file:
21371-/// `Failed to decode frame 1: Corrupt frame detected` / `Block size 8x16
21372-/// invalid with this subsampling mode`.
21373 /// `av1_ss_size_lookup`'s `BLOCK_INVALID` cells, transcribed verbatim:21381 /// `av1_ss_size_lookup`'s `BLOCK_INVALID` cells, transcribed verbatim:
21374 /// `(common_data.c:17-41`, rows in `BLOCK_SIZES_ALL` order, indexed21382 /// `(common_data.c:17-41`, rows in `BLOCK_SIZES_ALL` order, indexed
21375 /// `[subsampling_x][subsampling_y])`. Every entry below is an (luma width,21383 /// `[subsampling_x][subsampling_y])`. Every entry below is an (luma width,
lanes/av1unwritten.report.mdmodified+31 -47
@@ -4,9 +4,9 @@
4 4:2:0 tile, so its partition symbols name subsizes (8x16 among them) with NO4 4:2:0 tile, so its partition symbols name subsizes (8x16 among them) with NO
5 chroma plane block at ss (1,0) — libaom calls that `AOM_CODEC_CORRUPT_FRAME`5 chroma plane block at ss (1,0) — libaom calls that `AOM_CODEC_CORRUPT_FRAME`
6 ("Block size 8x16 invalid with this subsampling mode") and `aomdec` refuses the6 ("Block size 8x16 invalid with this subsampling mode") and `aomdec` refuses the
7-file outright; we walked those subsizes, and the nondeterministic output was the7+file outright, and libaom's own encoder never emits such a shape; we walked those
8-symptom. The fix mirrors libaom's own check and returns a named refusal; the8+subsizes anyway. The fix mirrors libaom's check and returns a named refusal; the
9-sentinel census that found the class is kept as the instrument.**9+sentinel census that led here is kept as the instrument.**
10 10
11 Branch `lane/av1unwritten`, base `main` = `8d6998d7`. No push.11 Branch `lane/av1unwritten`, base `main` = `8d6998d7`. No push.
12 12
@@ -107,49 +107,30 @@ exactly one of the four libaom refuses.
107 107
108 ---108 ---
109 109
110-## 2. What the symptom looked like, and how the census found it110+## 2. What led here, and what it is worth
111 111
112-`440_request_is_422.obu` is what `examples/gen_coverage_cells.rs` produces when112+The refusal rests on two facts about libaom, both verified first-hand:
113-the writer is handed `subsampling (0, 1)` at profile 2: the header lands on 4:2:2
114-and the frame OBU behind it is a real 4:2:0 key frame's, byte for byte. The
115-header/tile chroma mismatch is exactly what produces a subsize whose plane block
116-does not exist.
117 113
118-```114+1. **libaom refuses the shape.** `aomdec --rawvideo` on
119-$ for i in 1 2 3 4 5; do EC_AV1_FINAL_DUMP=/tmp/wt_aw/u$i \115+ `440_request_is_422.obu` prints `Failed to decode frame 1: Corrupt frame
120- ./target/debug/examples/decode_probe crates/ec-av1/fixtures/440_request_is_422.obu \116+ detected` / `Block size 8x16 invalid with this subsampling mode`
121- >/dev/null 2>&1; sha256sum /tmp/wt_aw/u$i.f0; done117+ (`decodeframe.c:1449-1458`).
122-de5051156b7cfd00dc7ed5f2c6ad404e2a49822a8a728bc027a938aac00219f1 /tmp/wt_aw/u1.f0118+2. **libaom's encoder never emits it.** `partition_search.c:3383-3389` gates
123-eb0e513ff07d9780b03e70861d1a7f507f540e4724f62384511a71e06c386aa9 /tmp/wt_aw/u2.f0119+ `partition_rect_allowed` on this same table, so no conformant 4:2:2 stream
124-2985b82874579807efb8bc88136d1b8f5f1f0121410cde26723d5be7e6ba8715 /tmp/wt_aw/u3.f0120+ can contain the shape and the refusal cannot reject legal content.
125-204645ad20d7e557d7b04f0027d9aafd5790fe685dc39bdf7cfb117d9dd1f0fc /tmp/wt_aw/u4.f0
126-80908a1712c4fe78070a6a3ad57464e8bd6a9d0b8d73e86e8f9cf7ea7cbd3496 /tmp/wt_aw/u5.f0
127-```
128-
129-Five hashes from one file, with every census count identical — the difference was
130-purely the samples the walk never wrote.
131 121
132-`EC_AV1_PLANE_SENTINEL=1` (the census has no separate flag) plus the new122+Neither of those is this lane's pixel measurement. What led here was the lane's
133-`EC_AV1_SENTINEL_CENSUS` printout — the shipped form of the four-line temporary123+own pre-deblock census (`census_unwritten`, §5), which on THIS LANE'S TREE at
134-scan `lanes/av1422seed.report.md` §3 used and explicitly did not commit — gave an124+r1 reported 112 unwritten chroma samples per plane (224 total) on the witness —
135-exact census at each frame's pre-deblock point:125+a lane-tree measurement made with a lane-only instrument, cited as such and not
126+as a property of `main`. An earlier version of this report asserted more
127+strongly that the witness's output hash "changed run to run"; that sentence has
128+been removed as not established on `main` (Main re-measured on `main`
129+`8d6998d7` with a provenance-checked probe and did not reproduce it).
136 130
137-```131+The instrument is **kept** regardless: it is env-gated, off by default, and it
138-SENTINEL_CENSUS idx=0 plane=Y extent=64x64 unwritten=0132+is the only way to ask "did the tile walk write every sample it was handed" (a
139-SENTINEL_CENSUS idx=0 plane=U extent=32x64 unwritten=112 spans=24: (six 4x4 blocks)133+wrong-sample diff cannot tell an unwritten sample from a mis-predicted one).
140-SENTINEL_CENSUS idx=0 plane=V extent=32x64 unwritten=112 spans=24: (identical)
141-```
142-
143-Whole 4x4 chroma blocks, and each was the lower half of the plane block of one of
144-the subsizes §1 says are not decodable. That is the whole chain: the walk
145-accepted a subsize libaom refuses, and the chroma plane block it then covered
146-was shaped differently from the luma one.
147-
148-The instrument is **kept**: it is env-gated, off by default, and it is the only
149-way to ask "did the tile walk write every sample it was handed" (a wrong-sample
150-diff cannot tell an unwritten sample from a mis-predicted one).
151-
152----
153 134
154 ## 3. The fix135 ## 3. The fix
155 136
@@ -321,11 +302,14 @@ test stream::tests::a_422_header_over_a_420_tile_refuses_the_subsize_libaom_call
321 test result: ok. 1 passed; 0 failed; ...302 test result: ok. 1 passed; 0 failed; ...
322 ```303 ```
323 304
324-**Determinism, now a consequence rather than the pinned property.** The witness305+**No pixel property is pinned, because there is none to pin.** The witness no
325-no longer produces output at all, so there is no hash to vary. Before the fix,306+longer produces output at all — it refuses, which is the contract. An earlier
326-`for i in 1..5` gave five hashes (top of §2); after, the file refuses. The307+version of this report pinned "the output hash must not change run to run" and
327-nondeterminism was never a property of the pin worth pinning — it was the shape308+justified it with five differing hashes on the lane tree; that measurement is not
328-of a stream we should not have decoded at all.309+established on `main` (Main re-measured on `8d6998d7` with a
310+provenance-checked probe and did not reproduce it), so the sentence and the
311+assertion are both gone. The gate asserts the refusal and a positive control,
312+which is what libaom actually does.
329 313
330 **Mutation.** Deleting the two `chroma_plane_block_codable` call sites puts the314 **Mutation.** Deleting the two `chroma_plane_block_codable` call sites puts the
331 witness back to `OK: 1 frames decoded` and the gate's `unwrap_or_else` panics315 witness back to `OK: 1 frames decoded` and the gate's `unwrap_or_else` panics