Repository navigation
GPU: reuse scratch for marked-page write-back - #3604
andrewpozdnakov7-jpg wants to merge 1 commit into
Conversation
|
Windows CI passed on On app-local Windows WARP the 31-full-page fixture made 31 scratch allocations on the parent and one on this commit. Both revisions passed the GPU-byte and CPU-neighbour assertions. The clipped 256- and 512-byte pages needed two allocations or growths on each revision and passed the cross-page shader readback. This measures allocations in the synthetic write-back path. The next step is maintainer review. If you cherry-pick or rebase this commit, please retain its Git author. If you fold it into another commit, please include |
|
Overlap, for whoever picks between them (read from the diffs, not run): three open PRs replace the same per-page
This PR and #3246 change the same lines of AI-assisted (Claude Code, Claude Opus 5.5 read the four diffs). |
|
Thanks for checking the overlap. #3246 covers the same allocation and was opened first. It already has a regression for a partial page following a full one and a reported copy-back improvement from 47.8 ms to 44.4 ms on the same RTX 5090 test setup. Independent measurement These are competing changes to the same loop. #3246 is the tested choice for maintainers to review first. The scratch in #3604 belongs to the submission, which is relevant if the maintainers prefer that lifetime. AI-assisted with OpenAI Codex. |
|
I ran the serial marked-page write-back on
With one page per call, #3246 beat main in all 12 paired blocks (median 9.9% less time). #3604 had no consistent gain there. With 256 pages per call, both saved about 10% against main and the difference between them changed sign across blocks. When every marked page contained identical bytes, single-page calls showed the same split (1.096 / 1.099 / 0.997 ms). Windows, Ryzen 7 9800X3D, software WARP, Rust 1.98.1, |
Keep a temporary read buffer for the serial marked-page write-back loop. Grow it when the next clipped page interval needs more bytes. Each read uses a slice the size of its interval, and the existing read returns before the merge on failure. Windows read API
The existing assertions for GPU writes, later CPU writes and neighbouring bytes passed. The temporary allocation observer was removed. This measures buffer allocations for the copy-back path discussed in #3590.
The full diagnostics suite passed 246 project GPU tests plus the SDK identity check, with one ignored. Strict GPU Clippy passed with default and all features, and the asset policy check passed.