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

Closed
Dathinel wants to merge 3 commits from upstream-pr/684 into main
Dathinel commented 2026-11-24 06:48:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dathinel on 2026-11-24T06:48:20Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6576300470 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/684). Originally posted by [Dathinel](https://github.com/Dathinel) on 2026-11-24T06:48:20Z. --- 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.
catminou4 commented 2026-11-24 06:54:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T06:53:09Z.

Review: COMMENTED


cargo test -p victory-shader --locked on macOS 26 arm64, rustc 1.98.1: compiles clean, 56 passed / 0 failed (no regressions). The new diff_tests coverage is #[cfg(all(test, windows))], so it needs the Windows host backend I don't have here. The validator/compiler-path change compiles everywhere; behavior needs a Windows run.

<!-- greyfinch-sync:Marvisak/VIctory:review:6034901897 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/684#pullrequestreview-6034901897). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T06:53:09Z. **Review:** COMMENTED --- `cargo test -p victory-shader --locked` on macOS 26 arm64, rustc 1.98.1: compiles clean, 56 passed / 0 failed (no regressions). The new diff_tests coverage is `#[cfg(all(test, windows))]`, so it needs the Windows host backend I don't have here. The validator/compiler-path change compiles everywhere; behavior needs a Windows run.
LAKSHYA-cmd-tech commented 2026-11-24 07:07:54 +00:00 (Migrated from github.com)

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

Review: APPROVED


LGTM! Tested on Windows 11 with MSVC Rust 1.98.1. All 70 unit tests in ictory-shader passed cleanly, including pc_compiler_prefers_sdk_and_supports_standalone_dxc. Discovering dxc.exe independently from the SDK and VICTORY_PC_DXC prevents skipped differential tests when VICTORY_DXIL points to a validator-only directory.

<!-- greyfinch-sync:Marvisak/VIctory:review:6034985393 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/684#pullrequestreview-6034985393). Originally posted by [LAKSHYA-cmd-tech](https://github.com/LAKSHYA-cmd-tech) on 2026-11-24T07:01:18Z. **Review:** APPROVED --- LGTM! Tested on Windows 11 with MSVC Rust 1.98.1. All 70 unit tests in ictory-shader passed cleanly, including pc_compiler_prefers_sdk_and_supports_standalone_dxc. Discovering dxc.exe independently from the SDK and VICTORY_PC_DXC prevents skipped differential tests when VICTORY_DXIL points to a validator-only directory.
mercuryVM commented 2026-11-24 11:03:57 +00:00 (Migrated from github.com)

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

Review: APPROVED


Tested 9c2a364 on Windows 11, RTX 5070, MSVC: cargo test -p victory-shader -- --test-threads=1 70 passed, including pc_compiler_prefers_sdk_and_supports_standalone_dxc. cargo clippy -p victory-shader --all-targets is clean. VICTORY_CONSOLE_DXC isn't set on this host, so the differential tests themselves are skipped here, as designed.

  • Factoring the SDK scan into sdk_tool keeps Validator::default_path behaving as before (VICTORY_DXIL, then the newest SDK x64\dxil.dll), so the production validator lookup is unchanged.
  • One small change in behaviour: an explicit VICTORY_PC_DXC pointing at a missing file now makes the tests skip instead of falling back (the missing.exe assertion). That's the right call, since the user asked for that compiler.
  • .max() over paths picks the newest version folder by lexical order, same as the old sort + pop. It works for the 10.0.N.0 names, though not for a hypothetical 5-digit-to-6-digit build number jump. Pre-existing, so not a blocker.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6037622021 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/684#pullrequestreview-6037622021). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T10:33:43Z. **Review:** APPROVED --- Tested 9c2a364 on Windows 11, RTX 5070, MSVC: `cargo test -p victory-shader -- --test-threads=1` 70 passed, including `pc_compiler_prefers_sdk_and_supports_standalone_dxc`. `cargo clippy -p victory-shader --all-targets` is clean. `VICTORY_CONSOLE_DXC` isn't set on this host, so the differential tests themselves are skipped here, as designed. - Factoring the SDK scan into `sdk_tool` keeps `Validator::default_path` behaving as before (`VICTORY_DXIL`, then the newest SDK `x64\dxil.dll`), so the production validator lookup is unchanged. - One small change in behaviour: an explicit `VICTORY_PC_DXC` pointing at a missing file now makes the tests skip instead of falling back (the `missing.exe` assertion). That's the right call, since the user asked for that compiler. - `.max()` over paths picks the newest version folder by lexical order, same as the old `sort` + `pop`. It works for the `10.0.N.0` names, though not for a hypothetical 5-digit-to-6-digit build number jump. Pre-existing, so not a blocker. AI-assisted (Claude Code).
ErRusso commented 2026-11-24 12:04:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ErRusso on 2026-11-24T11:19:18Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7129946166 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/684#issuecomment-7129946166). Originally posted by [ErRusso](https://github.com/ErRusso) on 2026-11-24T11:19:18Z. --- ## 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.
Marvisak commented 2026-11-25 02:06:00 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:24:59Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149522589 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/684#issuecomment-7149522589). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:24:59Z. --- <!-- 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)_
upstream-sync closed this pull request 2026-11-25 22:02:43 +00:00
Marvisak commented 2026-11-25 22:04:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T21:59:15Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7175792644 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/684#issuecomment-7175792644). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T21:59:15Z. --- 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

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!684
No description provided.