batch 64 KiB block queries in texture mapped_bytes #177

Open
github-bot wants to merge 1 commit from github-bot/gh-177 into main AGit
Owner

@⁠matheusfrta on GitHub · 2026-11-24 22:13 UTC · original
matheusfrta:patch-1795558392 → main · +70 −7 · 1 files · 1 commits · open

mapped_bytes previously called readable one 64 KiB block at a time, issuing a separate K32QueryWorkingSetEx call per block on streamed textures. Batch up to 256 block probes per query like readable already does, and add a sparse reservation test across batch boundaries.

**@⁠matheusfrta** on GitHub · 2026-11-24 22:13 UTC · [original](https://github.com/fxceless/victory-fork/pull/177) `matheusfrta:patch-1795558392` → `main` · +70 −7 · 1 files · 1 commits · open mapped_bytes previously called readable one 64 KiB block at a time, issuing a separate K32QueryWorkingSetEx call per block on streamed textures. Batch up to 256 block probes per query like readable already does, and add a sparse reservation test across batch boundaries.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:37:38 +00:00
Author
Owner

@⁠rostaddotcc on GitHub · 2026-11-24 22:36 UTC · original

Supporting measurement from Linux/Proton, where this is now the largest item left in the texture lane.

With #175 (8e0e7b6, range-scoped mapping locks) the wait-for-remap counter is 0.0 ms in all 113 sampled windows, and what remains of texture refreshes per frame, all threads is the asking: 62.9 ms median, 936 ms in the worst window, out of a lane that runs 0.2–0.3 fps with 3 478–4 223 ms frames (RX 7900 XT, RADV, vkd3d-proton 3.2.0, 430-second run).

On the same box before that PR the split was the other way round — asking 7.3 ms median against 20.2 ms of waiting — so batching the block queries is what the lane needs next, not a micro-optimisation. It also matters on Wine specifically: K32QueryWorkingSetEx is emulated there, and the per-block call is a syscall round trip, so the wall-clock gain should be larger than on Windows for the same block count. If you have a way to count the calls per refresh, that number from a run here would make the case for the batch size.

**@⁠rostaddotcc** on GitHub · 2026-11-24 22:36 UTC · [original](https://github.com/fxceless/victory-fork/pull/177#issuecomment-7146425615) Supporting measurement from Linux/Proton, where this is now the largest item left in the texture lane. With #175 (`8e0e7b6`, range-scoped mapping locks) the wait-for-remap counter is 0.0 ms in all 113 sampled windows, and what remains of `texture refreshes per frame, all threads` is the asking: **62.9 ms median, 936 ms in the worst window**, out of a lane that runs 0.2–0.3 fps with 3 478–4 223 ms frames (RX 7900 XT, RADV, vkd3d-proton 3.2.0, 430-second run). On the same box before that PR the split was the other way round — asking 7.3 ms median against 20.2 ms of waiting — so batching the block queries is what the lane needs next, not a micro-optimisation. It also matters on Wine specifically: `K32QueryWorkingSetEx` is emulated there, and the per-block call is a syscall round trip, so the wall-clock gain should be larger than on Windows for the same block count. If you have a way to count the calls per refresh, that number from a run here would make the case for the batch size.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/177/head:github-bot/gh-177'
git switch 'github-bot/gh-177'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-177'
git switch 'github-bot/gh-177'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-177'
git switch 'github-bot/gh-177'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-177'
git switch 'main'
git merge --squash 'github-bot/gh-177'
git switch 'main'
git merge --ff-only 'github-bot/gh-177'
git switch 'main'
git merge 'github-bot/gh-177'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.