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

Closed
github-bot wants to merge 1 commit from github-bot/gh-40 into main AGit
Owner

@⁠Timmybread22 on GitHub · 2026-12-01 07:22 UTC · original
Timmybread22:pr-waitresident → main · +9 −1 · 1 files · 1 commits · closed without merging

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

**@⁠Timmybread22** on GitHub · 2026-12-01 07:22 UTC · [original](https://github.com/Slaktarn700/SlaktarnVI/pull/40) `Timmybread22:pr-waitresident` → `main` · +9 −1 · 1 files · 1 commits · closed without merging **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)
vkd3d-proton binds new memory when it is made, so under Wine every
residency wait was a round trip on our queue for nothing. Same save,
Proton Experimental + patches, RX 6900 XT, Ryzen 9 5900X, S70,
2-minute runs: 6.7 / 3.9 fps median with the waits, 12.6 / 12.3 / 12.6
without. Windows keeps the waits (the device losses of 2026-11-25).
VICTORY_WAIT_RESIDENT=1 turns them back on under Wine.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 07:27:09 +00:00
Author
Owner

@⁠Slaktarn700 on GitHub · 2026-12-01 14:56 UTC · original

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?

**@⁠Slaktarn700** on GitHub · 2026-12-01 14:56 UTC · [original](https://github.com/Slaktarn700/SlaktarnVI/pull/40#issuecomment-7315079393) 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?
Author
Owner

@⁠Slaktarn700 on GitHub · 2026-12-05 03:25 UTC · original

Thank you. Since 2026-12-02 main is on a new base (VIctory-xmem), and the files this changes are not there anymore, so it cannot merge as it is. If the same idea helps on the new base, a new pull request against main is welcome.

**@⁠Slaktarn700** on GitHub · 2026-12-05 03:25 UTC · [original](https://github.com/Slaktarn700/SlaktarnVI/pull/40#issuecomment-7431044945) Thank you. Since 2026-12-02 main is on a new base (VIctory-xmem), and the files this changes are not there anymore, so it cannot merge as it is. If the same idea helps on the new base, a new pull request against main is welcome.
github-bot closed this pull request 2026-12-05 05:02:47 +00:00
Author
Owner

@⁠Slaktarn700 on GitHub · 2026-12-05 05:01 UTC · original

Thank you. The new base (VIctory-xmem, on main since 2026-12-02) has no residency waits at all: the game's memory is mapped straight into the card, so the cost this removed is gone. The code this changes is not there anymore. Closing.

**@⁠Slaktarn700** on GitHub · 2026-12-05 05:01 UTC · [original](https://github.com/Slaktarn700/SlaktarnVI/pull/40#issuecomment-7432306790) Thank you. The new base (VIctory-xmem, on main since 2026-12-02) has no residency waits at all: the game's memory is mapped straight into the card, so the cost this removed is gone. The code this changes is not there anymore. Closing.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.