From 699975b22e21c095d34a06bcfaa8fecf5a2149f2 Mon Sep 17 00:00:00 2001 From: vakaobr <15154330+vakaobr@users.noreply.github.com> Date: Tue, 24 Nov 2026 07:26:39 -0300 Subject: [PATCH] Tests: the UMA import check test skips where D3D12 has no heaps over process memory gpu_uma_import_check_at_init failed on the Macs in #258 (CrossOver + D3DMetal) with an empty message. D3DMetal answers E_NOTIMPL (0x80004001) for OpenExistingHeapFromAddress, so open_uma records it in uma_error and returns before check_uma_import: the check's result stays "" ("not run"), also with XCL_UMA_CHECK=0. The runtime is right; the test assumed host-memory heaps. For exactly that error the test now asserts the check did not report "ok" and skips with "no GPU UMA". Any other UMA error, and every host that opens the windows, gets the unchanged assertion, whose message now includes uma_error. Measured with mutations in real.rs: the check reporting that the GPU does not see CPU writes (#175), the open failing with 0x8007000E, and the check claiming "ok" with no window imported each still fail the test. Assisted-by: Claude Code (Claude Opus 5.5) --- crates/xcl/src/gpu/recomp/tests.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/crates/xcl/src/gpu/recomp/tests.rs b/crates/xcl/src/gpu/recomp/tests.rs index 4e032b68d..026bbca74 100644 --- a/crates/xcl/src/gpu/recomp/tests.rs +++ b/crates/xcl/src/gpu/recomp/tests.rs @@ -3367,8 +3367,18 @@ fn gpu_uma_import_check_at_init() { return; } crate::hle::d3d12x::real::init().expect("real D3D12.X backend"); - let s = crate::hle::d3d12x::real::stats().uma_import_check; - assert!(s.starts_with("ok") || s.starts_with("off"), "{s}"); + let st = crate::hle::d3d12x::real::stats(); + let s = st.uma_import_check; + // a D3D12 with no heaps over process memory (D3DMetal answers E_NOTIMPL): no window was + // imported, so there is nothing to check, and the check must not say it passed; any other + // failure to open the windows still fails below + if st.uma_error.starts_with("OpenExistingHeapFromAddress") && st.uma_error.contains("0x80004001") { + assert!(!s.starts_with("ok"), "check passed on windows that were not imported: {s}"); + println!("no heaps over process memory on this D3D12 – skipping ({})", st.uma_error); + runner::skip_test("no GPU UMA"); + return; + } + assert!(s.starts_with("ok") || s.starts_with("off"), "{s} (UMA: {})", st.uma_error); } /// End-to-end GPU test of the sparse-window VRAM runtime layout: