Performance regression on RX 9070 XT: d59b4f8 drops to 9-12 fps where 31c20c7 held 25-30 #171

Closed
opened 2026-12-01 23:37:51 +00:00 by github-bot · 10 comments
Owner

@⁠Flezzonkeys on GitHub · 2026-12-01 23:35 UTC · original

On my machine the current main (d59b4f8) plays clearly worse than a build on 31c20c7: frequent drops to 9-12 fps in the world where the older build mostly stays at 25-30 fps. I went back to the older build and it is fine again.

Setup: RX 9070 XT, Ryzen 7 9800X3D, 32 GB RAM, CachyOS, GE-Proton, Series X, 4K output.

Builds compared (all from my fork; besides upstream they carry small local changes that are off or unrelated: CAS sharpening in the present downscale, an opt-in output-size patch that is off, Series S tiling selection, and in two builds the shader change from PR #146):

Run Build Base Avg fps, first 25 world windows Windows < 15 fps
12-01 20:44 5b32ce3 31c20c7 26.3 0
12-01 21:06 5b32ce3 31c20c7 25.3 0
12-01 21:11 5b32ce3 31c20c7 28.5 0
12-01 22:27 643bfae 31c20c7 + PR #146 19.0 5
12-02 00:14 3642b54 d59b4f8 + PR #146 20.6 4
12-02 00:22 3642b54 d59b4f8 + PR #146 20.6 6
12-02 00:26 859c4ed d59b4f8 (no PR #146) 19.3 8
12-02 00:30 5b32ce3 31c20c7 23.1 1

"World windows" = vkback live: lines with more than 2 ms/frame recording (excludes menus and pauses). The last row is the old build run again right after the slow ones, same session, same system state, and it felt much better in play.

From the stats lines (ms per window, averages over the first 25 world windows):

5b32ce3 (3 runs) d59b4f8 builds (3 runs)
live: remap in queue order: present waits for the remapper 20-22 71-94
present: release what queues hold behind waits 20-23 72-96
live: call Present 107-113 153-174
renderer thread on CPU 1439-2107 1588-1714
live: slot_reads at Execute (index slots) 496-728 515-540

So the renderer's own CPU time is not higher (index slots are a bit cheaper, as #143 measured), but presents wait for the remapper about 3-4x longer. That alone is only ~1 ms per frame though, so I am not sure it explains the drops. VKB_TLCAP and UMEM_BINDLOG were not set.

Caveats, to be fair: these were normal play sessions, not a scripted A/B; the runs do not start at the same spot, and the machine was swapping (zram) in some of them (renderer major page faults up to ~5k per window in the slow windows of some runs, but run 12-02 00:22 had slow windows with almost none). I did not bisect the commits between 31c20c7 and d59b4f8 (#129, #130, #134, #141, #142, #143, the HLE window logging, the VKB_TLCAP hooks). Run logs (vk.log) are available if useful.

Is the remapper wait at presents expected after one of these changes?

**@⁠Flezzonkeys** on GitHub · 2026-12-01 23:35 UTC · [original](https://github.com/vktory6/VKtory/issues/171) On my machine the current main (d59b4f8) plays clearly worse than a build on 31c20c7: frequent drops to 9-12 fps in the world where the older build mostly stays at 25-30 fps. I went back to the older build and it is fine again. **Setup:** RX 9070 XT, Ryzen 7 9800X3D, 32 GB RAM, CachyOS, GE-Proton, Series X, 4K output. **Builds compared** (all from my fork; besides upstream they carry small local changes that are off or unrelated: CAS sharpening in the present downscale, an opt-in output-size patch that is off, Series S tiling selection, and in two builds the shader change from PR #146): | Run | Build | Base | Avg fps, first 25 world windows | Windows < 15 fps | |---|---|---|---|---| | 12-01 20:44 | 5b32ce3 | 31c20c7 | 26.3 | 0 | | 12-01 21:06 | 5b32ce3 | 31c20c7 | 25.3 | 0 | | 12-01 21:11 | 5b32ce3 | 31c20c7 | 28.5 | 0 | | 12-01 22:27 | 643bfae | 31c20c7 + PR #146 | 19.0 | 5 | | 12-02 00:14 | 3642b54 | d59b4f8 + PR #146 | 20.6 | 4 | | 12-02 00:22 | 3642b54 | d59b4f8 + PR #146 | 20.6 | 6 | | 12-02 00:26 | 859c4ed | d59b4f8 (no PR #146) | 19.3 | 8 | | 12-02 00:30 | 5b32ce3 | 31c20c7 | 23.1 | 1 | "World windows" = `vkback live:` lines with more than 2 ms/frame recording (excludes menus and pauses). The last row is the old build run again right after the slow ones, same session, same system state, and it felt much better in play. **From the stats lines (ms per window, averages over the first 25 world windows):** | | 5b32ce3 (3 runs) | d59b4f8 builds (3 runs) | |---|---|---| | live: remap in queue order: present waits for the remapper | 20-22 | 71-94 | | present: release what queues hold behind waits | 20-23 | 72-96 | | live: call Present | 107-113 | 153-174 | | renderer thread on CPU | 1439-2107 | 1588-1714 | | live: slot_reads at Execute (index slots) | 496-728 | 515-540 | So the renderer's own CPU time is not higher (index slots are a bit cheaper, as #143 measured), but presents wait for the remapper about 3-4x longer. That alone is only ~1 ms per frame though, so I am not sure it explains the drops. `VKB_TLCAP` and `UMEM_BINDLOG` were not set. **Caveats, to be fair:** these were normal play sessions, not a scripted A/B; the runs do not start at the same spot, and the machine was swapping (zram) in some of them (renderer major page faults up to ~5k per window in the slow windows of some runs, but run 12-02 00:22 had slow windows with almost none). I did not bisect the commits between 31c20c7 and d59b4f8 (#129, #130, #134, #141, #142, #143, the HLE window logging, the VKB_TLCAP hooks). Run logs (vk.log) are available if useful. Is the remapper wait at presents expected after one of these changes?
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 23:37:51 +00:00
Author
Owner

@⁠tmalik1116 on GitHub · 2026-12-02 01:37 UTC · original

Checked on an RX 6800 XT (RDNA2, RADV, Mesa 26.3.1, 32 GB RAM, no swapping): the fps drop does not reproduce here, but the longer remapper wait does.

Seen on: d59b4f8. Compared against: 31c20c7. Clean builds of both, warm shader store, 300 s auto-press runs into the world from the same save, interleaved A B B A. Same metric as above: vkback live: windows with more than 2 ms/frame recording.

Run Build Avg fps, first 25 world windows Windows < 15 fps Median fps, all world windows "present waits for the remapper", avg ms/window (first 40)
g1 31c20c7 22.0 9 25.6 ~218
b1 d59b4f8 25.0 2 24.9 ~465
b2 d59b4f8 24.3 2 24.2 ~500
g2 31c20c7 25.0 0 24.5 ~308
  • fps: no difference outside the run-to-run spread. g1 was the first run of the session; its slow windows are at the start.
  • Remapper wait: both d59b4f8 runs wait about 1.5–2x longer than both 31c20c7 runs, which matches the 3–4x above in direction. So the wait is real on both GPUs, but on this machine it does not cost frames. One guess, not measured: it may only hurt together with memory pressure (the zram swapping mentioned above).

I haven't bisected, because there is no fps difference here to bisect on. If useful, I can bisect the remapper-wait number across the nine code commits (#129, #130, #132, #134, #141, #142, #143, the HLE window logging, VKB_TLCAP) on this machine.

**@⁠tmalik1116** on GitHub · 2026-12-02 01:37 UTC · [original](https://github.com/vktory6/VKtory/issues/171#issuecomment-7331908612) Checked on an RX 6800 XT (RDNA2, RADV, Mesa 26.3.1, 32 GB RAM, no swapping): **the fps drop does not reproduce here, but the longer remapper wait does.** Seen on: d59b4f8. Compared against: 31c20c7. Clean builds of both, warm shader store, 300 s auto-press runs into the world from the same save, interleaved A B B A. Same metric as above: `vkback live:` windows with more than 2 ms/frame recording. | Run | Build | Avg fps, first 25 world windows | Windows < 15 fps | Median fps, all world windows | "present waits for the remapper", avg ms/window (first 40) | |---|---|---|---|---|---| | g1 | 31c20c7 | 22.0 | 9 | 25.6 | ~218 | | b1 | d59b4f8 | 25.0 | 2 | 24.9 | ~465 | | b2 | d59b4f8 | 24.3 | 2 | 24.2 | ~500 | | g2 | 31c20c7 | 25.0 | 0 | 24.5 | ~308 | - **fps:** no difference outside the run-to-run spread. g1 was the first run of the session; its slow windows are at the start. - **Remapper wait:** both d59b4f8 runs wait about 1.5–2x longer than both 31c20c7 runs, which matches the 3–4x above in direction. So the wait is real on both GPUs, but on this machine it does not cost frames. One guess, not measured: it may only hurt together with memory pressure (the zram swapping mentioned above). I haven't bisected, because there is no fps difference here to bisect on. If useful, I can bisect the remapper-wait number across the nine code commits (#129, #130, #132, #134, #141, #142, #143, the HLE window logging, VKB_TLCAP) on this machine.
Author
Owner

@⁠firefloc on GitHub · 2026-12-02 10:05 UTC · original

I ran an A/B/B/A on an RX 7900 XTX (RADV, 7800X3D, GE-Proton 11-14, Series X at 3840×2160 into a 3440×1440 window). Each 125 s launch used the same prison-cell save, a separate copy of the same warm cache, and the same Windows executable. Only the Unix Vulkan backend changed. Frame metrics are for the first 45 s after the world marker, excluding frames with fresh shader work. Remap percentiles use the full trace.

Backend Mean FPS Frame p99 Renderer hands off → release p99 Remapper takes → ack p99
31c20c7 A1 10.47 520.9 ms 57.4 ms 175.0 ms
d59b4f8 B1 9.74 481.2 ms 39.4 ms 181.2 ms
d59b4f8 B2 10.45 534.9 ms 42.4 ms 173.0 ms
31c20c7 A2 9.72 495.7 ms 38.0 ms 179.4 ms

Across 14 comparable renderer stats windows after the marker, cumulative present-block time per window averaged 804 and 888 ms on the old backend and 896 and 762 ms on the new one. Release-to-take was 0.47–0.60 ms at p99. All observed takes were single-remap batches. Most of the remap time was between take and acknowledgement.

I did not reproduce the reported FPS drop or a consistent increase in remapper wait in this scene. The host was actively swapping, one A2 frame translated a shader, and this compares backends in isolation. The reported RX 9070 XT, route, and 4K output still need a matched run. I also reproduced a separate release-order race in the proposed optimisation and posted its reproducer on PR #199.

**@⁠firefloc** on GitHub · 2026-12-02 10:05 UTC · [original](https://github.com/vktory6/VKtory/issues/171#issuecomment-7341943485) I ran an A/B/B/A on an RX 7900 XTX (RADV, 7800X3D, GE-Proton 11-14, Series X at 3840×2160 into a 3440×1440 window). Each 125 s launch used the same prison-cell save, a separate copy of the same warm cache, and the same Windows executable. Only the Unix Vulkan backend changed. Frame metrics are for the first 45 s after the world marker, excluding frames with fresh shader work. Remap percentiles use the full trace. | Backend | Mean FPS | Frame p99 | Renderer hands off → release p99 | Remapper takes → ack p99 | | --- | ---: | ---: | ---: | ---: | | `31c20c7` A1 | 10.47 | 520.9 ms | 57.4 ms | 175.0 ms | | `d59b4f8` B1 | 9.74 | 481.2 ms | 39.4 ms | 181.2 ms | | `d59b4f8` B2 | 10.45 | 534.9 ms | 42.4 ms | 173.0 ms | | `31c20c7` A2 | 9.72 | 495.7 ms | 38.0 ms | 179.4 ms | Across 14 comparable renderer stats windows after the marker, cumulative present-block time per window averaged 804 and 888 ms on the old backend and 896 and 762 ms on the new one. Release-to-take was 0.47–0.60 ms at p99. All observed takes were single-remap batches. Most of the remap time was between take and acknowledgement. I did not reproduce the reported FPS drop or a consistent increase in remapper wait in this scene. The host was actively swapping, one A2 frame translated a shader, and this compares backends in isolation. The reported RX 9070 XT, route, and 4K output still need a matched run. I also reproduced a separate release-order race in the proposed optimisation and posted its reproducer on [PR #199](https://git.gtahub.st/github/vktory6--VKtory/pulls/199).
Author
Owner

@⁠TheRifai on GitHub · 2026-12-02 10:28 UTC · original

A matched A/B/B/A on the same hardware as the report, with clean builds and the same save, adds a data point. Setup: RX 9070 XT / RADV 26.3.1, Ryzen 5 9600X, 32 GB, CachyOS, GE-Proton11-16, Series X, 3840x2160, warm shader store, no PR #146, no VKB_TLCAP/UMEM_BINDLOG. Save rt3 (house), autopress, 110 s per run, interleaved old/new/new/old.

Run Build World windows Mean fps (first 25) p50 min windows <15 fps Recorder+submit ms/window Remapper-block ms/window (first 40, cumulative)
A1 31c20c7 38 28.90 29.9 18.7 0 11.04 1013
B1 d59b4f8 33 27.14 27.8 15.9 0 10.42 1142
B2 d59b4f8 35 27.79 28.5 18.6 0 9.86 958
A2 31c20c7 37 28.76 29.7 18.4 0 11.15 787

"World windows" are vkback live: lines with >2 ms/frame recording, as in the report. The remapper column is the cumulative renderer blocked on one at a present value per stats window, not per frame.

So here d59b4f8 is about 1.4 fps (~5%) slower than 31c20c7, and its remapper waits are higher in both pairs (+13% A1→B1, +22% B2→A2), matching the direction of both earlier reports. But there were no windows under 15 fps in any arm; the reported 9-12 fps drops did not reproduce with clean builds, this save, or GE-Proton11-16. Recorder+submit time is slightly lower on the new build, so the small loss is not from the renderer's own work. This is consistent with tmalik1116's and firefloc's results: the longer remap wait is real across cards but only costs frames under additional memory pressure or with local changes such as PR #146.

Logs: /home/shlong/Documents/VKtory-capture/reg171b-{A1,B1,B2,A2}/. No code change from me; this is a measurement only.

**@⁠TheRifai** on GitHub · 2026-12-02 10:28 UTC · [original](https://github.com/vktory6/VKtory/issues/171#issuecomment-7342530321) A matched A/B/B/A on the same hardware as the report, with clean builds and the same save, adds a data point. Setup: RX 9070 XT / RADV 26.3.1, Ryzen 5 9600X, 32 GB, CachyOS, GE-Proton11-16, Series X, 3840x2160, warm shader store, no PR #146, no `VKB_TLCAP`/`UMEM_BINDLOG`. Save `rt3` (house), autopress, 110 s per run, interleaved old/new/new/old. | Run | Build | World windows | Mean fps (first 25) | p50 | min | windows <15 fps | Recorder+submit ms/window | Remapper-block ms/window (first 40, cumulative) | |---|---|---:|---:|---:|---:|---:|---:|---:| | A1 | `31c20c7` | 38 | 28.90 | 29.9 | 18.7 | 0 | 11.04 | 1013 | | B1 | `d59b4f8` | 33 | 27.14 | 27.8 | 15.9 | 0 | 10.42 | 1142 | | B2 | `d59b4f8` | 35 | 27.79 | 28.5 | 18.6 | 0 | 9.86 | 958 | | A2 | `31c20c7` | 37 | 28.76 | 29.7 | 18.4 | 0 | 11.15 | 787 | "World windows" are `vkback live:` lines with >2 ms/frame recording, as in the report. The remapper column is the cumulative `renderer blocked on one at a present` value per stats window, not per frame. So here `d59b4f8` is about 1.4 fps (~5%) slower than `31c20c7`, and its remapper waits are higher in both pairs (+13% A1→B1, +22% B2→A2), matching the direction of both earlier reports. But there were **no windows under 15 fps** in any arm; the reported 9-12 fps drops did not reproduce with clean builds, this save, or GE-Proton11-16. Recorder+submit time is slightly lower on the new build, so the small loss is not from the renderer's own work. This is consistent with tmalik1116's and firefloc's results: the longer remap wait is real across cards but only costs frames under additional memory pressure or with local changes such as PR #146. Logs: `/home/shlong/Documents/VKtory-capture/reg171b-{A1,B1,B2,A2}/`. No code change from me; this is a measurement only.
Author
Owner

@⁠Flezzonkeys on GitHub · 2026-12-02 11:59 UTC · original

Thanks for the measurements. I repeated this with clean builds (no local changes, no PR #146), and on my machine the drops come from #141 (77a61b9).

Both builds are 08adddc (same code as d59b4f8); the second only has 77a61b9 reverted. Only victory.exe differs, libvkback_unix.so and the translator are byte-identical. Order A/B/A, first 66 world seconds of each run (victory_gpu::host lines in log.txt with at least 1000 draws/frame):

Run Build Avg fps Median p10 Seconds < 15 fps sending waits per wait
1 08adddc 13.1 11.8 7.8 74% 264 ms/s 8.9 ms
2 08adddc minus #141 21.6 21.8 19.6 3% 8 ms/s 0.5 ms
3 08adddc 13.0 13.1 9.3 73% 237 ms/s 6.4 ms

"sending waits" is from the "event stream since the last line" lines in log.txt.

Caveats: I played these by hand, so the route was not scripted, and there is only one run without #141. The machine had several GB in zram swap in all of this.

Possible cause, not proven: live_protect now calls is_view for every block it guards, which falls back to VirtualQuery when umem_has says no, and about 10-20k blocks/s are guarded again here.

Correction to my report: I run Proton Experimental (experimental-11.0-20261123b), not GE-Proton. That may be one difference to your setups.

@⁠firefloc: your A/B kept the same victory.exe, so it could not show this one. @⁠tmalik1116, @⁠TheRifai: what do the "sending waits" look like in your d59b4f8 logs?

I know #141 fixes the crash in #139, so a plain revert is probably not the right fix. I can test a patch.

**@⁠Flezzonkeys** on GitHub · 2026-12-02 11:59 UTC · [original](https://github.com/vktory6/VKtory/issues/171#issuecomment-7344696337) Thanks for the measurements. I repeated this with clean builds (no local changes, no PR #146), and on my machine the drops come from #141 (77a61b9). Both builds are 08adddc (same code as d59b4f8); the second only has 77a61b9 reverted. Only `victory.exe` differs, `libvkback_unix.so` and the translator are byte-identical. Order A/B/A, first 66 world seconds of each run (`victory_gpu::host` lines in log.txt with at least 1000 draws/frame): | Run | Build | Avg fps | Median | p10 | Seconds < 15 fps | sending waits | per wait | |---|---|---:|---:|---:|---:|---:|---:| | 1 | 08adddc | 13.1 | 11.8 | 7.8 | 74% | 264 ms/s | 8.9 ms | | 2 | 08adddc minus #141 | 21.6 | 21.8 | 19.6 | 3% | 8 ms/s | 0.5 ms | | 3 | 08adddc | 13.0 | 13.1 | 9.3 | 73% | 237 ms/s | 6.4 ms | "sending waits" is from the "event stream since the last line" lines in log.txt. Caveats: I played these by hand, so the route was not scripted, and there is only one run without #141. The machine had several GB in zram swap in all of this. Possible cause, not proven: `live_protect` now calls `is_view` for every block it guards, which falls back to `VirtualQuery` when `umem_has` says no, and about 10-20k blocks/s are guarded again here. Correction to my report: I run Proton Experimental (experimental-11.0-20261123b), not GE-Proton. That may be one difference to your setups. @⁠firefloc: your A/B kept the same `victory.exe`, so it could not show this one. @⁠tmalik1116, @⁠TheRifai: what do the "sending waits" look like in your d59b4f8 logs? I know #141 fixes the crash in #139, so a plain revert is probably not the right fix. I can test a patch.
Author
Owner

@⁠TheRifai on GitHub · 2026-12-02 12:12 UTC · original

Answering your question — my d59b4f8 logs do show the same step in sending waits, just much smaller than on your machine (I used GE-Proton11-16, not Experimental; you noted that as a difference).

The vkback standalone event stream since the last line lines are ~1 s apart in these logs. I took the matched old/new bisect runs from earlier on this issue (main 31c20c7, then 77a61b9 = #141, then 7c32096, 1befc31, d59b4f8), RX 9070 XT / RADV 26.3.1, Series X 3840x2160, house save rt3, warm store, scripted camera walk, 75 s each:

Build Windows Sending waits / s (mean / median / max) Sending wait ms / s (mean / median / max) Blocks guarded again / s (mean / median)
31c20c7 68 8 / 6 / 36 6 / 3 / 117 7,991 / 5,702
77a61b9 (#141) 68 14 / 16 / 39 53 / 21 / 943 13,264 / 12,020
7c32096 67 12 / 14 / 32 57 / 14 / 603 11,664 / 9,259
d59b4f8 67 14 / 16 / 46 61 / 22 / 651 13,753 / 11,478

So #141 raises sending waits from ~6 to ~53-61 ms/s and raises re-guard volume from ~8k to ~13-14k blocks/s. That fits your hypothesis: live_protect calls is_view for every block it is about to guard, and with more blocks re-guarded each second the VirtualQuery fallback is on the hot path. The pause shows up as a sending wait, not as slot_reads (which stayed ~6-7 ms per slow frame in my runs) — which is why my earlier A/B/B/A saw only ~5% fps loss instead of your larger drop.

Two details that may matter for a patch:

  • In my d59b4f8 run there are exactly 16 LIVE_NOT_TITLE refusals, all block=0x100000000 (the Wine stacks #140). So the filter itself is rarely declining a block; the cost is re-checking blocks it accepts, 13-14k times/s. A memo of blocks already known to be title memory (and of the refused ones) would keep #141's crash fix while avoiding a repeated is_view/VirtualQuery per re-guard.
  • 1befc31 had an anomalous median of 1 sending wait/s and only 2,974 blocks guarded again/s in one run (different scene composition at the end of the walk); I would not use that arm for the comparison.

Evidence: /home/shlong/Documents/VKtory-capture/bisect-{old,current}/ and /home/shlong/Documents/VKtory-capture/bisect{77,7c3209,1befc3}/.

**@⁠TheRifai** on GitHub · 2026-12-02 12:12 UTC · [original](https://github.com/vktory6/VKtory/issues/171#issuecomment-7345003260) Answering your question — my `d59b4f8` logs do show the same step in `sending waits`, just much smaller than on your machine (I used GE-Proton11-16, not Experimental; you noted that as a difference). The `vkback standalone event stream since the last line` lines are ~1 s apart in these logs. I took the matched old/new bisect runs from earlier on this issue (main `31c20c7`, then `77a61b9` = #141, then `7c32096`, `1befc31`, `d59b4f8`), RX 9070 XT / RADV 26.3.1, Series X 3840x2160, house save `rt3`, warm store, scripted camera walk, 75 s each: | Build | Windows | Sending waits / s (mean / median / max) | Sending wait ms / s (mean / median / max) | Blocks guarded again / s (mean / median) | |---|---:|---:|---:|---:| | `31c20c7` | 68 | 8 / 6 / 36 | 6 / 3 / 117 | 7,991 / 5,702 | | `77a61b9` (#141) | 68 | 14 / 16 / 39 | 53 / 21 / 943 | 13,264 / 12,020 | | `7c32096` | 67 | 12 / 14 / 32 | 57 / 14 / 603 | 11,664 / 9,259 | | `d59b4f8` | 67 | 14 / 16 / 46 | 61 / 22 / 651 | 13,753 / 11,478 | So #141 raises sending waits from ~6 to ~53-61 ms/s and raises re-guard volume from ~8k to ~13-14k blocks/s. That fits your hypothesis: `live_protect` calls `is_view` for every block it is about to guard, and with more blocks re-guarded each second the `VirtualQuery` fallback is on the hot path. The pause shows up as a sending wait, not as `slot_reads` (which stayed ~6-7 ms per slow frame in my runs) — which is why my earlier A/B/B/A saw only ~5% fps loss instead of your larger drop. Two details that may matter for a patch: - In my `d59b4f8` run there are exactly **16** `LIVE_NOT_TITLE` refusals, all `block=0x100000000` (the Wine stacks #140). So the filter itself is rarely declining a block; the cost is re-checking blocks it accepts, 13-14k times/s. A memo of blocks already known to be title memory (and of the refused ones) would keep #141's crash fix while avoiding a repeated `is_view`/`VirtualQuery` per re-guard. - `1befc31` had an anomalous median of 1 sending wait/s and only 2,974 blocks guarded again/s in one run (different scene composition at the end of the walk); I would not use that arm for the comparison. Evidence: `/home/shlong/Documents/VKtory-capture/bisect-{old,current}/` and `/home/shlong/Documents/VKtory-capture/bisect{77,7c3209,1befc3}/`.
Author
Owner

@⁠TheRifai on GitHub · 2026-12-02 12:33 UTC · original

Follow-up to my numbers above: I put the memo idea into PR #208 (GPU: remember guarded title blocks, keep the #141 crash fix). It adds Guards::known_view so a re-guarded block is not asked of is_view/VirtualQuery again, and clears the note on unmap/free so a reused address is re-checked.

Paired A/B/B/A against da2c3b1 on the same house save: main 27.15/26.93 fps and 45.1/51.5 ms/s of sending waits; patched 28.99/29.43 fps and 37.2/32.7 ms/s, with 183/177 -> 112/100 slow frames. LIVE_NOT_TITLE stayed at 16 in all runs (the same Wine stack blocks), so the #139 fix is intact. Static runs show the same direction. Full numbers and checklist are on the PR. No plain revert — #141 stays.

**@⁠TheRifai** on GitHub · 2026-12-02 12:33 UTC · [original](https://github.com/vktory6/VKtory/issues/171#issuecomment-7345525663) Follow-up to my numbers above: I put the memo idea into PR #208 (`GPU: remember guarded title blocks, keep the #141 crash fix`). It adds `Guards::known_view` so a re-guarded block is not asked of `is_view`/`VirtualQuery` again, and clears the note on unmap/free so a reused address is re-checked. Paired A/B/B/A against `da2c3b1` on the same house save: main 27.15/26.93 fps and 45.1/51.5 ms/s of sending waits; patched 28.99/29.43 fps and 37.2/32.7 ms/s, with 183/177 -> 112/100 slow frames. `LIVE_NOT_TITLE` stayed at 16 in all runs (the same Wine stack blocks), so the #139 fix is intact. Static runs show the same direction. Full numbers and checklist are on the PR. No plain revert — #141 stays.
Author
Owner

@⁠vktory6 on GitHub · 2026-12-02 15:41 UTC · original

Fixed on main: github.com/vktory6/VKtory@3aea0e4. Thanks to Flezzonkeys for the bisect to #141 and the Wine trace, to TheRifai for the counter (#219) and the first memo (#208), and to tmalik1116 and firefloc for the measurements on other cards.

The cause: since #141 the live guards asked Windows (VirtualQuery in is_view) for every block they were asked to guard. Under Wine that call walks the region's page bytes with virtual_mutex held, about 100 µs each. Blocks are guarded again thousands of times a second while the world streams in, and every thread that touches memory waited on that mutex. The guards now answer from the runtime's own record of the title's memory, with no Windows call. Wine's thread stacks stay unguarded (#141's crash fix is kept, and its test covers both cases).

A B B A on an RX 9070 XT, boat start, 141 world seconds each:

run build fps
a1 main fbf3e9d 13.54
b1 fix 25.01
b2 fix 26.38
a2 main fbf3e9d 14.18

"sending waits" in the stats line went from up to 174 ms a second to under 1 ms. No device loss, no refused-block lines in either build.

Please retest on your machines; I'll close this once one of you confirms.

**@⁠vktory6** on GitHub · 2026-12-02 15:41 UTC · [original](https://github.com/vktory6/VKtory/issues/171#issuecomment-7350763689) Fixed on main: https://github.com/vktory6/VKtory/commit/3aea0e4. Thanks to Flezzonkeys for the bisect to #141 and the Wine trace, to TheRifai for the counter (#219) and the first memo (#208), and to tmalik1116 and firefloc for the measurements on other cards. The cause: since #141 the live guards asked Windows (`VirtualQuery` in `is_view`) for every block they were asked to guard. Under Wine that call walks the region's page bytes with `virtual_mutex` held, about 100 µs each. Blocks are guarded again thousands of times a second while the world streams in, and every thread that touches memory waited on that mutex. The guards now answer from the runtime's own record of the title's memory, with no Windows call. Wine's thread stacks stay unguarded (#141's crash fix is kept, and its test covers both cases). A B B A on an RX 9070 XT, boat start, 141 world seconds each: | run | build | fps | |---|---|---| | a1 | main fbf3e9d | 13.54 | | b1 | fix | 25.01 | | b2 | fix | 26.38 | | a2 | main fbf3e9d | 14.18 | "sending waits" in the stats line went from up to 174 ms a second to under 1 ms. No device loss, no refused-block lines in either build. Please retest on your machines; I'll close this once one of you confirms.
Author
Owner

@⁠TheRifai on GitHub · 2026-12-02 15:52 UTC · original

Retest on the reference card from my side, for the close check. Main 3aea0e4 with only the #219 counter added (diagnostic, no behaviour change), RX 9070 XT / RADV 26.3.1, GE-Proton11-16, Series X 3840x2160, house rt3, warm store, 100 s with W/I/K/J at 20/45/70/95 s:

  • is_view calls: 0/s (0.11 ms/s residual) against 1,286/s and 111.7 ms/s on b447925 before the fix, where 56.6% of queries landed in <8G regions and 31.3% in >=8G (/home/shlong/Documents/VKtory-capture/isview-regions/).
  • sending waits: 5.5 ms/s against 48-59 ms/s before.
  • LIVE_NOT_TITLE still 16 (the same 0x100000000 Wine stack blocks), so #141's crash fix is intact.
  • mean fps 28.04 over the 40 host windows after startup.

No new loud kinds and no device loss. Evidence: /home/shlong/Documents/VKtory-capture/isview-after-main-fix/. That matches your A/B and the trace conclusion; from this card the issue is fixed.

**@⁠TheRifai** on GitHub · 2026-12-02 15:52 UTC · [original](https://github.com/vktory6/VKtory/issues/171#issuecomment-7351083972) Retest on the reference card from my side, for the close check. Main `3aea0e4` with only the #219 counter added (diagnostic, no behaviour change), RX 9070 XT / RADV 26.3.1, GE-Proton11-16, Series X 3840x2160, house `rt3`, warm store, 100 s with W/I/K/J at 20/45/70/95 s: - `is_view` calls: **0/s** (0.11 ms/s residual) against 1,286/s and 111.7 ms/s on `b447925` before the fix, where 56.6% of queries landed in `<8G` regions and 31.3% in `>=8G` (`/home/shlong/Documents/VKtory-capture/isview-regions/`). - sending waits: **5.5 ms/s** against 48-59 ms/s before. - `LIVE_NOT_TITLE` still 16 (the same `0x100000000` Wine stack blocks), so #141's crash fix is intact. - mean fps 28.04 over the 40 host windows after startup. No new loud kinds and no device loss. Evidence: `/home/shlong/Documents/VKtory-capture/isview-after-main-fix/`. That matches your A/B and the trace conclusion; from this card the issue is fixed.
Author
Owner

@⁠vktory6 on GitHub · 2026-12-02 16:38 UTC · original

Thanks for the retest: is_view calls 1,286/s → 0, sending waits 48–59 → 5.5 ms/s, the Wine stack blocks still refused, no device loss. That matches the A/B here, so I'm closing this. Flezzonkeys, if your machine still shows a drop on 3aea0e4 or later, reopen it with the numbers.

**@⁠vktory6** on GitHub · 2026-12-02 16:38 UTC · [original](https://github.com/vktory6/VKtory/issues/171#issuecomment-7352236902) Thanks for the retest: `is_view` calls 1,286/s → 0, sending waits 48–59 → 5.5 ms/s, the Wine stack blocks still refused, no device loss. That matches the A/B here, so I'm closing this. Flezzonkeys, if your machine still shows a drop on 3aea0e4 or later, reopen it with the numbers.
Author
Owner

@⁠tmalik1116 on GitHub · 2026-12-02 17:28 UTC · original

Retest on a third card (I'm an agent working for tmalik1116; numbers from the runs below): fixed here too.

Seen on: main 9388397 (includes 3aea0e4) against d59b4f8. RX 6800 XT, RADV 26.3.1, 5700X3D, CachyOS, Series X, own save (world scene, auto-press), warm store, 200 s per run, interleaved A B B A. Both arms are complete builds (victory.exe and backend), so B also carries the other commits since d59b4f8. Stats are the victory_gpu::host seconds with ≥1000 draws/frame; sending waits come from the "event stream since the last line" lines.

run build world s mean fps median p10 s < 15 fps GPU ms sending waits median (max), ms/s
A1 d59b4f8 132 14.2 12.9 3.5 71 53.2 45.6 (1261)
B1 9388397 148 19.2 19.5 6.3 47 51.0 2.8 (34)
B2 9388397 152 19.9 20.5 8.2 45 47.8 3.1 (50)
A2 d59b4f8 139 14.1 12.8 4.1 78 53.0 66.9 (824)

No device loss. Every loud kind in all four runs has an owner in TASKS.md (per-lane branches, null buffer views; B1/B2 also had 12 "past its title memory (tail reads 0)" and 3 "buffer view of an unknown buffer" hits, both owned).

**@⁠tmalik1116** on GitHub · 2026-12-02 17:28 UTC · [original](https://github.com/vktory6/VKtory/issues/171#issuecomment-7353346185) Retest on a third card (I'm an agent working for tmalik1116; numbers from the runs below): fixed here too. **Seen on:** main 9388397 (includes 3aea0e4) against d59b4f8. RX 6800 XT, RADV 26.3.1, 5700X3D, CachyOS, Series X, own save (world scene, auto-press), warm store, 200 s per run, interleaved A B B A. Both arms are complete builds (victory.exe and backend), so B also carries the other commits since d59b4f8. Stats are the `victory_gpu::host` seconds with ≥1000 draws/frame; sending waits come from the "event stream since the last line" lines. | run | build | world s | mean fps | median | p10 | s < 15 fps | GPU ms | sending waits median (max), ms/s | |---|---|---|---|---|---|---|---|---| | A1 | d59b4f8 | 132 | 14.2 | 12.9 | 3.5 | 71 | 53.2 | 45.6 (1261) | | B1 | 9388397 | 148 | 19.2 | 19.5 | 6.3 | 47 | 51.0 | 2.8 (34) | | B2 | 9388397 | 152 | 19.9 | 20.5 | 8.2 | 45 | 47.8 | 3.1 (50) | | A2 | d59b4f8 | 139 | 14.1 | 12.8 | 4.1 | 78 | 53.0 | 66.9 (824) | No device loss. Every loud kind in all four runs has an owner in TASKS.md (per-lane branches, null buffer views; B1/B2 also had 12 "past its title memory (tail reads 0)" and 3 "buffer view of an unknown buffer" hits, both owned).
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/vktory6--VKtory#171
No description provided.