DXC: the loaded compiler's version in the log, the report and xcl run's checks; 1.8 or newer recommended #223

Manually merged
github merged 1 commit from gh-pr/223/head into gh-pr/223/base 2026-11-26 04:16:26 +00:00
Owner

@⁠Kalmarv on GitHub · 2026-11-23 21:18 UTC · original
Kalmarv:fix/dxc-version → main · +306 −10 · 5 files · 1 commits · merged 2026-11-23 21:24 UTC

Nobody running XCL can tell which dxcompiler.dll it loaded, and it turns out to matter. With DXC 1.7.2308, the DXIL of translated compute programs was 2–2.7× the size of DXC 1.9.2602's, and the NVIDIA driver then took 1.4–2.2× as long to build the pipelines (#156, RTX 5070 Ti, synthetic programs). 1.7 also rejects [WaveSize] on library entries, which is what #174's linked path needs (review there).

Which DXC a Windows SDK gives is not fixed by its folder name: Windows Kits\10\bin\10.0.26100.0\x64 holds 1.7.2308.16 on my PC (SDK 10.0.26100.4654) and 1.8.2502.11 on ryosen0's (#174). So the only way to know is to ask the file.

This PR makes the loaded DXC visible and points users at 1.8 or newer. It bundles nothing, downloads nothing, and compiles exactly as before.

On #156 ivall wrote: "Kalmarv's finding that the DXC build changes NVIDIA's driver time a lot is worth a line in the README once confirmed". This PR has that line. It does not have the confirmation: the figures are still the one measurement on one card. What it adds is the means to get one, since every log and report.json now says which DXC was used.

What changes

dxc.rs, preflight.rs, report.rs, launcher.rs, README: +306/−10, about 90 of them tests.

  • Log. When DXC is loaded, one info line: DXC: dxcompiler 1.7.2308.16 (52da17e2), dxil 1.7 (file 101.7.2308.24), from C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64. Below 1.8, one warning with the measured cost and what to do (XCL_DXC_DIR).
  • xcl run's checks print the version (DXC 1.7.2308.16 (52da17e2): <folder>), and below 1.8 a NOTE with the fix. A note, not a warning: the game runs, its pipelines only take longer.
  • report.json gets dxc: the folder, and for dxcompiler.dll and dxil.dll the file version, IDxcVersionInfo's major/minor and the commit (IDxcVersionInfo2). #[serde(default)]; empty when no DXC was loaded. The game process fills it once it has compiled something; if it never did, the launcher fills it from its own checks.
  • Search order. XCL_DXC_DIR, then the folder of xcl.exe, as before. After that the Windows SDK folders were tried in reverse order of their names; now in order of the DXC version in them, then of the SDK version, both compared as numbers. On my PC this picks the same folder as before (10.0.26100.0). It differs when a name would mis-sort (10.0.100000.0 sorts below 10.0.26100.0 as text) or when an older SDK folder holds a newer DXC. Nothing is loaded to find out: the version is read from the file's version resource.
  • README: DXC 1.8 or newer is recommended, from the DirectXShaderCompiler GitHub releases, via XCL_DXC_DIR, and why. It says a Windows SDK may hold an older one, not that it does.

IDxcVersionInfo is not the release number

GetVersion is the newest DXIL version the library knows: the 1.8.2505 release answers 1.9. So the release is taken from the file's version resource (1.8.2505.32), and IDxcVersionInfo is the fallback for files that don't carry a DXC number (SDK 10.0.19041's dxcompiler.dll says 10.0.19041.5609 and answers 1.5; an SDK's dxil.dll says 101.7.2308.24). Both are in the log line and the report.

What the five compilers on my PC say:

from file version GetVersion commit below 1.8
SDK 10.0.19041.5609 10.0.19041.5609 1.5 – yes
SDK 10.0.22000.832 1.6.2104.52 1.6 e09a454e yes
SDK 10.0.26100.4654 1.7.2308.16 1.7 52da17e2 yes
GitHub release 1.8.2505 1.8.2505.32 1.9 b106a961 no
GitHub release 1.9.2602 1.9.2602.17 1.9 21d28f72 no

