Shaders: load DXC from host paths shadowed by console mounts #827

Open
JFyuhong wants to merge 1 commit from upstream-pr/833 into main
JFyuhong commented 2026-11-24 06:26:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JFyuhong on 2026-11-24T06:26:01Z.


A Windows SDK on D: passed launcher preflight, but the title process searched the game's mounted D: for DXC. On this machine the title presented black frames until the SDK DLLs were copied to another drive. Related to the shader-cache path fix in #331.

What is in it

  • Use the existing thread-local VFS guard during DXC discovery and when reading DLL metadata for the shader cache key.
  • The regression test shadows the SDK directory, compiles a shader, verifies title reads still see the mount, and reuses the cache in a fresh process without the mount.

Tested

  • Windows 11 build 26300, i7-14650HX, RTX 4060 Laptop 8 GB, driver 616.92, MSVC Rust 1.93.1, DXC 1.8.2502.11.
  • scripts/test.ps1 (debug workspace build and tests, four test threads): 714 reported passed, 0 failed, 41 ignored. Two GPU tests reported SKIPPED (no native wave64). The optional XCL_SAMPLE_* inputs were unset.
  • cargo test --release -p xcl --test e2e title_loads_host_dxc_under_a_console_mount -- --exact --nocapture: 0 passed / 1 failed on main with the new test (compiler DLL not found), 1 passed / 0 failed on this branch.
  • A separate retail run on this branch loaded both SDK DLLs directly from D:\Windows Kits\10\bin\10.0.26100.0\x64 and displayed the player selection screen. A longer run reached 1,517 PresentX calls and hit the previously reported loading crash at game_scarlett_master.exe+0x23cf683 after 229 s (#675).

Regression run

Release builds, read-only title mount, same working DXC directory on C: for both runs. Both used scripts/smoke.ps1 -Game W:\game_scarlett_master.exe -Seconds 60.

Main

xcl-smoke v1
commit: beaa245ca04e212f064efc7cafcdce104bc5c0a2
gpu: NVIDIA GeForce RTX 4060 Laptop GPU
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 515 (PresentX 515)
presents per 2 s (last 3): 25 25 24
device removals: 0
crashes: 0
peak commit: 15298 MB

PR

xcl-smoke v1
commit: 9e24a1fb61f5d2681e74aad76c4b5c788611bc5f
gpu: NVIDIA GeForce RTX 4060 Laptop GPU
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 909 (PresentX 909)
presents per 2 s (last 3): 41 44 43
device removals: 0
crashes: 0
peak commit: 15247 MB

Not tested

  • AMD hardware and other DXC versions. The smoke runs cover startup through player selection.

AI use

  • Codex (GPT-6) diagnosed the SDK path collision, wrote the change and regression test, and ran the local tests and smoke checks.
<!-- greyfinch-sync:ivall/xcl:issue:5467257243 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/833). Originally posted by [JFyuhong](https://github.com/JFyuhong) on 2026-11-24T06:26:01Z. --- A Windows SDK on `D:` passed launcher preflight, but the title process searched the game's mounted `D:` for DXC. On this machine the title presented black frames until the SDK DLLs were copied to another drive. Related to the shader-cache path fix in #331. **What is in it** - Use the existing thread-local VFS guard during DXC discovery and when reading DLL metadata for the shader cache key. - The regression test shadows the SDK directory, compiles a shader, verifies title reads still see the mount, and reuses the cache in a fresh process without the mount. **Tested** - Windows 11 build 26300, i7-14650HX, RTX 4060 Laptop 8 GB, driver 616.92, MSVC Rust 1.93.1, DXC 1.8.2502.11. - `scripts/test.ps1` (debug workspace build and tests, four test threads): 714 reported passed, 0 failed, 41 ignored. Two GPU tests reported `SKIPPED` (no native wave64). The optional `XCL_SAMPLE_*` inputs were unset. - `cargo test --release -p xcl --test e2e title_loads_host_dxc_under_a_console_mount -- --exact --nocapture`: 0 passed / 1 failed on main with the new test (compiler DLL not found), 1 passed / 0 failed on this branch. - A separate retail run on this branch loaded both SDK DLLs directly from `D:\Windows Kits\10\bin\10.0.26100.0\x64` and displayed the player selection screen. A longer run reached 1,517 PresentX calls and hit the previously reported loading crash at `game_scarlett_master.exe+0x23cf683` after 229 s (#675). **Regression run** Release builds, read-only title mount, same working DXC directory on C: for both runs. Both used `scripts/smoke.ps1 -Game W:\game_scarlett_master.exe -Seconds 60`. Main ``` xcl-smoke v1 commit: beaa245ca04e212f064efc7cafcdce104bc5c0a2 gpu: NVIDIA GeForce RTX 4060 Laptop GPU title: 419239bf seconds: 60 exit: 0x0 frames shown: 515 (PresentX 515) presents per 2 s (last 3): 25 25 24 device removals: 0 crashes: 0 peak commit: 15298 MB ``` PR ``` xcl-smoke v1 commit: 9e24a1fb61f5d2681e74aad76c4b5c788611bc5f gpu: NVIDIA GeForce RTX 4060 Laptop GPU title: 419239bf seconds: 60 exit: 0x0 frames shown: 909 (PresentX 909) presents per 2 s (last 3): 41 44 43 device removals: 0 crashes: 0 peak commit: 15247 MB ``` **Not tested** - AMD hardware and other DXC versions. The smoke runs cover startup through player selection. **AI use** - Codex (GPT-6) diagnosed the SDK path collision, wrote the change and regression test, and ran the local tests and smoke checks.
dcastell1 commented 2026-11-24 07:06:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by dcastell1 on 2026-11-24T06:55:02Z.


Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on main@beaa245:

patch -p1 < this PR            # clean, no fuzz
cargo test --workspace -- --test-threads=4
exit 0

All green: loading DXC from host paths shadowed by console mounts builds and runs, the workspace has no new failure against main on this box (737 passed there), and nothing else changes verdict. Restored the tree afterwards; no game data, hardware adapter, no Wine.

AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.

<!-- greyfinch-sync:ivall/xcl:comment:7124422793 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/833#issuecomment-7124422793). Originally posted by [dcastell1](https://github.com/dcastell1) on 2026-11-24T06:55:02Z. --- Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on `main@beaa245`: ``` patch -p1 < this PR # clean, no fuzz cargo test --workspace -- --test-threads=4 exit 0 ``` All green: loading DXC from host paths shadowed by console mounts builds and runs, the workspace has no new failure against `main` on this box (737 passed there), and nothing else changes verdict. Restored the tree afterwards; no game data, hardware adapter, no Wine. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
SlopTart commented 2026-11-24 09:07:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T08:09:37Z.


Linux / AMD RDNA3 datapoint.

Merged state: head 9e24a1f onto main 1ec4c98, clean merge.

Full suite, cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 705 passed, 11 failed, 41 ignored. Failures = the known Wine-lane set from my #42 rows plus #718 trio members and a hit of gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes (new flake, see #718 addendum). DXC host-path shadowing tests green.

Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.

Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross x86_64-pc-windows-gnu, XCL_NETWORK=0, release profile, --test-threads=4. My Linux rows: #42 / #718.

AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7125796293 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/833#issuecomment-7125796293). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-24T08:09:37Z. --- Linux / AMD RDNA3 datapoint. **Merged state:** head `9e24a1f` onto main `1ec4c98`, clean merge. **Full suite, `cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4`:** **705 passed, 11 failed, 41 ignored**. Failures = the known Wine-lane set from my #42 rows plus #718 trio members and a hit of `gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes` (new flake, see #718 addendum). DXC host-path shadowing tests green. **Not tested:** retail titles (none here), Windows, RDNA4. Counts only, no game data. **Machine:** RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross `x86_64-pc-windows-gnu`, `XCL_NETWORK=0`, release profile, `--test-threads=4`. My Linux rows: #42 / #718. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
gavinnolan commented 2026-11-24 18:09:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gavinnolan on 2026-11-24T17:54:47Z.


Hit this on my machine and this PR fixes it.

Setup: Windows 11 Home, NVIDIA GeForce RTX 2060 (driver 595.79), i7-10750H, 16 GB. XCL, DXC and the game are all on D: (XCL in D:\dev\xcl, DXC 1.9.2609 in D:\dev\tools\dxc\bin\x64, game in D:\GTA6.Xbox.v1.0.2.1), so the default D: console mount shadows them.

On main (9e3831e): with XCL_DXC_DIR=D:\dev\tools\dxc\bin\x64, and again with dxcompiler.dll + dxil.dll copied next to xcl.exe in D:\dev\xcl\target\release, XCL skipped both and fell back to the Windows SDK:

DXC: dxcompiler 1.6.2112.16 (e8295973), dxil 1.6 (file 101.6.2112.13), from C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64
DXC 1.6.2112.16 (e8295973) is older than 1.8: ...

With this PR merged onto main 9e3831e (clean merge), same XCL_DXC_DIR:

DXC: dxcompiler 1.9.2609.5 (01b62ad4), dxil 1.9.2609.5, from D:\dev\tools\dxc\bin\x64

No "older than 1.8" warning. 180 s run of the retail title (scripts/smoke.ps1, release build of the local merge): exit 0x0, 4376 frames, 0 device removals, 0 crashes, peak commit 15034 MB.

<!-- greyfinch-sync:ivall/xcl:comment:7139884300 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/833#issuecomment-7139884300). Originally posted by [gavinnolan](https://github.com/gavinnolan) on 2026-11-24T17:54:47Z. --- Hit this on my machine and this PR fixes it. **Setup:** Windows 11 Home, NVIDIA GeForce RTX 2060 (driver 595.79), i7-10750H, 16 GB. XCL, DXC and the game are all on `D:` (XCL in `D:\dev\xcl`, DXC 1.9.2609 in `D:\dev\tools\dxc\bin\x64`, game in `D:\GTA6.Xbox.v1.0.2.1`), so the default `D:` console mount shadows them. **On `main` (`9e3831e`):** with `XCL_DXC_DIR=D:\dev\tools\dxc\bin\x64`, and again with `dxcompiler.dll` + `dxil.dll` copied next to `xcl.exe` in `D:\dev\xcl\target\release`, XCL skipped both and fell back to the Windows SDK: ``` DXC: dxcompiler 1.6.2112.16 (e8295973), dxil 1.6 (file 101.6.2112.13), from C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64 DXC 1.6.2112.16 (e8295973) is older than 1.8: ... ``` **With this PR merged onto `main` `9e3831e`** (clean merge), same `XCL_DXC_DIR`: ``` DXC: dxcompiler 1.9.2609.5 (01b62ad4), dxil 1.9.2609.5, from D:\dev\tools\dxc\bin\x64 ``` No "older than 1.8" warning. 180 s run of the retail title (`scripts/smoke.ps1`, release build of the local merge): exit 0x0, 4376 frames, 0 device removals, 0 crashes, peak commit 15034 MB.
thaqiart139-alt commented 2026-11-24 23:08:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thaqiart139-alt on 2026-11-24T22:48:58Z.


Test report for this PR's head 9e24a1f, merged into main 689f2db (no conflicts), on AMD RDNA2 with native 64-lane waves and on a 32-lane NVIDIA card.

Tested

  • GPUs: AMD Radeon(TM) Graphics, the RDNA2 iGPU of a Ryzen 7 7800X3D (native wave64, driver 32.0.21045.29003), and NVIDIA GeForce RTX 5070 (driver 32.0.16.2101), chosen with XCL_ADAPTER.
  • System: 32 GB, Windows 11 Home build 26300, Rust 1.100.0, debug, DXC 1.9.2602.17.
  • cargo test --workspace --no-fail-fast -- --test-threads=4:
main 689f2db with this PR
RTX 5070 971 passed, 4 failed, 45 ignored 972 passed, 4 failed, 45 ignored
Radeon iGPU 974 passed, 1 failed, 45 ignored 975 passed, 1 failed, 45 ignored
  • This PR adds no failure. The failures are the same on main, from #1679's new fuzz tests, and both are already reported on #1679:
    • RTX 5070: fuzz_validate_and_gpu_0 to _3 (CreateComputePipelineState: 0x8007000E)
    • iGPU: fuzz_validate_and_gpu_1 (seed 540: res[833] = 0x7, CPU 0x6)
  • This PR's new tests pass on both GPUs: title_loads_host_dxc_under_a_console_mount.
  • This is an AMD run, and a second DXC version: 1.9.2602.17, where the description used 1.8.2502.11.
SKIPPED tests (the same on main and with this PR)
  • RTX 5070:
    • no wave64:
      • gpu::recomp::lower::tests: a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu
      • gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu, and the wave64 cases of its f16 / f32 / f64 / integer_programs_on_the_gpu
      • gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware
    • the wave32 per-lane cases of lower_dxil's f16 arithmetic, f16 packed and f32 conversions: refused ("its #1426 semantics differ from the console's")
    • heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows)
    • pso_measurement_compiles_an_exact_synthetic_record (Windows Developer Mode is off)
  • Radeon iGPU:
    • no mesh shaders: gpu::dxil::geometry_tests::gpu_geometry_direct_records, emitted_ms_primitive_attribute_reaches_the_pixel_shader, emitted_ms_ps_draw_a_triangle, gpu_geometry_mode_es_gs_strip, gpu_geometry_mode_es_gs_strip_with_branches, gpu_mesh_mode_two_passes
    • the wave32 and wave64 per-lane cases of lower_dxil's f16 arithmetic, f16 packed and f32 conversions: refused, as above
    • heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows)
    • pso_measurement_compiles_an_exact_synthetic_record (Developer Mode is off)

