Skip to content

Tests: select configured adapter in VRAM fixtures - #2337

Draft
luckyteagirl wants to merge 2 commits into
xcl-dev:mainfrom
luckyteagirl:codex/vram-test-adapter
Draft

luckyteagirl wants to merge 2 commits into
xcl-dev:mainfrom
luckyteagirl:codex/vram-test-adapter

Conversation

@luckyteagirl

@luckyteagirl luckyteagirl commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Make the two existing shared-video-memory GPU fixtures select the hardware requested by XCL_ADAPTER and report which adapter ran. Both previously used DXGI adapter 0, so a hybrid machine could report a pass on its integrated GPU while a discrete-GPU run was requested. This matters for the RDNA2 result on #2306 and the D32S8 check discussed on #2270. The diff is entirely inside existing #[cfg(test)] code.

What is in it

  • crates/xcl/src/hle/d3d12x/vram.rs: select a hardware adapter via gpu::adapter, print its name, and count unavailable-device/tier skips in the D32S8 VRAM fixture. Request IDXGIFactory6 through CreateDXGIFactory2 and skip cleanly if factory creation fails.
  • crates/xcl/src/hle/d3d12x/title_textures.rs: do the same for placed_title_textures_share_vram_and_preserve_pixels. Its existing cubemap/UMA capability exits now use counted skip_test reasons. Pixel, page-count, and alias assertions are unchanged.

Tested

  • Windows 11 build 26200, Ryzen 9 5980HX, discrete AMD Radeon RX 6800M (driver 30.0.13002.13003) plus integrated Radeon; Rust 1.99.0 MSVC; DXC/DXIL 1.9.2609.5. Debug tests and release build.
  • cargo build --locked --workspace -j 2 and cargo build --locked --workspace --release -j 2: passed.
  • XCL_ADAPTER=6800M cargo test --locked -p xcl --lib d32s8_targets_take_their_own_size_of_video_memory -- --test-threads=1 --show-output: 1 passed, 0 failed, 0 ignored, 0 skipped; printed D32S8 VRAM test adapter: AMD Radeon RX 6800M and checked depth/stencil readback.
  • XCL_ADAPTER=6800M cargo test --locked -p xcl --lib placed_title_textures_share_vram_and_preserve_pixels -- --test-threads=1 --show-output: 1 harness pass, 0 failed, 0 ignored, 1 explicit SKIPPED; printed Shared-page texture test adapter: AMD Radeon RX 6800M, then this adapter makes no reserved cube with mips. The checked-in test's early cubemap gate prevents its 2D assertions on this driver. A separate local test-only control with the gate removed and the cubemap case omitted passed the parent runtime's 2D shared-page checks, including a 1024×1024 RGBA8 11-mip shape; that overlay is not part of this branch.
  • Invalid-selector control (XCL_ADAPTER=NoSuchAdapterName, XCL_REQUIRE_GPU=wave64) for the shared-page test: 0 passed, 1 expected failure with no selected hardware adapter, but XCL_REQUIRE_GPU=wave64. The D32S8 invalid-selector control passed silently on unchanged main and failed as expected on this branch in an earlier run.
  • Full cargo test --locked --workspace --no-fail-fast -j 2 -- --test-threads=4 --show-output: 1,089 passed, 176 failed, 46 ignored across 23 targets, exit 101, with 10 explicit SKIPPED records. This old RX 6800M driver entered a suspect device state during broad GPU tests; both selected-adapter fixtures then reported cannot create D3D12 device as counted skips. The previous branch revision had the same 1,089/176/46/10 totals. Standalone runs above completed before the broad suite.

Regression run

  • This is test-only code inside runtime source files. A maintainer's test-only label is needed to waive the PR check's current-head smoke requirement. A 12-second owned-title pair on main 06c9f55 and the prior branch commit 774da77 ended without crashes or device removal; the added commit changes only test code. I do not claim that pair as a current-head smoke run. A guarded attempt on this exact head 6cb23b9 stopped after 7.5 seconds when available system commit fell to 948 MB, before xcl-smoke produced a result. No game data was uploaded.

Not tested

AI use

  • OpenAI Codex (GPT-6; exact variant unavailable in this session) wrote the test-only changes, ran the Windows checks, prepared and pushed the branch, and drafted this description.

Select the same high-performance hardware adapter as the GPU test runner. Report selection and device setup failures as skips instead of silently returning, so a GPU report identifies the device it actually exercised.

Assisted-by: OpenAI Codex (GPT-6; exact variant unavailable)
Use the selected hardware adapter in the existing texture fixture and count unavailable-capability skips. Request IDXGIFactory6 through CreateDXGIFactory2 in both VRAM GPU fixtures.
@SlopTart

SlopTart commented Nov 25, 2026 •

Copy link
Copy Markdown

Tested: current PR head merged onto current origin/main (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target x86_64-pc-windows-gnu run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).

  • gpu_ suite (--release --locked, --test-threads=2): 144 passed / 3 failed / 1 ignored, same three baseline failures as plain origin/main on this rig (rig's known baseline: fuzz seed 1003 of DXIL fuzz tests: fuzz_validate_and_gpu_1 fails on AMD (seed 722 and others, RDNA2-4), so the default suite is red there #2115, gpu_nonfused_mad_and_mac_prevent_fma_contraction, gpu_depth_buffer_created_for_unordered_access_is_placed).
  • The reworked SVAM fixtures (placed_title_textures_share_vram_and_preserve_pixels and sibling) now run through adapter::Selector under Wine/DXGI: pass with XCL_ADAPTER unset (auto) and with XCL_ADAPTER="AMD Radeon RX 7900 XT". The adapter-name print reports the real card on this lane.

Complements the XCL_ADAPTER fallback/skip matrix posted on #2324 earlier today: match path, auto path, and no-match skip all behave on the Wine lane.

Not tested: retail titles (no title data on this lane, counts only).

AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.

@throny throny added the off-goal Does not bear on the current goal (world loading); waits until it is reached label Nov 25, 2026
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.

3 participants