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

Open
amine23012004 wants to merge 1 commit from upstream-pr/200 into main
amine23012004 commented 2026-11-26 11:22:52 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by amine23012004 on 2026-11-26T11:22:52Z.


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

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:5509120315 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/200). Originally posted by [amine23012004](https://github.com/amine23012004) on 2026-11-26T11:22:52Z. --- ## 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)
flamme-demon commented 2026-11-26 22:05:01 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by flamme-demon on 2026-11-26T22:05:01Z.


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).

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7204343489 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/200#issuecomment-7204343489). Originally posted by [flamme-demon](https://github.com/flamme-demon) on 2026-11-26T22:05:01Z. --- **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 cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/200:upstream-pr/200'
git switch 'upstream-pr/200'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/200'
git switch 'upstream-pr/200'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/200'
git switch 'upstream-pr/200'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/200'
git switch 'main'
git merge --squash 'upstream-pr/200'
git switch 'main'
git merge --ff-only 'upstream-pr/200'
git switch 'main'
git merge 'upstream-pr/200'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
avatarmanz/VIctory-7900XTX!200
No description provided.