From d2fb996414a320812385a5e02c756ea7a689ea34 Mon Sep 17 00:00:00 2001 From: Enrique Villa Date: Sun, 29 Nov 2026 17:59:13 +0800 Subject: [PATCH 1/3] Tests: give the last-release test's fake resource a GetDesc a68f609f made res_release ask the resource for its desc on the last release (to log a buffer's GPU address). The fake resource in release_tests::the_last_release_drops_entries_before_the_object_goes has only AddRef and Release in its vtable, so the GetDesc slot is a null pointer: the child process the test runs in (XCL_LATE_RELEASE=0) dies with an access violation (0xC0000005) before printing anything, and the parent's assertion fails with an empty output. Fails on CI and on a PC alike. The fake now answers GetDesc with a texture's desc, which takes no GPU address, so the test checks what it checked before. Assisted-by: Claude Code (Claude Opus 5.5) Signed-off-by: Enrique Villa --- crates/xcl/src/hle/d3d12x/real.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/xcl/src/hle/d3d12x/real.rs b/crates/xcl/src/hle/d3d12x/real.rs index 757ee9c1c5..eb20fa5c8e 100644 --- a/crates/xcl/src/hle/d3d12x/real.rs +++ b/crates/xcl/src/hle/d3d12x/real.rs @@ -10760,9 +10760,15 @@ mod release_tests { } n } + // (the last release asks for the desc, to log a buffer's address: a texture's has none) + unsafe extern "system" fn get_desc(_this: *mut c_void, out: *mut D3D12_RESOURCE_DESC) -> *mut D3D12_RESOURCE_DESC { + *out = D3D12_RESOURCE_DESC { Dimension: D3D12_RESOURCE_DIMENSION_TEXTURE2D, ..Default::default() }; + out + } let mut orig = [0usize; 12]; orig[1] = add_ref as usize; orig[2] = release as usize; + orig[pc_slot!("ID3D12Resource", "GetDesc")] = get_desc as usize; let mut ext = vec![0usize; 13]; ext[0] = orig.as_ptr() as usize; ext[1..].copy_from_slice(&orig); From 94be9f5186cf6b80714db6bf6fa6c7f9927cbec1 Mon Sep 17 00:00:00 2001 From: DzXAnt22 Date: Thu, 26 Nov 2026 12:07:31 -0500 Subject: [PATCH 2/3] Tests: sparse tests take CI's Basic Render Driver for a software device On nvidia-dev, a_gpu_view_tile_is_filled_from_its_cpu_view_and_follows_its_writes sizes its GPU view by software(): 53 tiles on a software device, 3 GiB on a GPU. software() only looked at DXGI_ADAPTER_FLAG_SOFTWARE. On the CI runner the default adapter is the Microsoft Basic Render Driver (0 MiB VRAM), and the CI log of af2cecc4 shows the test reserving the 3 GiB view there; the device is then removed (0x887a0020) and the device-removal handler ends the test process, so the CI job fails on nvidia-dev and on every PR against it. software() now also counts the Microsoft software adapter by its IDs (vendor 0x1414, device 0x8c), which WARP and the Basic Render Driver share. small_runs_go_up_in_dispatches_and_leave_what_lies_between uses the same check and skips there as its comment intends. Co-Authored-By: Claude Opus 5.5 (cherry picked from commit 9d967cf8d65ae9dfdd36fd48c51149284c5a9a98) Signed-off-by: Enrique Villa --- crates/xcl/src/hle/d3d12x/sparse.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/xcl/src/hle/d3d12x/sparse.rs b/crates/xcl/src/hle/d3d12x/sparse.rs index f866cbca39..bc72aa86c3 100644 --- a/crates/xcl/src/hle/d3d12x/sparse.rs +++ b/crates/xcl/src/hle/d3d12x/sparse.rs @@ -5667,12 +5667,13 @@ mod tests { dev.expect("D3D12 device") } - /// Whether `dev` is a software device (WARP). + /// Whether `dev` is a software device (WARP, or the Microsoft Basic Render Driver CI runs on, + /// which is the default adapter there and need not carry DXGI_ADAPTER_FLAG_SOFTWARE). unsafe fn software(dev: &ID3D12Device) -> bool { use windows::Win32::Graphics::Dxgi::*; let Ok(factory) = CreateDXGIFactory1::() else { return false }; let adapter: windows::core::Result = factory.EnumAdapterByLuid(dev.GetAdapterLuid()); - adapter.and_then(|a| a.GetDesc1()).is_ok_and(|d| d.Flags & DXGI_ADAPTER_FLAG_SOFTWARE.0 as u32 != 0) + adapter.and_then(|a| a.GetDesc1()).is_ok_and(|d| d.Flags & DXGI_ADAPTER_FLAG_SOFTWARE.0 as u32 != 0 || (d.VendorId, d.DeviceId) == (0x1414, 0x8c)) } /// The small ones of an upload's runs go up in dispatches: each lands where it belongs (far From 95e3651549275061af72b31141a4efbbdc64c2c5 Mon Sep 17 00:00:00 2001 From: MarcosMDev <54442113+MarcosMDev@users.noreply.github.com> Date: Thu, 26 Nov 2026 09:42:06 -0300 Subject: [PATCH 3/3] Tests: a console MS in the AS slot is refused by its MS translation console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly (#2015) expects the "in the AS slot" refusal. #541 (70f91859) removed that refusal on purpose: a console MS alone in the AS slot is now translated as the mesh shader it is. nvidia-dev has both, so the test failed on every GPU run. The synthetic container has no NGG variant, so it is still refused with E_INVALIDARG, now by the MS translation ("MS: no NGG hardware variant"). The test now expects that. Co-Authored-By: Claude Opus 5.5 (cherry picked from commit 2331f2ea810c4c32d4915e1654ba7c02ddc9a06d) Signed-off-by: Enrique Villa --- crates/xcl/tests/d3d12_mesh_stream.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/crates/xcl/tests/d3d12_mesh_stream.rs b/crates/xcl/tests/d3d12_mesh_stream.rs index d742ee26d0..3a9cdbdd0a 100644 --- a/crates/xcl/tests/d3d12_mesh_stream.rs +++ b/crates/xcl/tests/d3d12_mesh_stream.rs @@ -2,8 +2,8 @@ //! (`d3d12x::real::dev_create_pipeline_state` / `translated_mesh_stream`), with no game data. //! //! Runs on any D3D12 adapter (AMD, NVIDIA, Intel, or WARP) with zero vendor-specific skips: -//! 1. Synthetic console MS placed in the AS slot with no MS slot is refused cleanly with -//! `E_INVALIDARG` and records the `"in the AS slot – refused"` error. +//! 1. Synthetic console MS placed in the AS slot with no MS slot is taken as the mesh shader +//! (#541) and, having no NGG variant, refused cleanly with `E_INVALIDARG` by its translation. //! 2. Synthetic console MS paired with an AS subobject is refused cleanly with `E_INVALIDARG`. //! 3. Empty, truncated, unknown-subobject, and unreadable-shader pipeline streams fail cleanly //! without panicking or crashing. @@ -91,11 +91,13 @@ fn console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly() { SizeInBytes: std::mem::size_of::(), pPipelineStateSubobjectStream: &st as *const _ as *mut c_void, }; - let err = unsafe { d2.CreatePipelineState::(&desc) }.expect_err("MS in AS slot must be refused"); + let err = unsafe { d2.CreatePipelineState::(&desc) }.expect_err("MS with no NGG variant must be refused"); assert_eq!(err.code(), E_INVALIDARG); + // since #541 it is not refused for its slot: it is translated as the MS it is, and this + // container has no NGG variant to translate assert!( - real::stats().translation_errors.iter().any(|e| e.contains("in the AS slot")), - "expected AS-slot refusal in translation_errors: {:?}", + real::stats().translation_errors.iter().any(|e| e.starts_with("MS: ")), + "expected the MS translation's refusal in translation_errors: {:?}", real::stats().translation_errors );