Shaders: precompile --pipelines compiles in the driver on its own threads #253
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/256"
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 1984742628 on 2026-11-23T21:59:18Z.
xcl shaders --precompile --pipelinesmade each compute pipeline on the thread that translated it, at most four at once (XCL_PIPELINE_THREADS). Once the four slots held programs the driver needs minutes for, every translating thread waited for a slot and the run stopped moving: a retail pack of 26 503 shaders sat at 22 800 for many minutes with about 3.5 cores busy, two driver compiles at about 6 CPU-minutes each. This PR moves the driver's compiles to their own threads and orders them by size and free memory. No issue is linked.What is in it
crates/xcl/src/shaders.rsonly (314 added, 25 removed).BiggestFirst, at most 2 GB of DXIL waiting). The translating threads go on and fill the DXIL cache meanwhile.driver_fits): the big ones start first, the threads left over make small ones. A program is taken to need 1536 bytes per byte of DXIL, between 64 MB and 1.5 GB, with 2 GB kept free.XCL_PIPELINE_THREADSstill works: that many at once, memory not watched.Tested
cargo test --workspace -- --test-threads=4oned5322fwith no uncommitted changes: 656 passed, 0 failed, 40 ignored (SKIPPED GPU tests: 2, both "no wave64":gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware). TheXCL_SAMPLE_*variables were not set, so the tests on game data did nothing.cargo test -p xcl --release --liboned5322f: 616 passed, 0 failed, 20 ignored.Regression run
Not run.
scripts/smoke.ps1was not run on main or on this PR, so there are noxcl-smokeblocks.main:
PR:
Not tested
xcl shaders --precompileonly;xcl rundoes not call it.--precompile --pipelinesrun with this version, so no before / after numbers. An earlier version (strictly biggest first, every running compile counted as 1.5 GB) was run on the retail pack: seven big programs took the whole memory allowance and nothing else was made meanwhile. The "biggest that fits" rule is the answer to that and has unit tests only.7a033c8, not rebased onto the newest main, and the commit subject is longer than 72 characters.AI use
Claude Code. Claude Opus 5.5 wrote the first version of the change; Claude Fable 5.2 wrote the final code, the unit tests, the commit message and this description, and ran the tests listed above.
upstream-sync referenced this pull request2026-11-25 16:10:51 +00:00
Pull request closed