GPU: query the allocation type when guarding mapped memory #119
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/119"
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 ifBars on 2026-11-24T00:40:24Z.
When
GetWriteWatchfalls back to guarded memory,guardasks whether the first address belongs to a mapped view.VirtualQueryalso determines the length of the run of pages with matching protection. On a large, clean view, finding that length can dominate the call.This changes the first query to
QueryVirtualMemoryInformation(MemoryRegionInfo). File-backed, page-file-backed and physical views take the mapped path. Private allocations and images take the existing non-view path. Unrecognized or combined flags and failed queries fall back to the originalVirtualQuerycheck. Windows allocation informationSynthetic benchmark
On an i5-11600K running Windows 10 22H2, both versions of
writes()ran in one optimized test executable against the same 174 MiB file-backed section. Each workload had a warm-up and nine paired samples with alternating order. The sparse case wrote to one guarded page before each call and checked its journal entry. Values are the median microseconds per call, including construction of the page journal.Validation
watch.rson Windows. Both tests passed on the upstream baseline. All three passed with this change, including the new file-view, stack, image and free-address cases.AI-assisted development and testing with Codex.
Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T00:46:40Z.
Tested under Wine 11.22 + vkd3d-proton 3.1 on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build of
095e44awithcargo xwin ... --target x86_64-pc-windows-msvc: pass, no regression.victory_gputest binary: 37 passed, 3 failed — the PR adds one test (36 → 37).main:argument_clamp_builds(Wine'sd3dcompiler_47cannot compile the clamp shader),a_rejected_blob_gives_an_empty_library(vkd3d returnsE_INVALIDARGfor an empty pipeline library),buffer_data_reaches_the_host_texture(see #128 —VirtualQueryreports vkd3d-mapped memory asMEM_FREE).texture::committedincopy_mapped, notwatch::guard. The newQueryVirtualMemoryInformationpath was exercised by the passing tests.No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T10:05:31Z.
Review: APPROVED
Tested
095e44aon Windows 11, RTX 5070, MSVC: the workspace passes (187 outsidevictory-shader; older base), includingallocation_query_recognizes_file_views_and_rejects_nonviews. I didn't re-run the benchmark.QueryVirtualMemoryInformation(MemoryRegionInfo)answers "what kind of allocation is this" without walking same-protection pages, which is the costVirtualQuery'sRegionSizecomputation adds on a big guarded view.MEM_MAPPED. Anything else falls back to the oldVirtualQuerytest, so unknown combinations can't change the answer.No issues found.
AI-assisted (Claude Code).
upstream-sync referenced this pull request2026-11-24 19:03:41 +00:00
Pull request closed