Linux: ~2x fps, no residency waits under Wine (VICTORY_WAIT_RESIDENT default off there) #40

Open
Timmybread22 wants to merge 1 commit from upstream-pr/40 into main
Timmybread22 commented 2026-12-01 07:22:29 +00:00 (Migrated from github.com)

Imported from Slaktarn700/SlaktarnVI. Originally posted by Timmybread22 on 2026-12-01T07:22:29Z.


About 2x fps on Linux/Proton.

wait_resident() is on everywhere today. Under Wine, vkd3d-proton binds new memory when it is made (there is no later mapping by the system), so each wait is a round trip on our queue for nothing.

This makes the default off under Wine only (crate::shadow::on_wine()); Windows keeps the waits that fixed the device losses of 2026-11-25. VICTORY_WAIT_RESIDENT=1 turns them back on under Wine, =0 still turns them off anywhere.

Measured on current main (CachyOS, Proton Experimental + both patches, RX 6900 XT / RADV Mesa 26.3, Ryzen 9 5900X, preset S70, same save, 2-minute runs, median rendered fps):

runs
main as is 6.7, 3.9
VICTORY_WAIT_RESIDENT=0 12.6, 12.3
this PR, no setting given 12.6

No crashes or device losses in those runs; I have also played with the waits off under Wine for two days.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Slaktarn700/SlaktarnVI:issue:5581029394 --> Imported from [Slaktarn700/SlaktarnVI](https://github.com/Slaktarn700/SlaktarnVI/pull/40). Originally posted by [Timmybread22](https://github.com/Timmybread22) on 2026-12-01T07:22:29Z. --- **About 2x fps on Linux/Proton.** `wait_resident()` is on everywhere today. Under Wine, vkd3d-proton binds new memory when it is made (there is no later mapping by the system), so each wait is a round trip on our queue for nothing. This makes the default **off under Wine only** (`crate::shadow::on_wine()`); Windows keeps the waits that fixed the device losses of 2026-11-25. `VICTORY_WAIT_RESIDENT=1` turns them back on under Wine, `=0` still turns them off anywhere. **Measured on current `main`** (CachyOS, Proton Experimental + both patches, RX 6900 XT / RADV Mesa 26.3, Ryzen 9 5900X, preset S70, same save, 2-minute runs, median rendered fps): | | runs | |---|---| | `main` as is | 6.7, 3.9 | | `VICTORY_WAIT_RESIDENT=0` | 12.6, 12.3 | | this PR, no setting given | 12.6 | No crashes or device losses in those runs; I have also played with the waits off under Wine for two days. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Slaktarn700 commented 2026-12-01 14:56:33 +00:00 (Migrated from github.com)

Imported from Slaktarn700/SlaktarnVI. Originally posted by Slaktarn700 on 2026-12-01T14:56:33Z.


Your finding is right: those waits cost. But turning them off is not safe: our own test of buffers made while the card reads (buffers_made_under_readers, on Proton here) lost the device in 4 of 4 runs without them, so I keep them. What c11828f does instead: small buffers come 64 at a time with one wait (VICTORY_BATCH_BUFFERS=1, the script's default now): 26,000 waits in two minutes became 10,300, 14-16 s added up over threads became 5 s, the same frame rate here. My PC is not CPU-bound the way yours is. Could you try it and say what your frame rate does?

<!-- greyfinch-sync:Slaktarn700/SlaktarnVI:comment:7315079393 --> Imported from [Slaktarn700/SlaktarnVI](https://github.com/Slaktarn700/SlaktarnVI/pull/40#issuecomment-7315079393). Originally posted by [Slaktarn700](https://github.com/Slaktarn700) on 2026-12-01T14:56:33Z. --- Your finding is right: those waits cost. But turning them off is not safe: our own test of buffers made while the card reads (`buffers_made_under_readers`, on Proton here) lost the device in 4 of 4 runs without them, so I keep them. What c11828f does instead: small buffers come 64 at a time with one wait (`VICTORY_BATCH_BUFFERS=1`, the script's default now): 26,000 waits in two minutes became 10,300, 14-16 s added up over threads became 5 s, the same frame rate here. My PC is not CPU-bound the way yours is. Could you try it and say what your frame rate does?
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/40:upstream-pr/40'
git switch 'upstream-pr/40'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/40'
git switch 'upstream-pr/40'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/40'
git switch 'upstream-pr/40'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/40'
git switch 'main'
git merge --squash 'upstream-pr/40'
git switch 'main'
git merge --ff-only 'upstream-pr/40'
git switch 'main'
git merge 'upstream-pr/40'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Slaktarn700/SlaktarnVI!40
No description provided.