Skip to content

Tests: honor XCL_ADAPTER in the texture upload state test - #537

Open
a-lebailly wants to merge 1 commit into
xcl-dev:mainfrom
a-lebailly:codex/texture-test-adapter
Open

a-lebailly wants to merge 1 commit into
xcl-dev:mainfrom
a-lebailly:codex/texture-test-adapter

Conversation

@a-lebailly

Copy link
Copy Markdown

The texture upload state test used the default D3D12 adapter even when XCL_ADAPTER selected another device. The test now uses XCL's adapter selector and verifies the device's adapter LUID. Related to #42.

What is in it

  • crates/xcl/tests/texture_states.rs: pass the selected adapter to D3D12 and test the skip message for an unmatched selector.

Tested

  • Windows 11 25H2 build 26200.9974, Core i9-9900K, RTX 4060 Ti driver 621.01, Rust 1.100.0 MSVC, debug.
  • .\scripts\test.ps1 with XCL_ADAPTER=4060 Ti on 68460c2: 681 passed, 0 failed, 41 ignored. Two reported SKIPPED for no wave64: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware.
  • cargo test --offline --locked -p xcl --test texture_states -- --show-output: 2 passed, 0 failed, 0 ignored. The regression failed with the original upload path as expected.

Not tested

  • AMD, retail titles, and game-data tests (XCL_SAMPLE_* unset). The diff is limited to an integration test.

AI use

  • Codex (GPT-6, exact variant unavailable) diagnosed the problem, wrote the patch and regression, and ran the tests.

The texture upload state test created a device on the Windows default
adapter even when XCL_ADAPTER selected another device. Use XCL's adapter
selection and verify the device's adapter LUID.

Run the upload test with an unmatched selector in a subprocess and
require a visible skip. The regression fails with the original upload
path and passes with the selector wired in.

Assisted-by: Codex (GPT-6, exact variant unavailable)
@futurepro62

Copy link
Copy Markdown

Tested exact head 68460c2 on a machine with two hardware adapters, with the D3D12 debug layer installed (Graphics Tools), so the test gets past its debug-layer skip and reaches the new LUID check.

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 texture_states -- --test-threads=1 --nocapture: 2 passed, 0 failed with XCL_ADAPTER unset, nvidia, radeon and warp. Each run printed per-subresource states: 0 debug-layer errors and one state for all: 1 debug-layer errors.

  • Which adapter the device was on, from a temporary local eprintln! of the selected adapter's description and LUID next to the new assert_eq! (not part of the PR, reverted after):

    XCL_ADAPTER main 508a0c7 (device LUID) this PR (selected adapter = device LUID)
    unset – RTX 5070 Ti (0:fdb2)
    nvidia 0:fdb2 (RTX 5070 Ti) RTX 5070 Ti (0:fdb2)
    radeon 0:fdb2 (RTX 5070 Ti, selector ignored) AMD Radeon iGPU (0:11276)
    warp – Microsoft Basic Render Driver (0:11243)

    So on main the test ignores XCL_ADAPTER=radeon and runs on the default adapter; with the PR it runs on the selected one.

  • .\scripts\test.ps1 (no XCL_ADAPTER): 681 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.

Not tested

  • The whole suite with XCL_ADAPTER=radeon (only texture_states was run on the iGPU).
  • A discrete AMD card, retail titles, game-data tests (XCL_SAMPLE_* unset).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests, added and reverted the temporary print, and wrote this report. I checked it before posting.

@MonkeyPython

Copy link
Copy Markdown

NVIDIA data point (the "AMD, retail titles, and game-data tests" gap — this host covers the retail-title and XCL_SAMPLE_* halves on NVIDIA): XCL_ADAPTER selection works as intended on an RTX 3080 Ti.

Setup: Windows 11 Pro 26300, Ryzen 7 7800X3D, 32 GB, RTX 3080 Ti 12 GB (driver 621.01) + AMD Raphael iGPU, PR head 68460c2, release build.

Runs (cargo test -p xcl --release --test texture_states -- --test-threads=4):

  • XCL_SAMPLE_RPF/DLLS/TTPF set (retail GTA VI 1.0.2.1 package), default adapter: 2 passed / 0 failed / 0 ignored, no internal skips.
  • Same samples + XCL_ADAPTER='3080 Ti': 2 passed / 0 failed / 0 ignored, no internal skips.
  • XCL_ADAPTER='No Such GPU': the upload test skips with the intended message — SKIPPED uploads_start_from_each_subresources_state: XCL_ADAPTER / d3d12_adapter "no such gpu" matches no hardware adapter (have: 0 = NVIDIA GeForce RTX 3080 Ti, 1 = AMD Radeon(TM) Graphics, 2 = NVIDIA GeForce RTX 3080 Ti) — and texture_upload_test_reports_an_unmatched_adapter passes.
  • Samples unset: 2 passed / 0 failed / 0 ignored (the game-data assertions no-op cleanly).

Minor observation, not a defect claim: the adapter list in the skip message enumerates the 3080 Ti twice (entries 0 and 2) on this host.

Not tested: AMD discrete GPUs, other retail titles.

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

@caua-an

caua-an commented Nov 24, 2026

Copy link
Copy Markdown

Tested: Clean PR head 68460c242fa7653f3c23a1f17b28389cd39193b4, debug build, Windows 11 Home build 26200, Core Ultra 9 185H, Rust 1.100.0 MSVC x64, and Graphics Tools installed.

cargo test --offline --locked -p xcl --test texture_states -- --test-threads=1 --nocapture passed with both XCL_ADAPTER=nvidia (RTX 4070 Laptop, driver 616.92) and XCL_ADAPTER=intel (Intel Arc integrated graphics, driver 32.0.101.8860): 2 passed, 0 failed, 0 ignored on each adapter. The upload test reached and passed the adapter LUID assertion on both. Each run reported zero debug-layer errors with per-subresource states and one expected error when using one state for all subresources. The unmatched-adapter regression also passed.

Not tested: Full workspace suite, release build, retail titles, or game-data samples.

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

@MesshM

MesshM commented Nov 24, 2026

Copy link
Copy Markdown

Test run of 68460c242fa7653f3c23a1f17b28389cd39193b4 on AMD RDNA4. I merged it onto current main dd2ae9a locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64), 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: 691 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 650 passed, 0 failed, 21 ignored
  • 0 SKIPPED; texture_upload_test_reports_an_unmatched_adapter and uploads_start_from_each_subresources_state pass with the default selector (one hardware adapter here).

Review: The test now builds its device on the adapter XCL_ADAPTER selects and checks the device's LUID; the child-process test sets the selector only for the child, so the parent's environment is untouched. 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.

@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.

7 participants