Repository navigation
Conversation
(cherry picked from commit 08e3d3011653a057cea3691d52be7777fc0d7a74)
The in-process copy is new on this branch and untested on Windows here, so it starts off: VICTORY_DIRECT_COPY=1 turns it on, as in the Linux/Proton report of issue PastiiJay#19.
With VICTORY_DIRECT_COPY=1 the in-process copy's exception handler only caught access violations and in-page errors. A guard page in title memory (STATUS_GUARD_PAGE_VIOLATION, 0x80000001) went unhandled and ended the process (Shadow::copy -> copy_mapped -> read -> try_copy; also klbf-lab issue PastiiJay#19's crash). It now fails the copy like an unreadable page and sets the guard flag again, since raising the fault cleared it. Test: direct_copy_fails_on_a_guard_page_and_keeps_it_guarded (the test process dies without the fix, passes with it, under Proton Experimental).
|
Thanks a lot @zocram4cc for opening these! It's great to have the Wine/Proton side covered. I'll test that nothing changes on Windows (the switch is off by default, right?) and report back here. |
|
Yes, it stays off by default. Only With the switch off, on Windows:
The one change on the default path is in Thanks for testing on Windows! |
|
Perfect, thanks for the precise answer @zocram4cc. That's exactly what I wanted to check. I'll run it with the switch off on our RX 9070 XT to confirm nothing moves, then merge. |
|
@zocram4cc I've added a "Playing on Linux / Proton?" box at the top of both READMEs (main and beta) pointing Linux players to your work (#34, #35) and asking them to tag you with their results. Thanks for leading the Linux side! |
Under Wine/Proton, putting back what shaders wrote is the slowest part of a world frame: Wine's
NtWriteVirtualMemorysends every byte through wineserver, even for the calling process (write_process_memoryrequest indlls/ntdll/unix/virtual.c), so copy-back takes seconds a frame and wineserver sits at ~70 % of a core with the GPU idle. This is the report in #19.Change
GPU: use VEH-guarded in-process copy for copy_mapped and write_mapped: the commit of GPU: use VEH-guarded in-process copy for copy_mapped and write_mapped (#118) fxceless/victory-fork#154 by @BitWuehler, cherry-picked unchanged (authorship kept). Reads and copy-back copy in-process; a vectored handler turns a fault inside the copy into a failed copy, as the kernel calls report it.VICTORY_DIRECT_COPY=1turns it on; without it nothing changes (Windows behaviour untouched).STATUS_GUARD_PAGE_VIOLATION. Title memory has guard pages, so with the copy on the process ended withunhandled exception 0x80000001after a minute or two in the world (Shadow::copy→copy_mapped→read→try_copy, symbolised from the PDB). This is the crash in Linux/Proton RX 7800 XT: stack-overflow workaround reaches 3D, but frame times remain seconds and lighting is inconsistent #19's second run. A guard page now fails the copy like an unreadable page, and the guard flag is set again (the fault that reported it cleared it), so the title still sees its own first touch.Tests (Proton Experimental 11.0-20261112, cross-built with cargo-xwin)
direct_copy_fails_on_a_guard_page_and_keeps_it_guarded: the test process dies without the fix, passes with it.write_mapped_skips_unmapped_and_readonly_pages_and_marks_write_watchpasses with and withoutVICTORY_DIRECT_COPY=1.benchmark_direct_copy_vs_kernel_calls(--ignored --nocapture, under Wine): 64 KiB writes NtWriteVirtualMemory 1,221 MB/s vs in-process 42,068 MB/s; 256 MB read 6.0 vs 10.1 GB/s.In game (RX 6900 XT, RADV / Mesa 26.3.1, Proton Experimental, Series X, scripted input, fresh profile; world medians of a per-second frame-time log)
Measured on a build of 553bd7c with the Wine fixes listed in #19; the copy path is the same as on this branch.
VICTORY_DIRECT_COPY=1VICTORY_DIRECT_COPY=1+ guard fixThe run with the fix then stopped at the title's own breakpoint
+0x5149aec(INSTANCE_LISTpool full, Marvisak/VIctory#698), which is unrelated.Not tested on Windows. Off by default, so Windows runs are unchanged unless the switch is set.
No game files, logs or dumps attached. AI-assisted (Claude Code); runs and measurements on my machine.