GPU: under Wine, write title memory without a wineserver request #256
No reviewers
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/fxceless--victory-fork!256
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-256"
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?
@yayameowmeow on GitHub · 2026-11-24 23:01 UTC · original
yayameowmeow:linux/wine-self-writes→main· +65 −1 · 1 files · 1 commits · openProblem
Under Wine (Linux, Proton),
write_mappedsends a wineserver request for every write. It puts shader results back into title memory withNtWriteVirtualMemory, orWriteProcessMemorywithVICTORY_DIRECT_WRITES=0. On Windows that is a kernel copy. Wine implements both as the server requestwrite_process_memory, which writes/proc/<pid>/mem, even when the process writes into itself. wineserver is one thread, and the process's other server calls (mappings, handles, timers) queue behind it.Counted with
WINEDEBUG=+serverin the opening gameplay scene (Wine 11.20, RX 7900 XTX / RADV): 3,400–24,000write_process_memoryrequests per 30 s.Fix
Under Wine (
ntdll!wine_get_versionpresent), the write becomes a read of our own process, from the host copy into the title page:ReadProcessMemory(GetCurrentProcess(), host, title, n).VICTORY_WINE_WRITES=0restores the old call.Verification
write_process_memoryno longer appears among the server requests (same scene,+servercount).map_view/unmap_view. Its per-process view list is searched linearly, which this PR doesn't address. With that also fixed locally, the scene runs at 0.6–0.9 s per frame instead of 2–6 s, but that number belongs to both changes.host::writes::writes_skip_pages_that_are_not_mapped: writes across two committed 64 KiB blocks around an uncommitted one and checks the committed ones got the bytes. Passes under Wine on both paths, the default andVICTORY_WINE_WRITES=0.cargo clippy --workspace --all-targets --locked -- -D warningsand the same with--all-featuresare clean (cross-built with cargo-xwin).cargo test -p victory-gpuunder Wine gives 107 passed, 4 failed. The same 4 fail on unmodifiedmainunder Wine: argument clamp, depth-plane twin, pipeline library, scratch reuse. Those are the Wine shader-compiler issues covered by #20 / #127. I couldn't run the suite on Windows.🤖 Generated with Claude Code
@Filip722 on GitHub · 2026-11-26 01:20 UTC · original
I tested
d945776under GE-Proton11-14 on Bazzite 44, vkd3d-protoncae8353ed7959c4+, and an RTX 5060 Laptop GPU with NVIDIA 615.78.08. The local integration is based ondc4c0fcand adds copy-back timing. The mapped–unmapped–mapped writes test passed with each API selected, and the title log confirmedwine_runtime=trueand the expected API in both launches.The two offline Series S runs used the same binary, warm seed, memory/VRAM limits and NVMe caps. Four comparable post-upscale opening frames wrote about 0.8–4.5 MB each. With the legacy
NtWriteVirtualMemorypath their copy-back times were 3.03, 2.98, 9.64 and 10.14 s. With Wine's in-processReadProcessMemorypath the corresponding observations were 0.52, 0.56, 0.67 and 0.45 s. Median copy-back wall time across those four frames fell from 6.33 s to 0.54 s. The control's minimum free-disk reserve was reduced for replay and was inactive through the measured frames.The in-process run returned 58 post-upscale Presents and rendered the opening sequence. It ended on the local NVMe contention guard. This was one run per API and its performance measurements cover copy-back during the opening.
Codex assisted with the integration and tests.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.