Tests: gpu adapter selector parse/fallback and env override contract #1664

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

@⁠amazedturnip on GitHub · 2026-11-24 18:57 UTC · original
amazedturnip:xcl/tests-gpu-adapter-selector-parsing-and-matching-183357 → main · +150 −0 · 1 files · 1 commits · open

Adds an integration test file covering the public Selector contract: parse (empty/auto, warp, positional index, leading-zeros never positional, non-digit/overflow names, lowercased names), from_env_or precedence (XCL_ADAPTER when set and non-blank, configured fallback otherwise), allows (Auto/Warp/Index/Name direct rules), and Display rendering. Env-touching tests serialize on a process-global mutex with restore-on-drop. No production code changed; pure parser coverage, GPU-independent.

What is in it

  • crates/xcl/tests/gpu_adapter.rs: new integration test file covering xcl::gpu::adapter::Selector parse/fallback (auto/empty, warp, digit positional index, leading-zeros never positional, non-digit names, lowercased names, u64/overflow degrades to Name)
  • crates/xcl/tests/gpu_adapter.rs: from_env_or contract — uses XCL_ADAPTER when set and non-blank, otherwise falls back to the configured string; blank/whitespace env values fall back
  • crates/xcl/tests/gpu_adapter.rs: allows — Auto matches every position, Warp matches nothing, Index matches only its position, Name matches case-insensitively by substring
  • crates/xcl/tests/gpu_adapter.rs: Display — auto/warp/{n}/"{s}" rendering for each variant
  • Uses a process-global ENV_LOCK mutex + EnvGuard (restores previous XCL_ADAPTER on drop) so env-touching tests cannot leak process state

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 — 868 passed, 0 failed, 42 ignored (SKIPPED GPU tests: 1 (no heap windows))
  • Verification / negative control: temporarily dropped the leading-zeros guard in crates/xcl/src/gpu/adapter.rs line 39; cargo test --test gpu_adapter failed 3/10 (parse_leading_zeros_are_never_a_positional_index, from_env_or_prefers_env_when_set_and_non_blank, from_env_or_falls_back_to_configured_when_unset_or_blank); reverted via git checkout -- crates/xcl/src/gpu/adapter.rs and re-ran 10/10 passed.

Not tested

  • Retail Xbox Series X|S titles (not available on this host)
  • pub(crate) DXGI device-creation / Selector::select_indices hardware paths (covered by inline tests in crates/xcl/src/gpu/adapter_tests.rs)
  • NVIDIA wave32 GPU (not run in this pass; verified on AMD Radeon native wave64)

AI use

  • Local AI (thinkingmachines_inkling-2-mini) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64).
**@⁠amazedturnip** on GitHub · 2026-11-24 18:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/1664) `amazedturnip:xcl/tests-gpu-adapter-selector-parsing-and-matching-183357` → `main` · +150 −0 · 1 files · 1 commits · open Adds an integration test file covering the public `Selector` contract: `parse` (empty/auto, warp, positional index, leading-zeros never positional, non-digit/overflow names, lowercased names), `from_env_or` precedence (`XCL_ADAPTER` when set and non-blank, configured fallback otherwise), `allows` (Auto/Warp/Index/Name direct rules), and `Display` rendering. Env-touching tests serialize on a process-global mutex with restore-on-drop. No production code changed; pure parser coverage, GPU-independent. **What is in it** - `crates/xcl/tests/gpu_adapter.rs`: new integration test file covering `xcl::gpu::adapter::Selector` parse/fallback (auto/empty, warp, digit positional index, leading-zeros never positional, non-digit names, lowercased names, `u64`/overflow degrades to `Name`) - `crates/xcl/tests/gpu_adapter.rs`: `from_env_or` contract — uses `XCL_ADAPTER` when set and non-blank, otherwise falls back to the configured string; blank/whitespace env values fall back - `crates/xcl/tests/gpu_adapter.rs`: `allows` — `Auto` matches every position, `Warp` matches nothing, `Index` matches only its position, `Name` matches case-insensitively by substring - `crates/xcl/tests/gpu_adapter.rs`: `Display` — `auto`/`warp`/`{n}`/`"{s}"` rendering for each variant - Uses a process-global `ENV_LOCK` mutex + `EnvGuard` (restores previous `XCL_ADAPTER` on drop) so env-touching tests cannot leak process state **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` — 868 passed, 0 failed, 42 ignored (SKIPPED GPU tests: 1 (no heap windows)) - Verification / negative control: temporarily dropped the leading-zeros guard in `crates/xcl/src/gpu/adapter.rs` line 39; `cargo test --test gpu_adapter` failed 3/10 (`parse_leading_zeros_are_never_a_positional_index`, `from_env_or_prefers_env_when_set_and_non_blank`, `from_env_or_falls_back_to_configured_when_unset_or_blank`); reverted via `git checkout -- crates/xcl/src/gpu/adapter.rs` and re-ran 10/10 passed. **Not tested** - Retail Xbox Series X|S titles (not available on this host) - `pub(crate)` DXGI device-creation / `Selector::select_indices` hardware paths (covered by inline tests in `crates/xcl/src/gpu/adapter_tests.rs`) - NVIDIA wave32 GPU (not run in this pass; verified on AMD Radeon native wave64) **AI use** - Local AI (thinkingmachines_inkling-2-mini) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:00:53 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 21:26 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored.

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 21:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/1664#issuecomment-7144934114) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~22 ignored. Thanks!
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 04:44 UTC · original

XCL PR #1664 — Windows / Intel Arc A770 verification

Tested clean, detached head 48702fb268a74de9528a833a6c57d4159ec94e8e on STOR-WINLAB. Intel Arc A770 (driver 32.0.101.9175), AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation build 26200. DXC 1.9.2609.5, verified with dxc.exe --version. Rust 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc). Cargo dev/test profiles were unoptimized with debug info and incremental compilation disabled.

Tested

  • cargo build --workspace passed. cargo test --workspace --no-run compiled 20 test binaries. Both ran outside the Arc mutex.
  • cargo test -p xcl --test gpu_adapter with XCL_ADAPTER=NONE_CPU_ONLY ran outside the mutex. 10 passed, 0 failed, 0 ignored, 0 skipped. The only changed file, crates/xcl/tests/gpu_adapter.rs, covers auto/WARP and name normalization, positional indices, leading-zero and overflow name fallback, nonblank environment override and unset/blank configuration fallback, direct index and name matching, and display formatting. These tests use no DXGI calls.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 ran once inside Invoke-ArcTest.ps1 with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1. Exit 101. All 21 result lines (20 binaries and one doc-test run) sum to 850 passed, 18 failed, and 42 ignored. All 10 selector tests passed again.

Workspace failures and skips

  • 17 library failures. Compute pipeline creation returned 0x80070057 in 13 tests. Four others reported mismatches in FMA, mip sampling, packed f16, and pixel-shader wave64 reductions.
  • One end-to-end failure. test_title_runs_and_game_folder_is_untouched reported blue where the RSSetDepthBiasX check expected green.
  • Six exact SKIPPED markers already appear in the harness pass tally and provide no coverage. Two reported no wave64, two reported missing D3D12 debug-layer support, one reported tiled tier below 2, and one reported no heap windows.

Not tested

Matched main baseline, retail-title smoke run, other adapters, and sample-backed paths gated by unset XCL_SAMPLE_* variables.

AI use

T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1664-suite.log and published.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 04:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/1664#issuecomment-7153122156) # XCL PR #1664 — Windows / Intel Arc A770 verification Tested clean, detached head `48702fb268a74de9528a833a6c57d4159ec94e8e` on STOR-WINLAB. Intel Arc A770 (driver 32.0.101.9175), AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation build 26200. DXC 1.9.2609.5, verified with `dxc.exe --version`. Rust 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc). Cargo dev/test profiles were unoptimized with debug info and incremental compilation disabled. **Tested** - `cargo build --workspace` passed. `cargo test --workspace --no-run` compiled 20 test binaries. Both ran outside the Arc mutex. - `cargo test -p xcl --test gpu_adapter` with `XCL_ADAPTER=NONE_CPU_ONLY` ran outside the mutex. 10 passed, 0 failed, 0 ignored, 0 skipped. The only changed file, `crates/xcl/tests/gpu_adapter.rs`, covers auto/WARP and name normalization, positional indices, leading-zero and overflow name fallback, nonblank environment override and unset/blank configuration fallback, direct index and name matching, and display formatting. These tests use no DXGI calls. - `cargo test --workspace --no-fail-fast -- --test-threads=4` ran once inside `Invoke-ArcTest.ps1` with `XCL_ADAPTER=A770` and `RUST_TEST_NOCAPTURE=1`. Exit 101. All 21 result lines (20 binaries and one doc-test run) sum to 850 passed, 18 failed, and 42 ignored. All 10 selector tests passed again. **Workspace failures and skips** - 17 library failures. Compute pipeline creation returned 0x80070057 in 13 tests. Four others reported mismatches in FMA, mip sampling, packed f16, and pixel-shader wave64 reductions. - One end-to-end failure. `test_title_runs_and_game_folder_is_untouched` reported blue where the `RSSetDepthBiasX` check expected green. - Six exact `SKIPPED ` markers already appear in the harness pass tally and provide no coverage. Two reported no wave64, two reported missing D3D12 debug-layer support, one reported tiled tier below 2, and one reported no heap windows. **Not tested** Matched main baseline, retail-title smoke run, other adapters, and sample-backed paths gated by unset `XCL_SAMPLE_*` variables. **AI use** T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against `pr1664-suite.log` and published.
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/1664/head:github-bot/gh-1664'
git switch 'github-bot/gh-1664'

Merge

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