Skip to content

Tests: GPU UMA tests skip where D3D12 has no heaps over process memory - #1060

Open
vakaobr wants to merge 1 commit into
xcl-dev:mainfrom
vakaobr:tests/uma-heaps-skip
Open

vakaobr wants to merge 1 commit into
xcl-dev:mainfrom
vakaobr:tests/uma-heaps-skip

Conversation

@vakaobr

@vakaobr vakaobr commented Nov 24, 2026

Copy link
Copy Markdown

On Apple's D3DMetal (macOS, CrossOver) OpenExistingHeapFromAddress answers E_NOTIMPL (0x80004001), so there are no GPU heaps over process memory. Six GPU tests that need them fail there instead of skipping: five unwrap runner::run_in_arena and panic on that error, and gpu_sparse_vram_descriptors_buffers_and_xmem finds no window VAs after real::init(). Part of #258.

What is in it

  • crates/xcl/src/gpu/recomp/tests.rs: no_host_heaps() skips with no GPU UMA only when the error is E_NOTIMPL from OpenExistingHeapFromAddress. run_in_arena_or_skip() wraps run_in_arena with it, used by gpu_unified_memory_arena, gpu_mesh_mode_reads_memory_windows (its positions closure now returns an Option), gpu_memory_windows_above_4_gib, gpu_memory_windows_reject_out_of_uma_aliasing and gpu_bvh64_intersect_ray_across_memory_windows_and_grazing. gpu_sparse_vram_descriptors_buffers_and_xmem checks the runtime's uma_error the same way before reading the window VAs. Any other error still fails the tests.

Tested

  • MacBook Pro M5 Pro (20-core GPU), 48 GB, macOS 27.2.1, CrossOver 26.3.0.39832, D3DMetal 3.0 ("AMD Compatibility Mode"), Rosetta 2. Rust 1.100.0, x86_64-pc-windows-gnu (mingw-w64 GCC 16.2.0), debug, DXC 1.9.2609. Each test in its own process (<lib test exe> --exact <test> --test-threads=1 --nocapture).
  • On main 9aec53d (full per-test run): all six fail, five with called Result::unwrap() on an Err value: "OpenExistingHeapFromAddress: Not implemented. (0x80004001)" and the sparse test with no valid window VAs.
  • At this PR's head b22e57c (on main 384f7f7): 6 passed, all six SKIPPED …: no GPU UMA.
  • Mutation: with the check looking for another code (0x8007000E), all six fail again.

Regression run

Test-only change in tests.rs: no xcl-smoke blocks.

