gpu: VICTORY_D3D12_WARP=0 opts out of the software adapter #695

Open
arthercz wants to merge 3 commits from upstream-pr/695 into main
arthercz commented 2026-11-24 06:59:45 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by arthercz on 2026-11-24T06:59:45Z.


Closes #610.

The diagnostics gate checked only the variable's presence, so VICTORY_D3D12_WARP=0 still created the device on WARP; the workaround was to remove the variable entirely.

This treats 0 like unset, keeps the documented 1 and presence-means-on for other values, and keeps the diagnostics feature gate. The predicate moves into warp_selected/warp_selected_at, covered by a table test (unset, 0, 1, empty); README documents the opt-out.

Verified: cargo test -p victory-gpu --features diagnostics --locked warp_ passes (both the new gate test and the existing adapter test); cargo test --workspace 265 passed; cargo clippy --workspace --all-features clean.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6576453526 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/695). Originally posted by [arthercz](https://github.com/arthercz) on 2026-11-24T06:59:45Z. --- Closes #610. The diagnostics gate checked only the variable's presence, so `VICTORY_D3D12_WARP=0` still created the device on WARP; the workaround was to remove the variable entirely. This treats `0` like unset, keeps the documented `1` and presence-means-on for other values, and keeps the diagnostics feature gate. The predicate moves into `warp_selected`/`warp_selected_at`, covered by a table test (unset, `0`, `1`, empty); README documents the opt-out. Verified: `cargo test -p victory-gpu --features diagnostics --locked warp_` passes (both the new gate test and the existing adapter test); `cargo test --workspace` 265 passed; `cargo clippy --workspace --all-features` clean.
LAKSHYA-cmd-tech commented 2026-11-24 08:02:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T07:15:39Z.

Review: APPROVED


Tested on Windows 11 MSVC:

  • cargo test -p victory-gpu --features diagnostics warp_: 2 passed, 0 failed (host::tests::warp_env_gate table test and warp_adapter_accepts_only_software both pass)
  • cargo xtask policy: 151 files ok

Note: Stacked on #691 (and #692). Once those land, the diff will cleanly reduce to the 2 files (README.md and host.rs).

<!-- greyfinch-sync:Marvisak/VIctory:review:6035129480 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/695#pullrequestreview-6035129480). Originally posted by [LAKSHYA-cmd-tech](https://github.com/LAKSHYA-cmd-tech) on 2026-11-24T07:15:39Z. **Review:** APPROVED --- Tested on Windows 11 MSVC: - cargo test -p victory-gpu --features diagnostics warp_: 2 passed, 0 failed (host::tests::warp_env_gate table test and warp_adapter_accepts_only_software both pass) - cargo xtask policy: 151 files ok Note: Stacked on #691 (and #692). Once those land, the diff will cleanly reduce to the 2 files (README.md and host.rs).
catminou4 commented 2026-11-24 09:05:58 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T08:48:15Z.

Review: COMMENTED


Same branch-shape note as on #699: this PR carries #692's fmt commit and #691's speech commit; only the tip b91ff3c ("gpu: VICTORY_D3D12_WARP=0 opts out") is this PR's change (closes #610). Rebase/retarget before review.

Reviewed the tip commit itself (host.rs +25, README +1):

  • warp_selected() now parses the env value: =0 opts out like unset, 1 on, any other value keeps the historical presence-means-on behavior — backward compatible and documented in the README row.
  • The warp_selected_at(Option<&OsStr>) seam makes the decision unit-testable, and there's a #[test] for it. The cfg!(feature = "diagnostics") gate is preserved.
  • Static only — victory-gpu is Windows/D3D12, so the adapter-selection behavior itself needs the Windows diagnostics build; the parsing logic is the portable part and it's covered by the unit test.
<!-- greyfinch-sync:Marvisak/VIctory:review:6036154826 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/695#pullrequestreview-6036154826). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T08:48:15Z. **Review:** COMMENTED --- Same branch-shape note as on #699: this PR carries #692's fmt commit and #691's speech commit; only the tip `b91ff3c` ("gpu: VICTORY_D3D12_WARP=0 opts out") is this PR's change (closes #610). Rebase/retarget before review. Reviewed the tip commit itself (host.rs +25, README +1): - `warp_selected()` now parses the env value: `=0` opts out like unset, `1` on, any other value keeps the historical presence-means-on behavior — backward compatible and documented in the README row. - The `warp_selected_at(Option<&OsStr>)` seam makes the decision unit-testable, and there's a `#[test]` for it. The `cfg!(feature = "diagnostics")` gate is preserved. - Static only — victory-gpu is Windows/D3D12, so the adapter-selection behavior itself needs the Windows diagnostics build; the parsing logic is the portable part and it's covered by the unit test.
mercuryVM commented 2026-11-24 11:03:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T10:20:47Z.

Review: COMMENTED


Tested b91ff3c on Windows 11, RTX 5070, MSVC: cargo test --workspace --exclude victory-shader 196 passed, and cargo test -p victory-gpu --features diagnostics warp_ 2 passed. Clippy shows 3 undocumented_unsafe_blocks warnings, at host.rs:294, list.rs:1452 and watch.rs:368. The same lines are already on main, so they aren't new here.

  • The change itself (warp_selected_at: 0 behaves like unset, any other value, including empty, turns WARP on, still under cfg!(feature = "diagnostics")) is correct, and the table test covers it.
  • Scope: this branch has three commits. It also carries the workspace cargo fmt (#692) and the WinRT speech narration (#691), which accounts for 38 files including the new windows-future dependency and the windows dependency in victory-hle becoming non-optional. Those belong to their own PRs. Please rebase this onto main so it holds only the WARP commit (host.rs and README). As it stands, approving this would also approve #691.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6037443273 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/695#pullrequestreview-6037443273). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T10:20:47Z. **Review:** COMMENTED --- Tested b91ff3c on Windows 11, RTX 5070, MSVC: `cargo test --workspace --exclude victory-shader` 196 passed, and `cargo test -p victory-gpu --features diagnostics warp_` 2 passed. Clippy shows 3 `undocumented_unsafe_blocks` warnings, at host.rs:294, list.rs:1452 and watch.rs:368. The same lines are already on main, so they aren't new here. - The change itself (`warp_selected_at`: `0` behaves like unset, any other value, including empty, turns WARP on, still under `cfg!(feature = "diagnostics")`) is correct, and the table test covers it. - Scope: this branch has three commits. It also carries the workspace `cargo fmt` (#692) and the WinRT speech narration (#691), which accounts for 38 files including the new `windows-future` dependency and the `windows` dependency in `victory-hle` becoming non-optional. Those belong to their own PRs. Please rebase this onto main so it holds only the WARP commit (`host.rs` and README). As it stands, approving this would also approve #691. AI-assisted (Claude Code).
Marvisak commented 2026-11-25 01:08:06 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:36:10Z.


Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: README.md, crates/victory-gpu/src/capture.rs, crates/victory-gpu/src/descriptor/host.rs, crates/victory-gpu/src/draw.rs, crates/victory-gpu/src/host.rs, crates/victory-gpu/src/list.rs, crates/victory-gpu/src/pipeline/library.rs, crates/victory-gpu/src/pipeline/make.rs and 6 more.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148683184 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/695#issuecomment-7148683184). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:36:10Z. --- <!-- victory-triage v1 head=b91ff3c4829d2d9cf82f08032f6437b4fb667f74 verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `README.md`, `crates/victory-gpu/src/capture.rs`, `crates/victory-gpu/src/descriptor/host.rs`, `crates/victory-gpu/src/draw.rs`, `crates/victory-gpu/src/host.rs`, `crates/victory-gpu/src/list.rs`, `crates/victory-gpu/src/pipeline/library.rs`, `crates/victory-gpu/src/pipeline/make.rs` and 6 more. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
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/695:upstream-pr/695'
git switch 'upstream-pr/695'

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/695'
git switch 'upstream-pr/695'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/695'
git switch 'upstream-pr/695'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/695'
git switch 'main'
git merge --squash 'upstream-pr/695'
git switch 'main'
git merge --ff-only 'upstream-pr/695'
git switch 'main'
git merge 'upstream-pr/695'
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
Marvisak/VIctory!695
No description provided.