Recompiler: defer cold direct DXIL during compute PSO cache probes #1788
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!1788
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1788/head"
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?
@cansolele on GitHub · 2026-11-24 20:44 UTC · original
cansolele:defer-direct-dxil-cache-probe→main· +223 −11 · 3 files · 1 commits · closed without mergingPart of #1269. On a translated-cache miss, direct DXIL compute translation now defers during the cached-only probe. This lets async
CreateComputePipelineStatereturn a stand-in while keeping RAM and disk cache hits inline. Basemaincommit:4178e888c0b5be50a2887eda45cdb832763b68a4.What is in it
pso.rscallsdxc::defer()after the translation cache lookup and before direct compute translation.gpu_compute_e2e.rsexercises probe, cache, bind, and HLSL fallback behavior with synthetic shaders and GPU readback.README.mddocuments async direct compute support.Tested
x86_64-pc-windows-gnu).cargo test --workspace -- --test-threads=4viascripts/test.ps1on03d321d: 892 passed, 0 failed, 42 ignored. GPU skips reported by the harness: two native wave64, one heap windows.XCL_SAMPLE_*unset.cargo test --release -p xcl --test gpu_compute_e2e direct_compute_pso_cached_only -- --exact --nocapture: 1 passed with no skips. The cold probe and cold creation assertions both failed onmainwith the same test.CreateComputePipelineStatereturn fell from 2.02–2.12 ms to 0.40–0.41 ms. Time to the real PSO rose from 2.02–2.12 ms to 2.51–2.60 ms. Immediate firstSetPipelineStaterose from 9–13 µs to 1.81–2.08 ms.Regression run
@vitor127wt ran the independent retail smoke pair on Linux under Proton using
scripts/linux/smoke.shfrom #257. Both runs used the same title, 150 seconds,XCL_DIRECT_DXIL=1,XCL_HEAP_WINDOWS=1, and default lazy PSOs.The main run showed 2,126 frames and the PR run showed 1,822 frames (−14.3%). Linux cgroup peak memory rose from 14.72 GiB to 15.70 GiB. Both runs exited normally with zero crashes, device removals, or OOM kills. All 24 matching compute cache keys had byte-identical DXIL, with zero HLSL fallbacks.
The blocks below preserve the report's measurements and use the anonymized title identifier
9cc6a39e. Wine reportedpeak commit: 0 MBfor both runs. The Linux cgroup peaks are a separate measurement. This is one pair under Proton with default lazy PSOs, so the cause of the lower frame count is undetermined. Maintainer confirmation is pending on whether the Proton smoke pair satisfies the Windowsscripts/smoke.ps1requirement.main:
PR:
Follow-up with
XCL_LAZY_PSO=0In the updated independent report, @vitor127wt reran the same title and settings under Proton with
XCL_LAZY_PSO=0on both revisions. Each attempt used a fresh prefix and empty cache. The memory scope was capped at 16 GiB with no swap.main(4178e88)0x3at 100.915 smainretry (4178e88)0x3at 101.073 s03d321d)0x0after 150 sBoth baseline attempts logged the same stack through
d3d12core.dll+0x87333andwinevulkan.dll+0x11050. The early exits prevented the smoke script from producing end-of-run summaries or blocks formain. The PR's last active present interval ended at 124.035 s. The PR reached the cgroup cap and completed with zero OOM kills, crashes, or device removals.The PR logged 117 direct compute translations and zero HLSL fallbacks. For each baseline attempt, all 100 shared compute cache keys had byte-identical DXIL. The different run lengths and frame-count sources prevent a like-for-like 150 s frame or FPS comparison. The cgroup peaks cover different amounts of runtime work. The cause of the baseline exits and of the higher PR memory peak remains open. The standalone follow-up block is in the linked report. The paired blocks above are from the original default-lazy run.
Not tested
scripts/smoke.ps1on native Windows. The Proton follow-up did not yield a completed 150 s baseline withXCL_LAZY_PSO=0.AI use
@cansolele on GitHub · 2026-11-24 20:54 UTC · original
If anyone with a suitable retail title is available to help with the required paired smoke runs, I would really appreciate it.
4178e888c0b5be50a2887eda45cdb832763b68a403d321d823ef03d70a2387c680340f0deb8b9d31XCL_DIRECT_DXIL=1andXCL_LAZY_PSO=0to exercise the affected path.Please share both
xcl-smokeblocks here.Thanks for your help!
AI use: ChatGPT assisted with drafting this comment.
@cansolele on GitHub · 2026-11-24 21:08 UTC · original · edited 2026-11-24 21:11 UTC
Thanks, @vitor127wt, for running the paired retail smoke and focused GPU regression tests. If you have time, could you repeat both retail runs with
XCL_LAZY_PSO=0and the other settings held fixed? That would help clarify whether the frame-count drop reproduces with lazy PSOs disabled.Maintainers, could you confirm whether the Linux/Proton
xcl-smokeblocks count toward the required paired Windowsscripts/smoke.ps1runs? The original blocks report0 MBfor Wine's peak commit field, and the Linux cgroup peaks are documented separately in the PR description.AI use: GPT-6 helped me put my thoughts into words and translate this comment into English.
@vitor127wt on GitHub · 2026-11-24 20:58 UTC · original · edited 2026-11-24 21:34 UTC
Requested retail smoke pair — RTX 5070 Ti / Proton
With
XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1and default lazy PSOs, both 150 s runs exited0x0with no crashes or device removals. The PR showed 1,822 frames (85.7% of the base's 2,126 in this pair). The last two-second activity bin with presents ended near 106.0 s on the base and 94.2 s on the PR. Both runs used 24 matching compute cache keys, with byte-identical DXIL and zero HLSL fallbacks.Tested
7.3.5-2-cachyos, Proton Experimental 11.0 (experimental-11.0-20261112-x86_64). vkd3d-protonec207194with the #257 patch, dxil-spirv7c048638, and DXC 1.9.2609.5. Clean x64 Windows release builds using Rust 1.100.0 and LLVM-MinGW 20261117 (x86_64-pc-windows-gnullvm).cargo build --locked --release --target x86_64-pc-windows-gnullvm -p xcl --bin xcl. Ranscripts/linux/smoke.sh "$PROTON" "$PREFIX" "$GAME" 150from #257. Each run used the same retail title, a separate fresh Wine prefix and shader cache, networking off, and A presses scheduled every three seconds. XCL PSO cache blobs and vkd3d-proton/NVIDIA disk shader caches were disabled. Both usedXCL_DXC_THREADS=2,XCL_PSO_TRACE=1, andXCL_DIRECT_DXIL_STATS=1. The smoke scope was capped at 16 GiB RAM with no swap.cargo test --locked --release --target x86_64-pc-windows-gnullvm -p xcl --test gpu_compute_e2e --no-run. On the PR head, ran the Windows test binary in Proton Wine withdirect_compute_pso_cached_only --exact --test-threads=1 --nocapture. 1 passed, 0 failed, 0 ignored, 0 skipped. This exercises the cold cache-only probe, cache hits, first bind, GPU readback, and HLSL fallback.Regression run
The Wine smoke script generated both blocks. I abbreviated the local folder name in
title.mainPR head
Wine reported 0 MB in the Windows peak-commit field. The Linux cgroup peaks were 14.72 and 15.70 GiB, respectively, with no OOM kill. This is one title run per revision with default lazy PSOs. The focused integration test exercises the non-lazy cache-only path directly.
AI use — OpenAI Codex (GPT-6, exact variant unavailable) built and ran the checks, verified the logs, and drafted this report.
Follow-up with
XCL_LAZY_PSO=0I repeated the 150 s retail runs at the same commits and with the same settings, adding
XCL_LAZY_PSO=0to both. I repeatedmainonce after its early exit, using another fresh prefix and empty cache. The title, scheduled inputs, Proton NVIDIA stack,XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1and the 16 GiB RAM/no-swap scope were held fixed. I checked the flags in the running Wine processes. Test requestmain4178e888c0b5be50a2887eda45cdb832763b68a40x3at 100.915 smain, retry0x3at 101.073 s03d321d823ef03d70a2387c680340f0deb8b9d310x0after the 150 s windowBoth base attempts logged the same stack through
d3d12core.dll+0x87333andwinevulkan.dll+0x11050. The early exits left the Wine smoke script without its end-of-run frame summary or anxcl-smokeblock, so the two base counts come from summing the logged two-second activity bins. The PR's last bin with presents ended at 124.035 s. It reached the scope memory limit and finished with zero OOM kills, crashes, or device removals.The PR logged 117 direct compute translations and zero HLSL fallbacks. For each base attempt, all 100 compute translation cache keys shared with the PR had byte-identical DXIL. The early exits leave the 150 s frame-count difference unresolved with lazy PSOs disabled.
The Wine smoke script generated this block for the PR. I abbreviated the local folder name in
title.AI use — OpenAI Codex (GPT-6, exact variant unavailable) ran the follow-up and checked the logs and cache entries.
@cansolele on GitHub · 2026-11-24 21:52 UTC · original
Thanks, @vitor127wt, for rerunning both revisions and retrying
main. WithXCL_LAZY_PSO=0, both baseline runs exited with0x3near 101 s at the same reported stack, while this PR finished the 150 s window and reached the 16 GiB cgroup limit without an OOM kill, crash, or device removal. All 100 shared compute cache keys matched byte for byte in each comparison. The run lengths differ, and the cause of the baseline exits is still open.If the logs are still available, could you share the last few PSO trace lines before each baseline exit and any timestamped memory samples around that point for both revisions? Shader hashes, timing, and counters would be enough.
@Flyander, if you have time, would you be willing to run a native Windows
scripts/smoke.ps1pair for this PR on4178e88and03d321dwithXCL_DIRECT_DXIL=1,XCL_LAZY_PSO=0, and identical settings and duration? An anonymized title in the smoke output would be appreciated.AI use: GPT-6 helped analyze the evidence and draft this comment.
@cansolele on GitHub · 2026-11-24 22:20 UTC · original
I'll be offline for a while. Maintainers, feel free to review, test, or make any necessary adjustments to this PR while I'm away.
I'm happy with either integration order for #1788 and #1809, provided the end-to-end GPU regression coverage is preserved.
The remaining testing limitations are documented in the PR description.
Thanks for your time and help!
AI use: ChatGPT assisted with drafting this comment.
@DavidM1911 on GitHub · 2026-11-24 23:36 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@cansolele on GitHub · 2026-11-25 10:27 UTC · original
The cached-only direct compute issue addressed by this PR has been resolved upstream in #1836.
I'm closing this PR to avoid duplicating changes. The end-to-end GPU regression test remains available in this branch for anyone interested in extending the existing test coverage.
Thanks to everyone who took the time to test, review, and provide feedback. I appreciate your help!
Pull request closed