GPU: store watch protected/clean guards as coalesced BlockRuns intervals #1065
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1067"
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?
Imported from fxceless/victory-fork. Originally posted by UwUCammie on 2026-11-25T18:18:36Z.
Guards.protectedandGuards.cleaninwatch.rswereBTreeSet<usize>holding one entry per 64 KiB block. Eachwatch::guard()call allocated aVec<usize>overg.clean.range(first..last)(up to ~150k blocks/frame across ~10 GB of view memory), lockedGUARDStwice, and walked every block infirst..=lastwhenever any block in a range was dirty.protectedandcleanwithBlockRuns(BTreeMap<usize, usize>storing maximal disjoint[start, end)block intervals).g.clean.covers(first, last)fast path inguard()with zero allocation when a range is clean, and walks onlyg.clean.missing_runs(first, last)gaps when blocks are dirty (withinstall()hoisted above the lock to avoid VEH lock-order inversion).open_here()usestake_runs()to remove andVirtualProtectcontiguous runs directly (falling back per-block if a run spans regions).block_runs_intervals_merge_split_and_query.Tested on Linux + Wine 11.22 + RX 7900 XT (RADV,
VICTORY_RELAY=2, 480 s run into the cell scene):watchesdropped from ~21.2 ms to ~16.8 ms/frame (guards17.3 -> 13.4 ms/frame), 0 GPUVM faults, picture unchangedwatch::testspass under Wine.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.