lane-unwritten-dep r5b: the filed choice in section 12 is three-way, not two-way
Browse files at this commit691273fb9d3e380a553889e5d4b3f0d34f6cca8cParent: 6e36a7d1 changed file +22 -5
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 before | 374 | 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, at | 379 | +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 the | 390 | 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 premise | 392 | +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): a | 403 | **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, |