Shaders: --pipelines makes programs of 4 MB DXIL or more last, by name #1279
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!1279
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1279"
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?
@bstillbstill on GitHub · 2026-11-24 14:10 UTC · original
bstillbstill:shaders/precompile-giants-last→main· +66 −1 · 1 files · 1 commits · draftxcl shaders <pack> --precompile --pipelinesnow makes the pipelines of compute programs of 4 MB of DXIL or more after all the others, one at a time, smallest first, and names each with its size before the driver gets it. Part of #505; the stall reported on #744 (RTX 4080, RTX 5080) and #505 (RTX 4090).On the newer retail title's pack the pass stopped advancing right after record 22 600, its memory growing (to 27 – 44 GB on an RTX 4080), and printed no name. The records there are three screen-probe programs: #22616
indirect_diffuse_lighting:CS_ScreenProbes_ActivateProbes_9083c094_Wrapped(29 052 KB of DXIL), #22617…ActivateProbesTarget_534f271f…(28 940 KB), #22618…ActivateRays_d60186e6…(13 774 KB). Their console code is unrolled (88 863 instructions for ActivateProbes). The NVIDIA driver alone (one thread) had not built ActivateRays after 14 minutes, at 4.6 GB and growing about 0.2 GB a minute.What is in it
Shaders: --pipelines makes programs of 4 MB DXIL or more last, by name–crates/xcl/src/shaders.rs:GIANT_DXIL(4 MB),Giants(kept aside during the pass, taken smallest first), the pass makes them after the others; testpipelines_of_giant_programs_are_kept_for_the_end_smallest_first.Tested
stable-x86_64-pc-windows-msvc, DXC 1.9.2609.5; debug for the tests, release for the passes.cargo build --workspace && cargo test --workspace -- --test-threads=4ond2eb1b4: 742 passed, 0 failed, 41 ignored. SKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64).xcl rpf <pack> --extract CS_ScreenProbes_ --out <dir>; 5 more have names past the Windows path limit), thenxcl shaders <dir> --precompile --only cs --pipelines: the 26 others were made in 25 s (pipelines: 25 made, 0 refusedthe last progress line), then it printed3 compute programs of 4 MB of DXIL or more, made last …and gave ActivateRays (13 774 KB) to the driver, named. I stopped it there.--precompile --only cs --pipelines --limit 22700: 225 pipelines in 22 minutes, 0 refused, private bytes mostly 2.2 – 3.1 GB (peak 8.9 GB). It had not reached record 22 616 when I stopped it: the 0.3 – 1 MB programs before it went at about 2 a minute (NVIDIA's compiler waits on the process heap lock, as reported on #744 and #759).Regression run
main:This PR:
The title run does not reach this code (it is
xcl shadersonly). No input in either run (intro and menus). Made withsmoke.ps1plus a local fix that reads the log of a run that does not exit by itself (an earlier main run hung inend_titleafter its 60 s); these runs exited by themselves, somain's script gives the same blocks.Not tested
Pipelines::makekeeps): a conflict inshaders.rsis likely.AI use
🤖 Generated with Claude Code
@DavidM1911 on GitHub · 2026-11-24 14:11 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib shaders: 6 passed, 0 failed.Thanks!
@WillyboPeep on GitHub · 2026-11-24 16:59 UTC · original
Test report:
d2eb1b4on an RTX 4090. The pass gets everything but the giants done first, as described; then the driver had not finished the smallest giant after 41 minutes. Counts and timings only.Setup: NVIDIA GeForce RTX 4090 (driver 621.01, 32-lane waves), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro 26300, Rust 1.98.1 MSVC, release, DXC 1.9.2602.17. This PR's head
d2eb1b4as pushed (onmain47efa2e), nothing else.cargo test --release -p xcl --lib shaders: 6 passed, 0 failed (withpipelines_of_giant_programs_are_kept_for_the_end_smallest_first).shaders.rpf:xcl rpf … --extract CS_ScreenProbes_ --out <short path>extracted 32 records with a short output path (29 in the PR's run). Thenxcl shaders <folder> --precompile --only cs --pipelineswith a new, emptyXCL_DXIL_CACHE, one run, page file grown beforehand, stopped after 45 minutes.3 compute programs of 4 MB of DXIL or more, made last …CreateComputePipelineStateThree things that may matter for the PR:
driver\*.psofile afterwards. The base is before #744 (merged in6cef69f), so a rebase ontomainwould keep what the pass makes before the giants. That is where this ordering pays.mainthis record is far bigger: sinceb8b1f49, ActivateRays translates to 148.5 MB of structured HLSL (#1307, fixed by #1321). A rebase ontomainwould want #1321 for this pass, or the giants' DXC alone takes a long time. Not measured here.Not tested: this PR rebased onto
main; the whole pack; the two bigger giants; AMD.AI use: Claude Code (Claude Opus 5.5) ran the builds and runs on my PC and wrote this report.
@simonbronk on GitHub · 2026-11-24 19:15 UTC · original
A data point and one suggestion for this PR, from a run of a variant of it.
This PR keeps the giants aside only at pipeline creation, by DXIL size. DXIL size is known only after translation and DXC, so the giants' translation and DXC (
-O0, 14 – 30 MB of DXIL) still run in pack order, on the pass's threads. On this machine that part alone stalled the pass. A variant of mine sorts the records by their inflated size (pack::Record::usize, so nothing has to be read first) before any thread takes one:precompilewalksorder[k]instead ofk. The giants then come last in DXC as well as in the driver.Setup: RTX 5070 12 GB (driver 621.24), Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro 26300, Rust stable MSVC, release, DXC 1.9.2609.
main9e3831e(#680 merged) plus only the ordering change, retail 1.0.2.1 pack (26 503 records).xcl shaders shaders.rpf --precompile --only cs --pipelineswithXCL_HEAP_WINDOWS=1. One run each, and not a controlled comparison: the second run started with the DXIL and blobs the first had made.main): 525 pipelines made, then private bytes rose from 30 to 46 GB in 5 minutes past record 22 600. I killed it when free commit dropped under 6 GB.So I cannot give a throughput figure. What the data shows is that ordered this way, the pass got through the rest of the pack before the giants without the memory climb. If you'd rather keep this PR as it is, I can open the ordering as a separate small PR stacked on this one. Say which you prefer.
Title run after it (same tree,
XCL_HEAP_WINDOWS=1, warm blobs): at world load 291 compute pipelines came from blobs in 0 – 23 ms. The stop at world load (#1452) is still there. WithXCL_PSO_WAIT_MS=50it became thequeue.Wait … did not complete within 5000 msmode (waiter=q0/q2/q4,prod=qSome(1),completed=0x0) instead of the title's watchdog. So on this card the pipeline builds no longer explain it.AI use: Claude Code with Claude Opus 5.5 wrote the variant, ran the passes and the title, and wrote this comment at the request of the person running it.
@DavidM1911 on GitHub · 2026-11-26 04:41 UTC · original
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.