Skip to content

Tests: list_x GPU fixtures use the XCL_ADAPTER adapter - #3016

Open
KDenKC wants to merge 1 commit into
xcl-dev:mainfrom
KDenKC:list-x-adapter-fixtures
Open

KDenKC wants to merge 1 commit into
xcl-dev:mainfrom
KDenKC:list-x-adapter-fixtures

Conversation

@KDenKC

@KDenKC KDenKC commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

The list_x GPU tests made their devices on the default adapter (D3D12CreateDevice(None), agility::create_device(None)): on a machine with two GPUs they ran on whichever the system picked, whatever XCL_ADAPTER said. They now share fixture_device(), which takes the adapter XCL_ADAPTER selects (gpu::adapter), falls back to WARP when it is unset and no hardware adapter is there (an adapter it names that is not there is a skip), prints the adapter it used once per run, and skips the test when it cannot make a device.

What is in it (one commit, hle/d3d12x/list_x.rs, tests only)

  • fixture_device() and every list_x test that made a device on the default adapter, including the three main added after the first version of this PR: a_title_fence_wait_an_earlier_signal_covers_is_no_cycle, put_off_rig and a_split_after_kickoff_does_not_take_the_segment_just_submitted.
  • The tests that are meant to run on WARP (..._on_the_software_adapter and the WARP-only fixture) keep their WARP device.
  • Zero runtime lines change: every changed line is inside list_x.rs's #[cfg(test)] module. scripts/pr_check.py counts list_x.rs as a runtime file all the same, so this PR needs the maintainer's test-only label (CONTRIBUTING, point 3) in place of a smoke pair.

Tested

  • Current rebased head 4a9158b8914b0f3e7cc0845c276b7f4c20b41a7d: workspace suite build exit 0; 2,877 passed, 6 failed, 51 ignored. The six VM-known failures were gpu_direct_image_get_resinfo_d16, placed_title_textures_share_vram_and_preserve_pixels, the three stream_recheck_* follow-on tests, and test_title_runs_and_game_folder_is_untouched (e2e: Invalid bitcode signature). The 5090 smoke pair is below. Earlier detailed test results are from 795e4017.
  • Rebased on main 53e85fb1 (this head 795e4017; the previous head d32774f3 was on main fa204595). The PR checks' earlier failures were 4 pipeline_library / warm_library tests of that older base, which pass on 53e85fb1.
  • RTX 3090 24 GB (VM), NVIDIA 621.24, Intel i7-10700T, Windows 11 build 26300.9974, Rust 1.99.1, debug, at 795e4017:
    • cargo test -p xcl --lib --no-run, debug and release: both build.
    • cargo test -p xcl --lib -- list_x --nocapture --test-threads=1: 113 passed, 0 failed, 0 ignored, 2570 filtered out. The fixture printed list_x fixture adapter: NVIDIA GeForce RTX 3090; WARP=false.
    • cargo test --workspace --no-fail-fast -- --test-threads=4: the lib binary was killed (STATUS_ACCESS_VIOLATION) while gpu::agility::tests::create_device_sets_dred_first, gpu::bvh::tests::scene_trace_matches_brute_force and gpu::dxil::compact_tests::a_large_program_that_repeats_itself_takes_the_compact_form ran: main's own (main fa204595 was killed the same way on this machine, with the same three running). The other binaries: 138 passed, 1 failed, 20 ignored (the e2e failure below). The lib binary rerun on 1 thread (--skip uma_driver::tests, all 8 of them): 2641 passed, 5 failed, 29 ignored, the same lib tests as main (2641 + 5 + 29 + 8 = 2683). SKIPPED in that run's output: 14 (8 no wave64, 3 no debug layer, 2 refused per-lane forms, 1 no heap windows); the killed run's are not in it.
    • Main 53e85fb1 on the same machine: 2784 passed, 6 failed, 49 ignored, 31 SKIPPED. The 6 are main's own: title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels, the 3 stream_recheck_* tests, standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline (main's test does not count the stand-in pipeline's deferred release, Related: Tests: account for deferred stand-in pipeline release #3484), e2e test_title_runs_and_game_folder_is_untouched. The lib failures here are those 5; e2e fails as on main.
  • Earlier (0624a46): DarkPanda69's AMD + NVIDIA hybrid machine, 40/40 on both adapters with the adapter line matching XCL_ADAPTER.

Regression run

  • RTX 5090, 600 seconds each, same title and JIT setup. Both arms used the same translated-cache seed (main-full-d8bd), the same frozen accepted-terms profile (r18-terms: gamesave and pls/settings), and held Enter. The blocks below are copied verbatim from the rig script's report.

Main 9dfbe3ea:

xcl-smoke v1
commit: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b
gpu: NVIDIA GeForce RTX 5090
title: 9cc6a39e
seconds: 600
exit: 0x0
frames shown: 1872 (PresentX 1873)
presents per 2 s (last 3): 2 2 1
device removals: 0
crashes: 0
peak commit: 47791 MB

This head 4a9158b8:

xcl-smoke v1
commit: 4a9158b8914b0f3e7cc0845c276b7f4c20b41a7d
gpu: NVIDIA GeForce RTX 5090
title: 9cc6a39e
seconds: 600
exit: 0x0
frames shown: 1893 (PresentX 1893)
presents per 2 s (last 3): 2 1 2
device removals: 0
crashes: 0
peak commit: 47961 MB

