Tests: gpu adapter selector parse/fallback and env override contract #1654
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1664"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by amazedturnip on 2026-11-24T18:57:03Z.
Adds an integration test file covering the public
Selectorcontract:parse(empty/auto, warp, positional index, leading-zeros never positional, non-digit/overflow names, lowercased names),from_env_orprecedence (XCL_ADAPTERwhen set and non-blank, configured fallback otherwise),allows(Auto/Warp/Index/Name direct rules), andDisplayrendering. 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 coveringxcl::gpu::adapter::Selectorparse/fallback (auto/empty, warp, digit positional index, leading-zeros never positional, non-digit names, lowercased names,u64/overflow degrades toName)crates/xcl/tests/gpu_adapter.rs:from_env_orcontract — usesXCL_ADAPTERwhen set and non-blank, otherwise falls back to the configured string; blank/whitespace env values fall backcrates/xcl/tests/gpu_adapter.rs:allows—Automatches every position,Warpmatches nothing,Indexmatches only its position,Namematches case-insensitively by substringcrates/xcl/tests/gpu_adapter.rs:Display—auto/warp/{n}/"{s}"rendering for each variantENV_LOCKmutex +EnvGuard(restores previousXCL_ADAPTERon drop) so env-touching tests cannot leak process stateTested
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))crates/xcl/src/gpu/adapter.rsline 39;cargo test --test gpu_adapterfailed 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 viagit checkout -- crates/xcl/src/gpu/adapter.rsand re-ran 10/10 passed.Not tested
pub(crate)DXGI device-creation /Selector::select_indiceshardware paths (covered by inline tests incrates/xcl/src/gpu/adapter_tests.rs)AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T21:26:31Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored.Thanks!
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T04:44:33Z.
XCL PR #1664 — Windows / Intel Arc A770 verification
Tested clean, detached head
48702fb268a74de9528a833a6c57d4159ec94e8eon 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 withdxc.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 --workspacepassed.cargo test --workspace --no-runcompiled 20 test binaries. Both ran outside the Arc mutex.cargo test -p xcl --test gpu_adapterwithXCL_ADAPTER=NONE_CPU_ONLYran 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=4ran once insideInvoke-ArcTest.ps1withXCL_ADAPTER=A770andRUST_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
test_title_runs_and_game_folder_is_untouchedreported blue where theRSSetDepthBiasXcheck expected green.SKIPPEDmarkers 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.logand published.Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T20:17:51Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by amazedturnip on 2026-11-28T20:36:43Z.
Still merges cleanly onto main (
765b2c5b) with passing checks; pins GPU adapter selector parsing, fallback, and XCL_ADAPTER env override contracts — waiting on maintainer / post-goal review.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:26:39Z.
Triage (#1607) – head
48702fbNo open or merged PR adds the same tests. Part of the parse/allows coverage repeats main's inline
selector_parsingandselector_matchingin src/gpu/adapter_tests.rs. The new cases arefrom_env_orwith XCL_ADAPTER set, unset and blank, theDisplayoutput, and the overflow and leading-zero name cases.The expectations match Selector::parse/allows/from_env_or on main. XCL_ADAPTER is changed only under a lock, and a guard restores it.
The title mentions the fallback, but this file does not test the out-of-range numeric fallback (
select_indices); that is still covered only by the inline test.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.