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/vktory6--VKtory#171
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Flezzonkeys on GitHub · 2026-12-01 23:35 UTC · original
On my machine the current main (
d59b4f8) plays clearly worse than a build on31c20c7: 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):
31c20c731c20c731c20c731c20c7+ PR #146d59b4f8+ PR #146d59b4f8+ PR #146d59b4f8(no PR #146)31c20c7"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):
d59b4f8builds (3 runs)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_TLCAPandUMEM_BINDLOGwere 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
31c20c7andd59b4f8(#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?
@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.31c20c7d59b4f8d59b4f831c20c7d59b4f8runs wait about 1.5–2x longer than both31c20c7runs, 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.
@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.
31c20c7A1d59b4f8B1d59b4f8B231c20c7A2Across 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.
@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. Savert3(house), autopress, 110 s per run, interleaved old/new/new/old.31c20c7d59b4f8d59b4f831c20c7"World windows" are
vkback live:lines with >2 ms/frame recording, as in the report. The remapper column is the cumulativerenderer blocked on one at a presentvalue per stats window, not per frame.So here
d59b4f8is about 1.4 fps (~5%) slower than31c20c7, 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.@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 asd59b4f8); the second only has77a61b9reverted. Onlyvictory.exediffers,libvkback_unix.soand the translator are byte-identical. Order A/B/A, first 66 world seconds of each run (victory_gpu::hostlines in log.txt with at least 1000 draws/frame):08adddc08adddcminus #14108adddc"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_protectnow callsis_viewfor every block it guards, which falls back toVirtualQuerywhenumem_hassays 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 yourd59b4f8logs?I know #141 fixes the crash in #139, so a plain revert is probably not the right fix. I can test a patch.
@TheRifai on GitHub · 2026-12-02 12:12 UTC · original
Answering your question — my
d59b4f8logs do show the same step insending 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 linelines are ~1 s apart in these logs. I took the matched old/new bisect runs from earlier on this issue (main31c20c7, then77a61b9= #141, then7c32096,1befc31,d59b4f8), RX 9070 XT / RADV 26.3.1, Series X 3840x2160, house savert3, warm store, scripted camera walk, 75 s each:31c20c777a61b9(#141)7c32096d59b4f8So #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_protectcallsis_viewfor every block it is about to guard, and with more blocks re-guarded each second theVirtualQueryfallback is on the hot path. The pause shows up as a sending wait, not asslot_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:
d59b4f8run there are exactly 16LIVE_NOT_TITLErefusals, allblock=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 repeatedis_view/VirtualQueryper re-guard.1befc31had 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: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 addsGuards::known_viewso a re-guarded block is not asked ofis_view/VirtualQueryagain, and clears the note on unmap/free so a reused address is re-checked.Paired A/B/B/A against
da2c3b1on 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_TITLEstayed 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.@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 (
VirtualQueryinis_view) for every block they were asked to guard. Under Wine that call walks the region's page bytes withvirtual_mutexheld, 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:
"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.
@TheRifai on GitHub · 2026-12-02 15:52 UTC · original
Retest on the reference card from my side, for the close check. Main
3aea0e4with only the #219 counter added (diagnostic, no behaviour change), RX 9070 XT / RADV 26.3.1, GE-Proton11-16, Series X 3840x2160, housert3, warm store, 100 s with W/I/K/J at 20/45/70/95 s:is_viewcalls: 0/s (0.11 ms/s residual) against 1,286/s and 111.7 ms/s onb447925before the fix, where 56.6% of queries landed in<8Gregions and 31.3% in>=8G(/home/shlong/Documents/VKtory-capture/isview-regions/).LIVE_NOT_TITLEstill 16 (the same0x100000000Wine stack blocks), so #141's crash fix is intact.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.@vktory6 on GitHub · 2026-12-02 16:38 UTC · original
Thanks for the retest:
is_viewcalls 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 on3aea0e4or later, reopen it with the numbers.@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(includes3aea0e4) againstd59b4f8. 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 sinced59b4f8. Stats are thevictory_gpu::hostseconds with ≥1000 draws/frame; sending waits come from the "event stream since the last line" lines.d59b4f893883979388397d59b4f8No 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).