Not tested

  • A machine with two adapters on this head (the VM has one).
  • Other modules' GPU tests that make a device on the default adapter (alloc_pool.rs has three) are not part of this PR.

AI use

  • Claude Code (Claude Opus 5.5, Claude Sonnet 5.5), Codex (GPT-6.2-Sol), Antigravity (Gemini 4 Neon, Gemini 3.8 Flash): an agent swarm wrote, tested, reviewed and described this change.

🤖 Generated with Claude Code
https://claude.ai/code/session_013oPUFCA9W9F8Qb5MPK33bR

@DarkPanda69

Copy link
Copy Markdown

AMD run as asked, on a two-GPU PC (RX 9070 XT + RTX 3060), so the adapter check is a real one.

Tested: pass, head 0624a46 applied on main 6089122, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X (XCL_NETWORK not set).
cargo test -p xcl --lib -- hle::d3d12x::list_x::tests:: --test-threads=4 --nocapture:

  • XCL_ADAPTER=radeon: list_x fixture adapter: AMD Radeon RX 9070 XT; WARP=false, 40 passed, 0 failed, 0 ignored, 0 SKIPPED (driver 32.0.32029.2010).
  • XCL_ADAPTER=3060: list_x fixture adapter: NVIDIA GeForce RTX 3060; WARP=false, 40 passed, 0 failed, 0 ignored, 0 SKIPPED (driver 32.0.16.1088).

On this hybrid machine the reported adapter matched the request both times, the lowercase radeon included. main without the PR: 40 passed on both, with no adapter line.

Not tested: Intel, a WARP-only machine, release.

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

@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) needs-pr-check Failing the PR description check (CONTRIBUTING.md) labels Nov 29, 2026
@KDenKC
KDenKC force-pushed the list-x-adapter-fixtures branch from 0624a46 to d32774f Compare November 29, 2026 08:07
@github-actions github-actions Bot removed the needs-pr-check Failing the PR description check (CONTRIBUTING.md) label Nov 29, 2026
@KDenKC
KDenKC force-pushed the list-x-adapter-fixtures branch from d32774f to 795e401 Compare November 30, 2026 01:19
Use the existing adapter selector for test fixture devices, report the actual adapter and WARP status, and retain the WARP fallback. Keep the deliberate WARP-only test unchanged.

Assisted-by: Codex (GPT-6.1-Sol)
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Triage (#1607) – head 4a9158b

No open or merged PR makes the same change. #2337 and #2879 apply the same idea to other files (vram.rs/title_textures.rs, gpu/texture.rs). Notes on the diff in list_x.rs: fixture_device falls back to WARP when the adapter chosen with XCL_ADAPTER fails to create a device, and only logs it, so a run that asked for a specific GPU can quietly test on WARP. Tests that used to skip without hardware (an_internal_wait_is_listed_until_its_fence_reaches_the_value, a_split_after_kickoff_does_not_take_the_segment_just_submitted, ...) now run on WARP. Removing the use lines left a blank line at the start of several test bodies.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

@fromthemoonx

fromthemoonx commented Dec 1, 2026 •

Copy link
Copy Markdown

merge-check
base: 6bfb5c5
head: 4a9158b
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2904 passed, 0 failed, 51 ignored (base: 2904 passed, 0 failed, 51 ignored); SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps), the same set as base; failing: none
review: read the whole diff (1 file, +53 -226, all inside list_x.rs's #[cfg(test)] module, so test-only). No correctness problem found.

  • hle::d3d12x::list_x::tests:: (105 tests, --test-threads=4, --nocapture), one GPU here:

    XCL_ADAPTER Device Result
    unset NVIDIA GeForce RTX 3060; WARP=false 105 passed
    warp Microsoft Basic Render Driver; WARP=true 105 passed
    3060 RTX 3060 105 passed
    nosuchgpu none 105 passed, 22 SKIPPED with "nosuchgpu" matches no hardware adapter (have: 0 = NVIDIA GeForce RTX 3060)
  • Minor: split_close_rig still makes its device on the default adapter (agility::create_device(None, ...), list_x.rs:8496 in the merge), and it was already on the PR's base 9dfbe3e. So a_split_whose_close_fails_leaves_that_list_out_and_goes_on and a_split_whose_close_fails_with_no_list_in_its_place_fails_the_recording_closed do not follow XCL_ADAPTER; under XCL_ADAPTER=warp they ran on the RTX 3060. The description says "every list_x test".

  • The fixture now makes devices through agility::create_device (DRED set first, Agility factory when loaded) where most of these tests called D3D12CreateDevice directly. That is the runtime's own path; no test changed result here.

  • Foniass's note stands: a selected adapter whose device creation fails falls back to WARP with only an eprintln!. It did not come up here (every device creation succeeded).

  • put_off_dispatches_wait_at_the_submit_and_run_on_the_software_adapter, which is meant to run on WARP, keeps its WARP device.

  • list_x.rs counts as a runtime file for pr_check.py, so it still needs the maintainer's test-only label.
    performance: none: test code only.
    verdict: safe to merge
    hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)

@github-actions github-actions Bot added needs-1st-check Passes gates; needs first independent merge-check (#3041) needs:amd-test Needs a test report or merge-check on an AMD GPU needs:nvidia-test Needs a test report or merge-check on an NVIDIA GPU needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) and removed needs-1st-check Passes gates; needs first independent merge-check (#3041) needs:nvidia-test Needs a test report or merge-check on an NVIDIA GPU labels Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) needs:amd-test Needs a test report or merge-check on an AMD GPU needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants