Shaders: sort SDK dxil.dll versions numerically and ignore empty VICTORY_DXIL #3459

Open
github-bot wants to merge 1 commit from github-bot/gh-3459 into main AGit
Owner

@⁠alexandruiulian201-bot on GitHub · 2026-11-27 03:32 UTC · original
alexandruiulian201-bot:fix/dxil-validator-path-selection → main · +115 −13 · 1 files · 1 commits · open

Problem

In crates/victory-shader/src/emit/validator.rs:

  1. Validator::default_path() sorts Windows SDK bin directories lexicographically (versions.sort(); versions.pop()), so a version with fewer digits (such as 10.0.9999.0) sorts after a newer version (10.0.26100.0).
  2. An empty VICTORY_DXIL="" environment variable is returned as Some(PathBuf::from("")) instead of falling back to the Windows Kits lookup (unlike VICTORY_CONFIG and other path variables).
  3. When LoadLibraryW fails in Validator::load, the error message formats name including its trailing NUL terminator.

Fix

  • Parse dotted numeric SDK version components and sort Windows SDK directories numerically in newest_sdk_dxil.
  • Ignore empty VICTORY_DXIL values in resolve_default_path so they fall back to Windows Kits.
  • Strip the trailing NUL when formatting the LoadLibraryW error in Validator::load.
  • Add synthetic unit tests covering numeric SDK version ordering, empty/non-empty env handling, and NUL-free error formatting.

Verification

  • cargo test -p victory-shader --lib --features host --locked emit::validator::tests::: 3 passed.
  • cargo clippy -p victory-shader --all-targets --locked -- -D warnings: clean.
  • cargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings: clean.
  • cargo test -p xtask --bin xtask --locked: 6 passed (repository_passes_policy ok).

AI-assisted. Synthetic unit tests only (no game files used).

**@⁠alexandruiulian201-bot** on GitHub · 2026-11-27 03:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/3459) `alexandruiulian201-bot:fix/dxil-validator-path-selection` → `main` · +115 −13 · 1 files · 1 commits · open ### Problem In `crates/victory-shader/src/emit/validator.rs`: 1. `Validator::default_path()` sorts Windows SDK bin directories lexicographically (`versions.sort(); versions.pop()`), so a version with fewer digits (such as `10.0.9999.0`) sorts after a newer version (`10.0.26100.0`). 2. An empty `VICTORY_DXIL=""` environment variable is returned as `Some(PathBuf::from(""))` instead of falling back to the Windows Kits lookup (unlike `VICTORY_CONFIG` and other path variables). 3. When `LoadLibraryW` fails in `Validator::load`, the error message formats `name` including its trailing NUL terminator. ### Fix - Parse dotted numeric SDK version components and sort Windows SDK directories numerically in `newest_sdk_dxil`. - Ignore empty `VICTORY_DXIL` values in `resolve_default_path` so they fall back to Windows Kits. - Strip the trailing NUL when formatting the `LoadLibraryW` error in `Validator::load`. - Add synthetic unit tests covering numeric SDK version ordering, empty/non-empty env handling, and NUL-free error formatting. ### Verification - `cargo test -p victory-shader --lib --features host --locked emit::validator::tests::`: 3 passed. - `cargo clippy -p victory-shader --all-targets --locked -- -D warnings`: clean. - `cargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings`: clean. - `cargo test -p xtask --bin xtask --locked`: 6 passed (`repository_passes_policy` ok). AI-assisted. Synthetic unit tests only (no game files used).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 03:35:45 +00:00
Author
Owner

@⁠oni-swr on GitHub · 2026-11-27 04:10 UTC · original

WARP test report for #3459 (AI-assisted (Claude), claimed on #1633 comment 7209455899)

  • Environment: Windows 11 Pro 10.0.26200, WARP adapter (d3d10warp.dll 10.0.26100.9818, VICTORY_WARP=1 VICTORY_D3D12_WARP=1), rustc 1.98.1 / cargo 1.98.1, Windows SDK 10.0.26100 dxil.dll via VICTORY_DXIL, cargo test -j 4 -p <crate> --lib --locked -- --test-threads=1. No GPU hardware used. No game files involved.
  • Base: origin/main 63bcca43c6a00a758510398fa43096ce7e4f7df0; head 7efc12bf740b8e3de04f5dcd3107804289f0ad8b (already contains this main; merge is a fast-forward, tested tree equals head).
  • victory-shader lib: main 298 passed / 4 failed / 3 ignored -> head 301 passed / 4 failed / 3 ignored. The 3 new tests (numeric version order, empty VICTORY_DXIL ignored, no NUL in the load error) pass. The 4 failures are identical on main and head, so they are not caused by this PR: synthetic_tests::{a_mask_joined_with_data_at_a_uniform_loop_is_its_number, gathers_at_a_level_match_the_hardware, permutes_mask_high_address_bits_and_divergent_branches, permutes_read_the_lane_named_and_zero_from_lanes_left_out}. They look like lane/wave-dependent checks that WARP does not satisfy (I did not investigate the cause). No regressions.
  • Review notes: numeric comparison is by dotted u64 parts, and non-numeric directory names sort below every real version (None < Some), so a stray folder cannot win. The name[..len-1] slice assumes the wide name is NUL-terminated, which it is on this path. No concerns.