#174 and #214

#174 does not look at the DXC version: it tries to link and falls back to the whole program on any failure, logging the first. This PR does not touch that path (it is not on main), so nothing is duplicated. dxc::toolchain().outdated() is there if #174 wants to skip linking below 1.8 instead of failing once per program. The two merge without conflict (git merge-tree of this head with #174's 328cf29).

#214 (PSO compile concurrency) also edits dxc.rs, in one place: the compile pool and compile (around line 203 of its base). This PR's changes are above that (the folder search, the version query, load) and don't touch the pool. git merge-tree of this head with #214's bf2a27e reports no conflict in any file.

Tested

Windows 11 (10.0.26200), Ryzen 9 9950X, RTX 5070 Ti, Rust MSVC debug. Head 247d909, one commit on main 6da33fa, so the head was the merge result when tested. main has since moved to af20b4b (2 commits, none in the five files here; git merge-tree reports no conflict); nothing was re-run on that.

command main 6da33fa 247d909
cargo test -p xcl --lib -- version_tests preflight:: 5 / 5 (preflight only) 10 / 10 pass
cargo test -p xcl --lib -- gpu::recomp::dxc:: preflight:: report:: launcher:: (no GPU needed) 26 / 26 31 / 31 pass
cargo test -p xcl --lib, 4 runs each, alternating 3 runs: 582 pass, 20 ignored, 0 fail; 1 run: access violation after 562 tests 4 runs: 587 pass, 20 ignored, 0 fail
  • versions_parse_and_compare_as_numbers, the_sdk_with_the_newest_dxc_is_tried_first: parsing, and the order of eight made-up SDK folders, including the mis-sorting name, a newer DXC in an older SDK, and a Windows-numbered compiler.
  • dxc_below_1_8_is_outdated: the verdict and the printed form for the compilers in the table as they answer, and for libraries that say nothing.
  • the_loaded_dxc_is_identified: loads this PC's DXC and checks the folder, IDxcVersionInfo, the file version, the verdict, that the value goes into a Report, and that a report without the field still reads. Prints SKIPPED … no DXC without one; not ignored. Run against each compiler in the table (at bb51c80, the same code before the rebase): the 10.0.26100 one by the default search, the others through XCL_DXC_DIR. A folder in XCL_DXC_DIR without DXC falls through to the SDK as before.
  • an_old_dxc_is_a_note_with_a_fix (preflight): 1.7 gives the note with XCL_DXC_DIR in the fix, 1.8 gives nothing.
  • Seven mutations each fail one of these: the verdict taken from GetVersion instead of the release, threshold 1.7, folders ordered by name, Windows-numbered compilers not last, the loaded version not recorded, no preflight note, the report field without its default.
  • cargo build -p xcl adds no warning.

Not tested

  • Nothing was measured on a GPU for this PR. The cost figures are the ones from #156 and #174: one NVIDIA card, synthetic compute programs. No AMD or Intel figure exists.
  • DXC 1.8's DXIL size and driver time: nobody has measured them. 1.8 is the threshold because 1.8.2505 and the SDK's 1.8.2502 accept [WaveSize] on library entries; the size gain is measured for 1.9 only.
  • An SDK with DXC 1.8.2502.11: I don't have that revision; its version resource and GetVersion answer are not in the table.
  • xcl run with a game: the launcher filling dxc when the game compiled nothing (4 lines) has no test, and the console lines were read from the unit tests, not from a run.
  • A PC with two SDK folders whose DXC order differs from their name order (the ordering is tested on made-up folders only).
  • The SDK roots are the two hard-coded Program Files paths, as before; no registry lookup. XCL still doesn't fetch or ship DXC.
  • The whole suite is not stable on main, and I did not find out why. main's own test binary died with 0xC0000005 in 1 of 4 runs at 6da33fa; this branch's did not in 4 at 247d909, but did in 1 of 2 at bb51c80 (the same change on eaa36b6), so a pass here is not proof that the suite is clean. Separately, hle::kernelx::tests::xmem_and_physical_page_overflows_fail_cleanly fails on main in 3 of 15 runs of --lib hle::kernelx at 6da33fa (6 of 15 at eaa36b6; last error 203 where 8 is expected). Neither is touched by this PR.

