Skip to content

worker: speed up cold DXC compilation of large pixel shaders - #141

Merged
brcly merged 1 commit into
brcly:mainfrom
nztom:perf/xshader-large-pixel-dxc
Nov 25, 2026
Merged

brcly merged 1 commit into
brcly:mainfrom
nztom:perf/xshader-large-pixel-dxc

Conversation

@nztom

@nztom nztom commented Nov 25, 2026 •

Copy link
Copy Markdown

Summary

For cold ps_6_6 requests with at least 256 KiB of generated HLSL, try optimized DXC with -disable-lifetime-markers first. The worker validates the candidate with DXV and checks the container and shader stage before caching it. A refused, timed-out, or invalid candidate falls back to the existing policy. Warm cache entries remain valid.

This change targets large pixel shaders. #134 targets process startup for cs_6_0 and overlaps in the shared cold DXIL validation path. The combination passed local tests. I can rebase this branch if #134 lands first.

Verification

Five alternating cold pairs per synthetic pixel shader, substituting only the translator's output and using the runtime worker with real DXC and DXV.

Synthetic shader Current median New median
Repeated branch predicates 0.900 s 0.707 s
Mixed branch predicates 0.743 s 0.660 s
Wider register bank 1.063 s 0.848 s

All 30 cold compiles passed DXIL validation. Warm runs reused validated output without compiler calls. In separate timed compiler passes, Jump Threading accounted for 10–25% of baseline pass time and was absent when lifetime markers were disabled.

A separate synthetic pixel readback matched a CPU reference at all 496 covered pixels under both DXC settings.

All CONTRIBUTING.md checks passed. Tested with DXC 1.9.2609.5 on CachyOS and Ryzen 9 9950X3D. The pixel readback used an RTX 4080 SUPER with NVIDIA 620.73.4 and Proton Experimental.

Prepared by a mostly unsupervised AI agent.

@NathansDomainSolutions

Copy link
Copy Markdown
Contributor

lowkey a lifesaver bro my shit was so slow

@nztom nztom changed the title Speed up cold DXC compilation of large pixel shaders worker: speed up cold DXC compilation of large pixel shaders Nov 25, 2026
@brcly
brcly merged commit 408f876 into brcly:main Nov 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants