dxc: hash arguments into the DXIL cache key and honor XCL_DXC_ARGS (#559) #591
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!591
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-591"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Ivankiosan on GitHub · 2026-11-24 02:12 UTC · original
Ivankiosan:dxc-cache-key-args→main· +142 −33 · 1 files · 1 commits · openHash explicit and environment DXC arguments into the DXIL disk cache key, and honor
XCL_DXC_ARGSon the cached compilation path. Fixes #559.Previously,
cache_key_for_toolchainonly hashed the package version, toolchain identity, profile, entry, and source text, omitting any compiler arguments (extra: &[&str]). Furthermore,compile_cached_inhardcoded an empty argument list&[], ignoringXCL_DXC_ARGS. This caused different optimization levels or custom arguments to collide on the same cache key or be dropped entirely.This change:
cache_key_for_toolchainandcache_keyto append and hash the argument list into the FNV-1a digest. Empty argument lists keep the digest unchanged.compile_cached_argsto allow callers to pass explicit arguments through the cache.XCL_DXC_ARGSthroughcompile_cached_inso environment-specified arguments reach both the cache key and the compiler.What is in it
crates/xcl/src/gpu/recomp/dxc.rs: hash arguments intocache_key_for_toolchain, exposecompile_cached_args, consultXCL_DXC_ARGSincompile_cached_in, and add unit tests verifying key separation and environment variable handlingTested
cargo test --workspace -- --test-threads=4: 678 passed, 0 failed, 37 ignoredSKIPPEDGPU tests on adapter: nonegame_scarlett_master.exe)Regression run
Not tested
AI use
@fromthemoonx on GitHub · 2026-11-24 02:47 UTC · original
NVIDIA run, since Not tested lists NVIDIA GPUs.
Tested
6c68cc703df3e2d75d5820ee594a4a155ce3ee9e, clean worktreestable-x86_64-pc-windows-msvc; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0); debugcargo build --workspace, thencargo test --workspace -- --test-threads=4: 687 passed, 0 failed, 41 ignored (lib 647 / 0 / 21)cache_key_tracks_the_dxc_arguments,compile_cached_args_distinguishes_argument_lists,compile_cached_in_honors_xcl_dxc_args_envgpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwareXCL_SAMPLE_*andXCL_DXC_ARGSnot setNot tested
smoke.ps1run here.AI use
@MesshM on GitHub · 2026-11-24 02:55 UTC · original
Test run of
6c68cc703df3e2d75d5820ee594a4a155ce3ee9eon AMD RDNA4; the PR was tested on NVIDIA only. I merged it onto currentmain18c105alocally (clean merge) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 692 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 652 passed, 0 failed, 21 ignoredSKIPPED;cache_key_tracks_the_dxc_arguments,compile_cached_args_distinguishes_argument_listsandcompile_cached_in_honors_xcl_dxc_args_envpass.Review: An empty argument list keeps the old digest, so existing caches stay valid. One thing in the tests:
compile_cached_in_honors_xcl_dxc_args_envsetsXCL_DXC_ARGS="-O1"withstd::env::set_varin the middle of thexcllib test binary, which runs with several threads. While it is set, any GPU test compiling throughcompile_cached/compile_cached_inat the same time reads-O1fromenv_dxc_args(), compiles with it and caches under that key. It does not fail anything today, but it makes those runs depend on scheduling. Testingenv_dxc_args()'s parsing separately and callingcompile_cached_argswith an explicit list (ascompile_cached_args_distinguishes_argument_listsalready does) would keep the environment untouched. Smaller:XCL_DXC_ARGSis split on whitespace, so an argument containing a space cannot be passed.Not tested: no retail title or regression run (I have no unpacked game), no
XCL_SAMPLE_*tests, release build; the PR's head on its old base was not run, only its merge ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
@KainanP on GitHub · 2026-11-24 19:35 UTC · original
Thanks for wiring
XCL_DXC_ARGSinto the cache key. I read the diff at6c68cc7(not run).Two things about
compile_cached_in_honors_xcl_dxc_args_env:XCL_DXC_ARGSwhile other tests run in parallel.dxil_cache_round_tripcallscompile_cached_intwice and asserts the second is a hit. If theset_var("-O1")/remove_varwindow falls between those calls, the keys differ ([]vs["-O1"]) and that test fails intermittently.compile_cached_in_with(..., &env_dxc_args()...)directly, so thecompile_cached_in→env_dxc_argswiring is not actually tested.Suggestion: split parsing into a pure
dxc_args_from(Option<&str>) -> Vec<String>and test that, pluscompile_cached_argswith explicit lists (already covered), and drop the env mutation. Alternatively, guard every test that touches the variable orcompile_cached_inwith one shared mutex.AI use: Claude Code (Claude Opus 5.5) read the diff; not run. Checked by the user before posting.
@JJAutoCompare on GitHub · 2026-11-25 06:43 UTC · original
Empirical test report (
6c68cc70)Hardware / environment
6c68cc703df3e2d75d5820ee594a4a155ce3ee9e, verified at detached HEAD.0ef1bc386), hostx86_64-pc-windows-msvc, unoptimized test profile. Loaded DXC compiler and DXIL signer 1.9.2609.5 (compiler revision01b62ad4).Commands and results
cargo test --workspace --no-runexited 0. It built the workspace test binaries and executed no tests.XCL_ADAPTER=NONE_CPU_ONLY,RUST_TEST_NOCAPTURE=1, andXCL_DXC_ARGSinitially unset,cargo test -p xcl --lib gpu::recomp::dxc:: -- --test-threads=1exited 0. The focused log recorded 17 passed, 0 failed, 0 ignored, 0 skipped and 651 filtered out. Skips were counted from case-sensitive lines beginning withSKIPPED.Observed behavior
XCL_DXC_ARGS=-O1caused a miss in the synthetic cache tests, and repeating the environment value hit the cache.Not tested
Full GPU workspace suite, game smoke runs, and real DXC compilation with overridden flags. The flag-specific tests used synthetic DXIL.
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr591-focused.log and published.
@DavidM1911 on GitHub · 2026-11-25 13:06 UTC · original
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!
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.