AI use: Claude Code, Claude Fable 5.2. No game data.

**@⁠Kalmarv** on GitHub · 2026-11-23 21:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/223) `Kalmarv:fix/dxc-version` → `main` · +306 −10 · 5 files · 1 commits · merged 2026-11-23 21:24 UTC Nobody running XCL can tell which `dxcompiler.dll` it loaded, and it turns out to matter. With DXC 1.7.2308, the DXIL of translated compute programs was 2–2.7× the size of DXC 1.9.2602's, and the NVIDIA driver then took 1.4–2.2× as long to build the pipelines ([#156](https://github.com/ivall/xcl/issues/156#issuecomment-7113820177), RTX 5070 Ti, synthetic programs). 1.7 also rejects `[WaveSize]` on library entries, which is what #174's linked path needs ([review there](https://github.com/ivall/xcl/pull/174#issuecomment-7113816987)). Which DXC a Windows SDK gives is not fixed by its folder name: `Windows Kits\10\bin\10.0.26100.0\x64` holds 1.7.2308.16 on my PC (SDK 10.0.26100.4654) and 1.8.2502.11 on ryosen0's ([#174](https://github.com/ivall/xcl/pull/174#issuecomment-7114011784)). So the only way to know is to ask the file. This PR makes the loaded DXC visible and points users at 1.8 or newer. It bundles nothing, downloads nothing, and compiles exactly as before. On [#156](https://github.com/ivall/xcl/issues/156#issuecomment-7114203740) ivall wrote: "Kalmarv's finding that the DXC build changes NVIDIA's driver time a lot is worth a line in the README once confirmed". This PR has that line. It does not have the confirmation: the figures are still the one measurement on one card. What it adds is the means to get one, since every log and `report.json` now says which DXC was used. ## What changes `dxc.rs`, `preflight.rs`, `report.rs`, `launcher.rs`, README: +306/−10, about 90 of them tests. - **Log.** When DXC is loaded, one info line: `DXC: dxcompiler 1.7.2308.16 (52da17e2), dxil 1.7 (file 101.7.2308.24), from C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64`. Below 1.8, one warning with the measured cost and what to do (`XCL_DXC_DIR`). - **`xcl run`'s checks** print the version (`DXC 1.7.2308.16 (52da17e2): <folder>`), and below 1.8 a `NOTE` with the fix. A note, not a warning: the game runs, its pipelines only take longer. - **`report.json`** gets `dxc`: the folder, and for `dxcompiler.dll` and `dxil.dll` the file version, `IDxcVersionInfo`'s major/minor and the commit (`IDxcVersionInfo2`). `#[serde(default)]`; empty when no DXC was loaded. The game process fills it once it has compiled something; if it never did, the launcher fills it from its own checks. - **Search order.** `XCL_DXC_DIR`, then the folder of `xcl.exe`, as before. After that the Windows SDK folders were tried in reverse order of their *names*; now in order of the DXC version in them, then of the SDK version, both compared as numbers. On my PC this picks the same folder as before (10.0.26100.0). It differs when a name would mis-sort (`10.0.100000.0` sorts below `10.0.26100.0` as text) or when an older SDK folder holds a newer DXC. Nothing is loaded to find out: the version is read from the file's version resource. - **README**: DXC 1.8 or newer is recommended, from the DirectXShaderCompiler GitHub releases, via `XCL_DXC_DIR`, and why. It says a Windows SDK *may* hold an older one, not that it does. ## `IDxcVersionInfo` is not the release number `GetVersion` is the newest DXIL version the library knows: the 1.8.2505 release answers **1.9**. So the release is taken from the file's version resource (`1.8.2505.32`), and `IDxcVersionInfo` is the fallback for files that don't carry a DXC number (SDK 10.0.19041's `dxcompiler.dll` says `10.0.19041.5609` and answers 1.5; an SDK's `dxil.dll` says `101.7.2308.24`). Both are in the log line and the report. What the five compilers on my PC say: | from | file version | `GetVersion` | commit | below 1.8 | |---|---|---|---|---| | SDK 10.0.19041.5609 | 10.0.19041.5609 | 1.5 | – | yes | | SDK 10.0.22000.832 | 1.6.2104.52 | 1.6 | e09a454e | yes | | SDK 10.0.26100.4654 | 1.7.2308.16 | 1.7 | 52da17e2 | yes | | GitHub release 1.8.2505 | 1.8.2505.32 | 1.9 | b106a961 | no | | GitHub release 1.9.2602 | 1.9.2602.17 | 1.9 | 21d28f72 | no | ## #174 and #214 #174 does not look at the DXC version: it tries to link and falls back to the whole program on any failure, logging the first. This PR does not touch that path (it is not on `main`), so nothing is duplicated. `dxc::toolchain().outdated()` is there if #174 wants to skip linking below 1.8 instead of failing once per program. The two merge without conflict (`git merge-tree` of this head with #174's `328cf29`). #214 (PSO compile concurrency) also edits `dxc.rs`, in one place: the compile pool and `compile` (around line 203 of its base). This PR's changes are above that (the folder search, the version query, `load`) and don't touch the pool. `git merge-tree` of this head with #214's `bf2a27e` reports no conflict in any file. ## Tested Windows 11 (10.0.26200), Ryzen 9 9950X, RTX 5070 Ti, Rust MSVC debug. Head `247d909`, one commit on `main` `6da33fa`, so the head was the merge result when tested. `main` has since moved to `af20b4b` (2 commits, none in the five files here; `git merge-tree` reports no conflict); nothing was re-run on that. | command | `main` `6da33fa` | `247d909` | |---|---|---| | `cargo test -p xcl --lib -- version_tests preflight::` | 5 / 5 (preflight only) | 10 / 10 pass | | `cargo test -p xcl --lib -- gpu::recomp::dxc:: preflight:: report:: launcher::` (no GPU needed) | 26 / 26 | 31 / 31 pass | | `cargo test -p xcl --lib`, 4 runs each, alternating | 3 runs: 582 pass, 20 ignored, 0 fail; 1 run: access violation after 562 tests | 4 runs: 587 pass, 20 ignored, 0 fail | - `versions_parse_and_compare_as_numbers`, `the_sdk_with_the_newest_dxc_is_tried_first`: parsing, and the order of eight made-up SDK folders, including the mis-sorting name, a newer DXC in an older SDK, and a Windows-numbered compiler. - `dxc_below_1_8_is_outdated`: the verdict and the printed form for the compilers in the table as they answer, and for libraries that say nothing. - `the_loaded_dxc_is_identified`: loads this PC's DXC and checks the folder, `IDxcVersionInfo`, the file version, the verdict, that the value goes into a `Report`, and that a report without the field still reads. Prints `SKIPPED … no DXC` without one; not ignored. Run against each compiler in the table (at `bb51c80`, the same code before the rebase): the 10.0.26100 one by the default search, the others through `XCL_DXC_DIR`. A folder in `XCL_DXC_DIR` without DXC falls through to the SDK as before. - `an_old_dxc_is_a_note_with_a_fix` (preflight): 1.7 gives the note with `XCL_DXC_DIR` in the fix, 1.8 gives nothing. - Seven mutations each fail one of these: the verdict taken from `GetVersion` instead of the release, threshold 1.7, folders ordered by name, Windows-numbered compilers not last, the loaded version not recorded, no preflight note, the report field without its default. - `cargo build -p xcl` adds no warning. ## Not tested - Nothing was measured on a GPU for this PR. The cost figures are the ones from #156 and #174: one NVIDIA card, synthetic compute programs. No AMD or Intel figure exists. - DXC **1.8**'s DXIL size and driver time: nobody has measured them. 1.8 is the threshold because 1.8.2505 and the SDK's 1.8.2502 accept `[WaveSize]` on library entries; the size gain is measured for 1.9 only. - An SDK with DXC 1.8.2502.11: I don't have that revision; its version resource and `GetVersion` answer are not in the table. - `xcl run` with a game: the launcher filling `dxc` when the game compiled nothing (4 lines) has no test, and the console lines were read from the unit tests, not from a run. - A PC with two SDK folders whose DXC order differs from their name order (the ordering is tested on made-up folders only). - The SDK roots are the two hard-coded `Program Files` paths, as before; no registry lookup. XCL still doesn't fetch or ship DXC. - **The whole suite is not stable on `main`, and I did not find out why.** `main`'s own test binary died with `0xC0000005` in 1 of 4 runs at `6da33fa`; this branch's did not in 4 at `247d909`, but did in 1 of 2 at `bb51c80` (the same change on `eaa36b6`), so a pass here is not proof that the suite is clean. Separately, `hle::kernelx::tests::xmem_and_physical_page_overflows_fail_cleanly` fails on `main` in 3 of 15 runs of `--lib hle::kernelx` at `6da33fa` (6 of 15 at `eaa36b6`; last error 203 where 8 is expected). Neither is touched by this PR. **AI use:** Claude Code, Claude Fable 5.2. No game data.
Nobody running XCL could tell which dxcompiler.dll it had loaded, and it
matters: with DXC 1.7.2308 (what Windows SDK 10.0.26100.4654 installs;
other revisions of that SDK have 1.8.2502) the DXIL of translated
compute programs was 2-2.7 times the size of DXC 1.9.2602's and an
NVIDIA driver took 1.4-2.2 times as long to build pipelines from it
(#156); 1.7 also rejects [WaveSize] on library entries (#174).

- dxc.rs: after loading, dxcompiler.dll and dxil.dll are asked for
  IDxcVersionInfo and IDxcVersionInfo2 (commit), and their version
  resources are read. One info line with versions and folder; below
  1.8 one warning with the measured cost and XCL_DXC_DIR.
  The release number is taken from the file: IDxcVersionInfo gives the
  DXIL version the library knows, and release 1.8.2505 answers 1.9.
- report.json: `dxc` (folder, both libraries). Filled by the game
  process when it compiled something, else by the launcher from its
  checks.
- xcl run's checks print the version, and a note with the fix when it
  is below 1.8.
- Windows SDK folders are tried in the order of their DXC's version,
  then of the SDK's, compared as numbers (old SDKs' compilers carry
  their Windows build number and go last). XCL_DXC_DIR and the folder
  of xcl.exe come first as before.
- README: DXC 1.8 or newer is recommended, and where to get it.

Co-Authored-By: Claude <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:16:25 +00:00
github manually merged commit 247d909505 into gh-pr/223/base 2026-11-26 04:16:26 +00:00
Author
Owner

@⁠ivall on GitHub · 2026-11-23 21:24 UTC · original

Merged (main d4f17ca). Checked on an RX 9070 (RDNA4) with 11 PRs merged together on main af20b4b: cargo build --workspace && cargo test --workspace -- --test-threads=4 - 605 unit tests passed, 0 failed (20 ignored), the integration and e2e tests passed; and the retail game still reaches its first menu at 30 fps (720 draws per 2 s).

**@⁠ivall** on GitHub · 2026-11-23 21:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/223#issuecomment-7114419392) Merged (main d4f17ca). Checked on an RX 9070 (RDNA4) with 11 PRs merged together on main af20b4b: `cargo build --workspace && cargo test --workspace -- --test-threads=4` - 605 unit tests passed, 0 failed (20 ignored), the integration and e2e tests passed; and the retail game still reaches its first menu at 30 fps (720 draws per 2 s).
This discussion has been locked. Commenting is limited to contributors.
No description provided.