**@⁠oni-swr** on GitHub · 2026-11-27 04:10 UTC · [original](https://github.com/Marvisak/VIctory/pull/3459#issuecomment-7209583158) **WARP test report for #3459** (AI-assisted (Claude), claimed on #1633 comment 7209455899) - Environment: Windows 11 Pro 10.0.26200, WARP adapter (d3d10warp.dll 10.0.26100.9818, `VICTORY_WARP=1 VICTORY_D3D12_WARP=1`), rustc 1.98.1 / cargo 1.98.1, Windows SDK 10.0.26100 `dxil.dll` via `VICTORY_DXIL`, `cargo test -j 4 -p <crate> --lib --locked -- --test-threads=1`. No GPU hardware used. No game files involved. - Base: origin/main `63bcca43c6a00a758510398fa43096ce7e4f7df0`; head `7efc12bf740b8e3de04f5dcd3107804289f0ad8b` (already contains this main; merge is a fast-forward, tested tree equals head). - `victory-shader` lib: main **298 passed / 4 failed / 3 ignored** -> head **301 passed / 4 failed / 3 ignored**. The 3 new tests (numeric version order, empty `VICTORY_DXIL` ignored, no NUL in the load error) pass. The 4 failures are identical on main and head, so they are not caused by this PR: `synthetic_tests::{a_mask_joined_with_data_at_a_uniform_loop_is_its_number, gathers_at_a_level_match_the_hardware, permutes_mask_high_address_bits_and_divergent_branches, permutes_read_the_lane_named_and_zero_from_lanes_left_out}`. They look like lane/wave-dependent checks that WARP does not satisfy (I did not investigate the cause). No regressions. - Review notes: numeric comparison is by dotted `u64` parts, and non-numeric directory names sort below every real version (`None < Some`), so a stray folder cannot win. The `name[..len-1]` slice assumes the wide name is NUL-terminated, which it is on this path. No concerns.
Author
Owner

@⁠cloph-dsp on GitHub · 2026-11-27 04:56 UTC · original

Independent CPU-only verification of PR #3459 (victory-shader: order DXIL SDK versions numerically and tighten default path/error handling).

  • Windows, rustc/cargo 1.100.0/MSVC, worktree-local CARGO_TARGET_DIR (D:\Victory-Contrib\target-3459-watch), CARGO_BUILD_JOBS=2.
  • Head 7efc12bf740b8e3de04f5dcd3107804289f0ad8b, merge base 63bcca4.
  • Command: cargo test --locked -p victory-shader --lib -- emit::validator::tests::newest_sdk_dxil_orders_versions_numerically --exact --test-threads=1 --quiet -> 1 passed; 0 failed; 307 filtered.
  • Negative control: git grep -F for the new test name on 63bcca4 returned no hits (test absent on base).
  • git diff --check 63bcca4 HEAD exit 0 (clean).
  • Only the named synthetic test was replayed; the other new tests, real DXIL SDK layout and full crate suite were not exercised.
  • AI-assisted (Hy4 flash). GPU/driver: N/A (CPU-only path/version logic). No game data, assets, shaders, DRM or decrypt used.
**@⁠cloph-dsp** on GitHub · 2026-11-27 04:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/3459#issuecomment-7210217417) Independent CPU-only verification of PR #3459 (`victory-shader: order DXIL SDK versions numerically and tighten default path/error handling`). - Windows, rustc/cargo 1.100.0/MSVC, worktree-local `CARGO_TARGET_DIR` (`D:\Victory-Contrib\target-3459-watch`), `CARGO_BUILD_JOBS=2`. - Head `7efc12bf740b8e3de04f5dcd3107804289f0ad8b`, merge base `63bcca4`. - Command: `cargo test --locked -p victory-shader --lib -- emit::validator::tests::newest_sdk_dxil_orders_versions_numerically --exact --test-threads=1 --quiet` -> `1 passed; 0 failed; 307 filtered`. - Negative control: `git grep -F` for the new test name on `63bcca4` returned no hits (test absent on base). - `git diff --check 63bcca4 HEAD` exit 0 (clean). - Only the named synthetic test was replayed; the other new tests, real DXIL SDK layout and full crate suite were not exercised. - AI-assisted (Hy4 flash). GPU/driver: N/A (CPU-only path/version logic). No game data, assets, shaders, DRM or decrypt used.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-27 09:07 UTC · original

NVIDIA full-suite run, to go with the reports above by cloph-dsp, oni-swr, since none of them names a GPU run. Tested exact head 7efc12b (on its base 63bcca4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 869 passed, 0 failed, 10 ignored.
  • The new tests ran and passed: newest_sdk_dxil_orders_versions_numerically, resolve_default_path_prefers_non_empty_env_and_ignores_empty, load_missing_dll_error_omits_trailing_nul.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-27 09:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/3459#issuecomment-7214309975) NVIDIA full-suite run, to go with the reports above by cloph-dsp, oni-swr, since none of them names a GPU run. Tested exact head `7efc12b` (on its base `63bcca4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **869 passed, 0 failed, 10 ignored**. - The new tests ran and passed: `newest_sdk_dxil_orders_versions_numerically`, `resolve_default_path_prefers_non_empty_env_and_ignores_empty`, `load_missing_dll_error_omits_trailing_nul`. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3459/head:github-bot/gh-3459'
git switch 'github-bot/gh-3459'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3459'
git switch 'github-bot/gh-3459'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3459'
git switch 'github-bot/gh-3459'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3459'
git switch 'main'
git merge --squash 'github-bot/gh-3459'
git switch 'main'
git merge --ff-only 'github-bot/gh-3459'
git switch 'main'
git merge 'github-bot/gh-3459'
git push origin 'main'
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!3459
No description provided.