recomp: add XCL_HLSL_CS to force compute shaders onto HLSL path #3060
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3060"
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 rdj415 on 2026-11-27T18:34:45Z.
Add
XCL_HLSL_CS=<hash>,<hash>...(split out from#2114per D95 triage) so specific compute shaders can stay on the HLSL translation path when running withXCL_DIRECT_DXILor triggeringenormousdirect-DXIL rerouting, while keeping HLSL translated disk cache entries separated.What is in it
crates/xcl/src/gpu/recomp/pso.rs: parseXCL_HLSL_CScomma-separated shader dump hashes (with optional0x/0Xprefix), skipXCL_DIRECT_DXILandenormousdirect-DXIL rerouting for matchingStage::Computeshaders, store/load their translated disk cache viatranslated::hlsl_identity()+translated::cached_hlsl()(cached_in), and add unit testhlsl_cs_hashes_parse_and_separate_cache_identity.Tested
cargo test --workspace -- --test-threads=4onb7be7b02: 1453 passed, 0 failed, 47 ignored (SKIPPED GPU tests on adapter: 19)Regression run
PR changes
crates/xcl/src/gpu/recomp/pso.rsoutside tests — addscripts/smoke.ps1runs frommainandb7be7b02before removing Draft / runningscripts/pr_check.py.main:
.\scripts\smoke.ps1runPR:
.\scripts\smoke.ps1run onb7be7b025a7473a0bfd16d5f4fd5864a71f186e4Not tested
scripts/smoke.ps1regression run forb7be7b02alone (previously exercised combined in#2114ata4cb014c)AI use
XCL_HLSL_CSimplementation and separated PR summary from#2114.Imported from ivall/xcl. Originally posted by Saksukella on 2026-11-28T10:37:52Z.
Tested
XCL_HLSL_CSon AMD Radeon RX 9070 XT (RDNA4, 16 GB VRAM, driver32.0.32029.2010, DXC1.9.2609.5, ReBAR enabled, release build onamd-devwithXCL_DIRECT_DXIL=1 XCL_PER_LANE=1 XCL_GPU_PROFILE=1):XCL_HLSL_CS: Compute shader344335e52c4be50e(8x4x1wave32,34,712 BRDNA2,ExecuteIndirect, 22 loops / 203 texture ops / 133 Interlocked ops) took342.5 ms/calllongest (825.2 msover 3 calls) on the Direct DXIL path (232 KBDXIL), stalling the GPU and triggering TDRs.XCL_HLSL_CS=344335e52c4be50e,4097cf4856634349onto the HLSL+DXC path dropped344335e52c4be50eto5.4–8.3 ms/call(16.5 msover 2 calls — 41.3x faster / -97.6% GPU time) and4097cf4856634349from10.9 msto6.5–8.3 ms, bringing total profiled 2 s GPU time down from448.1 ms(12,897 ops) to292.4 ms(20,763 ops) and enabling cleanexit 0x0sustained 3D runs (3.53 FPSavg,5.0 FPSpeak, 0 device removals, 0 slabs lost) while keeping the warm.plibcache intact (478/0hits).hlsl_identity/cached_hlsl) worked cleanly alongside existing Direct DXIL entries.Strong +1 for landing
XCL_HLSL_CS— it is immediately useful for both perf A/Bs and shader bug isolation on RDNA4.AI use: analysis and comment drafted with AI assistance; all runs executed locally on the RX 9070 XT above.
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-28T10:53:39Z.
Tested
Exact
b7be7b025a7473a0bfd16d5f4fd5864a71f186e4on Windows 11 x64 build 26200.9974, Ryzen 7 3800X, Rust 1.100.1 MSVC. I verified byte-for-byte Git source ranges forStage,parse_hlsl_cs_hashes,cs_hlsl_forcedandfnv64in the pinned standalone CPU harness.I ran
hlsl_override.exe --nocapture --test-threads=1in five fresh processes with isolatedXCL_HLSL_CSsettings. The synthetic inputs hashed to A=a430d84680aabd0band B=85944171f73967e8.Vertex, Pixel, and Mesh returned false for both inputs in every process. 5 passed, 0 failed, 0 ignored, 0 runtime skips. All five native exits were 0.
Not tested
Shader translation, runtime routing, cache use or performance, GPU or DXC execution, CI, retail smoke, and the workspace suite.
AI use
T3 Code through the Codex harness (
gpt-6.2-sol) verified the source and executable, reran the five cases, and wrote this report.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:25:31Z.
Triage (#1607) – head
b7be7b0No open or merged PR adds a per-hash switch that routes compute shaders to HLSL. Main has no
XCL_HLSL_CS.Problem in the diff:
translated::hlsl_identityinpso.rsrebuilds the HLSL disk-cache identity by hand. On current main,identity()also tagsXCL_X_LDS_ORDER=0(xcl-x-lds-order-0), andhlsl_identitydoes not, so after a rebase a forced shader could reuse an entry made with different settings. Deriving it fromidentity()withBackend::Hlslwould avoid that. The commit subject prefixrecomp:is not one of the repository's areas. The branch conflicts with main.Recommendation: keep open.
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 Foniass on 2026-12-01T10:51:17Z.
Review (head
b7be7b02, diff read, not a merge-check; draft, conflicts with main,PR descriptionred: no smoke blocks):XCL_DEBUG_CS_SUB=<hash>:(pso.rs~793-796, ~916-923), which already sends one compute shader to the HLSL path, uncached. Main also restructured this code (console_to_dxil_in_with,rt32_mask,cached_for), so the conflict inpso.rsneeds a rework rather than a mechanical rebase.hlsl_identity(~253) is rebuilt by hand, and after a rebase it would miss main'sxcl-x-lds-order-0tag, so a forced shader could reuse an entry built with other settings. Deriving it fromidentity()withBackend::Hlslavoids that. WithXCL_DIRECT_DXIL=0, a large forced shader's HLSL entry is looked up first and keeps being used after the switch is removed (cached_rerouted).XCL_HLSL_CSisn't in the settings that key the warm pipeline library (shaders.rs~31); whether that matters is unverified.recomp:should beRecompiler:.Fine: off by default and limited to compute shaders, and per-shader HLSL fallback already exists in direct mode, so mixing the two paths is supported. The 41x figure is backed by Saksukella's RDNA4 run.
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.