gpu/adapter: fall back to numeric model token when index is out of range #81
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/82"
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 certified-retart on 2026-11-23T01:56:57Z.
Summary
Allows numeric GPU model selectors like
XCL_ADAPTER=5070,XCL_ADAPTER=3080, orXCL_ADAPTER=7900to work naturally without breaking numeric adapter index selection (0,1, ...).Previously,
Selector::parseturned any integer string intoSelector::Index(n)and matched only by adapter index, soXCL_ADAPTER=5070reported no match even when"NVIDIA GeForce RTX 5070"was present.Changes
crates/xcl/src/gpu/adapter.rs:"0"or no leading zero, no leading+) forSelector::Index, preserving inputs like"+1"or"007"asSelector::Name.contains_numeric_tokenandselect_indices: whenSelector::Index(n)is out of range (n >= names.len()), fall back to matchingnas a standalone numeric token bounded by non-digits (so5070matchesRTX 5070,7900matchesRX 7900XTX, and770matchesArc A770, while an out-of-range index like2does not falsely matchRTX 2080).candidatesthroughselect_indices.crates/xcl/src/gpu/adapter_tests.rs:0,007,+1, in-range index precedence, out-of-range model fallback (5070,7900,770) with Unicode™/®names, empty adapter lists, and non-digit token boundary rejection (2,208,80againstRTX 2080).Verification
cargo test -p xcl --lib gpu::adapter::tests -- --test-threads=2: 3 passed; 0 failed.Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T10:36:37Z.
Merged. Tested on Windows 11 with an RX 9070 (RDNA4):
cargo test --workspacegreen with the retail samples (shader pack, console DLLs, texture archive), lib tests also withXCL_SPLIT_WAVE64=1; Unicorn Overlord, Minecraft and Fortnite run with this round merged. Thanks!