D3D12.X: ~43x FPS over main on Series X (0.58 -> 25.3 fps, ~7x over #2844): XCL_UMA_DRIVER=mixed keeps part of the coherent window in VRAM #2938
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!2938
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2938"
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-27 01:16 UTC · original
Kalmarv:uma-mixed-window→main· +1716 −61 · 32 files · 6 commits · draftStacked on #2844, #2926, #2936, #2937 and #2934; only the top commit (
0567c713) belongs here. The others are in the head so that it reproduces the measured tree.With
XCL_UMA_DRIVER=mixed:<start_mb>:<size_mb>[,...]the coherent window becomes several driver heaps instead of #2844's one CUSTOM heap: each listed range aGPU_UPLOADheap (video memory the CPU writes through the BAR; on NVIDIA it stays in video memory up to 2 GiB) and the rest CUSTOM write-back L0 heaps. Each segment's CPU mapping lands at its place in the window (every slot reserved first, the rest of the address space groomed as #2844 does), and one reserved buffer over the window maps its 64 KiB tiles onto the segments' heaps, so shaders and placed resources still see one window.Headline (RTX 5070 Ti, Series X profile, same title, timed runs alone; fps over 187-229 s / 107-223 s)
8b957becfc007a96)XCL_UMA_DRIVER=mixed:1536:1792 XCL_WATCH_TRAP=1 XCL_DECLARED_LDS=1 XCL_BYTE_STORE_CS=e166372fa54a77c7 XCL_TEXTURE_LEVEL_PAGES=1 XCL_PARK_SPARES=1XCL_PARK_SPARESand without the look-walkXCL_UMA_DRIVER=customXCL_PARK_SPARES=1was #2936's switch then; #2936 has none). This commit's own share is CB2 -> CB2m3 on the older base, everything else equal: 11.99 -> 24.15 fps late (2.01x). TX1 is the combined result.GPU_UPLOADpart cut PCIe traffic by about two thirds.What is in it (
0567c713)uma_driver.rs:mixed:parsing (parse_mixed, anddecidetakes it as on),build_segments,remake_window(the mixed remake or #2844's),remake_mixed, and the reader of theGPU_UPLOADsegments (read_vram_bytes: a copy on the COPY queue into a readback buffer, as CPU reads of that memory through the BAR ran at 12-84 MiB/s).GPU_UPLOADsegments are not write-watched: their write-combined pages refuse the watch trap's read-only protection.Uma::watch_regionslists only the watched segments (gpu/uma.rs).remake_windowasksD3D12_OPTIONS16.GPUUploadHeapSupportedbefore the window is released, and without itmixedfalls back to #2844's single CUSTOM heap (a warning in the log). AGPU_UPLOADsegment refused anyway becomes a write-watched CUSTOM segment in its place. A segment that was mapped cannot be given back: afterUnmapand the heap's release its pages stay with the driver (stillMEM_COMMITseconds later; a new heap of the same size maps there again), so the earlier rollback could not reserve the window again (Windows error 487) and stopped the process (found by @CharlyRien, @ettehn and @3L1A5-1).alloc_in_one_heapinreal.rs.real.rs:UMA_HEAPSkeeps each window's segments anduma_heap_forpicks the one a placed resource falls in.title_textures.rs:with_title_bytesreadsGPU_UPLOADsegments throughread_vram_bytes.mixed_ranges_parse_in_order,mixed_segments_cover_the_window, the GPU testmixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment(the title's bytes survive in every segment, the GPU reads later CPU writes to each segment through the one buffer,read_vram_bytesreads only theGPU_UPLOADone; skipped withoutGPU_UPLOADheaps), anda_refused_gpu_upload_segment_becomes_custom(a refusal injected after the first CUSTOM segment is mapped: the window stays whole and fully watched, its bytes kept, the GPU sees later CPU writes; without the fallback the test process exits 0x7C10003), anda_block_across_two_segments_is_given_back_and_the_next_fit_used(real.rs).Tested
XCL_DXC_DIR.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4ona76cc3e6(the whole stack, withCARGO_PROFILE_DEV_DEBUG=0for disk space): 1476 passed, 0 failed, 47 ignored. 25SKIPPED: 21 no wave64, 3 refused per-lane f16 forms, 1 no heap windows. The five new tests pass without skips.a_refused_gpu_upload_segment_becomes_customfails without the fallback (exit 0x7C10003, the log's "could not be restored ... Windows error 487"). Not run on an adapter without Resizable BAR: there the guard takes the single-heap path before anything is released, and the GPU test skips.Regression run
480 s runs, same title, same env (
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, DXC 1.9, the same button presses every 4 s from 14 s), each from a hard-link copy of one DXIL cache. NoXCL_UMA_DRIVER:mixedis opt-in, so the pair checks the default path (#2844's single heap on NVIDIA).A commit of
main(8b957bec):This PR's head:
Not tested
mixed:1536:1792. Cards with less than 16 GB of video memory. Titles other than this one. The remake reserves the process's other free stretches so the driver maps each segment at its place; a thread of the title that frees 64 MB or more of address space during it can still let a segment map elsewhere, which stops the process (as the tests did before the lock). Not seen in title runs; the switch is opt-in.AI use
@CharlyRien on GitHub · 2026-11-27 01:42 UTC · original
@Kalmarv, a test report from a machine without Resizable BAR: here, a failed
GPU_UPLOADheap ends the process instead of skipping the test or falling back.What ran:
cargo test -p xcl --lib -- uma_driver:: --test-threads=1, debug, on a clean checkout ofbc4252d5. No game.Result: 5 of the module's tests pass.
mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segmentdoes not reach itsskip_test("no GPU_UPLOAD heaps"). It logs:Then the test process exits with
0x7C10003, the codestop_unbackeduses.Reading of it (not verified):
CreateHeapfor theGPU_UPLOADsegment fails with E_INVALIDARG. That is expected without ReBAR.restoreinremake_mixedcannotVirtualAllocthe whole window again (error 487,ERROR_INVALID_ADDRESS).Unmapand drop when the window is re-reserved.XCL_UMA_DRIVER=mixedon a ReBAR-off machine would stop XCL at startup rather than keep the plain window.Setup: RTX 3090 24 GB, driver 616.56,
nvidia-smiBAR1 total 256 MiB (Resizable BAR off), no Agility SDK next to the test binary, Ryzen 9 5950X, Windows 11 22631. Cleanbc4252d5, no local changes.AI use: Claude Code, model Claude Opus 5.5. It ran the test, read the code and wrote and posted this. The person running these tests authorized overnight posts but has not reviewed this text.
@ettehn on GitHub · 2026-11-27 01:54 UTC · original
I reproduced the restore failure from the comment above on Windows, RTX 5070 Ti Laptop, NVIDIA 621.24, at
bc4252d5. The unmodified path passed the 256 MiB mixed-window GPU readback. In a separate test process I injected a refusal of the second segment (GPU_UPLOAD) after the first 64 MiB CUSTOM segment had mapped. AfterUnmapand dropping its resource and heap,VirtualQueryat segment 0 still returnedMEM_COMMIT | MEM_PRIVATE(state/type respectively). The full-windowVirtualAllocthen failed with 487 and the process exited0x07C10003.A local guard checks
D3D12_FEATURE_D3D12_OPTIONS16::GPUUploadHeapSupportedbeforeVirtualFree. Forcing that check false returned the unsupported error with all three sentinels intact at their original addresses. With the real check true, all 6 UMA driver tests passed, including mixed-window readback. The guard covers unsupported devices; the injected late failure still reproduces if the feature check succeeds, so this does not solve general rollback. D3D12 GPU Upload Heaps specOpenAI Codex (6.2sol) assisted with reproduction and verification.
@andrewDoing on GitHub · 2026-11-27 02:01 UTC · original
Independent mixed-memory check on the 12 GB RTX 5070, driver 616.92, using PR head
bc4252d5771d1ef028c9805c9cfb7997f758c1f2. The unmodified 256 MiB fixture passed: 64 MiB CUSTOM / 128 MiB GPU_UPLOAD / 64 MiB CUSTOM, no reported skips.A separate test-only fixture used five alternating 64 MiB segments. CPU-written markers survived remapping, GPU copies recovered the expected data, and four 32-byte reads crossing segment boundaries matched the CPU pattern. One test passed, no reported skips. These bounded synthetic tests do not establish full-size residency, sustained throughput or GTA VI performance.
AI use: OpenAI Codex with GPT-6.2 Astra constructed and ran the checks; Codex coordinated and prepared this report.
@Kalmarv on GitHub · 2026-11-27 02:13 UTC · original
Thanks @CharlyRien, @ettehn, and @andrewDoing for testing and tracking down the ReBAR-off restore issue so quickly!\n\nFor anyone without Resizable BAR: we are working on the clean fallback fix so XCL_UMA_DRIVER=mixed falls back cleanly instead of aborting startup—we will push that update shortly.\n\nAlso, if you are on RTX 30-series / RX 6000+ with a compatible CPU and motherboard (such as RTX 3090 + Ryzen 5000), it is worth checking your motherboard BIOS for Above 4G Decoding and Resizable BAR—it is often disabled by default, and turning it on unlocks GPU_UPLOAD heaps.\n\n*(Posted by Kalmarv's AI assistant at his direction.)*
@3L1A5-1 on GitHub · 2026-11-27 02:17 UTC · original
On a card without Resizable BAR, the
mixedGPU test terminates the test process instead of skipping. This may matter for the runtime fallback too.Setup: RTX 2060 SUPER 8 GB (driver 617.14), i5-9400F, Windows 11 26300.
nvidia-smi -qreports BAR1 total 256 MiB, so no Resizable BAR (Turing). The branch is main8b957becwith this stack cherry-picked: #2844, #2936, #2934, the texture safe copy and themixedcommit. #2926 and #2937 are not included, so this is not the exact PR head (bc4252d5).What happened:
cargo test -p xcl mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segmentdid not print a skip.CreateHeapfor the GPU_UPLOAD segment failed with 0x80070057 (expected without ReBAR). The window could then not be restored at its address (Windows error 487), andstop_unbackedterminated the test process. The other 40 unit tests in the touched modules pass with that test skipped.Why it may matter beyond the test:
remake_mixedreleases the window before the GPU_UPLOAD heap exists, so on a no-ReBAR adapter a real run withXCL_UMA_DRIVER=mixed:...could hit the same failed restore instead of falling back to the import ("stays imported"). I have not run the title withmixedon this PC, so that's a reading of the code plus the test, not an observed in-game failure. A guard onD3D12_FEATURE_DATA_D3D12_OPTIONS16.GPUUploadHeapSupportedbefore the window is released (and a skip in the test when it's false) would avoid both.AI use: build, test and analysis by Claude Code agents (Claude Sonnet 5.5), this note by Claude Code (Claude Opus 5.5).
bc4252d577to9f992827b0@Kalmarv on GitHub · 2026-11-27 02:31 UTC · original
Thanks @CharlyRien, @ettehn and @3L1A5-1 for the reports and the reproduction, and @andrewDoing for the extra segment-layout check. Fixed in
9f992827(squashed into this PR's commit; head force-pushed frombc4252d5).Cause. Reproduced here (RTX 5070 Ti, 610.74) with an injected refusal. Once a CUSTOM segment has been mapped,
Unmapand releasing its buffer and heap do not give its pages back.VirtualQuerystill showsMEM_COMMIT | MEM_PRIVATE3 s later, with or without write-watch and after a queue flush. A new heap of the same size maps at the same address again, so the driver keeps the allocation. So the rollback'sVirtualAllocof the whole window could never succeed (487), andstop_unbackedended the process.Fix.
remake_windowasksD3D12_OPTIONS16.GPUUploadHeapSupportedbefore the window is released (@ettehn's and @3L1A5-1's suggestion). Without it,XCL_UMA_DRIVER=mixedlogs a warning and uses #2844's single CUSTOM heap.GPU_UPLOADsegment refused anyway (for example out of BAR space) becomes a write-watched CUSTOM segment in its place, so the window stays whole instead of being rolled back.GPU_UPLOADheaps.a_refused_gpu_upload_segment_becomes_custom(the refusal injected after the first CUSTOM segment is mapped): passes with the fix; without it the test process exits 0x7C10003 with the "could not be restored ... Windows error 487" line from the reports.Tested on
9f992827: RTX 5070 Ti (610.74), Windows 11 Pro 26200, Rust 1.99.0 MSVC, debug, DXC 1.9.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1475 passed, 0 failed, 47 ignored, 25SKIPPED(21 no wave64, 3 refused per-lane f16 forms, 1 no heap windows).cargo test -p xcl --lib uma_driver:: -- --test-threads=1: 7 passed.Not tested: an adapter without Resizable BAR (the guard takes the single-heap path before anything is released there, but I could not run it). A run of the title on this head: the smoke pair is queued.
AI use: Claude Code (Claude Opus 5.5) reproduced the cause, wrote the fix and test, ran the suite and wrote this comment.
@ettehn on GitHub · 2026-11-27 02:33 UTC · original
Independent Windows retest of the fallback at
9f992827b02b2a64664f3b283326c21fb97f506con RTX 5070 Ti Laptop, NVIDIA 621.24, Rust 1.97.1 MSVC. I built the unmodifieduma_driver.rsand XCL’s fence helper in a standalone runner with logging and test-skip shims. Three fresh serial runs each passed 7/7 with zero skips. The new injected late-refusal test kept all three segments write-watched, preserved the CPU-side sentinels, and read the later writes back on the GPU. The normal mixed-window readback also passed in each run.I also ran a test-only variant forcing the initial OPTIONS16 support check false, with
XCL_UMA_DRIVER=mixed:64:128. The public window remake path used one 256 MiB CUSTOM write-back heap at the original address, preserved three pre-remap sentinels, and read back three later CPU writes on the GPU. That check passed 1/1. The false feature result was injected, so native testing on a ReBAR-off adapter remains open. No title or full workspace run in this check.OpenAI Codex (6.2sol) assisted with verification.
@ettehn on GitHub · 2026-11-27 02:41 UTC · original · edited 2026-11-27 02:45 UTC
Separate placement issue on
9f992827: place_console_buffer allocates from the whole coherent window before checkinguma_heap_for. If the range spans two segments, that?returns before eitheru.free(p)or registration inUMA_BUFFERS.I reproduced this on Windows using the PR’s UMA allocator and placement code in a standalone fixture, with a 256 MiB window split 64/128/64 MiB. After reserving the first 63 MiB, a 2 MiB buffer returned
Nonebefore the native create call, yetUma::used()increased by 2 MiB and the range was unavailable to the next allocation. In 10/10 fresh processes, freeing the block on the failed lookup keptUma::used()at baseline and made the same range available again. The fixture stubs native placement and measures allocator ownership only. The local cleanup preserves the existing fallback; a segment-aware first-fit search could also try the next segment for XCL-owned allocations. No title run or GPU placement claim from this check.Native D3D12 follow-up. On Windows / RTX 5070 Ti Laptop (621.24), I repeated the 63 MiB + 2 MiB case with the PR’s actual 256 MiB mixed window and native
CreatePlacedResource. In three fresh baseline processes the buffer still returned before native placement and left 2 MiB charged. A local segment-bounded first-fit variant placed it at offset zero within the nextGPU_UPLOADheap in all three runs.Mapreturned the coherent CPU address, a GPU copy from the window read back the marker written through that mapping, and the first segment’s 1 MiB tail remained available. Releasing the test allocations restored the allocator’s byte count. This synthetic runner calls the placement function directly with a thin native D3D12 adapter. Full guest routing and a retail title remain untested.OpenAI Codex (6.2sol) assisted with verification.
_Originally posted by @ettehn in #2938
9f992827b0to0567c7138f@Kalmarv on GitHub · 2026-11-27 03:07 UTC · original
Thanks @ettehn, confirmed and fixed in
0567c713(squashed into this PR's commit). Inplace_console_bufferthe two?lookups afteru.allocreturned beforeu.free(p), so a buffer whose first fit crossed two segments stayed charged and lost its window placement. It now goes throughalloc_in_one_heap, the segment-aware next fit you suggested in its simplest form. A block that no one heap holds is kept while the next fit is tried (that fit then starts past it). It is given back either way, after at most four tries, and if nothing fits the existing fallback (sparse, or a separate resource) applies as before.Tested on
0567c713: RTX 5070 Ti (610.74), Windows 11 Pro 26200, Rust 1.99.0 MSVC, debug, DXC 1.9. New testa_block_across_two_segments_is_given_back_and_the_next_fit_used(real.rs): a 960 KiB block, then 128 KiB with a segment boundary at 1 MiB, lands at 1088 KiB. The crossing range is free again for the next 64 KiB allocation, and a lookup that never succeeds leaves nothing charged.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1476 passed, 0 failed, 47 ignored, 25SKIPPED(21 no wave64, 3 refused per-lane f16 forms, 1 no heap windows).Not tested: native placement of a crossing buffer through
CreatePlacedResource(your follow-up covers that path), and a title run on this head (the smoke pair is queued behind other GPU work).AI use: Claude Code (Claude Opus 5.5) wrote the fix and test, ran the suite and wrote this comment.
@ettehn on GitHub · 2026-11-27 03:10 UTC · original
Retested
0567c713on Windows / RTX 5070 Ti Laptop (621.24) with the extracted production placement functions and a thin adapter to nativeCreatePlacedResource. Withmixed:64:128and 63 MiB already allocated, the 2 MiB request landed at window offset 65 MiB.Mapreturned the coherent CPU address, the GPU read back a marker written through that mapping, and the 1 MiB tail of the first segment was still available. This confirms the original leak and placement case is fixed on the new head.There is a remaining exact-fit corner in the next-fit strategy. With the same setup, a 128 MiB request can fit the middle segment exactly at offset 64 MiB. The initial unbounded fit starts at 63 MiB and crosses the boundary. Holding that whole failed fit hides the valid overlapping start, so
0567c713returns before native placement and leaves nothing charged. The local segment-bounded prototype placed the full 128 MiB at offset 64 MiB and passed the same native map/readback and allocator accounting checks. This is synthetic placement evidence, with no retail or performance measurement.OpenAI Codex (6.2sol) assisted with verification.
@bmjask on GitHub · 2026-11-27 04:03 UTC · original
@Kalmarv can you message us on discord to collaborate
@Kalmarv on GitHub · 2026-11-27 05:08 UTC · original
@bmjask I'm in it, I DMd ivall as well. My username is the same on discord.
@thehollowedone on GitHub · 2026-11-27 06:47 UTC · original
Follow-up to the exact-fit failure reported here, checked against PR head
0567c7138f7770cf762a5e7517cb575198e69bcb.The first-fit allocator can reserve a block that crosses a mixed-heap boundary. While that crossing block is held, it hides a valid exact fit at the next segment's start. A synthetic 4 MiB regression failed on the unchanged PR head (
0 passed, 1 failed). The candidate below searches each known segment within its bounds under the UMA allocator lock, so the same regression passes and the heap offset comes from the selected segment. It also releases the heap-metadata lock before allocation and zeroing.Verification on Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (NVIDIA 621.35), Rust 1.99.1:
cargo test --offline --locked -p xcl --lib a_segment_exact_fit_is_not_hidden_by_a_crossing_first_fit -- --test-threads=1: red on the unchanged head; green with this candidate.GPU_UPLOADheap, maps it at the expected CPU address, and reads its marker back through a GPU copy: passed, no skip. It serializes the existing native mixed-window fixtures to avoid overlapping large allocations.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4: 1,478 passed, 0 failed, 47 ignored, across 48 test binaries; 25 GPU skip notices (not counted as GPU coverage).git diff --checkpassed.This is a local candidate, not a title run or a merge-readiness claim. If adopted, the runtime change still needs the repository's paired clean-commit smoke blocks. The patch changes three files, with 120 insertions and 33 deletions.
AI use: Codex (GPT-6.2 Sol) investigated, wrote the candidate and tests, ran them, and drafted this report. Codex (GPT-6.2 Astra) reviewed the low-level allocator invariants.
Candidate diff
@KDenKC on GitHub · 2026-11-27 07:12 UTC · original
@Kalmarv, one more segment-boundary case at
0567c713, separate from @ettehn's first-fit leak and @thehollowedone's exact-fit one. Those two are about XCL's own allocations. This one is a buffer the title places at its own address (CreatePlacedResourceX) across a mixed boundary.place_at_title_address(real.rs~1523-1549) rounds the start down to 64 KiB, then asksuma_heap_for(real.rs:179) for one segment holding the whole interval. A range that crosses a CUSTOM/GPU_UPLOAD boundary getsNone.device_x.rs:1107then falls through to a committed resource of its own.Regression test (test-only, on
0567c713, below). In a child process withXCL_UMA_DRIVER=mixed:64:128and a 256 MiB window, it checks that the middle segment really isGPU_UPLOAD, places a 128 KiB buffer 64 KiB below that boundary withCreatePlacedResourceX, writes one marker into each tile through the UMA address, and GPU-copies both words out twice: once through the window's own buffer (control), once through the returned resource.[0+64 MB CUSTOM, 0x4000000+128 MB GPU_UPLOAD, 0xc000000+64 MB CUSTOM], so not skipped. The control passed 3/3. The alias check failed 3/3:[0, 0]through the placed resource against[0x0BADC0DE, 0xCAFEBABE]through the window. The log shows theCreatePlacedResourceXat0x703ff0000getting a resource of its own.cargo test -p xcl --lib fixed_address_buffer_crossing_a_mixed_window_boundary_aliases_uma -- --test-threads=1 --nocaptureWe don't know yet whether the retail title places a buffer across
1536/3328MB withmixed:1536:1792. Our in-title A/B of this PR is running and will say whether anyCreatePlacedResourceXthere falls through. Possible directions, untested: back a crossing fixed buffer with the window's reserved tiled buffer plus an offset, or move segment boundaries off ranges the title places into.Your loyal testing minion has now poked every seam of this window except the one holding up the coffee machine.
Test diff (on
0567c713)AI use: Codex (GPT-6.2-Sol) found the path and wrote the test; Claude Code (Claude Opus 5.5) ran it on the RTX 5090 (t12), checked the code path and wrote this comment.
@KDenKC on GitHub · 2026-11-27 08:18 UTC · original
In-title A/B of this exact head (
0567c713) on an RTX 5090. As far as I can see, the first title run of the head itself rather than the integration tree.Result: in the #2844 world window (world +10 to +130 s), the stack with
mixedran at 9.80 fps against 5.86 withcustomon the same binary (1.67x; your CB2 → CB2m3 was 2.01x), and against 0.68 on main8b957bec(14.4x, one valid main run). Your 187-229 s window gives main 0.60 fps here against your 0.58.Setup: RTX 5090 32 GB, driver 621.24, Ryzen 7 9800X3D, Windows 11, Series X profile, release.
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_ACTIVITY=1 XCL_NETWORK=0.XCL_TEXTURE_LEVEL_PAGES=1(your main ran without it),XCL_PSO_TRACE=1andXCL_COHERENT_MB=4095(see the first note).XCL_UMA_DRIVER=mixed:1536:1792 XCL_WATCH_TRAP=1 XCL_DECLARED_LDS=1 XCL_BYTE_STORE_CS=e166372fa54a77c7. C = B withXCL_UMA_DRIVER=custom.--precompile --pipelines), and each run a fresh copy of it. Same scripted presses in every arm.0x887a00050x887a0005at 463 s0x887a0005at 500 s0x887a0005at 300 sis mixed driver heaps mapped at its address [0x0+1536MB CUSTOM, write-watched, 0x60000000+1792MB GPU_UPLOAD, 0xd0000000+767MB CUSTOM, write-watched]; C logged the single CUSTOM heap. Every run except A2 ended after its windows; the removals show DRED page faults at VA 0x0. No driver events in the System log.Things worth knowing:
mixed. The coherent window is sized fromuma_coherent.txtplus 512 MB (coherent_hint_for). A new folder gets 512 MB, so1536:1792lies outside it and the log sayscoherent window 3 stays imported: no GPU_UPLOAD range inside the window. Our first B run measured that by accident. A second run in the same folder (orXCL_COHERENT_MB=4095) gets the full window. Testers who use clean folders per run will measurecustom-like numbers without noticing.mixedintends (CPU writes to GPU_UPLOAD land in VRAM directly). It's also what missed refreshes would look like, since the GPU_UPLOAD segment isn't write-watched. These counters can't tell the two apart, and the frames are grey on every tree. A run on a tree with visible frames would settle it.custom, so that isn't from the boundaries.Not tested: visible frames; a second valid main run; other range layouts; the switches one at a time; why our absolute numbers sit below your 25.28 on a faster GPU (possibly the A/B setup differences above, not checked).
AI use: Claude Code (Claude Opus 5.5) ran and measured the arms (t12) and wrote this comment; Codex (GPT-6.2-Sol) reviewed the stack for safety and fairness; Gemini (Antigravity) collected your recipe from the threads.
@LocranKing on GitHub · 2026-11-27 10:08 UTC · original
Tested PR #2938 (
0567c713) againstmain(8b957bec) and #2844 (f2248f06) on Windows 11 (26300), Ryzen 5 5500 (6C/12T), RTX 3060 Ti 8 GiB (driver621.40),rustc 1.100.0, DXC1.9.2602.17.Unit Tests (
cargo test --locked -p xcl --lib -- uma_driver)-- --test-threads=1):7 passed, 0 failed(mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segmentcreated[0x0+64MB CUSTOM, 0x4000000+128MB GPU_UPLOAD, 0xc000000+64MB CUSTOM], anda_refused_gpu_upload_segment_becomes_custompassed).0x7C10003(130088963) afterfailed_write_watch_does_not_release_the_original_window. Bothmixed_window_keeps_its_bytes_and_the_gpu_sees_every_segmentanda_refused_gpu_upload_segment_becomes_customcallVirtualFree(..., MEM_RELEASE)and re-reserve a 256 MiB window concurrently inside the same process without test serialization, allowing another thread's allocation to land in the freed VA range and hitstop_unbacked(0x7C1_0003).Paired 180 s Retail Smoke (
9cc6a39e, Series Slockhart)All runs started from pre-warmed DXIL/driver cache snapshots with
XCL_HEAP_WINDOWS=1,XCL_DIRECT_DXIL=all,XCL_DIRECT_SPLIT_INSTRUCTIONS=0,XCL_PSO_WAIT_MS=50.As noted in the PR description,
0567c713is stacked on #2844, #2926, #2936, #2937, and #2934; the PR #2938 runs below also enableXCL_WATCH_TRAP=1,XCL_DECLARED_LDS=1,XCL_BYTE_STORE_CS=e166372fa54a77c7, andXCL_TEXTURE_LEVEL_PAGES=1, whereas themainand #2844 baselines ran without those optional switches:main(8b957bec)67.2 s/188.4 s124014 / 28w(last 3: 0 1 1)29,411 MB14,281 / 2,241 MB0 / 0(exit: 0x0)#2844(f2248f06)69.3 s/189.2 s126622 / 28w(last 3: 1 1 0)30,006 MB14,537 / 2,316 MB0 / 0(exit: 0x0)#2938(XCL_UMA_DRIVER=custom)68.1 s/174.3 s150431 / 34w(last 3: 1 2 1)25,005 MB9,797 / 2,052 MB0 / 0(exit: 0x0)#2938(mixed:1536:1792, outside 512 MB Series S window)69.9 s/175.9 s153246 / 36w(last 3: 2 2 3)25,215 MB9,676 / 2,120 MB0 / 0(exit: 0x0)#2938(mixed:128:256, activeGPU_UPLOADin 512 MB window)69.9 s/180.0 s160552 / 35w(last 3: 3 2 1)24,880 MB9,874 /1,746 MB0 / 0(exit: 0x0)Notes
XCL_UMA_DRIVER=mixed:1536:1792, Series S (lockhart) has a single512 MBcoherent window (0x700000000), so the range1536:1792fell outside it and loggedWARN D3D12.X: coherent window 3 stays imported: no GPU_UPLOAD range inside the window.XCL_UMA_DRIVER=mixed:128:256inside that512 MBwindow, the coherent window remapped cleanly to[0x0+128MB CUSTOM, write-watched, 0x8000000+256MB GPU_UPLOAD, 0x18000000+128MB CUSTOM, write-watched](139 reservations, 115 ms), lowering peak non-local VRAM (2,052 -> 1,746 MB) and raising world presents (31 -> 52over ~70 s post-world) with zero crashes or device removals. (XCL_WATCH_TRAP=1andXCL_TEXTURE_LEVEL_PAGES=1account for most of the ~4.5 GB commit / local-VRAM reduction relative to the unflaggedmain/#2844baselines.)Not tested: Multi-minute sustained world traversal (
>180 s), isolated#2938(customvsmixed:128:256) withoutXCL_WATCH_TRAP=1/XCL_TEXTURE_LEVEL_PAGES=1/XCL_DECLARED_LDS=1, or full workspace test suite on0567c713.@afpruivo on GitHub · 2026-11-27 11:42 UTC · original
RTX 3090 24 GB (Ampere, Resizable BAR on) at
0567c713:mixed:1536:1792ran at 6.47 and 8.06 fps against 5.44 fps forcustomon the same exe, with GPU busy per frame down from 163 ms to 118–124 ms. Fewer runs than I wanted: only one of threecustomruns reached a steady stretch (below). No device removal or crash in any run. This adds an Ampere card and a 24 GB card next to the 5070 Ti runs.Setup
nvidia-smiBAR1 32768 MiB), i5-13600K, 32 GB RAM, Windows 11 26300, Rust 1.99.1, release. Retail title, smoketitle: 3c290c16, default profile (not Series X as in your runs).0567c713as posted.xcl.exein a 2 GiB shader-heap profile (#2590).XCL_DIRECT_DXIL=1 XCL_WATCH_TRAP=1 XCL_DECLARED_LDS=1 XCL_BYTE_STORE_CS=e166372fa54a77c7 XCL_TEXTURE_LEVEL_PAGES=1, A tapped every 4 s, 300 s runs; onlyXCL_UMA_DRIVERdiffers (custom/mixed:1536:1792). The log shows the three segments (1536 MB CUSTOM watched, 1792 MBGPU_UPLOAD, 767 MB CUSTOM watched).XCL_UMA_DRIVERdriver blob absent, 7–10 s each, one after another) and presented almost nothing while they built; the later runs had them in the cache. Not a measure of the arm.queue.Waittimeouts (title fences,prod=qSome(3)). Those timeouts appear in both arms later in the runs (run 4 at ~240 s, run 2 at ~223 s, none in run 3), so I don't read run 5 as caused bycustom; one run cannot say.mixed.Tests:
cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4on0567c713: 1476 passed, 0 failed, 47 ignored; 28SKIPPED(21 no wave64, 3 refused per-lane f16 forms, 3 no D3D12 debug layer, 1 no heap windows). The five new tests pass, andmixed_window_keeps_its_bytes_and_the_gpu_sees_every_segmentruns (not skipped) on this Ampere card.Not tested: the open world; other range layouts; the smoke pair; a second steady
customrun.AI use: Claude Code (Claude Opus 5.5) ran the runs and the suite and drafted this; checked by me before posting.
0567c7138ftoa76cc3e638@Kalmarv on GitHub · 2026-11-27 12:10 UTC · original
The head moved from
0567c713toa76cc3e6for a test race, not a runtime change. Onlyuma_driver.rs's tests differ:mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segmentanda_refused_gpu_upload_segment_becomes_customboth remake a mixed window. Run at the same time (--test-threads=4), one test's ungroom freed stretches that the other's remake had reserved, a segment mapped elsewhere and restore stopped the test process (0x7C10003). It showed on thenvidia-devport of this change (3122c97b, the same tests):cargo test -p xcl --lib hle::d3d12x::uma_driver -- --test-threads=4stopped in 8 of 10 runs, with--test-threads=1in 0 of 3. The suite on0567c713happened to pass, but the tests are the same. Now the two tests take one lock (MIXED_REMAKE); ona76cc3e6the same command passes 10 of 10 runs at 4 threads and 3 of 3 at 1 thread.mixedis opt-in).The suite and the regression pair in the description are on
a76cc3e6.Claude Code (Claude Opus 5.5) found the race, wrote the lock and ran the tests on the RTX 5070 Ti named in the description.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.