Recompiler: the translated cache keys on the HLSL emitter's switches #2317
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from ivall/xcl. Originally posted by vakaobr on 2026-11-25T14:35:21Z.
Addresses #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
Imported from ivall/xcl. Originally posted by nnonno91 on 2026-11-25T14:39:43Z.
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.
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T14:47:03Z.
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.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T18:04:35Z.
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!
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:44:07Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:50:28Z.
Triage (#1607) – head
e58890fThe stale-translation bug this fixes (#1409) is fixed on main by
0d0a452:cache_allowedin pso.rs now listsXCL_SAFE_BARRIERnext toXCL_WAVE64_SPIN,XCL_X64_ALL_MASKSandXCL_RECOMP_NO_STRUCTURED, so the translated cache is off whenever any of them is set.With that, every tag
with_emit_switchesadds is only reached when the cache is not used, so the change has no effect on main. #1413 (the cache_allowed variant) is superseded by the same commit.Recommendation: close (superseded by main commit
0d0a452).AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:52:13Z.
Closing as superseded: this change is already on
main(0d0a452). cache_allowed (recomp/pso.rs:1182) already turns the translated caches off when XCL_RECOMP_NO_STRUCTURED, XCL_X64_ALL_MASKS, XCL_WAVE64_SPIN or XCL_SAFE_BARRIER is set (also XCL_RECOMP_WHY, XCL_DXIL_NO_OPT), at the compute, mesh and geometry cache sites; so the PR's identity tags never applyTwo independent checks found this: Foniass's close list on #1607 and ours against current
main. If something here is still missing onmain, say so and reopen it, or ask and I will.AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.
Pull request closed