lane-unwritten-dep r3: the census was never blind -- dump_stage16's 4:2:0 chroma crop was
Browse files at this commit9e84e98714144e304965867c4b39b28fdff42c7cParent: 89e850c1 changed file +252 -244
- lanes/unwritten-dep.report.md +252 -244
lanes/unwritten-dep.report.mdmodified+252 -244
| @@ -1,289 +1,297 @@ | |||
| 1 | -# lane/unwritten-dep — the reelb_* divergence is a TRUNCATED DUMP, and the census's blind spot is the loop filter | 1 | +# lane/unwritten-dep — the reelb_* rows are not decoder defects; the instrument that lied is `dump_stage16` |
| 2 | 2 | ||
| 3 | **Outcome in one line: neither `reelb_rect64_intra16x4_witness.obu` nor | 3 | **Outcome in one line: neither `reelb_rect64_intra16x4_witness.obu` nor |
| 4 | -`reelb_arf_witness.obu` output depends on unwritten plane content on `8d6998d7` — | 4 | +`reelb_arf_witness.obu` output depends on unwritten plane content; the census was |
| 5 | -the campaign's sentinel hash is reproduced EXACTLY by a run whose filesystem ran | 5 | +never blind — `dump_stage16` was, because it hardcoded a 4:2:0 chroma extent and |
| 6 | -out of space mid-write (`97ef82c0ce` = frames 0–4 complete plus 13 320 192 bytes | 6 | +on a 4:2:2 frame wrote half of each chroma plane into no dump at all, which |
| 7 | -of frame 5, hashed `cat dir/frame.f*`-style); and the census's real blind spot is | 7 | +fabricated the "identical pre-deblock, differs post-deblock" attribution; with |
| 8 | -named and fixed: it runs at PRE-DEBLOCK, while deblock READS neighbours to decide | 8 | +per-axis extents the 4:2:2 witness shows 224 unwritten samples pre-deblock |
| 9 | -an edge, so a hole can be invisible there and still change the output. A | 9 | +(exactly lane/av1unwritten's own number), so the difference is present BEFORE any |
| 10 | -post-filter census, taken at the exact point `EC_AV1_FINAL_DUMP` writes, reports | 10 | +filter runs. The gate's non-vacuity control is now synthetic and survives |
| 11 | -32 unwritten samples on the 4:2:2 witness (non-vacuity control) and 0 on all | 11 | +`main`'s refusal of the only fixture that had one.** |
| 12 | -four film fixtures.** | 12 | + |
| 13 | - | 13 | +Branch `lane/unwritten-dep`. Base `8d6998d7`, **rebased by merging |
| 14 | -Branch `lane/unwritten-dep`, base `main` = `8d6998d7`. No push. | 14 | +`main` = `e45cc748` locally** (commit `c62eeda9`) — the merge proof the |
| 15 | - | 15 | +acceptance asked for is this lane's own tree; no rebase onto a different base, |
| 16 | ---- | 16 | +the merge keeps `8d6998d7` as the branch point. |
| 17 | + | ||
| 18 | +> **r3 correction, on top of r2.** r2 named the census as the blind instrument and | ||
| 19 | +> attributed the 4:2:2 witness's divergence to deblock. Both were wrong, and r2's | ||
| 20 | +> own numbers refuted them: its `EC_AV1_DEBUG_SKIP_DEBLOCK` result did not remove | ||
| 21 | +> the difference, and 32 surviving sentinel samples cannot explain 1986 | ||
| 22 | +> differing bytes. The cause is r2's own unexamined instrument. | ||
| 23 | +> `dump_stage16` (`decode.rs`) cropped chroma as `(fw/2, fh/2)` — a 4:2:0 | ||
| 24 | +> assumption — so on a 64×64 **4:2:2** frame (ss_x=1, ss_y=0) it wrote 32×32 | ||
| 25 | +> chroma where the frame carries 32×64. **2048 chroma samples appeared in no | ||
| 26 | +> stage dump at all**, and they are exactly the region where the difference | ||
| 27 | +> lives. r2 read the dump's blind spot as a pipeline property. With per-axis | ||
| 28 | +> extents the pre-deblock dump is where the difference *starts*. | ||
| 17 | 29 | ||
| 18 | ## 1. Provenance | 30 | ## 1. Provenance |
| 19 | 31 | ||
| 20 | -The probe was built in this lane's own worktree with its own target dir, and its | 32 | +Built in this lane's worktree with its own target dir; the binary's embedded |
| 21 | -embedded paths name only this worktree: | 33 | +paths name only this worktree. |
| 22 | 34 | ||
| 23 | ``` | 35 | ``` |
| 24 | -$ cd /home/user/.cache/wt/unwrittendep | 36 | +$ CARGO_TARGET_DIR=/home/user/.cache/tgt/uwdep-merge cargo build -p ec-av1 --example decode_probe |
| 25 | -$ CARGO_TARGET_DIR=/home/user/.cache/tgt/uwdep-k9 cargo build -p ec-av1 --example decode_probe | 37 | +$ strings .../decode_probe | grep -o 'wt/[a-zA-Z0-9_-]*' | sort -u |
| 26 | -$ strings /home/user/.cache/tgt/uwdep-k9/debug/examples/decode_probe | grep -o "wt/[a-zA-Z0-9_-]*" | sort -u | ||
| 27 | wt/unwrittendep | 38 | wt/unwrittendep |
| 28 | -$ git rev-parse HEAD | ||
| 29 | -8d6998d7cbafa1a7a5271e0d638365890a4b4310 | ||
| 30 | ``` | 39 | ``` |
| 31 | 40 | ||
| 32 | -Two traps in the brief were live and are worth recording because both produce a | 41 | +Two live traps, both of which produce a *silent* wrong reading: this lane's first |
| 33 | -*silent* wrong reading: | 42 | +target dir was deleted underneath it mid-run (hence `uwdep-k9` → `uwdep-merge`), |
| 34 | - | 43 | +and `/tmp` is a 16 GB tmpfs that filled during the first sweep and produced |
| 35 | -* the first build's target dir (`/home/user/.cache/tgt/unwrittendep`) was | 44 | +short/zero-length dump files. Every retained run asserts the exact expected |
| 36 | - **deleted underneath this lane mid-run**; every binary whose path is quoted in | 45 | +frame size; the 10-bit fixtures' frame is 18 524 160 bytes. |
| 37 | - this report is under `uwdep-k9`, built and used after that; | ||
| 38 | -* `/tmp` is a 16 GB tmpfs that ran at 80% during the first sweep and silently | ||
| 39 | - produced **short** dump files (sizes 0, 7 553 024, 4194304 instead of | ||
| 40 | - 18 524 160) — those runs are excluded below and every retained run asserts | ||
| 41 | - the exact expected frame size. | ||
| 42 | 46 | ||
| 43 | -Fixtures, byte-identical to what the campaign measured: | 47 | +Fixtures: `reelb_arf_witness.obu` 32 126 B sha256 `7f3b060da5aa9c53…`, |
| 44 | -`reelb_arf_witness.obu` 32 126 bytes sha256 `7f3b060da5aa9c53…`, | 48 | +`reelb_rect64_intra16x4_witness.obu` 23 472 B sha256 `c9e721088766163b…`. |
| 45 | -`reelb_rect64_intra16x4_witness.obu` 23 472 bytes sha256 `c9e721088766163b…`. | ||
| 46 | 49 | ||
| 47 | -Both fixtures are 10-bit 3840×1608, so `EC_AV1_FINAL_DUMP` writes u16 LE and one | 50 | +## 2. Reproduction |
| 48 | -frame is exactly `(3840*1608 + 2*1920*804) * 2 = 18 524 160` bytes. Every run | ||
| 49 | -below asserts that size. | ||
| 50 | 51 | ||
| 51 | -## 2. Reproduction — and the result is NOT the campaign's | 52 | +Hash shape `cat dir/frame.f*` (lexicographic), 3 plain + 2 sentinel runs: |
| 52 | 53 | ||
| 53 | -`EC_AV1_FINAL_DUMP` writes `<prefix>.f<N>` per decode-order frame. Hashing the | 54 | +| fixture | plain | sentinel | campaign plain | campaign sentinel | |
| 54 | -concatenation in the order a shell glob produces (`cat dir/frame.f*`, i.e. | ||
| 55 | -lexicographic) is the shape that reproduces the campaign's numbers exactly: | ||
| 56 | - | ||
| 57 | -| fixture | plain run | sentinel run | campaign plain | campaign sentinel | | ||
| 58 | |---|---|---|---|---| | 55 | |---|---|---|---|---| |
| 59 | | `reelb_rect64_intra16x4_witness` (34 frames) | `a26438168c` ×3 | `a26438168c` ×2 | `a26438168c` | `0ee1edf403` | | 56 | | `reelb_rect64_intra16x4_witness` (34 frames) | `a26438168c` ×3 | `a26438168c` ×2 | `a26438168c` | `0ee1edf403` | |
| 60 | | `reelb_arf_witness` (40 frames) | `8d7a43bc5f` ×3 | `8d7a43bc5f` ×2 | `8d7a43bc5f` | `97ef82c0ce` | | 57 | | `reelb_arf_witness` (40 frames) | `8d7a43bc5f` ×3 | `8d7a43bc5f` ×2 | `8d7a43bc5f` | `97ef82c0ce` | |
| 61 | 58 | ||
| 62 | -**Both campaign PLAIN values reproduce exactly. Neither SENTINEL value does.** | 59 | +**Both campaign PLAIN values are reproduced exactly by this build; neither |
| 63 | -Plain is stable across repeats and across five different ambient contents | 60 | +SENTINEL value is.** The decode output is byte-identical plain vs sentinel, and |
| 64 | -(glibc `MALLOC_PERTURB_` ∈ {0, 1, 85, 170, 254} — every fresh allocation filled | 61 | +under every other ambient content available: glibc `MALLOC_PERTURB_` ∈ {0, 1, 85, |
| 65 | -with that byte), across `EC_AV1_THREADS` ∈ {1, 2, 4, 8}, and in-process with the | 62 | +170, 254}, `EC_AV1_THREADS` ∈ {1, 2, 4, 8}, and in-process poisoning of the |
| 66 | -allocator's free list deliberately poisoned (§4). Under every one of those the | 63 | +allocator's free list with 16 MiB dirty-then-freed blocks. |
| 67 | -sentinel run is byte-identical to the plain run, all 34 / all 40 frames. | ||
| 68 | 64 | ||
| 69 | -## 3. What the campaign's sentinel hash actually is: a truncated dump | 65 | +The in-process test is the strongest of these because there is no filesystem in |
| 66 | +the measurement at all, and it has teeth — on the 4:2:2 witness it reports | ||
| 67 | +differences under 4 of 4 poison patterns (667–715 differing U samples, | ||
| 68 | +673–690 differing V, 0 in luma), while reporting **0 differing frames under 4 | ||
| 69 | +of 4 patterns on both hg fixtures**. | ||
| 70 | 70 | ||
| 71 | -`EC_AV1_FINAL_DUMP` ignores its write error — `let _ = f.write_all(&buf);` at | 71 | +## 3. `97ef82c0ce` — consistent with a truncated dump, not proven to be one |
| 72 | -`stream.rs` (the final-dump site). A run whose filesystem fills therefore leaves | ||
| 73 | -a byte stream that is a **prefix** of the true one, and nothing reports it. | ||
| 74 | 72 | ||
| 75 | -Sweeping every (frames-complete, tail-truncated) shape against the campaign's | 73 | +Sweeping (frames-complete, tail-truncated) shapes against the campaign's value: |
| 76 | -value: | ||
| 77 | 74 | ||
| 78 | ``` | 75 | ``` |
| 79 | $ python3 /tmp/unwritten/partial.py reelb_arf_witness | 76 | $ python3 /tmp/unwritten/partial.py reelb_arf_witness |
| 80 | -reelb_arf_witness: 40 frames (max index 39), hunting 97ef82c0ce | ||
| 81 | MATCH: frames 0..4 + f5 truncated to 13320192 bytes, lex-hashed | 77 | MATCH: frames 0..4 + f5 truncated to 13320192 bytes, lex-hashed |
| 82 | - 1 match(es) | ||
| 83 | ``` | 78 | ``` |
| 84 | 79 | ||
| 85 | -**`97ef82c0ce` is reproduced bit-for-bit by a dump that stopped after 5 complete | 80 | +The campaign's value is reproduced **bit-for-bit** by a byte stream that is frames |
| 86 | -frames and 13 320 192 of frame 5's 18 524 160 bytes** — 71.8% of one frame, with | 81 | +0–4 complete plus 13 320 192 bytes of frame 5 (71.8% of one frame), frames 6–39 |
| 87 | -frames 6–39 never written. The decode is byte-identical; only the FILESYSTEM | 82 | +absent. `EC_AV1_FINAL_DUMP` does `let _ = f.write_all(&buf)`, so a full filesystem |
| 88 | -differs. This is the same class the brief already flagged ("a differing hash | 83 | +leaves a prefix of the true stream and nothing reports it. |
| 89 | -between runs can be a timeout with no dump at all"), one size up: not an absent | 84 | + |
| 90 | -dump but a **partial** one. | 85 | +**This pins the byte content and the shape, not the mechanism.** An unlived |
| 91 | - | 86 | +sentinel, a timeout-killed process, and a full filesystem all leave the same |
| 92 | -Corroborating mechanisms, each demonstrated with a byte-identical decode and a | 87 | +bytes. The wording is therefore *consistent with* a truncated dump, and the |
| 93 | -different hash: | 88 | +converse — that the decode is innocent — rests on §2's invariance, not on this |
| 94 | - | 89 | +match. Corroborating but likewise non-conclusive: `RLIMIT_FSIZE` at a 4 MiB cap |
| 95 | -* **`RLIMIT_FSIZE`** caps a file's size; `sigXFSZ` ignored, the write fails | 90 | +gives `788d3be08ae5112e` for both fills vs `5350cd5569d226eb` uncapped; a reused |
| 96 | - cleanly past the cap. `reelb_rect64` at a 4 MiB cap: `788d3be08ae5112e` for both | 91 | +dump directory leaves a longer fixture's tail (`9ca5c4d7af`); hashing the |
| 97 | - plain and sentinel, versus `5350cd5569d226eb` uncapped. Same decode, different | 92 | +`sha256sum` listing embeds the directory path. |
| 98 | - hash. | 93 | + |
| 99 | -* **A reused dump directory** keeps the tail files of any fixture that wrote more | 94 | +`0ee1edf403` is **not** reproduced by any shape swept (every numeric prefix; |
| 100 | - frames earlier. `reelb_arf_witness` into a directory `reelb_head_mvclamp_witness` | 95 | +every prefix + page-truncated tail at 4 KiB and 512 B; prefixes from either |
| 101 | - (55 frames) had written leaves 55 files and hashes `9ca5c4d7af` — a value no | 96 | +fixture, since rect64 is a 34-frame prefix of arf's 40 with byte-identical frames |
| 102 | - single decode produces. | 97 | +0–33; hole shapes; zero-length-frame shapes; stale cross-fixture mixes both |
| 103 | -* **Hashing the `sha256sum` LISTING** rather than the bytes embeds the directory | 98 | +orders; the listing shape). It remains an **open instrument-hygiene question**, |
| 104 | - path, so two byte-identical dumps in differently-named directories hash | 99 | +not a decode question — the decode is invariant (§2). |
| 105 | - differently (`8d7a43bc5f` vs `be6ca147a7` for the same content). | 100 | + |
| 106 | - | 101 | +## 4. The instrument defect, and the corrected measurement |
| 107 | -`reelb_rect64`'s `0ee1edf403` is **not** reproduced by any of these. Swept and ruled | 102 | + |
| 108 | -out: every numeric prefix and every prefix-plus-page-truncated tail at 4 KiB and | 103 | +**Class: `diagnostic-dump-assumes-one-subsampling`** — a debug/instrumental dump |
| 109 | -512 B granularity, prefixes built from either fixture (rect64 is a 34-frame | 104 | +that derives a plane's extent from an assumed subsampling rather than the |
| 110 | -prefix of arf's 40 with byte-identical frames 0–33), hole shapes (one truncated | 105 | +sequence's, so part of the plane is absent from the measurement and conclusions |
| 111 | -frame among a complete set), zero-length-frame shapes, stale cross-fixture | 106 | +drawn from that measurement are about the dump. Same per-axis family as the |
| 112 | -directory mixes in both orders, and the listing shape. Whatever produced that one | 107 | +decoder's own `round_ss(dim, ss)` rule. |
| 113 | -value, it is not the decode: §4 shows the decode's output is invariant under | 108 | + |
| 114 | -every ambient content available to test. | 109 | +`decode.rs`, `dump_stage16`, cropped chroma as `(fw.div_ceil(2), fh.div_ceil(2))` |
| 115 | - | 110 | +— the 4:2:0 assumption on both axes. The oracle's rung 1 uses libaom's |
| 116 | -## 4. The instrument with the blind spot is the CENSUS, and here is exactly where | 111 | +`uv_crop_width` / `uv_crop_height`, which are per-axis. Fixed to |
| 117 | - | 112 | +`(round_ss(fw, ss_x), round_ss(fh, ss_y))`, with all six call sites passing |
| 118 | -The refusal lane's `census_unwritten` scans the three planes at each frame's | 113 | +`ss_x(fctx)` / `ss_y(fctx)`. |
| 119 | -**pre-deblock** point. That is a real blind spot, and it is demonstrable on the | 114 | + |
| 120 | -one fixture where a hole genuinely reaches the output. | 115 | +**Corrected stage bisect on `440_request_is_422`** (8-bit, 64×64, 4:2:2 header |
| 121 | - | 116 | +over a 4:2:0 tile; `main` = `e45cc748` refuses it, so this is measured on the |
| 122 | -Stage-by-stage on `440_request_is_422` (8-bit 64×64, a 4:2:2 sequence header over | 117 | +branch point `8d6998d7`): |
| 123 | -a 4:2:0 tile — lane/av1unwritten's witness, which main still decodes), comparing | 118 | + |
| 124 | -an uninitialised run against a `PLANE_SENTINEL`-filled one: | 119 | +| stage dump | before the fix | after the fix | |
| 125 | - | ||
| 126 | -| stage dump | bytes | plain vs sentinel | | ||
| 127 | |---|---|---| | 120 | |---|---|---| |
| 128 | -| `EC_AV1_PREFILT_DUMP16` (pre-deblock, where the census runs) | 12 288 | **IDENTICAL** | | 121 | +| `EC_AV1_PREFILT_DUMP16` (pre-deblock) | 12 288 B, **IDENTICAL** | 16 384 B, **DIFFERS (2158 B)** | |
| 129 | -| `EC_AV1_POSTDEBLOCK_DUMP16` | 12 288 | DIFFERS (26 bytes) | | 122 | +| `EC_AV1_POSTDEBLOCK_DUMP16` | 12 288 B, DIFFERS (26 B) | 16 384 B, DIFFERS (2017 B) | |
| 130 | -| `EC_AV1_POSTCDEF_DUMP16` | 12 288 | DIFFERS (26 bytes) | | 123 | +| `EC_AV1_POSTCDEF_DUMP16` | 12 288 B, DIFFERS (26 B) | 16 384 B, DIFFERS (1948 B) | |
| 131 | -| `EC_AV1_DECODE_ORDER_DUMP` | 8 192 | DIFFERS (1 985 bytes) | | 124 | +| `EC_AV1_DECODE_ORDER_DUMP` | 8 192 B, DIFFERS (1985 B) | 8 192 B, DIFFERS (1917 B) | |
| 132 | -| `EC_AV1_FINAL_DUMP` | 8 192 | DIFFERS (1 986 bytes) | | 125 | +| `EC_AV1_FINAL_DUMP` | 8 192 B, DIFFERS (1986 B) | 8 192 B, DIFFERS (1986 B) | |
| 133 | - | 126 | + |
| 134 | -So the pre-deblock census sees **zero** unwritten samples and byte-identical | 127 | +12 288 B = 6144 samples = 4096 luma + 2×1024: only chroma rows 0–31. The frame the |
| 135 | -planes, and the dependence is nevertheless in the output. **Deblock creates it**: | 128 | +caller receives is 8192 samples. **The 2048 missing chroma samples are the |
| 136 | -it reads a neighbouring sample to decide an edge (`aom_lpf_*` masks and | 129 | +region r2's conclusion was drawn from.** |
| 137 | -thresholds), so an unwritten sample changes its neighbour's *filtered* value even | 130 | + |
| 138 | -though the unwritten sample itself is overwritten a moment later. A scan taken | 131 | +**Coordinates, from the corrected pre-deblock dump** (8192 samples, u16, whole |
| 139 | -before the filter cannot see that, by construction. | 132 | +plane, `0xDEAD` counted): |
| 140 | - | 133 | + |
| 141 | -An exact u16 census at the pre-deblock point confirms the zero rather than | 134 | +* unwritten samples, sentinel run: **U 112, V 112, Y 0** — U and V rows 36–63 |
| 142 | -inferring it: `EC_AV1_PREFILT_DUMP16` under `EC_AV1_PLANE_SENTINEL=1`, whole | 135 | + (16 distinct rows), cols 0–15, in whole 4×4 groups (row 36: cols 0–3 and |
| 143 | -file, `0xDEAD` counted per frame — 0 on every frame of all three fixtures. | 136 | + 12–15). **224 total, which is exactly lane/av1unwritten's own census number** |
| 144 | - | 137 | + (`lanes/av1unwritten.report.md:152-156`). |
| 145 | -**The fix (§5) is to also take the census where the output is taken.** A census | 138 | +* plain vs sentinel differing samples, pre-deblock: **U 1004 of 2048, V 1004 of |
| 146 | -there reports 32 unwritten samples on this witness and 0 on every clean fixture. | 139 | + 2048, Y 0**, rows 32–63 — the hole plus everything predicted from it. |
| 147 | - | 140 | + |
| 148 | -### Displayed vs hidden, per fixture | 141 | +So the corrected conclusion is the opposite of r2's: the difference is **already |
| 149 | - | 142 | +present before deblock**; no filter creates it. r2's "Deblock creates it" was an |
| 150 | -`reelb_arf_witness`: 40 decode-order frames, 19 shown, 21 hidden alt-refs, plus 18 | 143 | +artefact of the dump it could not see past. |
| 151 | -`show_existing_frame` headers. `reelb_rect64_intra16x4_witness`: 34 decode-order | 144 | + |
| 152 | -frames, 17 shown, 17 hidden, plus 16 `show_existing_frame`. (Header counts from | 145 | +**And the census was never blind.** It runs at pre-deblock and it reports the |
| 153 | -`EC_PROBE_HDR=1`; the show/hidden split is per non-`show_existing` header.) | 146 | +hole — 224 samples, in whole 4×4 chroma blocks. What could not see it was the |
| 154 | - | 147 | +stage dump. On the hg fixtures both report 0. |
| 155 | -**Answer to the campaign's question: no unwritten sample reaches a DISPLAYED | 148 | + |
| 156 | -frame on either fixture — because no unwritten sample reaches the output at all, | 149 | +## 5. Displayed vs hidden, per fixture |
| 157 | -displayed or hidden.** Every one of the 34 / 40 frames, hidden alt-refs included, | 150 | + |
| 158 | -hashes identically under plain, sentinel, and five ambient contents. The hidden | 151 | +`reelb_arf_witness`: 40 decode-order frames — 19 shown, 21 hidden alt-refs, plus 18 |
| 159 | -frames matter to the question precisely because they are the ones a shown-only | 152 | +`show_existing_frame` headers. `reelb_rect64_intra16x4_witness`: 34 — 17 shown, 17 |
| 160 | -gate never looks at; here they are clean too, which is why the film fixtures' | 153 | +hidden, plus 16 `show_existing_frame`. (From `EC_PROBE_HDR=1`; the split is over |
| 161 | -existing pixel-exactness gates are not exposed by this. | 154 | +non-`show_existing` headers.) |
| 162 | - | 155 | + |
| 163 | -The only fixture in the corpus where a hole reaches the output is the 4:2:2 | 156 | +**No unwritten sample reaches a DISPLAYED frame on either fixture — or a hidden |
| 164 | -witness, whose single frame is SHOWN (`Key show=true`), and whose cause is the | 157 | +one.** Every one of the 34/40 frames hashes identically under plain, sentinel, |
| 165 | -invalid subsize that lane/av1unwritten refuses. That lane owns the cause; this | 158 | +five ambient fills, four thread counts and in-process poisoning, and both the |
| 166 | -lane touches nothing in it (see §7). | 159 | +pre-deblock census and the new output-point census report 0. The hidden frames |
| 167 | - | 160 | +were measured specifically because they are the route by which a hole would reach |
| 168 | -## 5. The fix and the gate | 161 | +a later displayed frame through the reference bank; they are clean. |
| 169 | - | 162 | + |
| 170 | -`crates/ec-av1/src/decode.rs`: | 163 | +The one fixture where a hole does reach output is the 4:2:2 witness, whose single |
| 171 | - | 164 | +frame is **SHOWN** (`Key show=true`), with 224 unwritten chroma samples. Its |
| 172 | -* `PLANE_SENTINEL` census **at the output point** — `census_unwritten_final(y, u, v)` | 165 | +cause is the invalid subsize `main` now refuses; that lane owns it and is |
| 173 | - counts, over the three planes as they are about to be stored into the reference | 166 | +untouched here. |
| 174 | - slots, how many samples still hold `PLANE_SENTINEL` once every filter has run. | 167 | + |
| 175 | - Those planes are already cropped to the true extent at this point, so a flat | 168 | +## 6. The fix and the gate |
| 176 | - count over each IS the true-extent count. Env-gated on the same flag as the | 169 | + |
| 177 | - fill (the fill and the census must agree on when they are live). | 170 | +`decode.rs`: `census_unwritten_final` + `take_final_unwritten_samples` — a census |
| 178 | -* `FINAL_UNWRITTEN_SAMPLES`, a process-global counter, and | 171 | +over the three planes at the point they are stored into the reference slots, with |
| 179 | - `take_final_unwritten_samples()` to read and clear it — process-global rather | 172 | +`dump_stage16`'s chroma extent made per-axis. |
| 180 | - than thread-local because the gate reads it from a different thread than the one | 173 | + |
| 181 | - that scanned. | 174 | +`stream.rs`: the census is called beside the `EC_AV1_FINAL_DUMP` site. |
| 182 | - | 175 | + |
| 183 | -`crates/ec-av1/src/stream.rs`: the census is called beside the `EC_AV1_FINAL_DUMP` | 176 | +**SCOPE, stated not implied:** that point is **before `apply_grain`**, so the |
| 184 | -site — the same point, the same planes, so the claim it supports is literally | 177 | +claim is over the **pre-grain** planes. That is also the claim that matters |
| 185 | -"no sample the tile walk never wrote survives into the frame the caller receives". | 178 | +most — those exact bytes are what the reference bank stores and what every later |
| 186 | - | 179 | +frame predicts from, and grain synthesises from the pre-grain frame plus the |
| 187 | -The gate `the_frame_the_caller_receives_carries_no_unwritten_plane_sample` | 180 | +grain parameters without reading the plane buffer. "The caller's final grained |
| 188 | -(`crates/ec-av1/src/stream.rs`) asserts, in this order: | 181 | +picture has no hole" is **not** claimed and is not asserted. |
| 189 | - | 182 | + |
| 190 | -1. **non-vacuity first**: the census reports **> 0** on `440_request_is_422` | 183 | +Gate `the_frame_the_caller_receives_carries_no_unwritten_plane_sample`: |
| 191 | - (measured 32). A census that read zero everywhere would fail here, so every | 184 | + |
| 192 | - zero below means something; | 185 | +1. **non-vacuity first, and SYNTHETIC**: the census is handed planes carrying |
| 193 | -2. **0** on `reelb_arf_witness` (37 shown frames), `reelb_rect64_intra16x4_witness` (33), | 186 | + exactly 7 sentinel samples and must report exactly 7. No fixture is involved, |
| 194 | - `gm_small_side_witness` (33), `reelc_sb128_inter_witness` (15) — the real film | 187 | + so it cannot be affected by `main` refusing `440_request_is_422` — which is |
| 195 | - streams with hidden alt-refs, the only shapes where a hidden frame's hole | 188 | + what r2's fixture-carried control would have done on merge; |
| 196 | - could reach a later displayed frame through the reference bank. | 189 | +2. **0** on `reelb_arf_witness`, `reelb_rect64_intra16x4_witness`, `gm_small_side_witness`, |
| 197 | - | 190 | + `reelc_sb128_inter_witness` — the real 10-bit streams with hidden alt-refs. |
| 198 | -The fill is env-gated and this crate forbids `set_var` (`envflags`), so the | 191 | + |
| 199 | -measurement runs in a child process (`uwdep_child_unwritten_census`) that the | 192 | +The fill is env-gated and this crate forbids `set_var`, so the measurement runs |
| 200 | -parent invokes by name; the parent asserts the child's reported count. The child | 193 | +in a child process the parent invokes by name; the child asserts |
| 201 | -asserts `EC_AV1_PLANE_SENTINEL` is set, so a run where the fill was not live | 194 | +`EC_AV1_PLANE_SENTINEL` is set, so a non-live fill fails rather than reporting a |
| 202 | -fails rather than reporting a meaningless zero. | 195 | +meaningless zero. |
| 196 | + | ||
| 197 | +**Merge proof — green on a tree containing both lanes.** `main` = `e45cc748` | ||
| 198 | +merged into this branch (`c62eeda9`), then: | ||
| 203 | 199 | ||
| 204 | ``` | 200 | ``` |
| 205 | -$ cargo test -p ec-av1 --lib -- the_frame_the_caller_receives_carries_no_unwritten_plane_sample | 201 | +$ CARGO_TARGET_DIR=.../uwdep-merge cargo test -p ec-av1 --lib -- the_frame_the_caller_receives_carries_no_unwritten_plane_sample |
| 206 | -test stream::tests::the_frame_the_caller_receives_carries_no_unwritten_plane_sample ... ok | 202 | +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 816 filtered out; finished in 71.58s |
| 207 | -test result: ok. 1 passed; 0 failed; 0 ignored; 813 filtered out; finished in 66.06s | ||
| 208 | ``` | 203 | ``` |
| 209 | 204 | ||
| 210 | -Measured census, all five fixtures, provenance-verified probe: | 205 | +816 filtered (vs 813 on the branch point) — the merged tree's extra tests are |
| 211 | - | 206 | +present, so this is the gate running against both lanes' content, not one. |
| 212 | -``` | ||
| 213 | -440_request_is_422 FINAL_UNWRITTEN 32 frames=1 <- control, non-zero | ||
| 214 | -reelb_arf_witness FINAL_UNWRITTEN 0 frames=37 | ||
| 215 | -reelb_rect64_intra16x4_witness FINAL_UNWRITTEN 0 frames=33 | ||
| 216 | -gm_small_side_witness FINAL_UNWRITTEN 0 frames=33 | ||
| 217 | -reelc_sb128_inter_witness FINAL_UNWRITTEN 0 frames=15 | ||
| 218 | -``` | ||
| 219 | 207 | ||
| 220 | -### Mutations — three, all red | 208 | +### Mutations |
| 221 | 209 | ||
| 222 | | mutation | result | | 210 | | mutation | result | |
| 223 | |---|---| | 211 | |---|---| |
| 224 | -| `census_unwritten_final` neutered (`if true { return; }`) | RED at the non-vacuity control: "the census reports 0 even on the one fixture whose output DOES depend on unwritten plane memory" | | 212 | +| `census_unwritten_final` neutered (`if true { return; }`) | **RED**: "the census reported 0 for planes carrying exactly 7 sentinel samples … (class: census-silently-blind)" | |
| 225 | | the `census_unwritten_final` call removed from the output point | RED at the same control | | 213 | | the `census_unwritten_final` call removed from the output point | RED at the same control | |
| 226 | -| one sentinel sample forced into a film frame's output (`EC_AV1_UWDEP_MUT_HOLE=1`, `p.y[0] = 0xDEAD`) | RED on the fixture itself: "reelb_arf_witness hands the caller 40 samples the tile walk never wrote (class: a hole the loop filter read)" | | 214 | +| one sentinel sample forced into a film frame's output (`p.y[0] = 0xDEAD`) | RED on the fixture: "reelb_arf_witness hands the caller N samples the tile walk never wrote" | |
| 227 | 215 | ||
| 228 | -The third is the one that matters: it shows the gate bites on a hole of **one | 216 | +The first is the non-vacuity proof in the same run, and it no longer depends on |
| 229 | -sample in one frame** on a stream that otherwise decodes perfectly, which is | 217 | +any fixture's decode behaviour. |
| 230 | -exactly the class the pre-deblock census missed. | ||
| 231 | 218 | ||
| 232 | -## 6. Commands | 219 | +## 7. Commands |
| 233 | 220 | ||
| 234 | ```bash | 221 | ```bash |
| 235 | -# provenance | ||
| 236 | cd /home/user/.cache/wt/unwrittendep | 222 | cd /home/user/.cache/wt/unwrittendep |
| 237 | -CARGO_TARGET_DIR=/home/user/.cache/tgt/uwdep-k9 cargo build -p ec-av1 --example decode_probe | 223 | +git merge e45cc748 # merge proof tree |
| 238 | -strings /home/user/.cache/tgt/uwdep-k9/debug/examples/decode_probe | grep -o 'wt/[a-z]*' | 224 | +CARGO_TARGET_DIR=... cargo build -p ec-av1 --example decode_probe |
| 239 | - | 225 | +strings .../decode_probe | grep -o 'wt/[a-z]*' # provenance |
| 240 | -# reproduction: 3 plain + 2 sentinel, per-frame size asserted, per-frame hash | 226 | + |
| 241 | -# (frame = 18524160 bytes; the campaign's plain values reproduce exactly) | 227 | +python3 /tmp/unwritten/coords.py # corrected coordinates (§4) |
| 242 | -# stage bisect that names the blind spot | 228 | +bash /tmp/unwritten/determinism.sh "440_request_is_422 reelb_rect64_intra16x4_witness reelb_arf_witness" 5 |
| 243 | -python3 /tmp/unwritten/stages.py 440_request_is_422 | 229 | +python3 /tmp/unwritten/partial.py reelb_arf_witness # the 97ef82c0ce shape |
| 244 | -# EC_AV1_PREFILT_DUMP16 12288 bytes IDENTICAL | ||
| 245 | -# EC_AV1_POSTDEBLOCK_DUMP16 12288 bytes DIFFERS (26 bytes) | ||
| 246 | -# EC_AV1_DECODE_ORDER_DUMP 8192 bytes DIFFERS (1985 bytes) | ||
| 247 | -# EC_AV1_FINAL_DUMP 8192 bytes DIFFERS (1986 bytes) | ||
| 248 | -# the campaign's sentinel hash, reproduced as a truncated dump | ||
| 249 | -python3 /tmp/unwritten/partial.py reelb_arf_witness # MATCH: 0..4 + f5 cut to 13320192 bytes | ||
| 250 | -# the gate | ||
| 251 | cargo test -p ec-av1 --lib -- the_frame_the_caller_receives_carries_no_unwritten_plane_sample | 230 | cargo test -p ec-av1 --lib -- the_frame_the_caller_receives_carries_no_unwritten_plane_sample |
| 252 | ``` | 231 | ``` |
| 253 | 232 | ||
| 254 | -## 7. Disposition of the campaign's two rows | 233 | +## 8. Disposition |
| 255 | - | 234 | + |
| 256 | -* **`reelb_arf_witness` — closed, not a defect.** Output is invariant under the | 235 | +* **`reelb_arf_witness` — closed, not a decoder defect.** Output invariant under |
| 257 | - sentinel, five `MALLOC_PERTURB_` values, four thread counts, and in-process | 236 | + every ambient content tested (§2); the campaign's divergence is *consistent |
| 258 | - allocator poisoning. The reported divergence is reproduced exactly as a | 237 | + with* a truncated dump (§3), and the decode is innocent on the invariance |
| 259 | - **truncated dump** (`97ef82c0ce`), which the fix to the dump path must not be | 238 | + evidence, not on the hash match. |
| 260 | - mistaken for a decode difference: the dump site still ignores its write error, | 239 | +* **`reelb_rect64_intra16x4_witness` — closed, not a decoder defect; its campaign |
| 261 | - and that is a property of the INSTRUMENT. This lane does not change the dump | 240 | + sentinel value `0ee1edf403` remains an OPEN instrument-hygiene question** (§3). |
| 262 | - site (the brief scopes the fix to the walk / the pre-read write), and the gate | 241 | +* **`440_request_is_422` — measured and gated, not fixed here.** 224 unwritten |
| 263 | - in §5 makes the *decoder* claim checkable regardless. | 242 | + chroma samples, pre-deblock, whole 4×4 blocks; cause is the invalid subsize |
| 264 | -* **`reelb_rect64_intra16x4_witness` — closed, not a defect, cause not identified.** | 243 | + `main` refuses (lane/av1unwritten, untouched). |
| 265 | - Same invariance, same gate coverage. Its campaign sentinel value | 244 | +* **The `dump_stage16` per-axis extent is fixed** (§4) — the class is |
| 266 | - (`0ee1edf403`) is not reproduced by any dump-artefact shape swept (§3) and | 245 | + `diagnostic-dump-assumes-one-subsampling`. |
| 267 | - not by the decode (§4); it is unexplained. Named as an open measurement | 246 | + |
| 268 | - question, not a defect. | 247 | +## 9. What this lane did not do |
| 269 | -* **`440_request_is_422` — not this lane's to fix.** Its 32 unwritten samples and | 248 | + |
| 270 | - the loop-filter read are measured and gated here as the non-vacuity control; | 249 | +* **The unswept family, now swept**: r2 did not run-to-run content |
| 271 | - the CAUSE is the invalid subsize lane/av1unwritten refuses, and that lane owns | 250 | + nondeterminism with uninitialised planes — the family |
| 272 | - it. | 251 | + `lanes/av1unwritten.report.md:118-124` records as three different plain hashes |
| 273 | - | 252 | + of 440 from three identical invocations. A sentinel run structurally cannot |
| 274 | -Untouched, as instructed: `film_grain.rs`, the reserved 4:2:0 group-tail chroma | 253 | + detect it (it pins content to one value), and r2's in-process test could not |
| 275 | -SKIP arm, `decode_rect4_16_intrabc`, and anything on `lane/av1unwritten` (its | 254 | + (one process, one heap). N separate processes are required; the result is in |
| 276 | -`census_unwritten` and the two dump-adjacent hunks in `decode.rs` were read, not | 255 | + §10. **I had not swept it in r2 and said nothing about it — that was a gap, not |
| 277 | -written; this lane's changes are a new function above `fresh_plane`, one call | 256 | + a negative result.** |
| 278 | -beside the final-dump site, and the two new tests). | 257 | +* The dump sites still swallow their write errors, so a short dump remains |
| 279 | - | 258 | + possible — the artefact behind §3. Making a partial write loud is an |
| 280 | -## 8. What this lane did not do | 259 | + instrument change touching every dump in the crate; named, not done. |
| 281 | - | 260 | +* No pixel claim is made or unmade for any fixture. |
| 282 | -* The dump sites still swallow their write errors. A short dump is the artefact | 261 | +* Untouched per instructions: `film_grain.rs`, the reserved 4:2:0 group-tail |
| 283 | - that produced this whole question, and the honest fix is to make a partial | 262 | + chroma SKIP arm, `decode_rect4_16_intrabc`, and `lane/av1unwritten`'s content |
| 284 | - write loud (`assert_eq!` on the written length, or write-then-verify). That is | 263 | + (read-only). |
| 285 | - an instrument change touching every dump in the crate, beyond this lane's | 264 | + |
| 286 | - scope, and it needs its own mutation proof. **Named, not done.** | 265 | +## 10. The run-to-run nondeterminism family, swept |
| 287 | -* `0ee1edf403` is unexplained (§3). | 266 | + |
| 288 | -* No pixel claim is made or unmade for any fixture. The gate claims only that no | 267 | +N separate PROCESSES (not one process -- an in-process test cannot see this, it |
| 289 | - unwritten sample reaches the frame the caller receives. | 268 | +has one heap), uninitialised planes, per-run decode-order concatenation hashed, |
| 269 | +exact frame size asserted: | ||
| 270 | + | ||
| 271 | +``` | ||
| 272 | +=== 440_request_is_422 frames=0 (main = e45cc748 REFUSES it; not sweepable on the merge tree) | ||
| 273 | +=== reelb_rect64_intra16x4_witness | ||
| 274 | +5350cd5569d226eb frames=34 sizes=[18524160] | ||
| 275 | +5350cd5569d226eb frames=34 sizes=[18524160] | ||
| 276 | +5350cd5569d226eb frames=34 sizes=[18524160] | ||
| 277 | +5350cd5569d226eb frames=34 sizes=[18524160] | ||
| 278 | +=== reelb_arf_witness | ||
| 279 | +dca5b3d9d2d56f30 frames=40 sizes=[18524160] | ||
| 280 | +dca5b3d9d2d56f30 frames=40 sizes=[18524160] | ||
| 281 | +dca5b3d9d2d56f30 frames=40 sizes=[18524160] | ||
| 282 | +dca5b3d9d2d56f30 frames=40 sizes=[18524160] | ||
| 283 | +``` | ||
| 284 | + | ||
| 285 | +**Negative for both hg fixtures: 4/4 identical, correct size, no spread.** This | ||
| 286 | +is the family a sentinel run structurally cannot detect (it pins content to one | ||
| 287 | +value), and it is independent of the sentinel evidence in section 2. | ||
| 288 | + | ||
| 289 | +`440_request_is_422` **could not be swept on the merge tree** -- `main` = `e45cc748` | ||
| 290 | +refuses it, which is the refusal working as intended. On the branch point | ||
| 291 | +`8d6998d7` I measured 3 identical plain hashes (`a761118c8dd5c8d0`), i.e. I did | ||
| 292 | +**not** reproduce the three-distinct-hashes observation at | ||
| 293 | +`lanes/av1unwritten.report.md:118-124`. That is consistent rather than | ||
| 294 | +contradictory: the witness's output depends on ambient memory, and what the | ||
| 295 | +allocator hands back is machine- and run-dependent, so a fixed value on one host | ||
| 296 | +and a varying one on another are the same defect. **Stated as measured: 3/3 | ||
| 297 | +identical here, and no claim about reproducing their observation.** | ||