forge
Explore
Log in

Don't you dare go Hollow

lane-unwritten-dep r6: the SAFETY comment credited the gate with a census it does not perform

Browse files at this commit

caad117714cd82e253c84d50addbca1d99560929Ahmet Kaan GümüşParent: 691273f
Report/comment accuracy only. Zero non-comment lines changed -- verified with
git diff -U0 filtered for lines that are not /// or //.

1 -- THE GATE DOES ONE CENSUS, NOT TWO. decode.rs and report section 12 said the
sentinel gate "counts at two points, pre-deblock and the output point". It does
not: the gate reads only take_final_unwritten_samples /
take_final_census_scanned, which is ONE census at the output point. The
pre-deblock census (census_unwritten, take_unwritten_samples /
take_census_scanned) is a different instrument, and section 13 of this lane's own
report establishes it has NO committed reader anywhere in the crate on main. So
the two-point claim told a reviewer auditing the unsafe that the premise is backed
by two scans when only one exists -- and the missing one is exactly the scan
that would catch a hole before the filters. Both sites now say the gate counts at
the OUTPUT POINT ONLY and that the pre-deblock census backs nothing here, with the
earlier two-point wording named as the error it was.

2 -- THE FILING NOW RESTS ON THIS LANE'S OWN MEASUREMENT. Section 12 filed the
unsafe on "two distinct plain hashes across five runs", which is second-hand from
lanes/av1unwritten.report.md:118-124, and section 10 of this same report says I
did NOT reproduce it (five plain runs on 8d6998d7, one hash, a761118c8dd5c8d0).
The basis is now the measurement this lane actually took: an exact u16
whole-plane census finding 224 unwritten chroma samples (U 112, V 112, whole 4x4
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 needs no hash
claim. The hash observation is retained but labelled second-hand-and-not-
reproduced, with the note that ambient content is machine-dependent so a stable
value on one host and a varying one on another would be the same defect. The
reachability paragraph was rebased the same way, and the decode.rs SAFETY comment
no longer states the two-hash fact flatly.

3 -- ROW RANGE. decode.rs named the invisible region as "chroma rows 30..63". The
old crop wrote fh.div_ceil(2) = 32 of 64 rows, so the region is rows 32..63, which
is what section 4 of the report already said. The 2048-sample count was right;
only the range was wrong. Corrected, with the arithmetic now shown inline.

Not touched, per instruction: the same two-hash sentence inside
chroma_plane_block_codable's "What led here" is lane/av1unwritten's own prose and
accurately reports a measurement they made -- not mine to reword. The other
stale-prose sites found by the class sweep, the decode path, film_grain.rs, the
reserved 4:2:0 group-tail chroma SKIP arm, decode_rect4_16_intrabc, and the dump
writers' error swallowing.

No merge, no push.
crates/ec-av1/src/decode.rsmodified+31 -14
@@ -21172,7 +21172,9 @@ fn dump_stage16(
2117221172 // "identical pre-deblock, differs post-deblock" off these dumps is then
2117321173 // measuring the dump's blind spot, not the pipeline's: the samples it could
2117421174 // not see are exactly the region where the 4:2:2 witness's output diverges
21175- // (chroma rows 30..63, 2048 samples). `round_ss` is the same rounding the
21175+ // (chroma rows 32..63 -- the old `fh.div_ceil(2)` crop wrote 32 of 64 rows,
21176+ // so everything from row 32 up was invisible; 2048 samples). `round_ss` is
21177+ // the same rounding the
2117621178 // decoder's own plane extents use, and it matches the oracle's
2117721179 // `uv_crop_width` / `uv_crop_height` per axis.
2117821180 // 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]) {
2174421746 /// This comment previously claimed the SB-padded surface "is written
2174521747 /// sample-for-sample by the tile walk's reconstruction before anything reads
2174621748 /// it", and cited the sentinel gate as proof. **That claim is RETRACTED by
21747-/// measurement, in this same file**: on `440_request_is_422` the decode produced
21748-/// TWO different output hashes across five runs with uninitialised planes, one
21749-/// hash under `EC_AV1_PLANE_SENTINEL=1`, and a pre-deblock census of 112
21750-/// unwritten samples per chroma plane (224 total) -- see
21751-/// `chroma_plane_block_codable`'s "What led here" paragraph and
21752-/// `lanes/av1unwritten.report.md`. Output that varies with the buffer's initial
21753-/// content means an uninitialised sample was READ. A reviewer approving this
21754-/// `unsafe` on the old text was approving it on a withdrawn proof.
21749+/// measurement.** The basis for the retraction is THIS LANE's own, not
21750+/// second-hand: on `440_request_is_422` an exact u16 whole-plane census at the
21751+/// pre-deblock point finds **112 unwritten samples per chroma plane, 224 total**
21752+/// (U and V, 28 whole 4x4 groups each, rows 36..63) in a frame that is SHOWN
21753+/// (`Key show=true`) and whose samples the caller receives. Uninitialised memory
21754+/// that reaches the caller was read, or the read that produced it was. That is
21755+/// the UB, and it needs no hash-variation claim to stand.
21756+///
21757+/// A hash-variation observation also exists -- five plain runs of the same
21758+/// witness giving two different output hashes (`lanes/av1unwritten.report.md`),
21759+/// which would point the same way -- but it is SECOND-HAND and was NOT
21760+/// reproduced here: five plain runs on `8d6998d7` gave one hash
21761+/// (`a761118c8dd5c8d0`, `lanes/unwritten-dep.report.md` §10). It is not relied
21762+/// on, and the ambient content a run happens to receive is machine-dependent,
21763+/// so a stable value on one host and a varying one on another would be the same
21764+/// defect either way. The 224-sample census is the basis; the hashes are aside.
2175521765 ///
2175621766 /// WHAT IS ACTUALLY ESTABLISHED, and it is weaker:
2175721767 ///
2175821768 /// * The sentinel gate ([`census_unwritten_final`],
2175921769 /// `the_frame_the_caller_receives_carries_no_unwritten_plane_sample`) proves
2176021770 /// that no sample the tile walk never wrote SURVIVES into the frame the caller
21761-/// receives, on the corpus measured. It counts at two points -- pre-deblock and
21762-/// the output point -- so it measures SURVIVAL, not reads.
21771+/// receives, on the corpus measured. **It counts at the OUTPUT POINT ONLY --
21772+/// one census, one scan.** The pre-deblock census ([`census_unwritten`],
21773+/// `take_unwritten_samples` / `take_census_scanned`) is a DIFFERENT instrument
21774+/// and has NO committed reader anywhere in the crate on `main`, so it backs
21775+/// nothing here; an earlier revision of this comment credited the gate with
21776+/// both, which would have told a reviewer the premise is covered by two scans
21777+/// when only one exists. It is measured SURVIVAL, not reads.
2176321778 /// * It does NOT prove "every sample is written before it is read". A sample read
2176421779 /// as a prediction or filter neighbour and overwritten a moment later is
21765-/// invisible to both counts. **No such read has been observed, and no
21780+/// invisible to that count. **No such read has been observed, and no
2176621781 /// instrument here measures for one.**
2176721782 /// * On `main` = `e45cc748` the one path where a read was demonstrated is
2176821783 /// UNREACHABLE: lane/av1unwritten refuses the subsize before descending.
@@ -21792,8 +21807,10 @@ fn fresh_plane(n: usize) -> Vec<u16> {
2179221807 // sample before any read. That premise was RETRACTED by measurement (224
2179321808 // unwritten samples, output varying with initial content) on a path that is
2179421809 // now refused, and is UNMEASURED everywhere else. The sentinel gate measures
21795- // survival at two points, not reads. So this `unsafe` is sound under a
21796- // premise no current instrument proves.
21810+ // survival at the output point, not reads. The pre-deblock census is a
21811+ // separate instrument with no committed reader on main, so it adds nothing
21812+ // here. So this `unsafe` is sound under a premise no current instrument
21813+ // proves.
2179721814 #[allow(unsafe_code)]
2179821815 unsafe {
2179921816 v.set_len(n);
lanes/unwritten-dep.report.mdmodified+37 -18
@@ -348,22 +348,38 @@ this, so a reviewer can no longer approve the `unsafe` on a withdrawn proof.
348348 **The retracted claim.** `fresh_plane`'s doc asserted the SB-padded surface "is
349349 written sample-for-sample by the tile walk's reconstruction before anything reads
350350 it", and cited the sentinel gate as proof ("proven by the sentinel gate above").
351-**The same file retracts it**, at `chroma_plane_block_codable`'s "What led here":
352-on `440_request_is_422`, five runs with uninitialised planes give **two different
353-output hashes**, five sentinel runs give one, and the pre-deblock census finds
354-**112 unwritten samples per chroma plane, 224 total**
355-(`lanes/av1unwritten.report.md:126-128`). Output that varies with the buffer's
356-initial content means an uninitialised sample was **read**.
357-
358-**What the gate actually proves — the weaker claim.** The sentinel census counts
359-at two points, pre-deblock and the output point, so it measures **survival, not
360-reads**:
351+**The same file retracts it.** The basis is **this lane's own measurement**, not
352+second-hand: on `440_request_is_422` an exact u16 whole-plane census at the
353+pre-deblock point finds **112 unwritten samples per chroma plane, 224 total** (U
354+and V, 28 whole 4×4 groups each, rows 36–63) in a frame that is **SHOWN**
355+(`Key show=true`) and whose samples the caller receives (§4, §5). Uninitialised
356+memory that reaches the caller was read, or the read that produced it was. That
357+is the UB, and it stands without any hash-variation claim.
358+
359+A hash-variation observation also exists — five plain runs of the witness giving
360+two different output hashes (`lanes/av1unwritten.report.md:118-124`) — but it is
361+**second-hand and NOT reproduced here**: five plain runs on `8d6998d7` gave one
362+hash, `a761118c8dd5c8d0` (§10). It is therefore not relied on, and it should not
363+have been stated flatly in the `decode.rs` comment, where it did read as this
364+lane's measurement. Ambient content is machine-dependent, so a stable value on one
365+host and a varying one on another would be the same defect either way; the
366+224-sample census is the basis, the hashes are an aside.
367+
368+**What the gate actually proves — the weaker claim.** The gate counts at the
369+**output point only**: one census, one scan. The pre-deblock census
370+(`census_unwritten`, `take_unwritten_samples` / `take_census_scanned`) is a
371+**different instrument with no committed reader anywhere in the crate on `main`**
372+(§13), so it backs nothing here. An earlier revision of this section credited
373+the gate with both, which would have told a reviewer auditing the `unsafe` that
374+the premise is covered by two scans when only one exists — and the missing one is
375+exactly the scan that would catch a hole before the filters. What the gate
376+measures is **survival, not reads**:
361377
362378 * PROVEN: no sample the tile walk never wrote **survives into the frame the
363379 caller receives**, on the corpus measured.
364380 * NOT PROVEN: "every sample is written before it is read". A sample read as a
365381 prediction or filter neighbour and overwritten a moment later is invisible to
366- both counts. **No such read has been observed, and no instrument in this crate
382+ that count. **No such read has been observed, and no instrument in this crate
367383 measures for one.**
368384 * On `main` = `e45cc748` the one path where a read was **demonstrated** is now
369385 unreachable — lane/av1unwritten refuses the subsize before descending.
@@ -400,13 +416,16 @@ fixes one without the other will re-derive the error.
400416 can be proved rather than assumed. That is a real instrument, not a comment,
401417 and it is the only route that keeps the optimisation as-is.
402418
403-**Reachability evidence** (what makes this fileable rather than theoretical): a
404-demonstrated read on `440_request_is_422` at `8d6998d7` — 224 unwritten samples,
405-output varying with initial content, two distinct plain hashes across five runs
406-— and that path is refused on `main`, so the corpus contains no *currently
407-reachable* instance. The claim that needs proving is universal ("every sample is
408-written before it is read"), and one refused witness cannot establish it for the
409-other 126 fixtures.
419+**Reachability evidence** (what makes this fileable rather than theoretical),
420+**this lane's own measurement**: on `440_request_is_422` at `8d6998d7`, an exact
421+u16 whole-plane census finds **224 unwritten chroma samples** (U 112, V 112,
422+whole 4×4 groups, rows 36–63) in a frame that is **SHOWN** and whose samples the
423+caller receives — uninitialised memory reaching the caller IS the UB, and it
424+needs no hash claim. That path is refused on `main`, so the corpus contains no
425+*currently reachable* instance; the hash-variation observation that also exists is
426+second-hand and was not reproduced here (§10), so it is not part of the basis.
427+The claim that needs proving is universal ("every sample is written before it is
428+read"), and one refused witness cannot establish it for the other 126 fixtures.
410429
411430 ## 13. Does this lane's gate supply the reader `take_unwritten_samples` lacked? — NO
412431