Shaders: find the PC test compiler independently of the validator #684

Closed
github-bot wants to merge 3 commits from gh-pr/684/head into gh-pr/684/base
Owner

@⁠Dathinel on GitHub · 2026-11-24 06:48 UTC · original
Dathinel:fix/independent-sdk-tool-discovery → main · +69 −20 · 2 files · 3 commits · closed without merging

The Windows differential tests look for a PC compiler next to the validator selected by VICTORY_DXIL. A validator-only directory can therefore make the tests skip even when the Windows SDK provides dxc.exe.

Look for VICTORY_PC_DXC first, then a Windows SDK containing dxc.exe. If the SDK has no compiler, keep supporting standalone DXC next to VICTORY_DXIL. With both installations present, set VICTORY_PC_DXC to select the standalone compiler explicitly. The production validator keeps its existing lookup order.

The regression uses empty files in a temporary directory. It checks SDK preference, explicit overrides (including a missing path), and standalone fallback. Reintroducing the original validator lookup fails the SDK assertion. Removing the fallback fails the standalone assertion.

cargo test -p victory-shader --lib pc_compiler_prefers_sdk_and_supports_standalone_dxc

On Windows, the workspace suite reported 265 passed and 4 ignored. The new regression ran. The optional console-compiler comparisons skipped on this host. Strict Clippy for victory-shader, package formatting, and the asset-policy check passed.

Developed with Codex and independently reviewed with Claude Code.

**@⁠Dathinel** on GitHub · 2026-11-24 06:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/684) `Dathinel:fix/independent-sdk-tool-discovery` → `main` · +69 −20 · 2 files · 3 commits · closed without merging The Windows differential tests look for a PC compiler next to the validator selected by `VICTORY_DXIL`. A validator-only directory can therefore make the tests skip even when the Windows SDK provides `dxc.exe`. Look for `VICTORY_PC_DXC` first, then a Windows SDK containing `dxc.exe`. If the SDK has no compiler, keep supporting standalone DXC next to `VICTORY_DXIL`. With both installations present, set `VICTORY_PC_DXC` to select the standalone compiler explicitly. The production validator keeps its existing lookup order. The regression uses empty files in a temporary directory. It checks SDK preference, explicit overrides (including a missing path), and standalone fallback. Reintroducing the original validator lookup fails the SDK assertion. Removing the fallback fails the standalone assertion. ```sh cargo test -p victory-shader --lib pc_compiler_prefers_sdk_and_supports_standalone_dxc ``` On Windows, the workspace suite reported 265 passed and 4 ignored. The new regression ran. The optional console-compiler comparisons skipped on this host. Strict Clippy for `victory-shader`, package formatting, and the asset-policy check passed. Developed with Codex and independently reviewed with Claude Code.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:12:57 +00:00
github-bot closed this pull request 2026-11-26 04:12:57 +00:00
Author
Owner

@⁠ErRusso on GitHub · 2026-11-24 11:19 UTC · original

Audit: ✅ Looks good — verified & tested

Reviewed this PR as part of an audit of mergeable PRs.

  • Scope: crates/victory-shader/src/emit/validator.rs + diff_tests.rs (+61/-20, plus a tempfile dev-dependency). Extracts sdk_tool() from Validator::default_path() so PC dxc.exe discovery is independent of the dxil.dll validator, with an additional fallback to the DXC sibling of VICTORY_DXIL. The .max() on SDK versions preserves the "newest SDK wins" behavior.
  • Merges cleanly into main.
  • Tests: cargo test -p victory-shader -- emit → 10/10 passed, including the new tempfile-based pc_compiler_prefers_sdk_and_supports_standalone_dxc which covers SDK precedence, explicit VICTORY_PC_DXC, and standalone-DXC fallback.

One tiny nit: sdk_tool compares PathBuf with .max(), which relies on lexical ordering of version dir names — fine for Windows Kits (10.0.26100.0 etc.), worth a comment if versions ever go non-lexical. Not blocking.

No functional issues found.