Not tested

  • a title run, DXC on another drive; other GPUs; Linux / Wine.

AI use

  • Claude Code (Claude Opus 5.5) ran the builds and tests and wrote this report.
<!-- greyfinch-sync:ivall/xcl:comment:7146676880 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/833#issuecomment-7146676880). Originally posted by [thaqiart139-alt](https://github.com/thaqiart139-alt) on 2026-11-24T22:48:58Z. --- Test report for this PR's head `9e24a1f`, merged into `main` `689f2db` (no conflicts), on AMD RDNA2 with native 64-lane waves and on a 32-lane NVIDIA card. **Tested** - GPUs: AMD Radeon(TM) Graphics, the RDNA2 iGPU of a Ryzen 7 7800X3D (native wave64, driver 32.0.21045.29003), and NVIDIA GeForce RTX 5070 (driver 32.0.16.2101), chosen with `XCL_ADAPTER`. - System: 32 GB, Windows 11 Home build 26300, Rust 1.100.0, debug, DXC 1.9.2602.17. - `cargo test --workspace --no-fail-fast -- --test-threads=4`: | | `main` `689f2db` | with this PR | |---|---|---| | RTX 5070 | 971 passed, 4 failed, 45 ignored | 972 passed, 4 failed, 45 ignored | | Radeon iGPU | 974 passed, 1 failed, 45 ignored | 975 passed, 1 failed, 45 ignored | - This PR adds no failure. The failures are the same on `main`, from #1679's new fuzz tests, and both are already reported on #1679: - RTX 5070: `fuzz_validate_and_gpu_0` to `_3` (`CreateComputePipelineState`: `0x8007000E`) - iGPU: `fuzz_validate_and_gpu_1` (`seed 540: res[833] = 0x7, CPU 0x6`) - This PR's new tests pass on both GPUs: `title_loads_host_dxc_under_a_console_mount`. - This is an AMD run, and a second DXC version: 1.9.2602.17, where the description used 1.8.2502.11. <details><summary>SKIPPED tests (the same on <code>main</code> and with this PR)</summary> - **RTX 5070:** - no wave64: - `gpu::recomp::lower::tests`: `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu` - `gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu`, and the wave64 cases of its `f16` / `f32` / `f64` / `integer_programs_on_the_gpu` - `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` - the wave32 per-lane cases of `lower_dxil`'s f16 arithmetic, f16 packed and f32 conversions: refused ("its #1426 semantics differ from the console's") - `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows) - `pso_measurement_compiles_an_exact_synthetic_record` (Windows Developer Mode is off) - **Radeon iGPU:** - no mesh shaders: `gpu::dxil::geometry_tests::gpu_geometry_direct_records`, `emitted_ms_primitive_attribute_reaches_the_pixel_shader`, `emitted_ms_ps_draw_a_triangle`, `gpu_geometry_mode_es_gs_strip`, `gpu_geometry_mode_es_gs_strip_with_branches`, `gpu_mesh_mode_two_passes` - the wave32 and wave64 per-lane cases of `lower_dxil`'s f16 arithmetic, f16 packed and f32 conversions: refused, as above - `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows) - `pso_measurement_compiles_an_exact_synthetic_record` (Developer Mode is off) </details> **Not tested** - a title run, DXC on another drive; other GPUs; Linux / Wine. **AI use** - Claude Code (Claude Opus 5.5) ran the builds and tests and wrote this report.
DavidM1911 commented 2026-11-25 11:09:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T10:38:32Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7159974320 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/833#issuecomment-7159974320). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T10:38:32Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Foniass commented 2026-12-01 04:15:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:15:39Z.


