Repository navigation
Conversation
|
Paired offline benchmark for #2880 on RTX 5070 Ti Laptop 12 GiB (621.24), Ryzen 9 8945HX, 31.8 GiB usable RAM, Windows 11 26200.9974, Rust 1.97.1 MSVC, DXC/DXIL 1.8.2502.11. Clean release builds of Synthetic RPF9 with 160 variants of the existing wave32 split compute fixture.
Thread snapshots: median interval 4.17–4.57 ms across runs, maximum 5.95 ms. IDs seen are a lower bound, not an ETW thread-create total. Peak commit is the Windows |
|
Thank you @ettehn, a paired, interleaved A/B with matched cache states is exactly what this needed. I've written up what it shows, together with the two runs on #2880, in this comment. In short: thread starts per pass go from about 640 to 4 and peak commit drops about 10 MiB, consistent with thread stacks. Cold time doesn't change, because the 4-slot gate is the limit. The small warm slowdown may come from this PR dropping the blob read-ahead that the waiting helpers gave AI use: Claude Code (Claude Opus 5.5) drafted this comment. |
|
AMD/RADV/Wine functional coverage at Tested
A local precompile pilot with four owned guarded-add programs produced 28 SDK-validated wave32 DXIL pieces. With matched warm translation caches, empty private driver caches, Not tested The requested bulk cold/warm performance comparison, execution of the queued twelve-piece fixture, native Windows, other GPUs, the full suite, startup cancellation, retail workloads or AI use OpenAI Codex (GPT-6; exact serving variant not exposed) ran the comparisons, prepared the local test-only observations/pilot, independently checked sources and raw results, and drafted this report. Publication authorized by the account owner. |
luckyteagirl
left a comment
There was a problem hiding this comment.
If every piece builder panics, precompilation can hang before it reports the failure. The Built guard decrements the count only for the job that started. Jobs still queued keep their producer waiting in queue_pieces, and the coordinator joins producers before closing the pool. I ran an isolated Windows harness with the exact queue methods and the same join order, using two builders and three jobs. The control completed. When the build stub panicked in both builders, the coordinator was still blocked after two seconds and I stopped the fixture. Could the pool wake its producers with a failure and shut down when a builder exits unexpectedly? Queue and builder loop · Shutdown order
The regression test has a related teardown issue. It unwraps each producer's join result before closing the pool, so a failed assertion can leave the scoped threads waiting indefinitely. Collecting the join results and closing the pool before propagating errors would let that test report the assertion. Test teardown
AI use: OpenAI Codex (GPT-6.2 Sol) reviewed the source, ran the CPU-only fault-injection harness, and drafted this comment. No title, GPU, or full suite was run.
|
Tested Clean
Four passed, zero failed, ignored, or skipped. Each group used the shared Arc mutex. The pinned executables matched before, under, and after the lock. Not tested Arc performance, peak native calls, cancellation and panic handling, the full workspace, and retail smoke. AI use T3 Code / Codex ( Tested — follow-up at Native Windows 11 build 26200.9974, Ryzen 7 3800X, Intel Arc A770 (PCI I used
2 passed, 0 failed, 0 ignored, 0 runtime skips. Not tested Production AI use T3 Code through the Codex harness ( |
093a5fc to
1625b9d
Compare
|
Thanks @luckyteagirl, both points were right. Fixed in 1625b9d (squashed into the PR's commit):
RTX 2070 SUPER, Windows 11 26300, debug: AI use: Claude Code (Claude Opus 5.5) wrote the fix, the test and this reply. |
1625b9d to
b41e4b7
Compare
|
Help wanted: a full
Programs split on GPUs with 32-lane waves (NVIDIA, Intel). If you have one and a title's shader pack, please run, on $env:XCL_DXIL_CACHE = '<empty folder>' # one fresh folder per build
xcl shaders '<pack>' --precompile --only cs --pipelinesand post the summary lines (split programs / pieces, pipelines made / refused / reused, time), the peak commit or working set of — Claude Code (Claude Opus 5.5), on behalf of the PR author |
`--pipelines` builds the compute pipelines of the pass in `make_pipelines`, on `XCL_PIPELINE_THREADS` workers. For every split compute program a worker started a fresh scoped group of up to `XCL_PIPELINE_THREADS` helpers, one group per root it builds. All the groups wait at the same `running` gate, so 4 workers each on a four-piece program held up to 16 helpers for 4 driver slots. Each helper also reads its piece's driver blob from disk before the gate, so on a warm run every waiting helper holds a blob in memory (xcl-dev#2880). `make_pipelines` now starts `XCL_PIPELINE_THREADS` piece builders once. A split program's worker queues its pieces, each with the root it is built for, and waits for them as before, so progress and the summary counters do not change. At most `XCL_PIPELINE_THREADS` pieces are past `make_one`'s blob read at a time. `make` outside `make_pipelines` (the tests) keeps its own helpers, and startup preparation, which builds a program's pieces one after another, is unchanged. A queued piece counts as done when it is dropped, and the last builder to exit drops what is still queued, so a panic in every builder cannot leave a worker waiting for pieces nobody builds; the pool is closed before a failed job's panic goes on. Tests: split_programs_share_the_piece_builders (12 pieces of 4 programs on 2 builders, each program's pieces cached when its make returns), split_program_returns_when_every_piece_builder_panics, and offline_pipeline_jobs_hand_their_pieces_to_the_piece_builders (with builders that panic, make_pipelines panics instead of building the pieces on helpers of its own, and returns). Not measured yet: the cost of the old scheme on a split-heavy corpus is the open question in xcl-dev#2880. Part of xcl-dev#2880 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b41e4b7 to
adaa3a2
Compare
|
No open or merged PR makes this change. On main, AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
--pipelinesand startup preparation build split compute programs' pieces on helper threads. Onmaine429936 the pass's pipelines are made inmake_pipelines, after the shader workers, by up toXCL_PIPELINE_THREADSworkers; each starts its own group of up toXCL_PIPELINE_THREADShelpers for a split program, and they all wait at the same 4-slotrunninggate: up to 16 helpers for 4 driver slots at the default. Each helper reads its piece's driver blob (driver_cache::load, a fullfs::read) before the gate, so on a warm run every waiting helper holds a blob in memory.This PR starts
XCL_PIPELINE_THREADSpiece builders once permake_pipelines, and the pieces of every split program go through them. The native-create limit is unchanged, and at mostXCL_PIPELINE_THREADSpieces have read their blob at a time. A program's worker still waits for its own pieces, so progress reporting and the summary counters behave as before. Rebased ontomaine429936: the first revision started the builders inprecompile, which on today'smainreturns before any pipeline is made, so they moved tomake_pipelines(the commit message says more). The 68 helpers in the first revision's description were beforemainmoved pipeline creation out of the shader workers.Part of #2880. Whether the old scheme costs anything measurable is the open question in #2880, and this PR is mainly there so it can be measured A/B against
main. If it only changes thread counts, it may not be worth merging.What is in it
crates/xcl/src/shaders.rs:PieceQueue/PieceJob,Pipelines::{queue_pieces, build_pieces, open_pieces, close_pieces, make_chain_pieces};make_pipelinesstarts the builders and closes the queue once its jobs have returned (also when one panics).makecalled outside it (tests, a single worker) keeps its own per-program helpers.split_programs_share_the_piece_builders: four three-piece programs on two builders. Every piece is cached whenmakereturns, the queue drains, the builders exit and the gate count returns to 0. A second test,split_program_returns_when_every_piece_builder_panics, has two builders panic with three pieces queued. A third,offline_pipeline_jobs_hand_their_pieces_to_the_piece_builders, runsmake_pipelineswith panicking builders and checks it returns with the queue drained and closed.Testing wanted: please post baseline figures, not only the smoke run
The standard smoke run is useful as a regression check, but it doesn't reach what this PR changes. What's needed is the profile from the #2880 comment, run on
mainand on this PR's head with everything else held constant:XCL_SPLIT_WAVE64=1). Give the GPU, driver, CPU and RAM.XCL_DXC_THREADS(same value throughout, e.g. 15),XCL_PIPELINE_THREADS=4, defaultXCL_PIPELINE_MAX_KB, a dedicatedXCL_DXIL_CACHE, a release build.xcl shaders <pack> --precompile --only cs --pipelines, on a pack whosesplit compute programs: N (M pieces)line shows at least a few hundred pieces.%XCL_DXIL_CACHE%\driverand the driver's shader cache (NVIDIA\DXCache/D3DSCache) deleted before each runXCL_DXIL_CACHEtime … sline; thepipelines made / refused / loaded from the driver cacheandsplit compute programslines; peak live threads and total threads created (WPR, or a ≤10 ms sampler; sampled peaks miss short-lived helpers); process peak commit (PeakPagefileUsage, or a ≤50 msPrivateMemorySize64sampler).%XCL_DXIL_CACHE%\driverand the same made / refused / reused counts on both builds.Tested
cargo test --workspace -- --test-threads=4: 2129 passed, 9 failed, 48 ignored; 25SKIPPED(21 no wave64, 3 gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426, 1 no heap windows). The 9 failures are main e429936 on NVIDIA: 3 e2e title tests and 6 split-wave64 GPU tests fail since #2959 #3093's and fail the same onmaine429936 (2126 passed, 9 failed, 48 ignored), same skips.main'smake_pipelines(no builders) and the rest of b41e4b7,offline_pipeline_jobs_hand_their_pieces_to_the_piece_buildersfails.Regression run
RTX 2070 SUPER, the retail game, 60 s,
XCL_PRESS_AT=25:A,XCL_PREPARE=0(no startup preparation) on both, release builds, one after the other in one queue job; each run starts from the DXIL cache the run before it left. Startup preparation is skipped, so this does not reach split programs (the logs show 0 programs split during the runs): it is a regression check.Not tested
xcl runwith a split-heavy titleAI use
maine429936 and ran the tests. The author reviewed them.🤖 Generated with Claude Code