**@⁠ErRusso** on GitHub · 2026-11-24 11:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/684#issuecomment-7129946166) ## Audit: ✅ Looks good — verified & tested Reviewed this PR as part of an audit of mergeable PRs. - **Scope:** `crates/victory-shader/src/emit/validator.rs` + `diff_tests.rs` (+61/-20, plus a `tempfile` dev-dependency). Extracts `sdk_tool()` from `Validator::default_path()` so PC `dxc.exe` discovery is independent of the `dxil.dll` validator, with an additional fallback to the DXC sibling of `VICTORY_DXIL`. The `.max()` on SDK versions preserves the "newest SDK wins" behavior. - **Merges cleanly** into `main`. - **Tests:** `cargo test -p victory-shader -- emit` → **10/10 passed**, including the new tempfile-based `pc_compiler_prefers_sdk_and_supports_standalone_dxc` which covers SDK precedence, explicit `VICTORY_PC_DXC`, and standalone-DXC fallback. One tiny nit: `sdk_tool` compares `PathBuf` with `.max()`, which relies on lexical ordering of version dir names — fine for Windows Kits (`10.0.26100.0` etc.), worth a comment if versions ever go non-lexical. Not blocking. No functional issues found.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:24 UTC · original · edited 2026-11-25 07:25 UTC

Automated triage for the maintainers.

Merge candidate. The new head 08aff6d drops the tempfile dev-dependency: the test now makes its own fresh directory under the temp dir, and Cargo.toml/Cargo.lock are no longer touched. That was the only reason it needed the maintainer's decision. The rest reads as before:

  • validator::sdk_tool takes over the newest-SDK search, and Validator::default_path keeps its order (VICTORY_DXIL, then the newest SDK's dxil.dll).
  • diff_tests::tools_in finds the PC dxc.exe from VICTORY_PC_DXC, then the newest SDK that has one, then the file next to VICTORY_DXIL.
  • pc_compiler_prefers_sdk_and_supports_standalone_dxc covers each case with empty files.

Only test tooling changes; nothing changes at run time. It merges cleanly.

CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/684#issuecomment-7149522589) · edited 2026-11-25 07:25 UTC <!-- victory-triage v1 head=08aff6d847183923600d8d27db1de06abdd802fa verdict=merge-candidate at=2026-11-25T07:25:04Z --> Automated triage for the maintainers. **Merge candidate.** The new head `08aff6d` drops the `tempfile` dev-dependency: the test now makes its own fresh directory under the temp dir, and `Cargo.toml`/`Cargo.lock` are no longer touched. That was the only reason it needed the maintainer's decision. The rest reads as before: - `validator::sdk_tool` takes over the newest-SDK search, and `Validator::default_path` keeps its order (`VICTORY_DXIL`, then the newest SDK's `dxil.dll`). - `diff_tests::tools_in` finds the PC `dxc.exe` from `VICTORY_PC_DXC`, then the newest SDK that has one, then the file next to `VICTORY_DXIL`. - `pc_compiler_prefers_sdk_and_supports_standalone_dxc` covers each case with empty files. Only test tooling changes; nothing changes at run time. It merges cleanly. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 21:59 UTC · original

Automated triage for the maintainers, second look (a review against current main, with builds and tests where they could change the verdict).

Closing because it reverses the precedence the README documents. When the SDK's validator is too old for SM 6.6, the README says to point VICTORY_DXIL at a current standalone DXC, and on main the PC compiler then comes from that same release. With this change the newest SDK's older dxc.exe would win, and the differential tests would compile their PC HLSL with it. The case fixed here (a directory that holds only dxil.dll) is already served by VICTORY_PC_DXC. It also changes only diff_tests::tools, so the three PC-compiler lookups would disagree.

If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 21:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/684#issuecomment-7175792644) Automated triage for the maintainers, second look (a review against current `main`, with builds and tests where they could change the verdict). Closing because it reverses the precedence the README documents. When the SDK's validator is too old for SM 6.6, the README says to point `VICTORY_DXIL` at a current standalone DXC, and on `main` the PC compiler then comes from that same release. With this change the newest SDK's older `dxc.exe` would win, and the differential tests would compile their PC HLSL with it. The case fixed here (a directory that holds only `dxil.dll`) is already served by `VICTORY_PC_DXC`. It also changes only `diff_tests::tools`, so the three PC-compiler lookups would disagree. If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!684
No description provided.