Triage (#1607) – head 9e24a1f

#1769 and #2101 (open) solve the same problem, a console drive mount shadowing XCL's DXC folder, a different way: they exempt xcl.exe's folder, XCL_DXC_DIR and the Agility SDK folder from the mount with Vfs::own_folder in host.rs. This PR instead runs DXC's lookup and fingerprinting under the hooks' thread-local guard (vfs_hooks::with_host_io), so the Agility SDK folder is not covered.
No problems found in the diff. The branch conflicts with main.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7300545829 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/833#issuecomment-7300545829). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:15:39Z. --- **Triage (#1607)** – head 9e24a1f #1769 and #2101 (open) solve the same problem, a console drive mount shadowing XCL's DXC folder, a different way: they exempt xcl.exe's folder, `XCL_DXC_DIR` and the Agility SDK folder from the mount with `Vfs::own_folder` in host.rs. This PR instead runs DXC's lookup and fingerprinting under the hooks' thread-local guard (`vfs_hooks::with_host_io`), so the Agility SDK folder is not covered. No problems found in the diff. The branch conflicts with main. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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/833:upstream-pr/833'
git switch 'upstream-pr/833'

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/833'
git switch 'upstream-pr/833'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/833'
git switch 'upstream-pr/833'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/833'
git switch 'main'
git merge --squash 'upstream-pr/833'
git switch 'main'
git merge --ff-only 'upstream-pr/833'
git switch 'main'
git merge 'upstream-pr/833'
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
xcl-dev/xcl!827
No description provided.