D3D12.X: UMA windows in a driver heap on NVIDIA, 4.9x FPS (0.62 -> 3.03) #2844
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2844
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2844"
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?
@Kalmarv on GitHub · 2026-11-26 18:20 UTC · original
Kalmarv:pr/uma-driver-window→main· +575 −59 · 7 files · 2 commits · merged 2026-11-27 04:50 UTCStacked on #751; only the top commit belongs here (#751 fixes the detile crash that otherwise ends every world run before a two-minute window). Part of #2688.
Result: 3.03 FPS instead of 0.62 in the world (4.9x), RTX 5070 Ti, title ea3b5e4d, same 2-minute window, no device removal or crash. The GPU time of a replayed world frame drops 8.7x (1,427 ms -> 165 ms), the hot compute programs 18-39x each.
On NVIDIA the coherent UMA window is the bottleneck: the title's GPU code reads and writes it through a heap opened with
OpenExistingHeapFromAddress, and the GPU's loads and atomics on those imported pages are an order of magnitude slower than on a driver heap in the same host memory. This PR puts the window in a driverCUSTOMwrite-back L0 heap mapped at the window's own address, so the title keeps its pointers.How it was found: locum
locum (MIT) is a standalone D3D12 capture and replay tool: a wrapper DLL records every call, resource and descriptor of a frame, and
locum-clireplays that frame offline, optionally with one thing changed, timing every draw and dispatch on the GPU (locum-cli verify --times). It is only used as an external tool here; no code of it is in XCL. Live, the title is too slow and noisy to tell causes apart (shader form, tile remaps, video memory over budget, paging and sync stalls all looked plausible). With locum:OpenExistingHeapFromAddress): 1,427.3 ms, 8.7x, reproducing the live per-op times. b78fa10b 19.7 -> 350.6 ms (18x), 24de2aef's three dispatches 10.2 -> 393.6 ms (39x), 1b5466f2 1.4 -> 246.5 ms. Same capture, same replay code, one queue, no tile remaps: the cost is in how the window's memory is made, not in the live run. (Both replays ran at the same low clocks, since a replay feeds the GPU slowly: the ratio is the result, not the absolute times.)Evidence beyond the replay
A standalone probe on the same card (one 1024x64x16 dispatch per memory home, ns per loop iteration, atomics / load):
OpenExistingHeapFromAddress)Write watch is not the cause (imported without it: same rows), and neither are the cross-adapter flags (a DEFAULT heap with SHARED_CROSS_ADAPTER runs at CUSTOM L0 speed). Plain stores at 256-4096 boxes are the one row where the driver heap is slower (4-7x); the frame totals above include that.
What is in it
hle/d3d12x/uma_driver.rs(new): atopen_uma, the window's written pages are copied out, the window is released, every other free stretch of 1 GiB or more is reserved for a moment so that the driver's CPU mapping of a new CUSTOM L0 heap can only land in the hole the window left, and the pages are copied back. If the mapping lands anywhere else, or any step fails, the window is made again at its address with its pages and imported as before (logged ascoherent window N stays imported: ...). If the snapshot of the written pages fails, the window is not released at all (found in review by @thehollowedone, with their testfailed_write_watch_does_not_release_the_original_window).hle/d3d12x/mod.rs,real.rs,host.rs: the backend, and with it the window and any remap, is made once inhost_mainbeforeload_main, before a title DLL's TLS callbacks orDllMaincan hold a window pointer; a backend first made later, andreal::init(), only import. Otherwise a title write between the snapshot and the release could be lost. If the window cannot be made again at its address after the release, XCL logs it and ends the process (0x7C10003) rather than run the title on an unbacked window. Both found in review by @thehollowedone (review), with their candidates and tests applied as posted: the order check in the e2e testtest_title_runs_and_game_folder_is_untouched, andfailed_restore_stops_before_importing_an_unbacked_window.hle/d3d12x/real.rs: buffers placed in a driver window dropALLOW_CROSS_ADAPTER.gpu/uma.rs: which windows are driver heaps.hle/d3d12x/title_textures.rs: under Wine,read_committed_intogoes region by region instead of one whole-rangeReadProcessMemory(from #751's commit below), which under Wine read through guard and no-access pages and failedtitle_bytes_leave_guard_pages_aloneon Wine/NVIDIA (found by @SlopTart, traced by @thehollowedone, their candidate applied). Native Windows keeps the one copy.D3D12_HEAP_FLAG_ALLOW_WRITE_WATCH. On the RTX 5070 TiGetWriteWatchreads the mapped window (4 KiB pages reported, reset, reported again after a new write; all 16,386 written pages of the 4 GiB window found once), so the window stays inwatch_regionsand the title's CPU writes reach its textures as with the import. A driver that refuses the flag, or a mappingGetWriteWatchcannot read, keeps the import. (A first form without write watch left CPU rewrites of title textures in the window off the GPU:placed_title_textures_share_vram_and_preserve_pixelsrow 6 failed in the full parallel suite, where another test had made the window a driver heap.)util::under_wine); AMD, Intel and Wine keep the import unchanged.XCL_UMA_DRIVER=0turns it off,XCL_UMA_DRIVER=1turns it on anywhere. Unit testsdriver_windows_by_default_on_nvidia_outside_wine,failed_write_watch_does_not_release_the_original_windowandfailed_restore_stops_before_importing_an_unbacked_window.Tested
RTX 5070 Ti (16 GB), driver 610.74, Ryzen 9 9950X, 31 GB RAM, Windows 11 Pro 26200, Rust 1.99.0, release.
On this head
f2248f0, debug:cargo test -p xcl --lib hle::d3d12x::title_textures::tests:: -- --test-threads=1: 21 passed, 0 failed;cargo test -p xcl --lib hle::d3d12x::uma_driver::tests:: -- --test-threads=1: 3 passed, 0 failed. It differs from50ae2ebonly in the under-Wine branch above, so the full suite below is from50ae2eb.On
50ae2eb, debug:cargo test --workspace --no-fail-fast -- --test-threads=4: 1448 passed, 3 failed, 47 ignored, the same 144 SKIPPED. The failed ones: the twolink_testsbelow (as on main), andlist_x::tests::a_dispatch_with_a_pipeline_still_building_waits_at_the_submitonce, in a suite run beside other jobs; it passed alone 3 of 3 and incargo test -p xcl --lib list_x(40 passed, 0 failed). This PR does not touchlist_x.cargo test -p xcl --lib hle::d3d12x::uma_driver::tests:: -- --test-threads=1: 3 passed, 0 failed;cargo test -p xcl --test e2e test_title_runs_and_game_folder_is_untouched: 1 passed, 0 failed.On the previous head
fc007a9:cargo test --workspace -- --test-threads=4: 1448 passed, 2 failed, 47 ignored; 144 SKIPPED (119 validator 1.7 < 1.8, validation step only; 21 no wave64; 3 refused f16 forms V_MUL_F16 / V_PK_MUL_F16 / V_CVT_F16_F32, #1426 semantics; 1 no heap windows). The failed ones arelink_tests::gpu_linked_memory_accessorsandlink_tests::linked_programs_keep_their_declarations(DXC: "attribute WaveSize only valid on entry point function"); they fail the same way on main8b957be(cargo test -p xcl --lib link_tests: 0 passed, 2 failed).Title ea3b5e4d, one paired run each (main and the previous head
fc007a9), 480 s, the GPU alone (no build or other job on the machine). Both arms start from snapshots of one cache made by a singlexcl shaders shaders.rpf --precompile --pipelineson main's translator (this PR changes no shader code; the precompile: 20,748 compiled, 14,842 already cached, 0 errors, 2,689 pipelines made, 0 refused), and neither arm wrote a new loose DXIL cache entry or driver PSO file in play (it still wrote translation records, which can hold DXIL from direct translation: main 866, this PR 868); the startup preparation still rescans the pack on every launch. Env for both:XCL_HEAP_WINDOWS=1 XCL_DIRECT_DXIL=all XCL_DIRECT_SPLIT_INSTRUCTIONS=0 XCL_PSO_JOURNAL=0 XCL_DRED=1 XCL_GPU_WAIT_TIMEOUT_MS=120000 XCL_DXIL_CACHE=<snapshot> XCL_DXC_DIR=<DXC 1.9.2609> XCL_PRESS_AT=14:A,18:A,...(A every 4 s from 14 s). Each arm is scored over 120 s from 10 s after its world starts (the first 2 s with 5,000+ dispatches), FPS as presents over the measured time of the activity intervals: main's world from 108 s, scored 117.7-238.7 s (121.0 s measured); this PR's from 106 s, scored 116.1-236.1 s (120.1 s measured).8b957befc007a9the coherent window at 0x... (4095 MB) is a driver CUSTOM write-back L0 heap mapped at its address, write-watchedOn
50ae2eb, 480 s, the same env and cache snapshot, in the queue's title lane beside other jobs (not timed, so not in the table): 2,937 frames shown (fc007a9: 2,841), 0 device removals, 0 crashes, peak commit 39,371 MB; the window became the driver heap before the title loaded (0 pages kept). On this headf2248f0, the same: 2,939 frames, 0 device removals, 0 crashes, peak commit 39,360 MB (block below). A first run on this head stopped presenting at ~591 s (about 470 s into play):Write64 Signal ... would close a GPU cyclelines, then no submits, and the device was found removed when the run ended (0x887a0006, no DRED page fault). On Windows this head runs the same code as50ae2eb, whose run had 4 of those lines and no removal; the rerun had none. One hang in the three runs of this PR's two latest heads, cause not known.A second PR run, on
25dfc2c, an earlier form of this PR whose window was not write-watched and which instead hashed all ~500 MB of the title's textures in it at every look (16-19 ms a look): 1.22 FPS (world from 148 s, scored 158.0-278.1 s; device removals / crashes 0 / 0).Regression run
Not tested
XCL_UMA_DRIVER=1on them is untested. The under-Wine read change is not run under Wine here.nvidia-devport), which ran to its 900 s cap.Unmapand dropping it do not give the address back (VirtualQuery still shows it committed seconds later). So ifGetWriteWatchcannot read a mapping that landed at the right address, the restore cannot succeed, and the process stops with0x7C10003instead of keeping the import. The doc comment's "the window is the title's memory again" holds for the other failures. Not reached in any run here, as the heap is made withD3D12_HEAP_FLAG_ALLOW_WRITE_WATCH.failed_restore_stops_before_importing_an_unbacked_windowexits 1 instead of0x7C10003on Wine/NVIDIA (@SlopTart); the child's output is not known yet.AI use
🤖 Generated with Claude Code
@thehollowedone on GitHub · 2026-11-26 18:26 UTC · original
Focused review of #2844 at
25dfc2c: the fallback can lose bytes when the page snapshot fails. Inuma_driver::written_pages, a nonzeroGetWriteWatchresult exits the loop but returns the empty or partialVecas success.remakethen releases the original window and restores only thatVec. Microsoft defines nonzero as failure; the original mapping should stay intact on this path.I forced this path with a synthetic 64 KiB
VirtualAllocblock lackingMEM_WRITE_WATCH. On the unmodified PR head,cargo test --offline --locked -p xcl --lib failed_write_watch_does_not_release_the_original_window -- --test-threads=1 --nocapturefailed: afterremake, the bytes no longer matched the original0x5apattern (0 passed, 1 failed, 0 ignored). With the candidate change,written_pagesreturns an error andremakeexits beforeVirtualFree;cargo test --offline --locked -p xcl --lib hle::d3d12x::uma_driver::tests:: -- --test-threads=1 --nocapturepassed (2 passed, 0 failed, 0 ignored).cargo build --offline --locked --workspacealso passed. Hardware: Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti 621.35; no GPU skip in these two tests.This is a forced failure-path test, not an observed
GetWriteWatchfailure on the retail window. I did not run a title or the full workspace suite for this local suggestion.open_umaalready logs a failedremakeand uses the original imported window, so propagating the error preserves that fallback.Candidate diff and regression test
AI use: Codex (GPT-6.2 Sol) traced the page-snapshot and fallback paths, wrote and ran the local candidate and test, and drafted this review. I checked the source path, diff, and test output.
25dfc2c00etofc007a9664@Kalmarv on GitHub · 2026-11-26 18:47 UTC · original
Thanks, confirmed and applied as posted in
fc007a9(squashed into the PR commit, with your test and credit in the commit message):written_pagesreturns an error andremakeleaves the window untouched.cargo test --workspace -- --test-threads=4onfc007a9, RTX 5070 Ti:failed_write_watch_does_not_release_the_original_windowpasses.The same push also changes one other thing: the driver heap is now created with
D3D12_HEAP_FLAG_ALLOW_WRITE_WATCHand kept only ifGetWriteWatchreads its mapping, so the window stays write-watched like the import (otherwise the import is kept). The earlier head left the window out of write watch, which missed CPU rewrites of title textures there.AI use: Claude Code (Claude Opus 5.5) checked the finding, applied the diff and wrote this reply.
D3D12.X: coherent UMA windows in a driver heap at the title's address on NVIDIAto D3D12.X: UMA windows in a driver heap on NVIDIA, 4.9x FPS (0.62 -> 3.03)@thehollowedone on GitHub · 2026-11-26 19:11 UTC · original
Independent Windows/NVIDIA check of #2844 at
fc007a9. On Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC and DXC 1.8.2502.11:cargo build --offline --locked --workspacepassed.cargo test --offline --locked -p xcl --lib hle::d3d12x::uma_driver::tests -- --test-threads=1 --nocapture: 2 passed, 0 failed, 0 ignored.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1,450 passed, 0 failed, 47 ignored. The log contains 25SKIPPEDGPU notices (21 no wave64, 3 refused per-lane f16 forms, 1 no heap windows); these are not coverage. I setXCL_DXIL_CACHEto writable scratch for this run.stays importedfallback messages, each followed by anUMA import check: ok. These are log occurrences across test processes, not a measure of title performance. The synthetictest_title_runs_and_game_folder_is_untouchede2e test passed 1/0/0 but took the fallback:Mapreturned a different address. This machine exercised both paths.Two lifecycle points remain after reading the current code. I did not trigger either failure; these are execution paths to cover before treating the remap as safe for concurrent title code:
kernelx::VirtualAlloccan return a coherent-window pointer before the first D3D device.backend()initializes the device lazily.remakesnapshots written pages, releases the VA, maps the new heap, then restores the snapshot. A title worker holding the earlier pointer can read/write during that gap; a write after the snapshot can be lost. Could the transition happen before any pointer is exposed, or be guarded by a guest-thread safe point? A synthetic regression should keep a pre-device allocation active on another guest thread while device creation begins, and verify its bytes remain accessible and unchanged.restoreandVirtualAlloc(base, size, ...)cannot reacquire the entire original range, it returns an ordinaryErr.open_umathen tries to import that address and returns after an error, whilereal::initcontinues with the device. The coherent window may no longer be backed, yet the runtime can keep serving its pointers. Please distinguish failed rollback from an ordinary fallback and stop device initialization/guest execution on that path. A fault-injection regression could force a post-release address collision and verify the runtime does not continue with an unbacked window.I did not run a retail title or measure FPS on this card. AMD/Intel and post-reset write-watch behavior on this card remain untested here. AI use: Codex (GPT-6.2 Sol) reviewed the current source and ran the tests; I checked each point and the output before posting.
@thehollowedone on GitHub · 2026-11-26 19:14 UTC · original
Follow-up to my RTX 3080 Ti report on head
fc007a9: I checked post-reset write-watch behavior on this card with a local synthetic test. It mapped the 512 MB coherent window as the driver CUSTOM write-back L0 heap at its original address, resetGetWriteWatch, wrote one 4 KiB page, confirmed that page appeared, reset again and confirmed an empty result, then wrote a different page and confirmed that only the new page appeared.cargo test --offline --locked -p xcl --lib local_probe_driver_heap_tracks_writes_after_reset -- --test-threads=1 --nocapture: 1 passed, 0 failed, 0 ignored, 0 skipped. RTX 3080 Ti / 621.35, Windows 11 build 26300; no retail title involved.This verifies the write-watch reset path on this NVIDIA driver. It does not resolve the two remap lifecycle concerns in my prior comment. The probe was local-only and has been removed from the worktree. AI use: Codex (GPT-6.2 Sol) wrote and ran the probe; I checked its assertions and result.
@thehollowedone on GitHub · 2026-11-26 19:41 UTC · original
Follow-up to my lifecycle review on head
fc007a9: I reproduced a lost write at the snapshot boundary with a local synthetic test on Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35.The test writes
0x5ainto a 64 KiB write-watched window, letswritten_pagessnapshot it, writes0xa5while the original mapping is still valid, then lets the existingremakecontinue.cargo test --offline --locked -p xcl --lib write_after_snapshot_survives_remake -- --test-threads=1 --nocapturefailed on two runs (0 passed, 1 failed, 0 ignored, 0 skipped each): the committed window contained0x5aafterward. This machine took the imported fallback (remade=false); that fallback also restores the stale snapshot. The callback only makes the timing deterministic. It does not establish how often a title thread hits this interval.A bounded resolution would complete backend initialization and any remap before
load_maincan run title DLL callbacks, then prohibit a driver remap during later lazy initialization so an already-published guest pointer remains on its original mapping. Please test both the early path and the late import path with an active pre-device allocation. The separate failed-rollback path from my earlier review still needs a terminal outcome if the original VA cannot be restored. I have not implemented or benchmarked that lifecycle change.Local failing regression diff (test instrumentation only)
The test was local only; no retail title, private game data or FPS measurement was used. AI use: Codex (GPT-6.2 Sol) traced the current source, wrote and ran the test, and drafted this report. I checked the source path, diff and failures before posting.
@thehollowedone on GitHub · 2026-11-26 19:52 UTC · original
Candidate for the snapshot-boundary failure on #2844 head
fc007a9. I checked the startup path:load_maincan execute a dependent DLL's TLS callbacks andDllMainbefore the subsequent report initializes D3D12. The local candidate initializes the shared backend once beforeload_main; ordinary/later backend calls and directreal::init()use the import path, so they cannot destructively remap a window after guest code may hold a pointer. The run-seconds worker starts after this preparation so it cannot win the backend initializer. Null graphics still returns before device creation.A new assertion in the existing synthetic title e2e test checks backend initialization precedes the dependent DLL's
DllMain. On unmodifiedfc007a9,cargo test --offline --locked -p xcl --test e2e test_title_runs_and_game_folder_is_untouched -- --test-threads=1 --nocapturefailed (0 passed, 1 failed, 0 ignored): backend initialized after title DLL code. With this local candidate, the same command passed (1/0/0).cargo build --offline --locked --workspacepassed, andcargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapturepassed across 38 targets: 1,450 passed, 0 failed, 47 ignored; 25 GPUSKIPPEDnotices are not coverage. RTX 3080 Ti / 621.35, Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC.The synthetic title attempted early remap but this driver's mapping landed elsewhere, so it used the imported fallback. This run proves startup ordering and fallback, not successful CUSTOM mapping or a retail FPS effect. I did not run matched clean-tree retail smoke, AMD or Intel. The separate failed-rollback path in my earlier review remains unresolved; if the old VA cannot be reacquired, initialization must stop rather than continue with an unbacked window.
Local candidate diff
AI use: Codex (GPT-6.2 Sol) traced the current code, wrote and ran the local candidate and tests, and drafted this report. Codex (GPT-6.2 Astra) provided a read-only architecture check. I independently checked every point and the output before posting.
@thehollowedone on GitHub · 2026-11-26 20:10 UTC · original
Follow-up on the second #2844 lifecycle point, checked on head
fc007a9. I forced the post-release rollback collision in a child test process: after the original 64 KiB write-watched window was released, the test reserved its exact address and made heap creation fail. On the unchanged recovery path,remakereturned an ordinary error and the child continued with that address no longer backed by the original window. The parent regression failed (0 passed, 1 failed, 0 ignored); the child exited normally and printedcontinued after failed restore.In the local candidate below, an unsuccessful exact-address restoration logs the cause, flushes, and terminates the process with
0x7C10003. It cannot reachopen_uma's import fallback or guest execution with a lost window. I usedTerminateProcessfor this unrecoverable path because Microsoft documents that it does not invoke guest DLL detach handlers; an ordinary report write here would also reenter the backend initializer throughreal::stats. Recoverable failures still restore the original bytes and use the import path.On Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC:
cargo test --offline --locked -p xcl --lib failed_restore_stops_before_importing_an_unbacked_window -- --test-threads=1 --nocapture: 1 passed, 0 failed, 0 ignored after the candidate; the child exited with the expected code and never printed the continuation marker.cargo test --offline --locked -p xcl --lib hle::d3d12x::uma_driver::tests:: -- --test-threads=1 --nocapture: 3 passed, 0 failed, 0 ignored; this includes the existing write-watch fallback regression.cargo build --offline --locked --workspacepassed.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1,451 passed, 0 failed, 47 ignored across 38 targets, with 25 GPUSKIPPEDnotices (not coverage).This is a forced failure-path test, not evidence that an address collision occurred in a retail run. No title or paired clean-tree smoke was run for this local candidate; the separate pre-guest remap timing candidate remains in my earlier comment.
Local candidate diff and child-process regression
AI use: Codex (GPT-6.2 Sol) traced the recovery path, wrote and ran the candidate and tests, and drafted this report. I checked the code and outputs before posting.
@S1m0ne1997 on GitHub · 2026-11-26 20:23 UTC · original
Tested — RTX 4090, one pair in the world: GPU time of the console's work per frame 5,080 ms → 91 ms, 0.27 → 2.66 fps.
fc007a96(onmain8b957bec), release, plus an uncommitted local port of #2057's GPU profiler (timestamps only), same binary for both runs,XCL_UMA_DRIVER=0/=1.9cc6a39e, 1920x1080, Series X profile.XCL_HEAP_WINDOWS=1 XCL_DIRECT_DXIL=1 XCL_DIRECT_SPLIT_INSTRUCTIONS=0 XCL_HUGE_PSO_CONCURRENCY=8 XCL_NETWORK=0 XCL_GPU_PROFILE=1 XCL_ACTIVITY=1 XCL_PSO_TRACE=1 XCL_DRED=1=1the log hasthe coherent window at 0x700000000 (4095 MB) is a driver CUSTOM write-back L0 heap mapped at its address, write-watched.=0=1=0=11b5466f261a70cdeb78fa10b425b8e543429c04607b000169dc85ad397cbaffe19a1c1ba0b56761856446569eccb04f067657769b50d2f8b24de2aef6c31d55eSeen: green flashes over the whole picture with
=1. The=0run showed only grey frames and some text, so this pair cannot tell whether the PR causes them.Not tested: the test suite and
smoke.ps1on this head, a run without the driver profile, repeated pairs, AMD, Intel.AI use: Claude Code (Claude Sonnet 5.5) built the tree, read the logs and wrote this report; I played the runs.
fc007a9664to50ae2eb85c@Kalmarv on GitHub · 2026-11-26 20:38 UTC · original
@thehollowedone thank you, both lifecycle points confirmed and taken as posted, squashed into the PR commit in
50ae2ebwith credit in its message:host_mainbeforeload_main; a backend first made later, andreal::init(), only import. Your e2e assertion (D3D12.X: backend 'before the dependent DLL'sDllMain() is intest_title_runs_and_game_folder_is_untouched. Sincegpu::uma::get()creates the window on first use, the early init also makes the window itself before any guest pointer exists, so the snapshot taken there holds nothing the title wrote.0x7C10003);failed_restore_stops_before_importing_an_unbacked_windowis inuma_driver::tests.Tested on
50ae2eb, RTX 5070 Ti, Windows 11, Rust stable MSVC:cargo test -p xcl --lib hle::d3d12x::uma_driver::tests:: -- --test-threads=1: 3 passed, 0 failed, 0 ignoredcargo test -p xcl --test e2e test_title_runs_and_game_folder_is_untouched -- --test-threads=1: 1 passed, 0 failedcargo test --workspace --no-fail-fast -- --test-threads=4: 1448 passed, 3 failed, 47 ignored: the twolink_teststhat fail the same way on main here, and onelist_xtest that failed once beside other jobs and passed alone 3 of 3 (details in the description)fc007a9: 2,841), 0 device removals, 0 crashes. The window became the driver heap before the title loaded, with0 pages kept. Block in the description.AI use: Claude Code, Claude Opus 5.5 checked both candidates against the code, applied them, ran the tests and the title run, and wrote this reply.
@thehollowedone on GitHub · 2026-11-26 20:51 UTC · original
Independent Windows/NVIDIA recheck of #2844 at
50ae2eb, after the startup-ordering and failed-restore changes.On Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, DXC 1.8.2502.11:
cargo test --offline --locked -p xcl --lib hle::d3d12x::uma_driver::tests:: -- --test-threads=1 --nocapture: 3 passed, 0 failed, 0 ignored, 0 skipped. This includes the failed write-watch and post-release restore-collision regressions.cargo test --offline --locked -p xcl --test e2e test_title_runs_and_game_folder_is_untouched -- --test-threads=1 --nocapture: 1 passed, 0 failed, 0 ignored. Its backend-before-DllMainassertion passed.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1,451 passed, 0 failed, 47 ignored across 38 test targets. The log has 25SKIPPEDGPU notices (21 no native wave64, 3 refused per-lane f16 forms, 1 no heap windows); these are not coverage.XCL_DXIL_CACHEpointed to fresh writable scratch undertarget.The full-suite synthetic title log shows one successful pre-guest remap: a 512 MB coherent window became a driver CUSTOM write-back L0 heap at its original address, remained write-watched, kept 0 pages, and passed the UMA import check. The backend log precedes the dependent DLL's
DllMain. This exercises the successful remap path on this GPU; the forced child-process regression exercises the failed-restore path separately.I checked the current diff and test output. No retail title, visual output, FPS comparison, or AMD/Intel run was performed here. AI use: Codex (GPT-6.2 Sol) inspected the revision, ran the tests, and drafted this report.
@SlopTart on GitHub · 2026-11-26 21:12 UTC · original
Linux (Wine) dual-lane run at head
50ae2eb8- your AMD Wine lane is spotless, and two of your own new tests fail deterministically on real NVIDIA hardware under Wine. That's the vendor combo no Windows tester covers, and it's exactly where the UMA driver-heap path lives.Suite:
cargo test --release --locked -p xcl --lib --target x86_64-pc-windows-gnu -- --test-threads=2 --skip gpu::vs today's fresh main baseline (rig 606/2, boxb 605/3).AMD Wine lane: 611/2. Their 5 new tests all green, red set identical to base. Clean PR on RADV.
NVIDIA Wine lane: 608/5. Base three plus two failures introduced here, both reproducible in isolation 3/3 with
--exact:uma_driver::tests::failed_restore_stops_before_importing_an_unbacked_window(your new test):title_textures::tests::title_bytes_leave_guard_pages_alone(new in this PR):Both tests are new in this PR (they don't exist at main
8b957bec, so no base comparison is possible - the failures arrived with it). Both pass on the AMD/RADV lane, and the Windows/NVIDIA full-suite report on this same commit (RTX 3080 Ti, comment above) is fully green including the failed-restore regressions. So the failure axis is not "NVIDIA", it is NVIDIA-under-Wine: Pascal + 550-branch driver + stock wine-10 + vkd3d-proton is the only stack in this thread where these two assertions fire. The guard-page one suggests guard/no-access page semantics differ under this stack (reads not zeroing as expected), the uma one lands on a mismatched value whereSome(1)was expected against0x7c10003.Caveats: we measure suite-level behavior only - the headline 4.9x FPS number is an in-game result we cannot reproduce here. Single suite run plus the solo confirmations above; nothing else moved in the red set.
AI use: Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.
50ae2eb85ctof2248f0689@VolenNakov on GitHub · 2026-11-26 21:52 UTC · original
Tested on a slower CPU: RTX 4060 Ti 16 GB with an i7-8700. #2844 halved the GPU's busy time in the world, but the present rate did not move, because this machine is held by the write-watch looks. One run per arm, head
fc007a9(before50ae2eb).Setup
ea3b5e4d, as in the PR.main08db802+ #2526, #2097, #2404, #2590, #2615, #2618, #751, #2753, #2759, #759 / #1826; run 73 addsfc007a9.XCL_NETWORK=0 XCL_DIRECT_DXIL=all XCL_TEXTURE_LEVEL_PAGES=1 XCL_SPLIT_INDIRECT_ROUNDS=2 XCL_DIRECT_SPLIT_INSTRUCTIONS=0, 2 GiB shader heap, warm caches, 900 s.the coherent window at 0x700000000 (4095 MB) is a driver CUSTOM write-back L0 heap mapped at its address, write-watched.fc007a9)nvidia-smievery 5 s, 200–880 s)sparse windows timing: write-watch, cumulative at ~790 sGetWriteWatch(617 s of ~790 s; #582).Not tested:
50ae2eb; more than one run per arm; with hot looks (XCL_WATCH_HOT, not onmain).AI use: Claude Code (Claude Opus 5.5) ran the runs, read the logs and wrote this.
@thehollowedone on GitHub · 2026-11-26 21:59 UTC · original
Follow-up to the Wine/NVIDIA failures on head
50ae2eb. I traced both new failures against this PR's parent.The guard-page test reaches a new fast path in
read_committed_into: a successful whole-rangeReadProcessMemoryreturns beforeVirtualQuerycan mask guard and no-access pages. The parent queried protections first. The Wine result is consistent with that bypass, although the report does not show Wine'sReadProcessMemoryreturn/count orVirtualQueryprotections, so the exact API behavior remains to be measured. A narrow candidate retains the native Windows fast path and the previous query-first behavior under Wine:Candidate diff against
50ae2ebOn Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35,
cargo test --offline --locked -p xcl --lib hle::d3d12x::title_textures::tests:: -- --test-threads=1reported 21 passed, 0 failed, 0 ignored, with zero GPU skip notices, on this local candidate. Not tested: Wine/NVIDIA, the full workspace, or a title run. A Wine rerun oftitle_bytes_leave_guard_pages_aloneandtitle_bytes_survive_concurrent_decommit, plus the API return/count and page protections, would establish whether this fixes the reported failure without weakening the test.For
failed_restore_stops_before_importing_an_unbacked_window, exit status1alone does not show whether the child terminated safely or panicked first. Please include the child's captured stdout/stderr (transcriptin the parent test) before changing the expected code. The test should still require the restore error and rejectcontinued after failed restore.AI use: Codex (GPT-6.2 Sol) traced the code, prepared the candidate, ran the Windows tests, and drafted this report.
@joeypercia on GitHub · 2026-11-26 22:25 UTC · original
@Kalmarv a port of this PR to
nvidia-dev(eae01502), and what it did on a 12 GB card. Branch:joeypercia/xcld3d12x-uma-driver-nvdev, one commit20e128ac, your authorship, for you to take or leave. Onnvidia-devthe driver heap is tried at the top ofopen_uma's per-window loop, before its import / video-memory shadow, and not withXCL_UMA_SHADOW=1; a shadowed or driver-heap window gets noALLOW_CROSS_ADAPTER.cargo check --testsis clean; I have not run the suite on it.Runs: RTX 4070 Ti 12 GB, driver 621.40, 2 GiB shader heap (#2590), Series S profile,
XCL_UMA_WINDOWS=16 XCL_HEAP_WINDOWS=1 XCL_DIRECT_DXIL=1 XCL_TWO_PASS_MB=3072, the tree of #2867 with3292b096reverted (that commit crashes this setup), 900 s runs, warm caches.XCL_UMA_DRIVERXCL_COHERENT_HEAPS=sparse:10240Map gave 0x14b070000, not the window's 0x1300000000, and it stayed imported as designedXCL_COHERENT_MB=4095), default heaps0sparse:1024), there was no gain on this card: 0.91 against 1.08 presents/s on the same build. That fits the window holding little of the hot work then.Not tested: the suite on the port; the 4 GB layout on a tree where it survives; a second card.
AI use: Claude Code (Claude Opus 5.5) ported the commit, ran the runs on the hardware above and wrote this.
@kole07139 on GitHub · 2026-11-26 22:50 UTC · original
8 GB card (RTX 3070, Ampere) on an Intel i9-9900K: with this PR the title presents 2.5–3.2x as often in its world (0.74 and 0.93 presents/s against 0.29 with
XCL_UMA_DRIVER=0on the same exe, and 0.24 / 0.27 on the tree without the PR). No device removal or crash in any run. The green flashes @S1m0ne1997 saw follow the PR here: they were on screen in both runs with it and absent in the run without. No 8 GB card or Ampere run was in this thread yet.Setup
main6d12f58+ #2404, #2097, #684, #751 (59f8e7c, the same patch as this PR's baseb84e037), #1803, #2229, #2384, #1975, #2590, #2753, #2551, #759 (my portcc2ac52), and this PR's top commit50ae2eb. One exe for H1–H3; K1/K2 are the same tree without50ae2eb.XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_TEXTURE_LEVEL_PAGES=1 XCL_PSO_WAIT_MS=50 XCL_NETWORK=0, default coherent window (4095 MB), Series X profile, A pressed every 5 s, 420 s per run, each run on its own copy of one warm cache.the coherent window at 0x700000000 (4095 MB) is a driver CUSTOM write-back L0 heap mapped at its address, write-watched (134 reservations, 0 pages kept, 0 KB, 1198 / 425 ms).Results (the world from the first
ListX #101, about 100 s, to 420 s)50ae2ebXCL_UMA_DRIVERnvidia-smievery 2 s)0Presents per 30 s in the world:
=0)cef865388bce9c18,216494e34b60ed7c,fbf6fb1ab17fe036) were built cold one after another on a title thread, 20–24 s each, with no driver blob in the cache.GetWriteWatchcosts more with the PR because frames come faster:sparse windows timing: write-watchreached 56 s by 138 s (H1) and 51 s by 136 s (H3), against 56 s by 302 s (H2). That is the next limit here, as #582 / #2754 say.Not tested: this PR on
mainalone (my tree has the stack above);joeypercia'snvidia-devport; more than one run without the PR on this exe; the test suite on this tree; AMD; Wine.AI use: Claude Code (Claude Opus 5.5) built the tree, ran the runs on my machine, read the logs and wrote this; I watched the runs and checked the report.
@afpruivo on GitHub · 2026-11-26 22:53 UTC · original
RTX 3090 24 GB at
50ae2eb8: 2.03–2.19 fps with the driver heap against 1.49–1.51 without it, same exe, runs in the order A B B A (plus one A rerun). GPU busy per frame drops from ~670 ms to ~200 ms, but a frame still takes ~500 ms with the GPU idle most of it, so on this machine too the frames are then held outside the GPU, as @VolenNakov found.Setup
title: 3c290c16.50ae2eb8as posted (main8b957bec+ #751).xcl.exein a 2 GiB shader-heap profile (#2590).XCL_DIRECT_DXIL=1, A pressed by script, 250 s runs. One warm-up run first, so the pipeline cache was filled for this tree.XCL_UMA_DRIVER=0, B =XCL_UMA_DRIVER=1. With B the log showsthe coherent window at 0x700000000 (4095 MB) is a driver CUSTOM write-back L0 heap mapped at its address.For comparison, not the same tree: on
nvidia-devaf2cecc4+ #2551 on the same machine, #2009'sXCL_COHERENT_HEAPS=sparse:2048(the 2199 MB heap in video memory) gave 3.03 fps against 1.37, still GPU-bound at ~320 ms (#2009 comment). This PR gets less on this card but spends no video memory. The two change different things and could be combined; I have not tried that.Tests at
50ae2eb8:cargo test --release -p xcl --lib -- uma_driver gpu::uma: 15 passed, 0 failed, 0 ignored. The whole suite was not run on this head.Not tested: the write-watch time with the PR; this PR on
nvidia-dev(@joeypercia's port); together withsparse:2048; video memory and commit use; AMD.AI use: Claude Code (Claude Opus 5.5) ran the runs and tests on my machine, read the PresentMon captures and the logs, and drafted this. Checked by me before posting.
@thehollowedone on GitHub · 2026-11-26 23:02 UTC · original
Independent Windows/NVIDIA recheck of #2844 at head
f2248f0, after the Wine guard-page change. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / driver 621.35, Rust 1.99.1 MSVC.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4: 1,451 passed, 0 failed, 47 ignored across 38 targets. The log has 25SKIPPEDGPU notices; those are not coverage. The threeuma_drivertests,title_bytes_leave_guard_pages_alone, and the synthetic title e2e test all passed. I used a fresh writableXCL_DXIL_CACHEundertargetand noXCL_SAMPLE_*variables were set.This confirms the current head on native Windows. It does not resolve the NVIDIA-under-Wine report: the new query-first Wine path still needs a Wine rerun, and the failed-restore child test's exit code
1still needs its captured transcript to locate the failure. The PR'sRegression runblock currently names prior head50ae2eb; a smoke block from this head is still required by the repository's merge rules. No retail title was run for this check.AI use: Codex (GPT-6.2 Sol) ran and checked the suite and drafted this report; Codex (GPT-6.2 Sol) independently reviewed the Wine failure and current code.
@Kalmarv on GitHub · 2026-11-26 23:49 UTC · original
Thanks all. On the points since
50ae2eb, now atf2248f06:title_bytes_leave_guard_pages_aloneon Wine/NVIDIA (@SlopTart; traced by @thehollowedone): @thehollowedone's candidate, same logic: under Wineread_committed_intoskips the whole-rangeReadProcessMemoryand goes region by region as before; native Windows keeps the one-copy path. It is folded into this PR's commit, because it changes a line #751's commit added, and that commit stays as #751 has it. On Windows,cargo test -p xcl --lib hle::d3d12x::title_textures::tests:: -- --test-threads=1gives 21 passed, 0 failed, anduma_driver::tests::3 passed, 0 failed. Not tested under Wine: a rerun of that test on the Wine/NVIDIA lane would settle it.failed_restore_stops_before_importing_an_unbacked_windowexits 1 on Wine/NVIDIA: I agree with @thehollowedone. The assertion prints the child's output after the two codes. @SlopTart, could you post it? It shows whether the child reached the restore error or failed before that, for example atD3D12CreateDeviceor at the exact-addressVirtualAlloc. The expected code stays as it is until then. The driver heap is off under Wine by default, so a title under Wine does not reach this path.XCL_UMA_DRIVER=0. Full-screen green is what a YUV-to-RGB pass gives when its planes read as zero (about RGB 0,135,0). My first candidate is a video frame read live from the window before its decoder has filled it; that is not tested. Could one of you run a flashing stretch withXCL_FRAME_DUMP=10and post thepresent: frame N raw texels (most common)lines, or one screenshot of a flash? A flat colour near0xff008700would point at the video path.Map gave ..., not the window's ...), and it ran to the 900 s cap. The 4095 MB layout fails with and without the driver heap on that tree, so I cannot tell the PR's share there;nvidia-devis not a branch I can test against.The regression run on
f2248f06is in the description. Same 480 s, env and cache snapshot as before, in the queue's title lane beside other jobs: 2,939 frames, 0 device removals, 0 crashes. A first run on this head stopped presenting at ~591 s and the device was found removed when it ended, afterwould close a GPU cyclelines. On Windows this head runs the same code as50ae2eb, whose run passed, and the rerun passed. That is one hang in the three runs of the two latest heads, and its cause is not known. It is in the description too.AI use: Claude Code, Claude Opus 5.5 applied the change, ran the tests and the title run, and wrote this reply.
github-bot referenced this pull request2026-11-27 02:39:22 +00:00
@Royalflamejlh on GitHub · 2026-11-27 02:38 UTC · original
On Linux + NVIDIA under Wine 11.21,
XCL_UMA_DRIVER=customdid not place the heap at the window in 2 of 2 runs, and both then hit our limit (34 GiB of memory, 8 GiB of swap) before the world load, at 46.8 and 52.9 s. Our tree withoutf2248f06ran its 110 s run to the end, peaking at 29.7 GiB (1 run).Setup: RTX 4060 Ti 16 GB, NVIDIA 615.71.09, Wine 11.21 Staging, vkd3d-proton
v3.1-90-g30b0eb9bwith local patches;f2248f06cherry-picked onto the tree of our #2753 comment with #2753 in (7202055600:mainb49be18+ twelve PRs, #751 among them); the switch set by hand (decidekeeps it off under Wine).create_viewwrites one protection byte per 4 KiB page of every new range, reserved or not, and releasing a range frees none (alloc_pages_vprot,set_page_vprot,dlls/ntdll/unix/virtual.c). Over the 128 TiBgroomcan reserve, that is up to 32 GiB. Wine's development tree stopped this for reserved-only ranges on 2026-11-18 (571d2d4de7). Shouldcustombe ignored under Wine until a release has it?title_bytes_leave_guard_pages_alone, andfailed_restore_stops_before_importing_an_unbacked_window, whose child printedcoherent window could not be restored … stopping before guest memory is usedand exited with the expected0x7C10003. SlopTart's stack differs (wine-10.0, GTX 1070, driver 550, release), so this does not show why it exits 1 there.Not tested: this tree without the switch; the two tests at the earlier head
50ae2ebor on that stack; Wine's development tree; Windows.AI use: Claude Code (Claude Opus 5.5) picked the commit onto our tree, ran the two tests, read the runs and Wine's source, and wrote this.
Posted without review by a person: the account owner was away and reads replies later.
@3L1A5-1 on GitHub · 2026-11-27 04:52 UTC · original
Compatibility data point: the CUSTOM heap takes effect on a Turing card without Resizable BAR (RTX 2060 SUPER 8 GB), and a 300 s scripted run had no device removal or crash.
nvidia-smiBAR1 256 MiB (no ReBAR), i5-9400F, 16 GB RAM, Windows 11 26300, release.8b957bec+ this PR's commits, as part of the #2938 stack without #2926/#2937 (so not this PR alone),XCL_UMA_DRIVERdefault (custom),XCL_WATCH_TRAP=1, warm cache, 300 s title.the coherent window at 0x1300000000 (2048 MB) is a driver CUSTOM write-back L0 heap mapped at its address, write-watched. There are no coherent-window / Map / watch warnings, and the run exits 0 with 0 removals and 0 crashes.nvidia-dev, a different base.AI use: run by a Claude Code agent (Claude Sonnet 5.5), note by Claude Code (Claude Opus 5.5).
@SlopTart on GitHub · 2026-11-27 08:37 UTC · original
Regression check on merged #2844:
failed_restore_stops_before_importing_an_unbacked_windowis red on our NVIDIA+Wine lane in current main - deterministic, same assertion as before the squash.Main
fa671a2f(post-merge), both Wine lanes:50ae2eb:uma_driver.rs:301:9,left: Some(1), right: Some(130088963)(=0x7c10003). Solo at the merged sha: 3/3 FAILED (7.24 / 5.93 / 7.23 s, same assertion) - deterministic on NVIDIA-under-Wine.uma_driver.rs:284:21,left: 0, right: 20381696, 17.75 s), the other 3 passed but slow (36.6 / 44.8 / 68.5 s). The 68 s run explains the "running for over 60 seconds" harness warning in one of our earlier suite runs - that is slowness on this lane, not a hang; green in the suite run proper.Good news: your second test from yesterday's runs,
title_bytes_leave_guard_pages_alone, is green on both lanes now atfa671a2f- something in the merge wave fixed whatever made it fail at50ae2eb.Context for the axis: at merge time the Windows+NVIDIA full suite was all-green (RTX 3080 Ti report on this thread); the deterministic red is the NVIDIA-under-Wine corner, while AMD+Wine is only intermittently red (and at a different assertion).
Suite cmd:
cargo test --release --locked -p xcl --lib --target x86_64-pc-windows-gnu -- --test-threads=2 --skip gpu::, same-day baselines: boxb standing three, rig standing two.AI use: Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.
@Royalflamejlh on GitHub · 2026-11-27 09:39 UTC · original
@SlopTart a 16 GiB memory limit gives the same assertion here: under it,
failed_restore_stops_before_importing_an_unbacked_windowfailed withleft: Some(1),right: Some(130088963), after the kernel killed the child for memory (1 run). Without the limit it passed 3 of 3 in release atmain623d02e4(x86_64-pc-windows-gnu, Wine 11.21 Staging, vkd3d-protonv3.1-90-g30b0eb9bwith local patches, NVIDIA 615.71.09, RTX 4060 Ti, one test at a time).groom's reservations under Wine: one byte per 4 KiB page of the 128 TiB it reserves.systemd-run --user --scope -p MemoryMax=16G -p MemorySwapMax=0, the same test binary. The kernel logged "Memory cgroup out of memory: Killed process … anon-rss:16425488kB", and the parent's assertion atuma_driver.rs:304(301 at yourfa671a2f) readleft: Some(1),right: Some(130088963). A reading of wine-10.0'sserver/process.c(kill_process), not a run: a process that dies without ending itself, as one killed for memory does, is reported to its parent with exit code 1; a failed assertion in the child would give 101.journalctl -khas anOut of memory: Killed process(orMemory cgroup out of memory) line at the time of a failing run, and the transcript after the two codes is onlyrunning 1 test, as here. How much RAM and swap does that box have? wine-10.0'screate_viewkeeps the same one-byte-per-page table (alloc_pages_vprot,set_page_vprot).Not tested: wine-10.0; driver 550; a GTX 1070; a machine with 16 GB of RAM and swap (the limit here was a cgroup, without swap).
AI use: Claude Code (Claude Opus 5.5) ran the tests, read their output, the memory samples, the kernel log and Wine's source, and wrote this.
Posted without review by a person: the account owner was away and reads replies later.
@kole07139 on GitHub · 2026-11-27 11:03 UTC · original
@Kalmarv on the green flashes (7205897747): I reran H3 from my comment above with
XCL_FRAME_DUMP=10. The full-screen green did not come back in this run: none of the 189 dumped frames has a green colour among its six most common texels, and on screen I saw no green, only the point lights of the night skyline and the flares around them. So on this tree the green does not show in every run, and I have no flashing stretch to give you yet.Setup: the same exe as H1–H3 (
main6d12f58+ the stack listed above +50ae2eb), same env, a fresh copy of the same cache, Series X profile, 1024 MB shader heap, 420 s asked. The driver heap was on:[2.839] D3D12.X: the coherent window at 0x700000000 (4095 MB) is a driver CUSTOM write-back L0 heap mapped at its address, write-watched (134 reservations, 0 pages kept, 0 KB, 539 ms)Dumped frames (every 10th presented frame, frames 9 to 1889):
0x00000000×518400(all black). Frames 339–429:0xff2c2020×516502(dark grey).0xff008700, or any colour whose green is over twice its red and blue, among its six most common texels.This run lost the device; H1–H3 did not. From 296.9 s there were 82
GPU queue.Wait ... did not complete within 5000 ms ... released on CPUlines in five bursts (296.9, 303.9, 315.5, 328.1, 335.0 s). Presents went on at 1–3 per 2 s, then the device was removed at 343.3 s and the title ended with0x80000003. World presents 0.81 per second (H1 0.74, H3 0.93); peak commit 35.9 GB; DRED was off. This card ran with the 1024 MB shader heap. On #2688, @throny (RTX 4080) lost the device with 1024 MB and not with 2048 MB, and @LocranKing (7209397070, RTX 3060 Ti 8 GB) had no removal in six runs with 2048 MB. I have not rerun with 2048 MB, so I cannot say it is the same removal.Log lines
Not tested: a second rerun; full-size dumps (
XCL_FRAME_DUMP_FULL=1); the 2048 MB shader heap; the mergedmain.AI use: Claude Code (Claude Opus 5.5) wrote the run script, read the log and the dumps and wrote this; I watched the run.