Tests: verify desc::image_d3d12 and sampler_d3d12 against D3D12 #540

Open
github-bot wants to merge 1 commit from github-bot/gh-540 into main AGit
Owner

@⁠amazedturnip on GitHub · 2026-11-24 01:34 UTC · original
amazedturnip:xcl/tests-desc-d3d12-srv-and-sampler-debug-layer-con-012601 → main · +431 −0 · 1 files · 1 commits · open

Add an integration test (crates/xcl/tests/desc_d3d12_e2e.rs) that exercises gpu::desc::image_d3d12 and gpu::desc::sampler_d3d12 against real D3D12 CreateCommittedResource, CreateShaderResourceView, and CreateSampler calls across all ImageType variants, mip/slice subranges, RGBA/BGRA/BC formats and swizzles, and sampler filter/reduction/comparison modes, checking ID3D12InfoQueue/ID3D12InfoQueue1 when the D3D12 debug layer is installed.

What is in it

  • crates/xcl/tests/desc_d3d12_e2e.rs: add e2e test exercising CreateCommittedResource, CreateShaderResourceView, and CreateSampler for desc::image_d3d12 and desc::sampler_d3d12 across all ImageType variants, mip/slice subranges, RGBA/BGRA/BC formats and component swizzles, and sampler filter/reduction/comparison modes, asserting zero ID3D12InfoQueue/ID3D12InfoQueue1 errors when the D3D12 debug layer is present

Tested

  • Hardware / OS / Rust: AMD Ryzen 7 9800X3D 8-Core Processor, Windows 11 Pro 10.0.26100 (Build 26100), rustc 1.94.1 (e408947bf 2026-03-25), stable-x86_64-pc-windows-msvc, debug build
  • AMD (AMD Radeon(TM) Graphics (driver 32.0.21043.19003, DXC 1.9.2609, native wave64), XCL_ADAPTER=radeon): cargo test --workspace -- --test-threads=2 — 681 passed, 0 failed, 41 ignored (SKIPPED GPU tests: none)
  • Verification / negative control: new test suite — verified 3x deterministic; includes an in-test InfoQueue negative control (3D SRV on 2D resource) gated on debug-layer availability

Not tested

  • ID3D12InfoQueue/ID3D12InfoQueue1 message assertions (host missing D3D12 debug layer SDK component 0x887A002D)
  • NVIDIA adapter (excluded per VRAM hygiene policy)
  • retail Xbox Series X|S title (not available on this host)

AI use

  • Antigravity CLI (Gemini 4 Hydrogen (Medium)) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64).
**@⁠amazedturnip** on GitHub · 2026-11-24 01:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/540) `amazedturnip:xcl/tests-desc-d3d12-srv-and-sampler-debug-layer-con-012601` → `main` · +431 −0 · 1 files · 1 commits · open Add an integration test (`crates/xcl/tests/desc_d3d12_e2e.rs`) that exercises `gpu::desc::image_d3d12` and `gpu::desc::sampler_d3d12` against real D3D12 `CreateCommittedResource`, `CreateShaderResourceView`, and `CreateSampler` calls across all `ImageType` variants, mip/slice subranges, RGBA/BGRA/BC formats and swizzles, and sampler filter/reduction/comparison modes, checking `ID3D12InfoQueue`/`ID3D12InfoQueue1` when the D3D12 debug layer is installed. **What is in it** - `crates/xcl/tests/desc_d3d12_e2e.rs`: add e2e test exercising `CreateCommittedResource`, `CreateShaderResourceView`, and `CreateSampler` for `desc::image_d3d12` and `desc::sampler_d3d12` across all `ImageType` variants, mip/slice subranges, RGBA/BGRA/BC formats and component swizzles, and sampler filter/reduction/comparison modes, asserting zero `ID3D12InfoQueue`/`ID3D12InfoQueue1` errors when the D3D12 debug layer is present **Tested** - Hardware / OS / Rust: AMD Ryzen 7 9800X3D 8-Core Processor, Windows 11 Pro 10.0.26100 (Build 26100), rustc 1.94.1 (e408947bf 2026-03-25), stable-x86_64-pc-windows-msvc, debug build - AMD (`AMD Radeon(TM) Graphics (driver 32.0.21043.19003, DXC 1.9.2609, native wave64)`, `XCL_ADAPTER=radeon`): `cargo test --workspace -- --test-threads=2` — 681 passed, 0 failed, 41 ignored (SKIPPED GPU tests: none) - Verification / negative control: new test suite — verified 3x deterministic; includes an in-test InfoQueue negative control (3D SRV on 2D resource) gated on debug-layer availability **Not tested** - ID3D12InfoQueue/ID3D12InfoQueue1 message assertions (host missing D3D12 debug layer SDK component 0x887A002D) - NVIDIA adapter (excluded per VRAM hygiene policy) - retail Xbox Series X|S title (not available on this host) **AI use** - Antigravity CLI (Gemini 4 Hydrogen (Medium)) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64).
Exercise CreateCommittedResource, CreateShaderResourceView, and CreateSampler across all ImageType variants, mip/slice subranges, RGBA/BGRA/BC formats and swizzles, and sampler filter/reduction/comparison modes, checking ID3D12InfoQueue/ID3D12InfoQueue1 when the D3D12 debug layer is installed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:25:06 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 01:50 UTC · original

Tested exact head 5d7f6e1 on NVIDIA and an AMD iGPU with the D3D12 debug layer installed (Graphics Tools), so the ID3D12InfoQueue checks and the negative control that Not tested lists ran.

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (driver 616.64) + AMD Radeon(TM) Graphics iGPU (driver 32.0.21036.18), Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug.
  • cargo test -p xcl --test desc_d3d12_e2e -- --nocapture, 3 runs each with XCL_ADAPTER=nvidia and XCL_ADAPTER=radeon: 1 passed, 0 failed every time. The log shows D3D12: debug layer enabled and backend 'real' on the adapter asked for.
  • With the debug layer active, the SRV and sampler cases gave no errors. The only debug-layer errors were those of the negative control (step 4), so it is not vacuous:
    • error, id 32: CreateShaderResourceView: The ViewDimension in the View Desc is incompatible with the type of the Resource.
  • .\scripts\test.ps1 (no XCL_ADAPTER, RTX 5070 Ti): 681 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.

Observations

  • On both adapters the negative control's invalid SRV is followed by error, id 232: ID3D12Device::RemoveDevice: Device removal has been triggered ... (DXGI_ERROR_INVALID_CALL ...). The test still passes because nothing uses the device after step 4. The device is XCL's shared backend device (real::device_raw()), so a test added to this file later, or run after this one in the same process, would get a removed device. I did not check GetDeviceRemovedReason myself; this is from the debug layer's message.
  • Four warning, id 1361 from CreateSampler2: ComparisonFunc is ALWAYS with non-comparison filters (MIN_MAG_MIP_LINEAR, ANISOTROPIC, MINIMUM_MIN_MAG_MIP_LINEAR, MAXIMUM_ANISOTROPIC). Warnings only; the test checks errors.

