GPU: walk only dirty gaps when refreshing guarded views #979
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!979
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-979"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@gmankab on GitHub · 2026-11-25 14:36 UTC · original
gmankab:gpu/clean-guard-intervals→main· +120 −41 · 1 files · 1 commits · openThe 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
@avt0m4t48 on GitHub · 2026-11-25 15:25 UTC · original
I ran the same release fixture at
0b0074eandac6e475on native Windows. All 11 existing watch tests passed on the baseline and all 12 passed on this head, each in a fresh process. The added interval oracle was among the 12.I also exercised the full
guard()call on a real 174 MiB page-file mapping. I alternated baseline, candidate, candidate, baseline on the same runner and checked the page list on every call. The table gives the two process medians per build, with nine samples per process.The four-block case includes reporting and restoring protections inside
guard(). Reopening the four blocks and writing into them happen outside the timer. This is a synthetic guarded-view cost on the Windows runner. The RX 6800 frame-time observation in the PR is a separate measurement.Fixture · Windows run
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.