Wine/Proton: know placeholders from the runtime's own reservations #1601
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!1601
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1601"
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?
@domx4q on GitHub · 2026-11-28 22:15 UTC · original
domx4q:fix/wine-placeholder-fallback→main· +65 −1 · 3 files · 1 commits · merged 2026-11-29 08:16 UTCFollows #207, which was closed for conflicts; this is it rebased on current main.
What it changes
Under Wine and Proton,
watch::placeholder()never recognises a hole as a placeholder:NtQueryVirtualMemory(MemoryRegionInformationEx)withSTATUS_INVALID_INFO_CLASS(0xC0000003), soplaceholder()always returns false.VICTORY_KNOWN_HOLEStherefore has no effect there. Every asking asks again about every hole.VirtualQuerycalls a frame, under the guards' lock. Under Wine each one goes through ntdll's emulation.The change:
STATUS_INVALID_INFO_CLASS,placeholder()answers from the runtime's own placeholder reservations instead.xmem.rsreports eachMEM_RESERVE_PLACEHOLDERreservation throughtitle_placeholder_reserved, andtitle_memory_freedforgets them.How it was tested
cargo testpassed for the crates it touches: not run. victory-gpu and victory-hle only build for Windows here.cargo xwin clippy -p victory --target x86_64-pc-windows-msvc: nothing in the changed files. The 13 warnings it reports are already on main.Checked for overlap
placeholder().@pickles976 on GitHub · 2026-11-29 06:54 UTC · original
Confirmed the Wine-side prerequisite on Wine11/Linux6.17: a standalone CPU probe creates its own placeholder and ordinary reservation, queries both, then frees them. Class7 returns
STATUS_INVALID_INFO_CLASSfor both; class0 and class3 metadata are indistinguishable. This agrees with the mechanism in this PR and rules out a generic MEM_RESERVE heuristic.I adapted your
ee85549b43c63317851bf6799a9285a3a6f5a4demechanism onto our older Wine-support fork. The corrected adaptation is public at cb766636, with the original idea credited. It is not an exact-head test of your patch.The additional lifetime contract matters: a late split/unmap/coalesce notification must not register a placeholder after another thread has released that identity and reused the address as ordinary memory. Origin-only ranges also need to exclude mapped/replaced portions and preserve exact identities for zero-size releases. The adaptation uses range transactions: overlapping transitions wait through publication, disjoint operations can proceed, queries over an in-flight transition conservatively report not-a-hole, and no registry mutex spans native calls or GUARDS acquisition. Failed calls do not publish a successful transition.
Two real-Win32 regressions are included:
watch::tests::runtime_placeholder_events_follow_win32_lifetime: failed operations, split/map/unmap/free, exact zero-size identity and ordinary same-address reuse.watch::tests::structural_placeholder_publication_precedes_release_and_reuse: pause after the native split; a competing release and then ordinary reservation cannot overtake its publication. The final ordinary reservation is not a known placeholder.The four placeholder/mapping fixtures that failed in our preserved baseline now pass. The selected group initially gave53passes/1fixture error: an already exact placeholder need not split again. Correcting that fixture's notification while retaining all replacement/data assertions passed its isolated rerun. Five existing HLE file/alias/window lifecycle cases and a real RTX4060 Laptop stock-vkd3d disk-backed alias/GPU-copy test also pass. Test allocation helpers report the same successful operations as HLE; no assertions were replaced with silent skips.
This supplies Wine correctness/lifetime evidence, not a measured title FPS gain or proof of fixing the separate native allocation/query stalls. The changed title build has not yet run. I would appreciate review of the transaction boundaries, especially the conservative extent used for zero-size releases. No assets, captures or raw mapping addresses are published.