Not tested

  • A discrete AMD card, wave64 hardware, retail titles, game-data tests (XCL_SAMPLE_* unset).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-24 01:50 UTC · [original](https://github.com/xcl-dev/xcl/pull/540#issuecomment-7119499967) Tested exact head `5d7f6e1` on NVIDIA and an AMD iGPU **with the D3D12 debug layer installed** (Graphics Tools), so the `ID3D12InfoQueue` checks and the negative control that **Not tested** lists ran. **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (driver 616.64) + AMD Radeon(TM) Graphics iGPU (driver 32.0.21036.18), Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug. - `cargo test -p xcl --test desc_d3d12_e2e -- --nocapture`, 3 runs each with `XCL_ADAPTER=nvidia` and `XCL_ADAPTER=radeon`: 1 passed, 0 failed every time. The log shows `D3D12: debug layer enabled` and `backend 'real'` on the adapter asked for. - With the debug layer active, the SRV and sampler cases gave no errors. The only debug-layer errors were those of the negative control (step 4), so it is not vacuous: - `error, id 32`: `CreateShaderResourceView: The ViewDimension in the View Desc is incompatible with the type of the Resource.` - `.\scripts\test.ps1` (no `XCL_ADAPTER`, RTX 5070 Ti): 681 passed, 0 failed, 41 ignored. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. **Observations** - On both adapters the negative control's invalid SRV is followed by `error, id 232: ID3D12Device::RemoveDevice: Device removal has been triggered ... (DXGI_ERROR_INVALID_CALL ...)`. The test still passes because nothing uses the device after step 4. The device is XCL's shared backend device (`real::device_raw()`), so a test added to this file later, or run after this one in the same process, would get a removed device. I did not check `GetDeviceRemovedReason` myself; this is from the debug layer's message. - Four `warning, id 1361` from `CreateSampler2`: `ComparisonFunc` is `ALWAYS` with non-comparison filters (`MIN_MAG_MIP_LINEAR`, `ANISOTROPIC`, `MINIMUM_MIN_MAG_MIP_LINEAR`, `MAXIMUM_ANISOTROPIC`). Warnings only; the test checks errors. **Not tested** - A discrete AMD card, wave64 hardware, retail titles, game-data tests (`XCL_SAMPLE_*` unset). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠amazedturnip on GitHub · 2026-11-24 01:56 UTC · original

Addressed both observations from @⁠futurepro62:

  1. Negative-control device removal: Moved step 4's mismatched-SRV negative control onto a dedicated temporary ID3D12Device created on the same adapter LUID (create_adapter_device) with its own ID3D12InfoQueue/ID3D12InfoQueue1 and descriptor heap, and added dev.GetDeviceRemovedReason().is_ok() to confirm real::device_raw() remains healthy.
  2. Non-comparison sampler warnings (id 1361): Changed compare_func from 7 (ALWAYS) to 0 (NEVER) on the four non-comparison sampler test cases (comparison = false).

Re-ran cargo test -p xcl --test desc_d3d12_e2e -- --nocapture with XCL_ADAPTER=radeon: 1 passed, 0 failed, 0 ignored (note: Graphics Tools / D3D12 debug layer is unavailable on this host, 0x887A002D, so the debug-layer InfoQueue/negative-control path was not exercised locally).

**@⁠amazedturnip** on GitHub · 2026-11-24 01:56 UTC · [original](https://github.com/xcl-dev/xcl/pull/540#issuecomment-7119600928) Addressed both observations from @⁠futurepro62: 1. **Negative-control device removal**: Moved step 4's mismatched-SRV negative control onto a dedicated temporary `ID3D12Device` created on the same adapter LUID (`create_adapter_device`) with its own `ID3D12InfoQueue`/`ID3D12InfoQueue1` and descriptor heap, and added `dev.GetDeviceRemovedReason().is_ok()` to confirm `real::device_raw()` remains healthy. 2. **Non-comparison sampler warnings (`id 1361`)**: Changed `compare_func` from `7` (`ALWAYS`) to `0` (`NEVER`) on the four non-comparison sampler test cases (`comparison = false`). Re-ran `cargo test -p xcl --test desc_d3d12_e2e -- --nocapture` with `XCL_ADAPTER=radeon`: 1 passed, 0 failed, 0 ignored (note: Graphics Tools / D3D12 debug layer is unavailable on this host, `0x887A002D`, so the debug-layer InfoQueue/negative-control path was not exercised locally).
Author
Owner

@⁠MonkeyPython on GitHub · 2026-11-24 02:11 UTC · original

NVIDIA data point (the author excluded NVIDIA for VRAM hygiene; 12 GB is well clear of it): the desc verification passes on an RTX 3080 Ti with the debug layer active.

Setup: Windows 11 Pro 26300, Ryzen 7 7800X3D, 32 GB, RTX 3080 Ti 12 GB (driver 621.01), PR head 5d7f6e1, release build.

Run: cargo test -p xcl --release --test desc_d3d12_e2e -- --test-threads=4 → desc_d3d12_srv_and_sampler_debug_layer ... ok, 1 passed / 0 failed / 0 ignored in 0.34 s. No D3D12 InfoQueue errors in the test output.

Not tested: Intel, WARP, other NVIDIA cards.

AI use: Gentle Shell (Pi coding agent), model qwen4-max: ran the test and wrote this report from the log; a human reviews it before posting. No code changes.

**@⁠MonkeyPython** on GitHub · 2026-11-24 02:11 UTC · [original](https://github.com/xcl-dev/xcl/pull/540#issuecomment-7119839367) NVIDIA data point (the author excluded NVIDIA for VRAM hygiene; 12 GB is well clear of it): the desc verification passes on an RTX 3080 Ti with the debug layer active. **Setup:** Windows 11 Pro 26300, Ryzen 7 7800X3D, 32 GB, RTX 3080 Ti 12 GB (driver 621.01), PR head `5d7f6e1`, release build. **Run:** `cargo test -p xcl --release --test desc_d3d12_e2e -- --test-threads=4` → `desc_d3d12_srv_and_sampler_debug_layer ... ok`, **1 passed / 0 failed / 0 ignored** in 0.34 s. No D3D12 InfoQueue errors in the test output. **Not tested:** Intel, WARP, other NVIDIA cards. **AI use:** Gentle Shell (Pi coding agent), model qwen4-max: ran the test and wrote this report from the log; a human reviews it before posting. No code changes.
Author
Owner

@⁠ecnarc on GitHub · 2026-11-24 02:43 UTC · original

On exact head d665f505c49d8f8071bf8eeea2a4c45ffe558afe, I reproduced the shared-device health failure on an RTX 3090 with the D3D12 debug layer enabled. The subprocess-isolation patch below passes the focused test and the default full workspace suite on the same machine.

Cause and proposed fix

create_adapter_device() enumerates the same adapter LUID and calls D3D12CreateDevice. Microsoft documents that this returns the existing per-adapter device in the current process. A new DXGI factory does not isolate the negative control.

The patch runs the invalid SRV in a child invocation of this test executable, passing the parent's adapter LUID and using the existing Agility helpers for debug configuration and device creation. It requires the child InfoQueue, a clean setup error queue, a captured validation error, successful exit, and a completion marker. It preserves the positive cases and the parent's device-health assertion. Only crates/xcl/tests/desc_d3d12_e2e.rs changes; the patch was tested as an uncommitted change on the exact head above.

Tested

  • Windows 11 Pro 26200.9974; Ryzen 9 9950X3D; RTX 3090, driver 32.0.16.2124; Rust 1.100.0 MSVC; DXC/DXIL 1.8.2502.11; debug build. XCL_ADAPTER=3090, XCL_REQUIRE_GPU=mesh.
  • Original head: focused test 0 passed, 1 failed, exit 101. Error 32 (incompatible SRV/resource dimension), then error 232 (device removal), then shared backend device should remain healthy at line 348.
  • Same head plus patch: focused test 1 passed, 0 failed, 0 ignored, exit 0. The log shows debug-layer activation, the RTX 3090, and the child error-capture marker. The retained parent health assertion passes.
  • Patched workspace: build exit 0; 681 passed, 0 failed, 41 ignored, test exit 0. The descriptor test also passes within this run with its debug layer and child marker.

Commands:

cargo +stable-x86_64-pc-windows-msvc test --locked -p xcl --test desc_d3d12_e2e -- --test-threads=1 --nocapture
cargo +stable-x86_64-pc-windows-msvc build --locked --workspace
cargo +stable-x86_64-pc-windows-msvc test --locked --workspace -- --test-threads=4 --show-output

Reported GPU skips, both no wave64:

  • gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask
  • gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware

These skips are included in Cargo's passed count, separately from the 41 ignored. Optional sample-data tests also returned early; the log explicitly reports missing XCL_SAMPLE_RPF, XCL_SAMPLE_TTPF, and XCL_SAMPLE_AWC. The existing compiler deprecation and debug-layer shutdown warnings remain.

Not tested

AMD/Intel, native wave64 hardware, Agility SDK configuration, release build, debug-layer-unavailable/GPU-unavailable patch paths, the 41 ignored tests, retail titles or retail sample-data coverage. The descriptor test validates creation/error reporting, not shader sampling or rendering. The unpatched full workspace suite was not run for this report.

AI use

ChatGPT (GPT-6 Astra Pro) reviewed the source and logs, wrote/reviewed the patch, and drafted this report. I ran the commands above on the Windows machine described here.

Tested patch against d665f505 (89 additions, 63 deletions)

Patch SHA256: 06df70ffbafb47a8ac28b382437636b3994ec72212832dc3e33b8f6f78154d64

diff --git a/crates/xcl/tests/desc_d3d12_e2e.rs b/crates/xcl/tests/desc_d3d12_e2e.rs
index 7af188a..2fa9170 100644
--- a/crates/xcl/tests/desc_d3d12_e2e.rs
+++ b/crates/xcl/tests/desc_d3d12_e2e.rs
@@ -5,17 +5,22 @@
 //! RGBA/BGRA/BC formats and component swizzles, and sampler filter/reduction/comparison modes.
 
 use std::ffi::c_void;
+use std::process::Command;
 use std::sync::Mutex;
 
 use windows::core::Interface;
+use windows::Win32::Foundation::LUID;
 use windows::Win32::Graphics::Direct3D::D3D_FEATURE_LEVEL_12_0;
 use windows::Win32::Graphics::Direct3D12::*;
 use windows::Win32::Graphics::Dxgi::{CreateDXGIFactory1, IDXGIAdapter1, IDXGIFactory4};
 
+use xcl::gpu::agility;
 use xcl::gpu::desc::{self, Image, ImageType};
 use xcl::gpu::recomp::runner;
 use xcl::hle::d3d12x::real;
 
+const NEGATIVE_CONTROL_LUID: &str = "XCL_DESC_NEGATIVE_LUID";
+const NEGATIVE_CONTROL_OK: &str = "negative control: captured invalid SRV error in child process";
 static DEBUG_ERRORS: Mutex<Vec<String>> = Mutex::new(Vec::new());
 
 unsafe extern "system" fn collect_debug_message(
@@ -169,6 +174,10 @@ fn check_sampler_case(
 
 #[test]
 fn desc_d3d12_srv_and_sampler_debug_layer() {
+    if let Ok(luid) = std::env::var(NEGATIVE_CONTROL_LUID) {
+        negative_control(&luid);
+        return;
+    }
     std::env::set_var("XCL_D3D12_DEBUG", "1");
 
     if xcl::hle::d3d12x::backend() != xcl::hle::d3d12x::Backend::Real {
@@ -283,65 +292,23 @@ fn desc_d3d12_srv_and_sampler_debug_layer() {
 
     // 4. Negative control: when the debug layer is active, a mismatched SRV dimension must
     // trigger a debug-layer error, proving that the InfoQueue check above is non-vacuous.
-    // Run on a dedicated temporary ID3D12Device so the invalid SRV's RemoveDevice does not
-    // poison XCL's shared backend device (`real::device_raw()`).
+    // D3D12CreateDevice reuses the process's device for an adapter LUID. Use a child process
+    // so the invalid SRV's RemoveDevice cannot poison XCL's shared backend device.
     if has_debug_layer {
-        let neg_dev = create_adapter_device(&dev);
-        let neg_iq = neg_dev.cast::<ID3D12InfoQueue>().ok();
-        let neg_iq1 = neg_dev.cast::<ID3D12InfoQueue1>().ok();
-        let mut neg_cookie = 0u32;
-        if let Some(ref q1) = neg_iq1 {
-            unsafe {
-                let _ = q1.RegisterMessageCallback(
-                    Some(collect_debug_message),
-                    D3D12_MESSAGE_CALLBACK_FLAG_NONE,
-                    std::ptr::null_mut(),
-                    &mut neg_cookie,
-                );
-            }
-        }
-        let _ = take_debug_errors(neg_iq.as_ref());
-
-        let neg_heap: ID3D12DescriptorHeap = unsafe {
-            neg_dev.CreateDescriptorHeap(&D3D12_DESCRIPTOR_HEAP_DESC {
-                Type: D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV,
-                NumDescriptors: 1,
-                ..Default::default()
-            })
-        }
-        .expect("CreateDescriptorHeap negative control");
-        let neg_srv_handle = unsafe { neg_heap.GetCPUDescriptorHandleForHeapStart() };
-
-        let (res_desc, _) = desc::image_d3d12(&base_image(ImageType::D2)).unwrap();
-        let (_, bad_srv) = desc::image_d3d12(&base_image(ImageType::D3)).unwrap();
-        let mut bad_res: Option<ID3D12Resource> = None;
-        unsafe {
-            neg_dev
-                .CreateCommittedResource(
-                    &D3D12_HEAP_PROPERTIES {
-                        Type: D3D12_HEAP_TYPE_DEFAULT,
-                        ..Default::default()
-                    },
-                    D3D12_HEAP_FLAG_NONE,
-                    &res_desc,
-                    D3D12_RESOURCE_STATE_COMMON,
-                    None,
-                    &mut bad_res,
-                )
-                .expect("CreateCommittedResource negative control");
-            let bad_res = bad_res.unwrap();
-            neg_dev.CreateShaderResourceView(&bad_res, Some(&bad_srv), neg_srv_handle);
-        }
-        let neg_errs = take_debug_errors(neg_iq.as_ref());
+        let luid = unsafe { dev.GetAdapterLuid() };
+        let output = Command::new(std::env::current_exe().expect("test executable"))
+            .args(["--exact", "desc_d3d12_srv_and_sampler_debug_layer", "--nocapture", "--test-threads=1"])
+            .env(NEGATIVE_CONTROL_LUID, format!("{}:{}", luid.LowPart, luid.HighPart))
+            .output()
+            .expect("spawn negative control");
+        let stdout = String::from_utf8_lossy(&output.stdout);
+        let stderr = String::from_utf8_lossy(&output.stderr);
         assert!(
-            !neg_errs.is_empty(),
-            "negative control: expected D3D12 debug error for 3D SRV on 2D resource"
+            output.status.success() && stdout.contains(NEGATIVE_CONTROL_OK),
+            "negative-control child did not complete: {}\nstdout:\n{stdout}\nstderr:\n{stderr}",
+            output.status
         );
-        if let Some(ref q1) = neg_iq1 {
-            unsafe {
-                let _ = q1.UnregisterMessageCallback(neg_cookie);
-            }
-        }
+        println!("{NEGATIVE_CONTROL_OK}");
     } else {
         println!("D3D12 debug layer unavailable on host – ran driver CreateCommittedResource/CreateShaderResourceView/CreateSampler without InfoQueue");
     }
@@ -357,14 +324,73 @@ fn desc_d3d12_srv_and_sampler_debug_layer() {
     }
 }
 
-fn create_adapter_device(dev: &ID3D12Device) -> ID3D12Device {
-    unsafe {
-        let luid = dev.GetAdapterLuid();
+fn negative_control(luid: &str) {
+    let (low, high) = luid.split_once(':').expect("negative-control adapter LUID");
+    let luid = LUID {
+        LowPart: low.parse().expect("adapter LUID LowPart"),
+        HighPart: high.parse().expect("adapter LUID HighPart"),
+    };
+    // Enable the debug layer before creating the child's device, through the same runtime
+    // selection as the parent (inbox D3D12 or the configured Agility SDK).
+    let debug = agility::configuration_interface::<ID3D12Debug>(&CLSID_D3D12Debug)
+        .expect("negative control requires the D3D12 debug layer");
+    let neg_dev = unsafe {
+        debug.EnableDebugLayer();
         let factory: IDXGIFactory4 = CreateDXGIFactory1().expect("CreateDXGIFactory1");
         let adapter: IDXGIAdapter1 = factory.EnumAdapterByLuid(luid).expect("EnumAdapterByLuid");
-        let mut out: Option<ID3D12Device> = None;
-        D3D12CreateDevice(&adapter, D3D_FEATURE_LEVEL_12_0, &mut out)
-            .expect("D3D12CreateDevice for negative control");
-        out.expect("D3D12CreateDevice returned None")
+        agility::create_device(&adapter, D3D_FEATURE_LEVEL_12_0)
+            .expect("create device for negative control")
+    };
+    let neg_iq = neg_dev.cast::<ID3D12InfoQueue>()
+        .expect("negative control requires ID3D12InfoQueue");
+    let neg_iq1 = neg_dev.cast::<ID3D12InfoQueue1>().ok();
+    let mut neg_cookie = 0u32;
+    if let Some(ref q1) = neg_iq1 {
+        unsafe {
+            q1.RegisterMessageCallback(
+                Some(collect_debug_message),
+                D3D12_MESSAGE_CALLBACK_FLAG_NONE,
+                std::ptr::null_mut(),
+                &mut neg_cookie,
+            ).expect("RegisterMessageCallback negative control");
+        }
+    }
+
+    let neg_heap: ID3D12DescriptorHeap = unsafe {
+        neg_dev.CreateDescriptorHeap(&D3D12_DESCRIPTOR_HEAP_DESC {
+            Type: D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV,
+            NumDescriptors: 1,
+            ..Default::default()
+        })
+    }.expect("CreateDescriptorHeap negative control");
+    let neg_srv_handle = unsafe { neg_heap.GetCPUDescriptorHandleForHeapStart() };
+    let (res_desc, _) = desc::image_d3d12(&base_image(ImageType::D2)).unwrap();
+    let (_, bad_srv) = desc::image_d3d12(&base_image(ImageType::D3)).unwrap();
+    let mut bad_res: Option<ID3D12Resource> = None;
+    unsafe {
+        neg_dev.CreateCommittedResource(
+            &D3D12_HEAP_PROPERTIES {
+                Type: D3D12_HEAP_TYPE_DEFAULT,
+                ..Default::default()
+            },
+            D3D12_HEAP_FLAG_NONE,
+            &res_desc,
+            D3D12_RESOURCE_STATE_COMMON,
+            None,
+            &mut bad_res,
+        ).expect("CreateCommittedResource negative control");
+    }
+    let bad_res = bad_res.expect("negative-control resource");
+    let setup_errs = take_debug_errors(Some(&neg_iq));
+    assert!(setup_errs.is_empty(), "negative-control setup: {setup_errs:?}");
+    unsafe { neg_dev.CreateShaderResourceView(&bad_res, Some(&bad_srv), neg_srv_handle); }
+    let neg_errs = take_debug_errors(Some(&neg_iq));
+    assert!(
+        !neg_errs.is_empty(),
+        "negative control: expected D3D12 debug error for 3D SRV on 2D resource"
+    );
+    if let Some(ref q1) = neg_iq1 {
+        unsafe { let _ = q1.UnregisterMessageCallback(neg_cookie); }
     }
+    println!("{NEGATIVE_CONTROL_OK}: {neg_errs:?}");
 }
**@⁠ecnarc** on GitHub · 2026-11-24 02:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/540#issuecomment-7120417558) On exact head `d665f505c49d8f8071bf8eeea2a4c45ffe558afe`, I reproduced the shared-device health failure on an RTX 3090 with the D3D12 debug layer enabled. The subprocess-isolation patch below passes the focused test and the default full workspace suite on the same machine. **Cause and proposed fix** `create_adapter_device()` enumerates the same adapter LUID and calls `D3D12CreateDevice`. [Microsoft documents](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-d3d12createdevice) that this returns the existing per-adapter device in the current process. A new DXGI factory does not isolate the negative control. The patch runs the invalid SRV in a child invocation of this test executable, passing the parent's adapter LUID and using the existing Agility helpers for debug configuration and device creation. It requires the child InfoQueue, a clean setup error queue, a captured validation error, successful exit, and a completion marker. It preserves the positive cases and the parent's device-health assertion. Only `crates/xcl/tests/desc_d3d12_e2e.rs` changes; the patch was tested as an uncommitted change on the exact head above. **Tested** - Windows 11 Pro 26200.9974; Ryzen 9 9950X3D; RTX 3090, driver `32.0.16.2124`; Rust `1.100.0` MSVC; DXC/DXIL `1.8.2502.11`; debug build. `XCL_ADAPTER=3090`, `XCL_REQUIRE_GPU=mesh`. - Original head: focused test **0 passed, 1 failed**, exit 101. Error 32 (incompatible SRV/resource dimension), then error 232 (device removal), then `shared backend device should remain healthy` at line 348. - Same head plus patch: focused test **1 passed, 0 failed, 0 ignored**, exit 0. The log shows debug-layer activation, the RTX 3090, and the child error-capture marker. The retained parent health assertion passes. - Patched workspace: build exit 0; **681 passed, 0 failed, 41 ignored**, test exit 0. The descriptor test also passes within this run with its debug layer and child marker. Commands: ```powershell cargo +stable-x86_64-pc-windows-msvc test --locked -p xcl --test desc_d3d12_e2e -- --test-threads=1 --nocapture cargo +stable-x86_64-pc-windows-msvc build --locked --workspace cargo +stable-x86_64-pc-windows-msvc test --locked --workspace -- --test-threads=4 --show-output ``` Reported GPU skips, both `no wave64`: - `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask` - `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` These skips are included in Cargo's passed count, separately from the 41 ignored. Optional sample-data tests also returned early; the log explicitly reports missing `XCL_SAMPLE_RPF`, `XCL_SAMPLE_TTPF`, and `XCL_SAMPLE_AWC`. The existing compiler deprecation and debug-layer shutdown warnings remain. **Not tested** AMD/Intel, native wave64 hardware, Agility SDK configuration, release build, debug-layer-unavailable/GPU-unavailable patch paths, the 41 ignored tests, retail titles or retail sample-data coverage. The descriptor test validates creation/error reporting, not shader sampling or rendering. The unpatched full workspace suite was not run for this report. **AI use** ChatGPT (GPT-6 Astra Pro) reviewed the source and logs, wrote/reviewed the patch, and drafted this report. I ran the commands above on the Windows machine described here. <details> <summary>Tested patch against d665f505 (89 additions, 63 deletions)</summary> Patch SHA256: `06df70ffbafb47a8ac28b382437636b3994ec72212832dc3e33b8f6f78154d64` ```diff diff --git a/crates/xcl/tests/desc_d3d12_e2e.rs b/crates/xcl/tests/desc_d3d12_e2e.rs index 7af188a..2fa9170 100644 --- a/crates/xcl/tests/desc_d3d12_e2e.rs +++ b/crates/xcl/tests/desc_d3d12_e2e.rs @@ -5,17 +5,22 @@ //! RGBA/BGRA/BC formats and component swizzles, and sampler filter/reduction/comparison modes. use std::ffi::c_void; +use std::process::Command; use std::sync::Mutex; use windows::core::Interface; +use windows::Win32::Foundation::LUID; use windows::Win32::Graphics::Direct3D::D3D_FEATURE_LEVEL_12_0; use windows::Win32::Graphics::Direct3D12::*; use windows::Win32::Graphics::Dxgi::{CreateDXGIFactory1, IDXGIAdapter1, IDXGIFactory4}; +use xcl::gpu::agility; use xcl::gpu::desc::{self, Image, ImageType}; use xcl::gpu::recomp::runner; use xcl::hle::d3d12x::real; +const NEGATIVE_CONTROL_LUID: &str = "XCL_DESC_NEGATIVE_LUID"; +const NEGATIVE_CONTROL_OK: &str = "negative control: captured invalid SRV error in child process"; static DEBUG_ERRORS: Mutex<Vec<String>> = Mutex::new(Vec::new()); unsafe extern "system" fn collect_debug_message( @@ -169,6 +174,10 @@ fn check_sampler_case( #[test] fn desc_d3d12_srv_and_sampler_debug_layer() { + if let Ok(luid) = std::env::var(NEGATIVE_CONTROL_LUID) { + negative_control(&luid); + return; + } std::env::set_var("XCL_D3D12_DEBUG", "1"); if xcl::hle::d3d12x::backend() != xcl::hle::d3d12x::Backend::Real { @@ -283,65 +292,23 @@ fn desc_d3d12_srv_and_sampler_debug_layer() { // 4. Negative control: when the debug layer is active, a mismatched SRV dimension must // trigger a debug-layer error, proving that the InfoQueue check above is non-vacuous. - // Run on a dedicated temporary ID3D12Device so the invalid SRV's RemoveDevice does not - // poison XCL's shared backend device (`real::device_raw()`). + // D3D12CreateDevice reuses the process's device for an adapter LUID. Use a child process + // so the invalid SRV's RemoveDevice cannot poison XCL's shared backend device. if has_debug_layer { - let neg_dev = create_adapter_device(&dev); - let neg_iq = neg_dev.cast::<ID3D12InfoQueue>().ok(); - let neg_iq1 = neg_dev.cast::<ID3D12InfoQueue1>().ok(); - let mut neg_cookie = 0u32; - if let Some(ref q1) = neg_iq1 { - unsafe { - let _ = q1.RegisterMessageCallback( - Some(collect_debug_message), - D3D12_MESSAGE_CALLBACK_FLAG_NONE, - std::ptr::null_mut(), - &mut neg_cookie, - ); - } - } - let _ = take_debug_errors(neg_iq.as_ref()); - - let neg_heap: ID3D12DescriptorHeap = unsafe { - neg_dev.CreateDescriptorHeap(&D3D12_DESCRIPTOR_HEAP_DESC { - Type: D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, - NumDescriptors: 1, - ..Default::default() - }) - } - .expect("CreateDescriptorHeap negative control"); - let neg_srv_handle = unsafe { neg_heap.GetCPUDescriptorHandleForHeapStart() }; - - let (res_desc, _) = desc::image_d3d12(&base_image(ImageType::D2)).unwrap(); - let (_, bad_srv) = desc::image_d3d12(&base_image(ImageType::D3)).unwrap(); - let mut bad_res: Option<ID3D12Resource> = None; - unsafe { - neg_dev - .CreateCommittedResource( - &D3D12_HEAP_PROPERTIES { - Type: D3D12_HEAP_TYPE_DEFAULT, - ..Default::default() - }, - D3D12_HEAP_FLAG_NONE, - &res_desc, - D3D12_RESOURCE_STATE_COMMON, - None, - &mut bad_res, - ) - .expect("CreateCommittedResource negative control"); - let bad_res = bad_res.unwrap(); - neg_dev.CreateShaderResourceView(&bad_res, Some(&bad_srv), neg_srv_handle); - } - let neg_errs = take_debug_errors(neg_iq.as_ref()); + let luid = unsafe { dev.GetAdapterLuid() }; + let output = Command::new(std::env::current_exe().expect("test executable")) + .args(["--exact", "desc_d3d12_srv_and_sampler_debug_layer", "--nocapture", "--test-threads=1"]) + .env(NEGATIVE_CONTROL_LUID, format!("{}:{}", luid.LowPart, luid.HighPart)) + .output() + .expect("spawn negative control"); + let stdout = String::from_utf8_lossy(&output.stdout); + let stderr = String::from_utf8_lossy(&output.stderr); assert!( - !neg_errs.is_empty(), - "negative control: expected D3D12 debug error for 3D SRV on 2D resource" + output.status.success() && stdout.contains(NEGATIVE_CONTROL_OK), + "negative-control child did not complete: {}\nstdout:\n{stdout}\nstderr:\n{stderr}", + output.status ); - if let Some(ref q1) = neg_iq1 { - unsafe { - let _ = q1.UnregisterMessageCallback(neg_cookie); - } - } + println!("{NEGATIVE_CONTROL_OK}"); } else { println!("D3D12 debug layer unavailable on host – ran driver CreateCommittedResource/CreateShaderResourceView/CreateSampler without InfoQueue"); } @@ -357,14 +324,73 @@ fn desc_d3d12_srv_and_sampler_debug_layer() { } } -fn create_adapter_device(dev: &ID3D12Device) -> ID3D12Device { - unsafe { - let luid = dev.GetAdapterLuid(); +fn negative_control(luid: &str) { + let (low, high) = luid.split_once(':').expect("negative-control adapter LUID"); + let luid = LUID { + LowPart: low.parse().expect("adapter LUID LowPart"), + HighPart: high.parse().expect("adapter LUID HighPart"), + }; + // Enable the debug layer before creating the child's device, through the same runtime + // selection as the parent (inbox D3D12 or the configured Agility SDK). + let debug = agility::configuration_interface::<ID3D12Debug>(&CLSID_D3D12Debug) + .expect("negative control requires the D3D12 debug layer"); + let neg_dev = unsafe { + debug.EnableDebugLayer(); let factory: IDXGIFactory4 = CreateDXGIFactory1().expect("CreateDXGIFactory1"); let adapter: IDXGIAdapter1 = factory.EnumAdapterByLuid(luid).expect("EnumAdapterByLuid"); - let mut out: Option<ID3D12Device> = None; - D3D12CreateDevice(&adapter, D3D_FEATURE_LEVEL_12_0, &mut out) - .expect("D3D12CreateDevice for negative control"); - out.expect("D3D12CreateDevice returned None") + agility::create_device(&adapter, D3D_FEATURE_LEVEL_12_0) + .expect("create device for negative control") + }; + let neg_iq = neg_dev.cast::<ID3D12InfoQueue>() + .expect("negative control requires ID3D12InfoQueue"); + let neg_iq1 = neg_dev.cast::<ID3D12InfoQueue1>().ok(); + let mut neg_cookie = 0u32; + if let Some(ref q1) = neg_iq1 { + unsafe { + q1.RegisterMessageCallback( + Some(collect_debug_message), + D3D12_MESSAGE_CALLBACK_FLAG_NONE, + std::ptr::null_mut(), + &mut neg_cookie, + ).expect("RegisterMessageCallback negative control"); + } + } + + let neg_heap: ID3D12DescriptorHeap = unsafe { + neg_dev.CreateDescriptorHeap(&D3D12_DESCRIPTOR_HEAP_DESC { + Type: D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, + NumDescriptors: 1, + ..Default::default() + }) + }.expect("CreateDescriptorHeap negative control"); + let neg_srv_handle = unsafe { neg_heap.GetCPUDescriptorHandleForHeapStart() }; + let (res_desc, _) = desc::image_d3d12(&base_image(ImageType::D2)).unwrap(); + let (_, bad_srv) = desc::image_d3d12(&base_image(ImageType::D3)).unwrap(); + let mut bad_res: Option<ID3D12Resource> = None; + unsafe { + neg_dev.CreateCommittedResource( + &D3D12_HEAP_PROPERTIES { + Type: D3D12_HEAP_TYPE_DEFAULT, + ..Default::default() + }, + D3D12_HEAP_FLAG_NONE, + &res_desc, + D3D12_RESOURCE_STATE_COMMON, + None, + &mut bad_res, + ).expect("CreateCommittedResource negative control"); + } + let bad_res = bad_res.expect("negative-control resource"); + let setup_errs = take_debug_errors(Some(&neg_iq)); + assert!(setup_errs.is_empty(), "negative-control setup: {setup_errs:?}"); + unsafe { neg_dev.CreateShaderResourceView(&bad_res, Some(&bad_srv), neg_srv_handle); } + let neg_errs = take_debug_errors(Some(&neg_iq)); + assert!( + !neg_errs.is_empty(), + "negative control: expected D3D12 debug error for 3D SRV on 2D resource" + ); + if let Some(ref q1) = neg_iq1 { + unsafe { let _ = q1.UnregisterMessageCallback(neg_cookie); } } + println!("{NEGATIVE_CONTROL_OK}: {neg_errs:?}"); } ``` </details>
Author
Owner

@⁠caua-an on GitHub · 2026-11-24 02:47 UTC · original

Tested: Clean head d665f505c49d8f8071bf8eeea2a4c45ffe558afe; Windows 11 Home build 26200, Core Ultra 9 185H, Rust 1.100.0 MSVC x64, debug build, XCL_REQUIRE_GPU=1. Intel Arc integrated graphics driver 32.0.101.8860; RTX 4070 Laptop driver 616.92.

With the D3D12 debug layer confirmed active, cargo test --offline --locked -p xcl --test desc_d3d12_e2e -- --test-threads=1 --nocapture reported 0 passed, 1 failed on both XCL_ADAPTER=intel and XCL_ADAPTER=nvidia. The negative control produced the expected invalid-view error, then DXGI_ERROR_INVALID_CALL on device removal, and the final shared backend device should remain healthy assertion failed. This is consistent with D3D12 returning the existing device for the same adapter in the same process. Suggest running the negative control in a separate process.

Not tested: Full workspace suite, release builds, retail titles, or game-data samples (XCL_SAMPLE_* unset).

AI use: OpenCode with GPT-6.2 Sol ran the tests and drafted this report.

**@⁠caua-an** on GitHub · 2026-11-24 02:47 UTC · [original](https://github.com/xcl-dev/xcl/pull/540#issuecomment-7120481493) **Tested:** Clean head `d665f505c49d8f8071bf8eeea2a4c45ffe558afe`; Windows 11 Home build 26200, Core Ultra 9 185H, Rust 1.100.0 MSVC x64, debug build, `XCL_REQUIRE_GPU=1`. Intel Arc integrated graphics driver 32.0.101.8860; RTX 4070 Laptop driver 616.92. With the D3D12 debug layer confirmed active, `cargo test --offline --locked -p xcl --test desc_d3d12_e2e -- --test-threads=1 --nocapture` reported **0 passed, 1 failed** on both `XCL_ADAPTER=intel` and `XCL_ADAPTER=nvidia`. The negative control produced the expected invalid-view error, then `DXGI_ERROR_INVALID_CALL` on device removal, and the final `shared backend device should remain healthy` assertion failed. This is consistent with [D3D12 returning the existing device for the same adapter in the same process](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-d3d12createdevice#remarks). Suggest running the negative control in a separate process. **Not tested:** Full workspace suite, release builds, retail titles, or game-data samples (`XCL_SAMPLE_*` unset). **AI use:** OpenCode with GPT-6.2 Sol ran the tests and drafted this report.
Author
Owner

@⁠amazedturnip on GitHub · 2026-11-24 03:16 UTC · original

Thanks for catching and reproducing the D3D12CreateDevice per-adapter singleton behavior when the D3D12 debug layer is active.

Updated crates/xcl/tests/desc_d3d12_e2e.rs to run the negative-control invalid SRV in a child process of the test executable (XCL_DESC_D3D12_NEG_CONTROL_LUID) targeting the parent's adapter LUID via xcl::gpu::agility::{configuration_interface, create_device}, requiring ID3D12InfoQueue, clean setup, a captured validation error, exit status 0, and a completion marker. This keeps the child's RemoveDevice isolated from XCL's shared backend device in the parent process.

Local check (XCL_ADAPTER=radeon, Windows Graphics Tools unavailable on this host): cargo test -p xcl --test desc_d3d12_e2e -- --test-threads=2 --nocapture -> 1 passed, 0 failed, 0 ignored.

**@⁠amazedturnip** on GitHub · 2026-11-24 03:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/540#issuecomment-7120940975) Thanks for catching and reproducing the `D3D12CreateDevice` per-adapter singleton behavior when the D3D12 debug layer is active. Updated `crates/xcl/tests/desc_d3d12_e2e.rs` to run the negative-control invalid SRV in a child process of the test executable (`XCL_DESC_D3D12_NEG_CONTROL_LUID`) targeting the parent's adapter LUID via `xcl::gpu::agility::{configuration_interface, create_device}`, requiring `ID3D12InfoQueue`, clean setup, a captured validation error, exit status 0, and a completion marker. This keeps the child's `RemoveDevice` isolated from XCL's shared backend device in the parent process. Local check (`XCL_ADAPTER=radeon`, Windows Graphics Tools unavailable on this host): `cargo test -p xcl --test desc_d3d12_e2e -- --test-threads=2 --nocapture` -> 1 passed, 0 failed, 0 ignored.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-24 01:40 UTC · original · edited 2026-11-24 03:40 UTC

Retest after subprocess isolation

The stock fixture passed 3/3 fresh runs on 09998c3. The D3D12 debug layer was active on the RTX 3080 Ti, with no GPU or validation skips. The parent passed all 23 SRV and seven sampler InfoQueue checks. The child captured the expected negative-control error and exited successfully, and the parent device passed its health assertion in every run.

Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug. cargo test --offline --locked -p xcl --test desc_d3d12_e2e desc_d3d12_srv_and_sampler_debug_layer -- --exact --nocapture --test-threads=1. GPU sampling readback, the full workspace suite, and retail use remain untested. Codex with GPT-6.2 Sol ran the tests and drafted this update.

Earlier same-process result

Tested

Reran d665f50 with Windows Graphics Tools installed. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug.

cargo test --offline --locked -p xcl --test desc_d3d12_e2e -- --test-threads=1 --nocapture ran the fixture on native D3D12 with the debug layer enabled (0 passed, 1 failed, 0 ignored, no GPU skip). All 23 SRV and seven sampler cases passed their InfoQueue assertions. The deliberate 3D SRV on a 2D resource triggered error 32, followed by device removal (error 232, DXGI_ERROR_INVALID_CALL). The fixture then failed its shared-device health assertion.

A diagnostic-only rerun compared the two devices' IUnknown identities before the control. They matched. Microsoft documents reuse of the process's existing D3D12 device for the same adapter.

Not tested

GPU sampling readback, full workspace suite, and retail titles.

AI use

Codex with GPT-6.2 Sol ran the tests and drafted this report.

**@⁠thehollowedone** on GitHub · 2026-11-24 01:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/540#issuecomment-7119330649) · edited 2026-11-24 03:40 UTC **Retest after subprocess isolation** The stock fixture passed **3/3 fresh runs** on [`09998c3`](https://github.com/ivall/xcl/commit/09998c343280f2b5dc66fbe4cc06f0bebdfc7af8). The D3D12 debug layer was active on the RTX 3080 Ti, with no GPU or validation skips. The parent passed all 23 SRV and seven sampler InfoQueue checks. The child captured the expected negative-control error and exited successfully, and the parent device passed its health assertion in every run. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug. `cargo test --offline --locked -p xcl --test desc_d3d12_e2e desc_d3d12_srv_and_sampler_debug_layer -- --exact --nocapture --test-threads=1`. GPU sampling readback, the full workspace suite, and retail use remain untested. Codex with GPT-6.2 Sol ran the tests and drafted this update. <details> <summary>Earlier same-process result</summary> **Tested** Reran [`d665f50`](https://github.com/ivall/xcl/commit/d665f505c49d8f8071bf8eeea2a4c45ffe558afe) with Windows Graphics Tools installed. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug. `cargo test --offline --locked -p xcl --test desc_d3d12_e2e -- --test-threads=1 --nocapture` ran the fixture on native D3D12 with the debug layer enabled (0 passed, 1 failed, 0 ignored, no GPU skip). All 23 SRV and seven sampler cases passed their InfoQueue assertions. The deliberate 3D SRV on a 2D resource triggered error 32, followed by device removal (error 232, `DXGI_ERROR_INVALID_CALL`). The fixture then failed its shared-device health assertion. A diagnostic-only rerun compared the two devices' `IUnknown` identities before the control. They matched. [Microsoft documents reuse of the process's existing D3D12 device for the same adapter.](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-d3d12createdevice#remarks) **Not tested** GPU sampling readback, full workspace suite, and retail titles. **AI use** Codex with GPT-6.2 Sol ran the tests and drafted this report. </details>
Author
Owner

@⁠JoaoPauluu on GitHub · 2026-11-24 03:50 UTC · original

Test report: #540 under Wine with vkd3d-proton as the host driver (Linux, NVIDIA)

The other runs here are native Windows drivers. Under Wine, the host driver this test compares XCL with is vkd3d-proton (D3D12 on Vulkan), and the test passes there as well.

Setup

  • CachyOS, kernel 7.3.3-1-cachyos, Intel i5-10400F, 16 GB RAM, NVIDIA GeForce RTX 3060 12 GB, driver 620.70.06
  • Proton Experimental experimental-11.0-20261112 (wine-11.0), vkd3d-proton v3.1 (4522cc1a) + the patch from #257, DXVK from Proton, DXVK_CONFIG="dxgi.hideNvidiaGpu = False"
  • Rust 1.100.0, x86_64-pc-windows-gnu (mingw-w64-gcc 16.2.0), debug build of this PR's head 09998c3

Result: desc_d3d12_e2e test binary under Wine, --test-threads=1: 1 passed, 0 failed, 0 ignored (one run).

  • desc_d3d12_srv_and_sampler_debug_layer: ok. vkd3d-proton has no debug layer (d3d12core_GetDebugInterface: Returning DXGI_ERROR_SDK_COMPONENT_MISSING), so the debug layer was not active in this run.

Not tested

  • Windows, AMD, other Wine / vkd3d-proton versions; the rest of the suite on this branch; a title run (test-only PR)

AI use: Claude Code (Claude Opus 5.5) built the test, ran it on the machine above and wrote this report. The results are pasted from those runs. The account owner asked for test reports to be posted while they were away and has not reviewed this one.

**@⁠JoaoPauluu** on GitHub · 2026-11-24 03:50 UTC · [original](https://github.com/xcl-dev/xcl/pull/540#issuecomment-7121471960) ### Test report: #540 under Wine with vkd3d-proton as the host driver (Linux, NVIDIA) The other runs here are native Windows drivers. Under Wine, the host driver this test compares XCL with is vkd3d-proton (D3D12 on Vulkan), and the test passes there as well. **Setup** - CachyOS, kernel 7.3.3-1-cachyos, Intel i5-10400F, 16 GB RAM, NVIDIA GeForce RTX 3060 12 GB, driver 620.70.06 - Proton Experimental `experimental-11.0-20261112` (wine-11.0), vkd3d-proton v3.1 (`4522cc1a`) + the patch from #257, DXVK from Proton, `DXVK_CONFIG="dxgi.hideNvidiaGpu = False"` - Rust 1.100.0, `x86_64-pc-windows-gnu` (mingw-w64-gcc 16.2.0), debug build of this PR's head `09998c3` **Result:** `desc_d3d12_e2e` test binary under Wine, `--test-threads=1`: 1 passed, 0 failed, 0 ignored (one run). - `desc_d3d12_srv_and_sampler_debug_layer`: ok. vkd3d-proton has no debug layer (`d3d12core_GetDebugInterface: Returning DXGI_ERROR_SDK_COMPONENT_MISSING`), so the debug layer was not active in this run. **Not tested** - Windows, AMD, other Wine / vkd3d-proton versions; the rest of the suite on this branch; a title run (test-only PR) **AI use:** Claude Code (Claude Opus 5.5) built the test, ran it on the machine above and wrote this report. The results are pasted from those runs. The account owner asked for test reports to be posted while they were away and has not reviewed this one.
Author
Owner

@⁠MesshM on GitHub · 2026-11-24 05:00 UTC · original

Test run of 09998c343280f2b5dc66fbe4cc06f0bebdfc7af8 on AMD RDNA4. I merged it onto current main 64b3f35 locally (clean merge).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 702 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 660 passed, 0 failed, 21 ignored
  • 0 SKIPPED; desc_d3d12_srv_and_sampler_debug_layer and the other desc_d3d12_e2e tests pass (single adapter here).

Review: Test-only; adds an AMD RDNA4 run to the many above. I found nothing to change.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

**@⁠MesshM** on GitHub · 2026-11-24 05:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/540#issuecomment-7122541417) Test run of `09998c343280f2b5dc66fbe4cc06f0bebdfc7af8` on AMD RDNA4. I merged it onto current `main` `64b3f35` locally (clean merge). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **702 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 660 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; `desc_d3d12_srv_and_sampler_debug_layer` and the other `desc_d3d12_e2e` tests pass (single adapter here). **Review:** Test-only; adds an AMD RDNA4 run to the many above. I found nothing to change. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, release build; the PR's head on its old base was not run, only its merge onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 06:53 UTC · original

Empirical test report (09998c34)

Independent Intel Arc A770 D3D12 verification of PR #540 at detached head 09998c343280f2b5dc66fbe4cc06f0bebdfc7af8 (clean worktree).

Hardware / environment

  • Intel Arc A770 Graphics (16,258 MiB VRAM, driver 32.0.101.9175), AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation x64 build 26200.9974 (D3D12 debug layer d3d12SDKLayers.dll absent).
  • rustc 1.100.0 (0ef1bc386 2026-11-09) (x86_64-pc-windows-msvc), DXC 1.9.2609.5 (01b62ad47), unoptimized Cargo test profile with debug info and incremental compilation disabled.

Commands and results

  • Located prebuilt integration test binary via cargo test -p xcl --tests --no-run --message-format=json outside the GPU lock.
  • Ran inside Invoke-ArcTest.ps1 with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1:
    • desc_d3d12_e2e.exe --nocapture --test-threads=1 (exit 0, 0.30s).
  • 1 passed, 0 failed, 0 ignored, 0 skipped.

Observed behavior

  • desc_d3d12_srv_and_sampler_debug_layer opened real backend Intel(R) Arc(TM) A770 Graphics and completed driver CreateCommittedResource, CreateShaderResourceView, and CreateSampler calls with exit 0.
  • Because the D3D12 debug layer is unavailable on this host (0x887A002D), the test logged that it ran without InfoQueue validation.

Not tested

  • D3D12 InfoQueue validation / negative invalid-SRV debug-layer checks (missing host SDK layers), full GPU workspace suite, and game smoke runs were omitted.

AI use

Verified and published with T3 Code / Antigravity (gemini-4-neon).

**@⁠JJAutoCompare** on GitHub · 2026-11-25 06:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/540#issuecomment-7155272848) ### Empirical test report (09998c34) Independent Intel Arc A770 D3D12 verification of PR #540 at detached head `09998c343280f2b5dc66fbe4cc06f0bebdfc7af8` (clean worktree). **Hardware / environment** - Intel Arc A770 Graphics (16,258 MiB VRAM, driver `32.0.101.9175`), AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation x64 build `26200.9974` (D3D12 debug layer `d3d12SDKLayers.dll` absent). - `rustc 1.100.0 (0ef1bc386 2026-11-09)` (`x86_64-pc-windows-msvc`), DXC `1.9.2609.5 (01b62ad47)`, unoptimized Cargo test profile with debug info and incremental compilation disabled. **Commands and results** - Located prebuilt integration test binary via `cargo test -p xcl --tests --no-run --message-format=json` outside the GPU lock. - Ran inside `Invoke-ArcTest.ps1` with `XCL_ADAPTER=A770` and `RUST_TEST_NOCAPTURE=1`: - `desc_d3d12_e2e.exe --nocapture --test-threads=1` (exit 0, 0.30s). - **1 passed, 0 failed, 0 ignored, 0 skipped.** **Observed behavior** - `desc_d3d12_srv_and_sampler_debug_layer` opened real backend `Intel(R) Arc(TM) A770 Graphics` and completed driver `CreateCommittedResource`, `CreateShaderResourceView`, and `CreateSampler` calls with exit 0. - Because the D3D12 debug layer is unavailable on this host (`0x887A002D`), the test logged that it ran without InfoQueue validation. **Not tested** - D3D12 InfoQueue validation / negative invalid-SRV debug-layer checks (missing host SDK layers), full GPU workspace suite, and game smoke runs were omitted. **AI use** Verified and published with T3 Code / Antigravity (gemini-4-neon).
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 13:43 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 13:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/540#issuecomment-7164191123) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠amazedturnip on GitHub · 2026-11-25 15:55 UTC · original

Thanks for the reports. The subprocess isolation the review surfaced is already in place at this head (the negative control runs in a child process; parent device stays healthy). My local run on the current head found one additional real defect: the B5G5R5A1 case used GFX10 format 135, which is the 5_5_5_1 layout (no DXGI equivalent, image_d3d12 correctly returns None) instead of the actual B5G5R5A1 format 134 (1_5_5_5). Fixed the test's format number; the run now passes (0 passed, 1 failed -> 1 passed, 0 failed) on AMD Radeon (debug layer unavailable on this host). No other changes needed.

**@⁠amazedturnip** on GitHub · 2026-11-25 15:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/540#issuecomment-7167427485) Thanks for the reports. The subprocess isolation the review surfaced is already in place at this head (the negative control runs in a child process; parent device stays healthy). My local run on the current head found one additional real defect: the B5G5R5A1 case used GFX10 format 135, which is the 5_5_5_1 layout (no DXGI equivalent, `image_d3d12` correctly returns None) instead of the actual B5G5R5A1 format 134 (1_5_5_5). Fixed the test's format number; the run now passes (0 passed, 1 failed -> 1 passed, 0 failed) on AMD Radeon (debug layer unavailable on this host). No other changes needed.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 03:00 UTC · original

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 03:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/540#issuecomment-7181306267) Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
Author
Owner

@⁠upipibi on GitHub · 2026-11-26 08:49 UTC · original

RTX 3070 8 GB run of 9a69001 (as-is on its base 0829441, not merged with current main) with the D3D12 debug layer on (inbox d3d12SDKLayers.dll), which the description's AMD run did not have.

  • cargo test -p xcl --test desc_d3d12_e2e -- --nocapture --test-threads=1, 3 runs: 1 passed, 0 failed, 0 ignored each; no SKIPPED; log shows debug layer enabled and the real backend on the 3070.
  • Steps 1-3 (9 view-type, 12 format/swizzle including the changed B5G5R5A1 = 134, 7 sampler cases): no debug-layer error or warning; the id 1361 sampler warnings seen on 5d7f6e1 are gone.
  • Negative control (child process): with a local print added only to show its messages, the child got id 32 (ViewDimension incompatible with the resource) and id 232 (device removed), exited 0, and the parent's device stayed healthy.

Not tested: the no-layer path, AMD, release builds, a merge with current main.
NVIDIA 616.56, Windows 11 26100, Rust 1.100.0, debug.

AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this.

**@⁠upipibi** on GitHub · 2026-11-26 08:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/540#issuecomment-7187063134) RTX 3070 8 GB run of `9a69001` (as-is on its base `0829441`, not merged with current `main`) **with the D3D12 debug layer on** (inbox `d3d12SDKLayers.dll`), which the description's AMD run did not have. - `cargo test -p xcl --test desc_d3d12_e2e -- --nocapture --test-threads=1`, 3 runs: 1 passed, 0 failed, 0 ignored each; no SKIPPED; log shows `debug layer enabled` and the real backend on the 3070. - Steps 1-3 (9 view-type, 12 format/swizzle including the changed B5G5R5A1 = 134, 7 sampler cases): no debug-layer error or warning; the id 1361 sampler warnings seen on `5d7f6e1` are gone. - Negative control (child process): with a local print added only to show its messages, the child got id 32 (ViewDimension incompatible with the resource) and id 232 (device removed), exited 0, and the parent's device stayed healthy. Not tested: the no-layer path, AMD, release builds, a merge with current `main`. NVIDIA 616.56, Windows 11 26100, Rust 1.100.0, debug. AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/540/head:github-bot/gh-540'
git switch 'github-bot/gh-540'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-540'
git switch 'github-bot/gh-540'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-540'
git switch 'github-bot/gh-540'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-540'
git switch 'main'
git merge --squash 'github-bot/gh-540'
git switch 'main'
git merge --ff-only 'github-bot/gh-540'
git switch 'main'
git merge 'github-bot/gh-540'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.