Repository navigation
Memory: skip VirtualQuery on committed coherent UMA windows in cpu_writes and kernelx - #1005
Conversation
…ites and kernelx A kernel VirtualQuery on a 4 GiB OpenExistingHeapFromAddress coherent UMA window walks the entire region (~75-80 ms) while holding MmLockAddressSpace, stalling GetWriteWatch on other threads. eh::is_writable already checks uma.in_committed_window() first; extend the same fast path to cpu_writes (write_now, write_u64_now, writable), kernelx (VirtualQuery, VirtualQueryEx, XMemVirtualQuery, committed_range, committed_page_in), and list_x frame-trace diagnostics.
|
Test report for the exact head Tested
Not tested
AI use
|
|
Independent verification, merged onto current Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti (8 GiB); Rust stable MSVC, debug.
AI use: test runs by Devin (Cognition, SWE-2); no code changes. |
|
Independent timing for On the same 4095 MiB coherent window imported with A second thread probed |
|
Test report for this PR's head Tested
SKIPPED tests (the same on
|
, xcl-dev#1876, xcl-dev#1866) Brings main to full parity with upstream/main (62265d3): - xcl-dev#1005: skip VirtualQuery on committed coherent UMA windows in cpu_writes and kernelx - xcl-dev#1053: opt-in fast-boot env vars (Bink intro skip, frame interval override, device type, TTS mute) - xcl-dev#1876: float v_cmpx through xcl-dev#1426 lowering keeps lanes outside EXEC out - xcl-dev#1866: track SCC of mixed mask and number operations Conflict in crates/xcl/src/hle/xgameruntime/api.rs resolved by keeping both the in-process Wine XAsync path and upstream's XCL_MUTE_TTS XAccessibility path. Assisted-by: Antigravity (Gemini 4)
Pulls in xcl-dev#1836 (graphics and two-pass PSO disk cache + lazy MS/GS + shader build coalescing), xcl-dev#1930 (DXIL CSE across discard), xcl-dev#1900, xcl-dev#1005, xcl-dev#1053, xcl-dev#1864, xcl-dev#1866, xcl-dev#1869, xcl-dev#1876, and xcl-dev#1898 while keeping our RDNA4 MSAA clamp (xcl-dev#1908), wave64 graphics Direct DXIL guard (xcl-dev#1913), atomic writable-range tracking, static-sampler cache keys, and 4M-group indirect dispatch clamp.
Avoid kernel
VirtualQuerycalls on committed coherent UMA windows incpu_writes,kernelx, andlist_x. On Windows, callingVirtualQueryon a 4 GiBOpenExistingHeapFromAddresscoherent window walks the whole region (~75-80 ms) while holdingMmLockAddressSpace, stallingGetWriteWatchon other threads.eh::is_writablealready checksuma.in_committed_window()first; this extends the same fast path to the remaining call sites.What is in it
crates/xcl/src/hle/d3d12x/cpu_writes.rs: fast-pathwrite_now,write_u64_now, andwritablewhen[va, va + bytes)lies inside a committed coherent UMA window.crates/xcl/src/hle/kernelx.rs: exportVirtualQueryandVirtualQueryEx, fast-path them plusXMemVirtualQuery,committed_range, andcommitted_page_inon committed coherent UMA windows, and add a unit test (virtual_query_fastpath_covers_committed_coherent_window).crates/xcl/src/hle/d3d12x/list_x.rs: route theXCL_TRACE_FRAMEvertex-bufferVirtualQuerythroughkernelx::VirtualQuery.Tested
rustc 1.99.1 (58cf8f9c3 2026-10-13), release + test profilescargo test --workspace -- --test-threads=4: 728 passed, 0 failed, 41 ignored (0 SKIPPED GPU tests)Regression run
main:
PR:
Not tested
AI use
origin/main, ported and refined the coherent-window fast path and unit test, ran the full test suite and smoke runs, and drafted this description.