Known holes under Wine: a placeholder told by VirtualQuery when class 7 is not answered (#59) #200

Open
github-bot wants to merge 1 commit from github-bot/gh-200 into main AGit
Owner

@⁠amine23012004 on GitHub · 2026-11-26 11:22 UTC · original
amine23012004:fix/wine-placeholder-fallback → main · +33 −1 · 1 files · 1 commits · open

Known holes under Wine: a placeholder told by VirtualQuery when class 7 is not answered (#59)

Problem. Wine answers NtQueryVirtualMemory class 7 with STATUS_INVALID_INFO_CLASS, so watch::placeholder was false for every block: no hole was ever known and each block was asked about at every asking — 13,000–23,000 VirtualQuery calls a frame behind Wine's single virtual-memory lock (#59).

Fix. Only when class 7 fails with STATUS_INVALID_INFO_CLASS, a block counts as a placeholder if VirtualQuery says it is MEM_RESERVE + MEM_PRIVATE + AllocationProtect == PAGE_NOACCESS over the whole block (the only protection MEM_RESERVE_PLACEHOLDER takes). Plain read-write or SEC_RESERVE reservations don't pass, so an ordinary VirtualAlloc commit there is still seen. Windows answers class 7: unchanged there. One file, crates/victory-gpu/src/watch.rs.

This is the version with @⁠zocram4cc's correction from #59 (the first fallback made any MEM_RESERVE page a hole and broke 4 watch:: tests under Proton). Their measurements on Proton / RX 6900 XT: questions about holes 18,520 → 2 a frame, copies 49.4 → ~34 ms a frame; watch:: under Proton 54 passed / 1 failed (holes_are_known_until_the_runtime_tells, which asserts a plain PAGE_NOACCESS reservation is not a placeholder — only class 7 can tell those apart).

Verification. Windows CI on my fork: clippy -D warnings + default and diagnostics test suites green (fork PR #3, which also carries the LAND_ECHO change). I have no Wine rig: the Proton numbers above are zocram4cc's.

Credit: Kayotic1337 (class-7 finding) and zocram4cc (measurements + correction), #59.

🤖 Generated with Claude Code

**@⁠amine23012004** on GitHub · 2026-11-26 11:22 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/200) `amine23012004:fix/wine-placeholder-fallback` → `main` · +33 −1 · 1 files · 1 commits · open ## Known holes under Wine: a placeholder told by `VirtualQuery` when class 7 is not answered (#59) **Problem.** Wine answers `NtQueryVirtualMemory` class 7 with `STATUS_INVALID_INFO_CLASS`, so `watch::placeholder` was false for every block: no hole was ever known and each block was asked about at every asking — 13,000–23,000 `VirtualQuery` calls a frame behind Wine's single virtual-memory lock (#59). **Fix.** Only when class 7 fails with `STATUS_INVALID_INFO_CLASS`, a block counts as a placeholder if `VirtualQuery` says it is `MEM_RESERVE` + `MEM_PRIVATE` + `AllocationProtect == PAGE_NOACCESS` over the whole block (the only protection `MEM_RESERVE_PLACEHOLDER` takes). Plain read-write or `SEC_RESERVE` reservations don't pass, so an ordinary `VirtualAlloc` commit there is still seen. Windows answers class 7: unchanged there. One file, `crates/victory-gpu/src/watch.rs`. This is the version with @⁠zocram4cc's correction from #59 (the first fallback made any `MEM_RESERVE` page a hole and broke 4 `watch::` tests under Proton). Their measurements on Proton / RX 6900 XT: questions about holes 18,520 → 2 a frame, copies 49.4 → ~34 ms a frame; `watch::` under Proton 54 passed / 1 failed (`holes_are_known_until_the_runtime_tells`, which asserts a plain `PAGE_NOACCESS` reservation is not a placeholder — only class 7 can tell those apart). **Verification.** Windows CI on my fork: clippy `-D warnings` + default and diagnostics test suites green ([fork PR #3](https://github.com/amine23012004/VIctory-7900XTX/pull/3), which also carries the LAND_ECHO change). I have no Wine rig: the Proton numbers above are zocram4cc's. Credit: Kayotic1337 (class-7 finding) and zocram4cc (measurements + correction), #59. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Wine answers NtQueryVirtualMemory class 7 with STATUS_INVALID_INFO_CLASS,
so `placeholder` was false for every block, no hole was ever known and
each was asked about at every asking: 13,000-23,000 VirtualQuery calls a
frame behind Wine's one virtual-memory lock (#59). Only then, a block in
a private, reserved, PAGE_NOACCESS region (what MEM_RESERVE_PLACEHOLDER
makes) counts as one. Windows answers class 7: unchanged there.
After Kayotic1337 and zocram4cc's measurements and patch in #59.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:30:46 +00:00
Author
Owner

@⁠flamme-demon on GitHub · 2026-11-26 22:05 UTC · original

Tested and working under Proton. With this PR the per-frame line says 0 questions about holes in every run here (about 15 runs of 5 to 12 minutes), where reports without it count thousands a frame (#59, #111). No regression seen.

Setup: RX 7900 XTX (RDNA 3), Mesa RADV 26.2.4, Proton Experimental 20261112 with its wineserver rebuilt with the view tree, vkd3d-proton master 71cae09, Microsoft's d3dcompiler_47; main c9c932c + #151, #166, #200, #201, #274; diagnostics build, Series S (VICTORY_UPSCALER=6). Linux runs in a KVM guest with the card passed through.

Tested by Claude Code (Claude Opus 5.5) on my machine; I only watched the picture. No captures posted (asset policy).

**@⁠flamme-demon** on GitHub · 2026-11-26 22:05 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/200#issuecomment-7204343489) **Tested and working under Proton.** With this PR the per-frame line says `0 questions about holes` in every run here (about 15 runs of 5 to 12 minutes), where reports without it count thousands a frame (#59, #111). No regression seen. Setup: RX 7900 XTX (RDNA 3), Mesa RADV 26.2.4, Proton Experimental 20261112 with its wineserver rebuilt with the view tree, vkd3d-proton master `71cae09`, Microsoft's `d3dcompiler_47`; main `c9c932c` + #151, #166, #200, #201, #274; diagnostics build, Series S (`VICTORY_UPSCALER=6`). Linux runs in a KVM guest with the card passed through. Tested by Claude Code (Claude Opus 5.5) on my machine; I only watched the picture. No captures posted (asset policy).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/200/head:github-bot/gh-200'
git switch 'github-bot/gh-200'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-200'
git switch 'github-bot/gh-200'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-200'
git switch 'github-bot/gh-200'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-200'
git switch 'main'
git merge --squash 'github-bot/gh-200'
git switch 'main'
git merge --ff-only 'github-bot/gh-200'
git switch 'main'
git merge 'github-bot/gh-200'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.