GPU: copy-back reaches write-watched pages under Wine #1829
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1831"
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?
Imported from Marvisak/VIctory. Originally posted by CaravelaLabs on 2026-11-24T23:07:53Z.
Under Wine,
WriteProcessMemoryfails withERROR_PARTIAL_COPYonMEM_WRITE_WATCHpages that have not been written since they were committed. The title's pools are allocated that way.write_mappedleft a failed 4 KiB piece alone, so bytes shaders had written never reached title memory.On main
70564ae,shadow::tests::snapshots_cover_the_declared_ranges_and_writes_go_back_oncefails under Wine 11.22 + vkd3d-proton 3.1: the title bytes stay[0, 0, 0, 0], expected[1, 2, 3, 9]. With this change it passes. A 4 KiB piece that could not be written is read into the page (ReadProcessMemoryinto the destination), which Wine allows. Read-only and unmapped pages are still refused. Pages that could be written take the same path as before.Radeon 8060S, RADV GFX1151, Mesa 25.2.8, Ubuntu 24.04. The device was reached.
victory-gpulibrary tests: 67 passed, 10 failed, 1 ignored. Those 10 are the same Wine compiler and heap-cap failures already on main, not this change. Windows clippy-D warningsis clean for the workspace, with and without--all-features.Not run on native Windows, and not with the title, so how much of the world this changes is not measured. #1215 rewrites this function onto
NtWriteVirtualMemory; that path was not tested. Linux and Proton notes are also in #844; this change is not in that branch.AI-assisted; tests run on this machine.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T23:47:35Z.
Review: COMMENTED
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Copy-back reaches write-watched pages under…: extends the dirty-page/write-watch coverage from #1681 to copy-back paths. Consistent with that work.
Imported from Marvisak/VIctory. Originally posted by 0xKaji on 2026-11-24T23:25:51Z.
Verified
756f641on Linux + Wine11.22+vkd3d-proton 3.2.0(GE-Proton11-14) + NVIDIA RTX 3060 8 GB, cross-built withcargo xwin(x86_64-pc-windows-msvc,VKD3D_DISABLE_EXTENSIONS=VK_NV_raw_access_chains):cargo xtask policy:asset policy: 174 files okcargo xwin clippy -p victory-gpu --tests --target x86_64-pc-windows-msvc --offline -- -D warnings: 0 warningsshadow::tests::snapshots_cover_the_declared_ranges_and_writes_go_back_once --test-threads=1): flips from FAIL on70564ae(left: [0, 0, 0, 0], right: [1, 2, 3, 9]) to PASS on756f641(1 passed, 0 failed,0.65s).Code check:
read()usesReadProcessMemory(GetCurrentProcess(), ...)on the 4 KiB piece, so unmapped/protected pages are still checked safely without faulting. Looks clean.Imported from Marvisak/VIctory. Originally posted by CaravelaLabs on 2026-11-25T00:36:22Z.
Closing this. @jsthope's #322 is on main
4118f33now, andwrite_mappedalready copies throughReadProcessMemory. That is the fallback this patch was adding for Wine.On that main,
snapshots_cover_the_declared_ranges_and_writes_go_back_oncepasses here, 3 of 3. Wine 11.22, vkd3d-proton 3.1, Radeon 8060S (RADV GFX1151, Mesa 25.2.8). The device was reached. The failure on70564ae(title bytes stayed 0) does not reproduce.This head still applies, but the combined result calls that same read twice, and the comment still talks about
WriteProcessMemory. Nothing left to land.Thanks @0xKaji for checking
756f641, and @catminou4 for the look. Those were right for that head.AI-assisted.
Pull request closed