Skip to content

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

Open
JFyuhong wants to merge 1 commit into
xcl-dev:mainfrom
JFyuhong:codex/dxc-host-path
Open

JFyuhong wants to merge 1 commit into
xcl-dev:mainfrom
JFyuhong:codex/dxc-host-path

Conversation

@JFyuhong

@JFyuhong JFyuhong commented Nov 24, 2026 •

Copy link
Copy Markdown

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 (Retail title 1.0.2.1: GPU hang / crash at +0x23cf683 when the story loads (RTX 3070 Ti) #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.

A title can mount D: over the Windows SDK. Preflight finds the compiler, but the game process then looks for its DLLs in the title files. Use the existing thread-local guard for DXC discovery and the DLL metadata used in the shader cache key.

Assisted-by: Codex (GPT-6)
@dcastell1

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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
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 gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #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.

@DavidM1911

Copy link
Copy Markdown
Contributor

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

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants