diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index 9652249f..efdf16f3 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -21172,7 +21172,9 @@ fn dump_stage16( // "identical pre-deblock, differs post-deblock" off these dumps is then // measuring the dump's blind spot, not the pipeline's: the samples it could // not see are exactly the region where the 4:2:2 witness's output diverges - // (chroma rows 30..63, 2048 samples). `round_ss` is the same rounding the + // (chroma rows 32..63 -- the old `fh.div_ceil(2)` crop wrote 32 of 64 rows, + // so everything from row 32 up was invisible; 2048 samples). `round_ss` is + // the same rounding the // decoder's own plane extents use, and it matches the oracle's // `uv_crop_width` / `uv_crop_height` per axis. // ONE file per frame: `dump_stage_idx` advances on every call, so creating @@ -21744,25 +21746,38 @@ pub(crate) fn census_unwritten_final(y: &[u16], u: &[u16], v: &[u16]) { /// This comment previously claimed the SB-padded surface "is written /// sample-for-sample by the tile walk's reconstruction before anything reads /// it", and cited the sentinel gate as proof. **That claim is RETRACTED by -/// measurement, in this same file**: on `440_request_is_422` the decode produced -/// TWO different output hashes across five runs with uninitialised planes, one -/// hash under `EC_AV1_PLANE_SENTINEL=1`, and a pre-deblock census of 112 -/// unwritten samples per chroma plane (224 total) -- see -/// `chroma_plane_block_codable`'s "What led here" paragraph and -/// `lanes/av1unwritten.report.md`. Output that varies with the buffer's initial -/// content means an uninitialised sample was READ. A reviewer approving this -/// `unsafe` on the old text was approving it on a withdrawn proof. +/// measurement.** The basis for the retraction is THIS LANE's own, not +/// second-hand: on `440_request_is_422` an exact u16 whole-plane census at the +/// pre-deblock point finds **112 unwritten samples per chroma plane, 224 total** +/// (U and V, 28 whole 4x4 groups each, rows 36..63) in a frame that is SHOWN +/// (`Key show=true`) and whose samples the caller receives. Uninitialised memory +/// that reaches the caller was read, or the read that produced it was. That is +/// the UB, and it needs no hash-variation claim to stand. +/// +/// A hash-variation observation also exists -- five plain runs of the same +/// witness giving two different output hashes (`lanes/av1unwritten.report.md`), +/// which would point the same way -- but it is SECOND-HAND and was NOT +/// reproduced here: five plain runs on `8d6998d7` gave one hash +/// (`a761118c8dd5c8d0`, `lanes/unwritten-dep.report.md` §10). It is not relied +/// on, and the ambient content a run happens to receive is machine-dependent, +/// so a stable value on one host and a varying one on another would be the same +/// defect either way. The 224-sample census is the basis; the hashes are aside. /// /// WHAT IS ACTUALLY ESTABLISHED, and it is weaker: /// /// * The sentinel gate ([`census_unwritten_final`], /// `the_frame_the_caller_receives_carries_no_unwritten_plane_sample`) proves /// that no sample the tile walk never wrote SURVIVES into the frame the caller -/// receives, on the corpus measured. It counts at two points -- pre-deblock and -/// the output point -- so it measures SURVIVAL, not reads. +/// receives, on the corpus measured. **It counts at the OUTPUT POINT ONLY -- +/// one census, one scan.** The pre-deblock census ([`census_unwritten`], +/// `take_unwritten_samples` / `take_census_scanned`) is a DIFFERENT instrument +/// and has NO committed reader anywhere in the crate on `main`, so it backs +/// nothing here; an earlier revision of this comment credited the gate with +/// both, which would have told a reviewer the premise is covered by two scans +/// when only one exists. It is measured SURVIVAL, not reads. /// * It does NOT prove "every sample is written before it is read". A sample read /// as a prediction or filter neighbour and overwritten a moment later is -/// invisible to both counts. **No such read has been observed, and no +/// invisible to that count. **No such read has been observed, and no /// instrument here measures for one.** /// * On `main` = `e45cc748` the one path where a read was demonstrated is /// UNREACHABLE: lane/av1unwritten refuses the subsize before descending. @@ -21792,8 +21807,10 @@ fn fresh_plane(n: usize) -> Vec { // sample before any read. That premise was RETRACTED by measurement (224 // unwritten samples, output varying with initial content) on a path that is // now refused, and is UNMEASURED everywhere else. The sentinel gate measures - // survival at two points, not reads. So this `unsafe` is sound under a - // premise no current instrument proves. + // survival at the output point, not reads. The pre-deblock census is a + // separate instrument with no committed reader on main, so it adds nothing + // here. So this `unsafe` is sound under a premise no current instrument + // proves. #[allow(unsafe_code)] unsafe { v.set_len(n); diff --git a/lanes/unwritten-dep.report.md b/lanes/unwritten-dep.report.md index 12f39c95..773b51c5 100644 --- a/lanes/unwritten-dep.report.md +++ b/lanes/unwritten-dep.report.md @@ -348,22 +348,38 @@ this, so a reviewer can no longer approve the `unsafe` on a withdrawn proof. **The retracted claim.** `fresh_plane`'s doc asserted the SB-padded surface "is written sample-for-sample by the tile walk's reconstruction before anything reads it", and cited the sentinel gate as proof ("proven by the sentinel gate above"). -**The same file retracts it**, at `chroma_plane_block_codable`'s "What led here": -on `440_request_is_422`, five runs with uninitialised planes give **two different -output hashes**, five sentinel runs give one, and the pre-deblock census finds -**112 unwritten samples per chroma plane, 224 total** -(`lanes/av1unwritten.report.md:126-128`). Output that varies with the buffer's -initial content means an uninitialised sample was **read**. - -**What the gate actually proves — the weaker claim.** The sentinel census counts -at two points, pre-deblock and the output point, so it measures **survival, not -reads**: +**The same file retracts it.** The basis is **this lane's own measurement**, not +second-hand: on `440_request_is_422` an exact u16 whole-plane census at the +pre-deblock point finds **112 unwritten samples per chroma plane, 224 total** (U +and V, 28 whole 4×4 groups each, rows 36–63) in a frame that is **SHOWN** +(`Key show=true`) and whose samples the caller receives (§4, §5). Uninitialised +memory that reaches the caller was read, or the read that produced it was. That +is the UB, and it stands without any hash-variation claim. + +A hash-variation observation also exists — five plain runs of the witness giving +two different output hashes (`lanes/av1unwritten.report.md:118-124`) — but it is +**second-hand and NOT reproduced here**: five plain runs on `8d6998d7` gave one +hash, `a761118c8dd5c8d0` (§10). It is therefore not relied on, and it should not +have been stated flatly in the `decode.rs` comment, where it did read as this +lane's measurement. Ambient content is machine-dependent, so a stable value on one +host and a varying one on another would be the same defect either way; the +224-sample census is the basis, the hashes are an aside. + +**What the gate actually proves — the weaker claim.** The gate counts at the +**output point only**: one census, one scan. The pre-deblock census +(`census_unwritten`, `take_unwritten_samples` / `take_census_scanned`) is a +**different instrument with no committed reader anywhere in the crate on `main`** +(§13), so it backs nothing here. An earlier revision of this section credited +the gate with both, which would have told a reviewer auditing the `unsafe` that +the premise is covered by two scans when only one exists — and the missing one is +exactly the scan that would catch a hole before the filters. What the gate +measures is **survival, not reads**: * PROVEN: no sample the tile walk never wrote **survives into the frame the caller receives**, on the corpus measured. * NOT PROVEN: "every sample is written before it is read". A sample read as a prediction or filter neighbour and overwritten a moment later is invisible to - both counts. **No such read has been observed, and no instrument in this crate + that count. **No such read has been observed, and no instrument in this crate measures for one.** * On `main` = `e45cc748` the one path where a read was **demonstrated** is now unreachable — lane/av1unwritten refuses the subsize before descending. @@ -400,13 +416,16 @@ fixes one without the other will re-derive the error. can be proved rather than assumed. That is a real instrument, not a comment, and it is the only route that keeps the optimisation as-is. -**Reachability evidence** (what makes this fileable rather than theoretical): a -demonstrated read on `440_request_is_422` at `8d6998d7` — 224 unwritten samples, -output varying with initial content, two distinct plain hashes across five runs -— and that path is refused on `main`, so the corpus contains no *currently -reachable* instance. The claim that needs proving is universal ("every sample is -written before it is read"), and one refused witness cannot establish it for the -other 126 fixtures. +**Reachability evidence** (what makes this fileable rather than theoretical), +**this lane's own measurement**: on `440_request_is_422` at `8d6998d7`, an exact +u16 whole-plane census finds **224 unwritten chroma samples** (U 112, V 112, +whole 4×4 groups, rows 36–63) in a frame that is **SHOWN** and whose samples the +caller receives — uninitialised memory reaching the caller IS the UB, and it +needs no hash claim. That path is refused on `main`, so the corpus contains no +*currently reachable* instance; the hash-variation observation that also exists is +second-hand and was not reproduced here (§10), so it is not part of the basis. +The claim that needs proving is universal ("every sample is written before it is +read"), and one refused witness cannot establish it for the other 126 fixtures. ## 13. Does this lane's gate supply the reader `take_unwritten_samples` lacked? — NO