Not tested

  • Windows and any host with heaps over process memory: there OpenExistingHeapFromAddress succeeds, nothing should skip, and the tests run as before, but I have not run it.
  • XCL_REQUIRE_GPU=wave64 / mesh turns these skips into failures, as for every reason but "no mesh shaders".
  • Not in this PR: list_x::tests::write_buffer_immediate_on_open_existing_heap_visible_to_cpu fails the same way but lives in list_x.rs (a runtime file for PR checks), and gpu::shader::tests::readable_answers_from_the_working_set_without_touching_pages fails for another reason (Wine's QueryWorkingSetEx).
  • Tests: the UMA import check test skips where D3D12 has no heaps over process memory #1024 handles gpu_uma_import_check_at_init the same way in another part of the file; the two do not overlap. Tests: the sparse VRAM test no longer depends on what ran before it #614 edits the real::init() line above the sparse test's new check and still applies on top of this change.

AI use

  • Claude Code with Claude Opus 5.5 traced the failures from a full per-test run, wrote the change and this description, and ran the tests and the mutation above on this machine.

On Apple's D3DMetal (macOS, CrossOver) OpenExistingHeapFromAddress
answers E_NOTIMPL (0x80004001). Five GPU tests unwrapped
runner::run_in_arena and panicked on it (gpu_unified_memory_arena,
gpu_mesh_mode_reads_memory_windows, gpu_memory_windows_above_4_gib,
gpu_memory_windows_reject_out_of_uma_aliasing,
gpu_bvh64_intersect_ray_across_memory_windows_and_grazing), and
gpu_sparse_vram_descriptors_buffers_and_xmem found no window VAs.

no_host_heaps() skips with "no GPU UMA" only for that error (the
runner's error, or the runtime's uma_error after init);
run_in_arena_or_skip() wraps run_in_arena with it. Any other error
still fails the tests: with the check looking for another code, all six
fail again on this host. (xcl-dev#258)

Assisted-by: Claude Code (Claude Opus 5.5)
@mikebuckets171

Copy link
Copy Markdown

Verified on a macOS host: all six tests this PR names do get the skip, from the E_NOTIMPL condition, and the skip does not fire anywhere it should not.

Host: MacBook Pro M5 Pro (48 GB), macOS 27.2.1, CrossOver 26 with D3DMetal (adapter reports "AMD Compatibility Mode"), Rosetta 2, Rust 1.100.0, x86_64-pc-windows-gnullvm (LLVM-MinGW, clang 23.1.6), --release --locked, test binaries under Wine, one test per process (--exact <full test path> --nocapture --test-threads=1), a fresh data root per run. Base 47efa2e, head b22e57c, each side built from its own checkout.

test 47efa2e b22e57c
gpu::recomp::tests::gpu_unified_memory_arena FAILED - panic at tests.rs:3115:54, exit 0x65 SKIPPED …gpu_unified_memory_arena: no GPU UMA -> ok 0.29 s
gpu::recomp::tests::gpu_mesh_mode_reads_memory_windows FAILED - tests.rs:3172:56 SKIPPED …: no GPU UMA -> ok 0.27 s
gpu::recomp::tests::gpu_memory_windows_above_4_gib FAILED - tests.rs:3236:54 SKIPPED …: no GPU UMA -> ok 0.26 s
gpu::recomp::tests::gpu_memory_windows_reject_out_of_uma_aliasing FAILED - tests.rs:3342:54 SKIPPED …: no GPU UMA -> ok 0.27 s
gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem FAILED - tests.rs:3397:5, assertion left == right failed, left: 0, right: 4 SKIPPED …: no GPU UMA -> ok 0.35 s
gpu::recomp::tests::gpu_bvh64_intersect_ray_across_memory_windows_and_grazing FAILED - tests.rs:4420:56 SKIPPED …: no GPU UMA -> ok 0.32 s

Six for six: the five run_in_arena sites fail on the base exactly as the description says (the unwrap on the heap-opening error, panic locations above), and gpu_sparse_vram_descriptors_buffers_and_xmem fails on its window-count assertion (left: 0, right: 4 - no window VAs recorded). At the head each one takes the no GPU UMA skip and the process exits 0.

The condition your no_host_heaps() looks for is the host's real answer here: a plain D3D12 program (no XCL, no game content) calling OpenExistingHeapFromAddress gets Not implemented (0x80004001) on this host, and the XCL runs record the same thing, so the narrow E_NOTIMPL-only trigger is the right discriminator rather than a general "UMA is missing" guess.

One failure in the same family this PR does not reach: hle::d3d12x::list_x::tests::write_buffer_immediate_on_open_existing_heap_visible_to_cpu panics at list_x.rs:5034:74, exit 0x65, on both sides - unchanged by this PR, because it lives in list_x.rs and this change touches only tests.rs. Its title is the same premise (write-buffer-immediate into a heap opened from an address), so on a Mac host it is the remaining failure of this family. Mentioning it only so the Mac-host list is complete; where it should be handled is your call.

Tree state, so the test counts line up with other reports: this head branched from 384f7f7; main is 9 commits further (vram.rs, vfs.rs, vfs_hooks.rs, which add 4 tests), so the lib test binary here reports 715 tests at the head and 719 at 47efa2e - the difference is main's newer tests, not anything this PR removes. git merge-tree of main 47efa2e against b22e57c reports no conflict, so no rebase is needed for this pair to describe main as it stands.

Not tested here: Windows (no Windows machine on this bench), a host where the skip must not fire - @DavidM1911's Windows row on #1024 covers that shape for the sibling PR (skip correctly not taken, "ok, 1 window(s)"), and I ran these seven tests rather than the whole suite (the whole lib binary does not run to completion on this host), and no titles.

Host: macOS 27.2.1 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal; local inference unloaded and the bottle's wineserver stopped for each run. AI use: GPT-6 Luna built both trees, ran the tests and drafted this comment; the panic locations, codes and timings are from those runs.

@mynzjerko

Copy link
Copy Markdown

Tested on Windows 11 with an AMD GPU (native wave64 and host heaps over process memory): all 6 GPU UMA tests ran without skipping, and the full suite passed.

Tested

  • Commit: b22e57cceafdeb46f01deab6f633d491e35a6488
  • Hardware / OS: AMD Radeon RX 9070 (RDNA4, native wave64, driver 32.0.32029.2010), AMD Ryzen 5 7500F, Windows 11 Pro 10.0.26300, rustc 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17, debug build
  • cargo build --workspace: ok
  • cargo test -p xcl --lib -- gpu_unified_memory_arena gpu_mesh_mode_reads_memory_windows gpu_memory_windows_above_4_gib gpu_memory_windows_reject_out_of_uma_aliasing gpu_sparse_vram_descriptors_buffers_and_xmem gpu_bvh64_intersect_ray_across_memory_windows_and_grazing --nocapture --test-threads=1: 6 passed, 0 failed, 0 ignored (0 SKIPPED; none hit no_host_heaps)
  • cargo test --workspace -- --test-threads=4: 737 passed, 0 failed, 41 ignored (xcl --lib: 694 passed, 0 failed, 21 ignored; SKIPPED GPU tests: 0)

Not tested

  • macOS / D3DMetal (where OpenExistingHeapFromAddress returns E_NOTIMPL), NVIDIA / Intel GPUs, Linux / Wine, release build, retail titles (scripts/smoke.ps1)

AI use

  • Google Antigravity (Gemini 4 Neon) checked out the PR, ran the builds and tests locally, and drafted this report; I verified the results before posting.

@jesuarchive

Copy link
Copy Markdown

Native Windows + NVIDIA check that no_host_heaps does not skip where D3D12 can place heaps over process memory. Head b22e57c, merged locally onto main 47efa2e (clean merge, nothing pushed).

Tested

  • NVIDIA GeForce RTX 3060 12 GB (Ampere, 32-lane waves only), driver 32.0.16.1088; AMD Ryzen 7 5800XT; Windows 11 Pro build 26300; rustc 1.95.0 stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17 from the Windows SDK; debug.
  • The eight tests the PR touches, with --test-threads=1 --nocapture: gpu_uma_import_check_at_init, gpu_unified_memory_arena, gpu_memory_windows_above_4_gib, gpu_memory_windows_reject_out_of_uma_aliasing, gpu_mesh_mode_reads_memory_windows, gpu_bvh64_intersect_ray_across_memory_windows_and_grazing, gpu_sparse_vram_descriptors_buffers_and_xmem, gpu_global_atomics_and_sub_dword_access: 8 passed, 0 failed. None printed skipping or SKIPPED: they all ran on the GPU. Same eight on main 47efa2e: 8 passed.
  • cargo test --workspace -- --test-threads=4: 741 passed, 0 failed, 41 ignored, the same as main.
  • SKIPPED on this adapter, the same two on main: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64).

Not tested

  • A host without heaps over process memory (no CrossOver / D3DMetal here); Intel GPUs; the head on its own base 384f7f7; release build.

AI use

  • Claude Code with Claude Opus 5.5: merged the branch, ran the commands above on this machine and wrote this report.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

off-goal Does not bear on the current goal (world loading); waits until it is reached

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants