Repository navigation
Conversation
Repeated checks of clean view heaps collect one entry per 64 KiB block while holding the guard mutex. If most blocks are clean, that allocates and scans thousands of entries to find just a few dirty gaps. Track the same clean blocks as contiguous half-open runs. The fully clean path needs a single lookup and the mixed path visits only dirty gaps. Keep the existing mapping queries, alias protection, and dirty notifications. Compare the interval operations with the old per-block representation and retain the existing guard and mapping tests. Based-on: fxceless#824 Tested-on: RX 6800, Fedora Linux 45, Wine (14 guard and mapping tests) Assisted-by: gpt-6.2 sol xhigh
|
I ran the same release fixture at I also exercised the full
The four-block case includes reporting and restoring protections inside |
Repeated checks of clean view heaps collect one entry per 64 KiB block while holding the guard mutex. If most blocks are clean, that allocates and scans thousands of entries to find just a few dirty gaps. Track the same clean blocks as contiguous half-open runs. The fully clean path needs a single lookup and the mixed path visits only dirty gaps. Keep the existing mapping queries, alias protection, and dirty notifications. Compare the interval operations with the old per-block representation and retain the existing guard and mapping tests. Based-on: fxceless#824 Tested-on: RX 6800, Fedora Linux 45, Wine (14 guard and mapping tests) Assisted-by: gpt-6.2 sol xhigh (pull request fxceless#979, fitted to this tree: the asking whether a range is held, and the notes of writes through other views, use the runs as well) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The texture refresh path checks guarded views repeatedly, including heaps whose 64 KiB blocks are all clean. The clean-block lookup currently allocates a vector of every clean block under the guard mutex before it can find the gaps.
Store those clean blocks as half-open runs and walk their gaps. A fully clean view needs one lookup. This keeps the existing guard lock, mapping checks, alias protection and write notifications. The tests compare the runs against the per-block representation and exercise real guarded and aliased mappings.
This takes the clean-run idea from #824 into a standalone change. It applies directly to current main and does not require the other changes in that PR.
Validation
13 write-watch and mapping tests passed on this branch under Wine, including the interval regression test. The equivalent canonical test branch passed all 14 tests in its write-watch module.
A synthetic 174 MiB lookup benchmark measured 7.6 µs to about 12 ns for an entirely clean range and 11.7 µs to about 80 ns with four gaps. These measurements cover the lookup and gap walk only.
A local paired RX 6800 run used the same launch settings, starting saves and caches. Both builds rendered the same prologue shot. The interval build did not show a frame-time improvement in the first 75 seconds of heavy rendering. In the first full reporting window, at similar executed draw counts (1,337 vs 1,352), the control reported 12.0 seconds per frame and the interval build 17.8 seconds. The measured time inside GetWriteWatch also varied between runs. One run per variant is insufficient to attribute the timing difference to this patch.
Based-on: #824
Tested-on: RX 6800, Fedora Linux 45, Wine/vkd3d-proton
Assisted-by: gpt-6.2 sol xhigh