GPU: copy-back reaches write-watched pages under Wine #1831
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1831
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1831/head"
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?
@CaravelaLabs on GitHub · 2026-11-24 23:07 UTC · original
CaravelaLabs:caravela/wine-copy-back→main· +6 −1 · 1 files · 1 commits · closed without mergingUnder 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.
@0xKaji on GitHub · 2026-11-24 23:25 UTC · original
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.@CaravelaLabs on GitHub · 2026-11-25 00:36 UTC · original
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