forge
Explore
Log in

Don't you dare go Hollow

lane-unwritten-dep r5b: the filed choice in section 12 is three-way, not two-way

Browse files at this commit

691273fb9d3e380a553889e5d4b3f0d34f6cca8cAhmet Kaan GümüşParent: 6e36a7d
Report only; no code change, no merge, no push.

Adds the middle closure Main identified, which section 12 was missing: a zeroed
allocation can come from the ALLOCATOR rather than a loop. alloc_zeroed /
anonymous mmap hands back zero pages on first touch, which for plane-sized
buffers costs a page fault rather than a per-sample store. It is recorded with
the caveat that makes it honest -- an option that needs its own measurement, not
a claim that it is free. The 4K cost is unmeasured in this lane, and "a page
fault per page" is a mechanism, not a benchmark; whoever takes it must measure it
before calling it cheaper than explicit zero-fill. The section now says "Three
closures, none taken here" and the decision stays with a chartered lane.

Also adds the connection the text implied but did not state: the withdrawn
premise was doing DOUBLE duty. It justified the unsafe in fresh_plane AND it was
the reason the census's original story -- a pre-deblock scan blind to a hole the
loop filter later reads -- looked plausible. The same measurement that withdrew
the safety argument is what made the blind-census reading wrong: there was never
a blind pre-deblock scan, only a dump_stage16 that could not see half the chroma
plane. So section 12 and the corrected stage bisect in section 4 are one fact
read twice, and a reader who fixes one without the other will re-derive the
error. That is the part worth leaving on the page for whoever picks this up.

Verified before commit: no source file changed in this round, no stale "two
closures" wording remains anywhere in the report, and the two source comments
still carry "NOT FULLY JUSTIFIED" / "SAFETY, PARTIAL" with the unsafe unchanged.
Gate remains green on the merged tree (1 passed, 816 filtered, 70.92s, measured
in r5 and unaffected by this report-only change).
lanes/unwritten-dep.report.mdmodified+22 -5
@@ -374,14 +374,31 @@ uninitialised memory is not itself UB: `u16` has no invalid bit patterns and no
374 uninitialised `u16`. `set_len` is therefore sound only under the "written before374 uninitialised `u16`. `set_len` is therefore sound only under the "written before
375 read" premise, and that premise is the one the measurement withdrew.375 read" premise, and that premise is the one the measurement withdrew.
376 376
377-**Two closures, neither taken here:**377+**The withdrawn premise was doing double duty, which is why one retraction
378-378+untangles two findings.** It justified *this* `unsafe`, AND it was the reason the
379-1. **Zero the allocation** — restore `vec![0u16; n]`. Sound unconditionally, at379+census's original story — a pre-deblock scan that is blind to a hole the loop
380+filter later reads — looked plausible in the first place. The same measurement
381+that withdrew the safety argument (output varying with initial content) is what
382+made the blind-census reading wrong: there was never a blind pre-deblock scan,
383+only a `dump_stage16` that could not see half the chroma plane. So §12 and the
384+corrected stage bisect in §4 are the same fact read twice, and a later reader who
385+fixes one without the other will re-derive the error.
386+
387+**Three closures, none taken here:**
388+
389+1. **Explicit zero-fill** — restore `vec![0u16; n]`. Sound unconditionally, at
380 the ~3% of frame-thread cycles at 4K that lane-picalloc removed. This is the390 the ~3% of frame-thread cycles at 4K that lane-picalloc removed. This is the
381 safe default and the honest cost of the optimisation.391 safe default and the honest cost of the optimisation.
382-2. **Instrument reads-before-write** — a per-sample read/write map, so the premise392+2. **Allocator-zeroed allocation** — a zeroed allocation can come from the
393+ allocator rather than a loop: `alloc_zeroed` / anonymous mmap hands back zero
394+ pages on first touch, which for plane-sized buffers costs a page fault rather
395+ than a per-sample store. **This is an option that needs its own measurement,
396+ not a claim that it is free** — the cost at 4K is unmeasured in this lane, and
397+ "a page fault per page" is a mechanism, not a benchmark. Whoever takes it must
398+ measure it before calling it cheaper than (1).
399+3. **Instrument reads-before-write** — a per-sample read/write map, so the premise
383 can be proved rather than assumed. That is a real instrument, not a comment,400 can be proved rather than assumed. That is a real instrument, not a comment,
384- and it is the only route that keeps the optimisation.401+ and it is the only route that keeps the optimisation as-is.
385 402
386 **Reachability evidence** (what makes this fileable rather than theoretical): a403 **Reachability evidence** (what makes this fileable rather than theoretical): a
387 demonstrated read on `440_request_is_422` at `8d6998d7` — 224 unwritten samples,404 demonstrated read on `440_request_is_422` at `8d6998d7` — 224 unwritten samples,