Tests: honor XCL_ADAPTER in the texture upload state test #532

Open
a-lebailly wants to merge 1 commit from upstream-pr/537 into main
a-lebailly commented 2026-11-24 01:32:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by a-lebailly on 2026-11-24T01:32:40Z.


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.
<!-- greyfinch-sync:ivall/xcl:issue:5464373760 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/537). Originally posted by [a-lebailly](https://github.com/a-lebailly) on 2026-11-24T01:32:40Z. --- 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.
futurepro62 commented 2026-11-24 07:05:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T01:50:42Z.


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.
<!-- greyfinch-sync:ivall/xcl:comment:7119499743 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/537#issuecomment-7119499743). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T01:50:42Z. --- 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 commented 2026-11-24 07:05:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MonkeyPython on 2026-11-24T02:11:01Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7119839025 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/537#issuecomment-7119839025). Originally posted by [MonkeyPython](https://github.com/MonkeyPython) on 2026-11-24T02:11:01Z. --- 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 commented 2026-11-24 07:05:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by caua-an on 2026-11-24T02:27:09Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7120156605 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/537#issuecomment-7120156605). Originally posted by [caua-an](https://github.com/caua-an) on 2026-11-24T02:27:09Z. --- **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 commented 2026-11-24 07:05:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T03:04:11Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7120742029 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/537#issuecomment-7120742029). Originally posted by [MesshM](https://github.com/MesshM) on 2026-11-24T03:04:11Z. --- 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 commented 2026-11-25 14:10:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T13:43:19Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7164192312 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/537#issuecomment-7164192312). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T13:43:19Z. --- 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!
github-actions[bot] commented 2026-11-29 07:43:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:43:37Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7252651942 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/537#issuecomment-7252651942). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T07:43:37Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 03:40:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:40:19Z.


Triage (#1607) – head 68460c2

No open or merged PR makes the same change; #3016 does the same for the list_x fixtures in another file. Main's texture_states.rs still creates its device with create_device(None, ...), so this is not superseded, but main has since changed the same test (stderr skips through skip_test, title_textures uploads), which is why it conflicts. The child-process test checks the message from adapter::no_match, which matches what main prints for an unmatched name. No problems found in the diff.
Recommendation: keep open (needs a rebase).

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

<!-- greyfinch-sync:ivall/xcl:comment:7299945242 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/537#issuecomment-7299945242). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T03:40:19Z. --- **Triage (#1607)** – head 68460c2 No open or merged PR makes the same change; #3016 does the same for the list_x fixtures in another file. Main's texture_states.rs still creates its device with `create_device(None, ...)`, so this is not superseded, but main has since changed the same test (stderr skips through `skip_test`, title_textures uploads), which is why it conflicts. The child-process test checks the message from `adapter::no_match`, which matches what main prints for an unmatched name. No problems found in the diff. Recommendation: keep open (needs a rebase). AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/537:upstream-pr/537'
git switch 'upstream-pr/537'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/537'
git switch 'upstream-pr/537'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/537'
git switch 'upstream-pr/537'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/537'
git switch 'main'
git merge --squash 'upstream-pr/537'
git switch 'main'
git merge --ff-only 'upstream-pr/537'
git switch 'main'
git merge 'upstream-pr/537'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!532
No description provided.