D3D12.X: prepare for the unified memory copy path #1326
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!1326
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1326"
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?
@vakaobr on GitHub · 2026-11-24 14:48 UTC · original
vakaobr:uma/prepare→main· +106 −57 · 4 files · 1 commits · openFirst of four PRs that bring the unified memory copy path to
main(Part of #258): helpers it needs, with no change in behaviour. D3DMetal answers E_NOTIMPL forOpenExistingHeapFromAddress, so on a Mac there is no GPU unified memory; the copy path (the fourth PR) gives the committed window a copy in video memory instead.Based on Ahmet-Dedeler's
c70bf8aonmac-on-main-wip("Unified memory without OpenExistingHeapFromAddress: the committed window gets a copy in video memory"), which he handed over in https://github.com/ivall/xcl/issues/258#issuecomment-7134093997. Rebased ontomain930e8b4and split into four PRs.What is in it
crates/xcl/src/gpu/uma.rs:Uma::shadowed(never set in this PR) andis_gpu_copy(p): a sparse window, or a committed one the GPU only has a copy of.crates/xcl/src/hle/d3d12x/sparse.rs:new_stateextracted frominit, so the copy path can build the state without sparse windows; it keepsmain'sparkedlist and debug names.crates/xcl/src/hle/d3d12x/list_x.rs:note_copy_into, which records PC copies into console buffers whose memory the GPU only has a copy of; it returns at once whileshadowedis false.crates/xcl/src/hle/d3d12x/real.rs: the places that askedis_sparseaskis_gpu_copy, which is the same thing whileshadowedis false.Tested
x86_64-pc-windows-gnu(mingw-w64 GCC 16.2.0), debug, DXC 1.9.2609. Each test in its own process (<test exe> --exact <test> --test-threads=1 --nocapture).3dd994a: the seven UMA tests that fail onmainon this host fail the same way, at the same lines (gpu_uma_import_check_at_init,gpu_unified_memory_arena,gpu_memory_windows_above_4_gib,gpu_mesh_mode_reads_memory_windows,gpu_bvh64_intersect_ray_across_memory_windows_and_grazing,gpu_memory_windows_reject_out_of_uma_aliasing,gpu_sparse_vram_descriptors_buffers_and_xmem), and thelist_xandvramtests I sampled still pass.cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 41 ignored on both (@futurepro62, https://github.com/ivall/xcl/pull/1326#issuecomment-7135133510); AMD RX 9070 XT (RDNA4), Windows 11, release: 751 passed, 0 failed, 41 ignored, with the seven UMA tests passing natively (@eizispark, https://github.com/ivall/xcl/pull/1326#issuecomment-7135248447).Regression run
This changes runtime files, so it needs an
xcl-smokepair from someone with a title; I have none. Nothing in it is reached whileshadowedis false.Not tested
AI use
c70bf8aontomainand split it. Claude Code with Claude Opus 5.5 reviewed the slices, ran the tests above on this machine and wrote this description.@futurepro62 on GitHub · 2026-11-24 14:54 UTC · original · edited 2026-11-24 14:56 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
3dd994a(on its base930e8b4).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.#[test]functions in the diff.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 41 ignored, no skips.Not tested
AI use
@eizispark on GitHub · 2026-11-24 14:58 UTC · original
Hardware test report — commit
3dd994aVerified clean merge with
main(930e8b4) on3dd994adb78c2b758d07866632083d261c3e8871: pass.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profilecargo test --workspace --no-fail-fast -- --test-threads=4:751 passed, 0 failed, 41 ignored(GPU tests skipped on this adapter:none)gpu_uma_import_check_at_init,gpu_unified_memory_arena,gpu_memory_windows_above_4_gib,gpu_mesh_mode_reads_memory_windows,gpu_bvh64_intersect_ray_across_memory_windows_and_grazing,gpu_memory_windows_reject_out_of_uma_aliasing,gpu_sparse_vram_descriptors_buffers_and_xmem)Regression run
main(930e8b4):PR (
3dd994a):Not tested
XCL_D3D12_DEBUG=1; gameplay past the menusAI use
@DavidM1911 on GitHub · 2026-11-24 15:18 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 707-709 passed, 0 failed, 21 ignored.Thanks!
@Kalmarv on GitHub · 2026-11-24 15:26 UTC · original
Regression pair for
3dd994aagainstmain930e8b4(this PR's base), for the Regression run section. Both runs pass: no device removal, no crash, 101 % ofmain's frames, 94 % of its peak commit.Tested
scripts/smoke.ps1, the same retail title for 60 s each:mainat930e8b4(this PR's base) first, then this PR's head, one after the other on the same machine.main930e8b4:this PR,
3dd994a:Not tested
shadowedis never set in this PR, so the run only shows no regression.AI use: Claude Code (Claude Opus 5.5)
@JoaoPauluu on GitHub · 2026-11-24 15:28 UTC · original
A regression run under Wine on Linux, on a retail title.
Tested
x86_64-pc-windows-gnu.3dd994aas it is andmain930e8b4, no uncommitted changes. Retail title 1.0.2.1,scripts/linux/smoke.sh(#257) for 60 s, no input. Nine runs in a row,mainfirst and last, other PRs in between.Regression run
main (first run):
this PR:
The last
mainrun: 1338 frames,exit: 0x0, no device removal, no crash. Under Wine,peak commitreads 0 MB, so these blocks do not check memory.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-24 15:58 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib -- --test-threads=1: all passed, 0 failed, 21 ignored. (Parallel runs intermittently abort with 0xc0000005 — same harness flake seen on unmodifiedmain.)Thanks!
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.