Recompiler: the translated cache keys on the HLSL emitter's switches #2327
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!2327
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2327"
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?
@vakaobr on GitHub · 2026-11-25 14:35 UTC · original
vakaobr:recompiler/translated-cache-emit-switches→main· +53 −2 · 1 files · 1 commits · draftAddresses #1409, like #1413, which came first. Correction to what this said before: only
XCL_SAFE_BARRIERhas the bug.XCL_WAVE64_SPIN,XCL_X64_ALL_MASKSandXCL_RECOMP_NO_STRUCTUREDare already incache_allowedonmain, which turns the memory and the disk cache off whenever one of them is set, so they never reuse a stale translation and the tags this adds for them never take effect.XCL_SAFE_BARRIER=0changes the HLSL emitted fors_barrier, but neithercache_allowednor the cache identity knows it, so a run with it can load a translation cached without it, and the other way round. #1413 adds it tocache_allowed(no cache while it is set), the same waymainhandles the other three. This keys the disk cache on it instead (translated::identity()gets a tag when it is set), so a run with it set is still cached. That only matters where the barrier switch is a mode people run in rather than a debug switch, as on the Mac branch from #258, where the native barrier is the default andXCL_SAFE_BARRIER=1brings back the spin barrier. Formain, #1413 fits the existing pattern; if it is merged, I'll close this.What is in it
crates/xcl/src/gpu/recomp/pso.rs:translated::with_emit_switches, applied at the end ofidentity()(rerouted entries derive from it, so they follow), and the testemit_switches_change_the_translated_identity.Tested
x86_64-pc-windows-gnu, debug, ate56c368(on main06c9f55).gpu::recomp::pso::shader_cache_tests, all 7 tests (the new one + the 6 existing): 7 passed, 0 failed, each in its own process.XCL_SAFE_BARRIERleft out ofwith_emit_switches, the new test fails (left: 4, right: 6).Regression run
scripts/smoke.ps1on. Needs someone with a title, or the maintainer's call.Not tested
AI use
@nnonno91 on GitHub · 2026-11-25 14:39 UTC · original
Independent Windows check of
e56c368079bb51c1ceccf60fbcbb1e1860f3b3c5, using actual cache files across process boundaries.Tested
cargo test --locked -p xcl --lib gpu::recomp::pso::shader_cache_tests -- --nocapture --test-threads=1gave 21 passed, 0 failed, 0 ignored and no skips.translated::cachedfor the same key and trivial DXC-compiled compute shader in nine separate processes sharing one empty-at-start cache directory. Rancargo test --locked -p xcl --lib local_emitter_switch_disk_cache -- --nocapture --test-threads=1withXCL_DIRECT_DXIL=0. Each run gave 1 passed, 0 failed and 0 ignored.XCL_SAFE_BARRIER=0,XCL_WAVE64_SPIN=0,XCL_X64_ALL_MASKS=1, andXCL_RECOMP_NO_STRUCTURED=1) each missed the default entry and made a distinct entry. Defaults and the barrier-off setting both hit on repeat. Explicit defaults reused the default identity, andXCL_TRANSLATED_CACHE=0compiled with identity zero. Five cache files remained. The temporary test was removed.Not tested
GPU execution, the emitter output under each setting, the parent revision, retail smoke and the full workspace suite.
AI use
OpenAI Codex (GPT-6.2 Sol) wrote the temporary cache fixture, ran the tests and prepared this report.
@SlopTart on GitHub · 2026-11-25 14:47 UTC · original
Tested: current PR head merged onto current
origin/main(clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo targetx86_64-pc-windows-gnurun under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).Disclosure: the branch as fetched carries stacked unmerged content beyond the cache-key commit (title_list, dispatch_chain, split-restore work; 1780 insertions total). This row covers the branch as-is, same as any reviewer building it.
gpu_suite (--release --locked,--test-threads=2): 142 passed / 3 failed / 1 ignored, identical to plainorigin/mainon this rig (rig's known baseline: fuzz seed 1003 of #2115,gpu_nonfused_mad_and_mac_prevent_fma_contraction,gpu_depth_buffer_created_for_unordered_access_is_placed).gpu::recomp::dxc::cache_tests::andgpu::recomp::pso::shader_cache_tests::filters): all green on this lane, includingcache_key_tracks_the_dxc_toolchainand the direct-vs-HLSL identity tests; no collisions with the XCL-patched vkd3d-proton toolchain fingerprint on the Wine lane.Adds the Wine/vkd3d-proton data point next to the independent Windows check.
Not tested: retail titles (no title data on this lane, counts only).
AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
@DavidM1911 on GitHub · 2026-11-25 18:04 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.