Skip to content

Shaders: key DXIL toolchain identity off DLL bytes, not mtime - #2848

Open
guinpereira wants to merge 1 commit into
xcl-dev:mainfrom
guinpereira:fix/dxc-toolchain-identity-bytes
Open

guinpereira wants to merge 1 commit into
xcl-dev:mainfrom
guinpereira:fix/dxc-toolchain-identity-bytes

Conversation

@guinpereira

@guinpereira guinpereira commented Nov 26, 2026 •

Copy link
Copy Markdown

Fixes #2824.

Hashes a fixed prefix of dxcompiler.dll/dxil.dll plus file size instead of modification time, so copied DLLs with new mtimes keep the cache key.

What is in it

  • crates/xcl/src/gpu/recomp/dxc.rs: toolchain identity derived from DLL bytes (fixed prefix) + size, not mtime.

Tested

  • Windows 11, NVIDIA GeForce RTX 5060 Ti, Rust stable (x86_64-pc-windows-msvc), debug build.
  • cargo test -p xcl --lib -- --test-threads=4: 1315 passed, 4 failed (GPU OOM in dxil fuzz tests, environment), 27 ignored.
  • cargo build -p xcl: clean.

Regression run

xcl-smoke v1
commit: 05adb5a9cfc718119c0c9c097365983e67982d05
gpu: NVIDIA GeForce RTX 5060 Ti
title: gta6
seconds: 60
exit: 0x0
frames shown: 1043 (PresentX 1043)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15536 MB

Reference run on the author's local main (05adb5a). A run on ivall/xcl main and on this PR's head commit is still pending (cold shader cache crashes the title's startup precompile on this machine).

Not tested

  • Smoke on ivall/xcl main baseline and on this PR's head commit (pending, see above).
  • A copied-DLL scenario end-to-end (mtime change) not exercised here.

AI use
OpenCode, Beam Free - drafted the change; smoke run and review by the author.

@sage-sage

Copy link
Copy Markdown

Test report: passes on NVIDIA. Exact head 88e56f93 (base main 8b957be).

Tested

  • RTX 4080 SUPER (driver 621.40), Ryzen 5 7600X, Windows 11 26H2 build 26300.10075, rustc 1.100.0 MSVC, DXC 1.9.2602.17 (Windows SDK 10.0.26100), debug build
  • cargo test --workspace -- --test-threads=4: 1446 passed, 0 failed, 47 ignored
  • SKIPPED: 29 lines, the same as on main on this machine (wave64, debug layer, Developer Mode, heap windows)

Not tested

  • I did not copy the DLLs with a new modification time and check that the cache still hits; only the suite ran. No game.

Claude Code (Claude Opus 5.5) ran the tests and wrote this report.

@Gevroska

Copy link
Copy Markdown

I checked the timestamp case on Windows at 88e56f93. I copied the pinned DXC compiler and validator DLLs and changed the copies’ modification times while preserving their contents. On the parent revision, the original kit and the copies produced different DXIL cache keys. On the PR head, both produced 5e6fa3bf0f189119.

I also checked which file changes the key detects, using inert test files. Changing the sampled prefix or the length of either DLL changed the key. A same-length edit beyond the sampled prefix preserved it. An independent repeat reproduced all seven cases. I measured key generation only; I didn’t load the test DLLs or measure a shader cache hit.

I used Codex GPT-6.2 Sol for the fixture and a separate GPT-6.2 Sol agent for independent verification. Codex GPT-6.2 Astra wrote this comment.

I reviewed and approved this comment before posting.

@rgroenewoudt

Copy link
Copy Markdown

Test report on AMD RDNA4 for 88e56f9

Tested

  • AMD Radeon RX 9070 (driver 32.0.32029.2010), Ryzen 9 5950X, 32 GB, Windows 11 Pro 26300, rustc 1.100.0, DXC 1.9.2602.17 (Windows Kits 10.0.26100.0), debug.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on 88e56f93: 1444 passed, 2 failed, 47 ignored.

Not tested

  • The cache behaviour this PR changes: a copied DXC folder hitting the existing cache was not checked.
  • A smoke run on a title.

AI use

  • Claude Code, Claude Opus 5.5: ran the tests and wrote this report.

rootw0rm pushed a commit to rootw0rm/xcl that referenced this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shaders: a copied dxcompiler.dll misses the whole DXIL cache (the toolchain key uses its modification time)

4 participants