Shaders: xcl pipelines --shard k/n splits the journal over processes #1826
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!1826
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1826"
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?
@VolenNakov on GitHub · 2026-11-24 21:30 UTC · original
VolenNakov:pipelines-shard→main· +1412 −31 · 11 files · 20 commits · openStacked on #759; only
Shaders: xcl pipelines --shard k/n splits the journal over processes, the merges ofmainabove it and @Kalmarv'sShaders: xcl pipelines keeps a replayed graphics pipeline's driver blob(5988731, cherry-picked from7f6d342with their authorship) belong here. The first of them (1037250,main568e7db) also resolves #759's conflicts withmain:GraphicsPrepcarries the VS / PS DXIL and samplers, sotranslated_graphics_psokeepsmain's graphics driver-blob cache on #759'sprep_graphics;warmgates big compute builds withmain's size-class slots and commit headroom (huge_pso_bytes,compile_slots,big_compile_headroom);uma::existingsits next tomain'sget. The next (01db6f4,main426a5a7) keeps #2176'simage_onlynext to #759's journal entry ingo_background; the last (7ae2bb7,main1a0bbe3) merged cleanly. Part of #1269; the same idea as #1502 forxcl shaders --precompile, with the same--shard k/nsyntax.NVIDIA's driver builds about one big compute pipeline at a time per process, however many threads ask (#1502 measured it for
xcl shaders --precompile; S1m0ne1997 on #505 forxcl pipelines). With onexcl pipelinesprocess,XCL_PIPELINE_THREADS=10andXCL_BIG_COMPILES=10on the retail title's journal, 10 big builds were in flight but the process kept 2.1 of 12 cores busy (1.7 threads running on average).--shard k/nlets n processes share the journal: four of them kept 9.6–10.6 cores busy on the same journal.What is in it
crates/xcl/src/pipelines.rs:--shard k/n. A process takes the pipelines whose hash % n is k − 1 (Queue::mine, innextandleft), the ones the title used first as before, and keeps its ownpipelines.shard{k}of{n}.done/.trying, so each process can be stopped and resumed on its own. Help text. Test:shards_split_the_pipelines_without_overlap(every pipeline in exactly one share, fair shares,leftcounts only the share).crates/xcl/src/hle/d3d12x/real.rs(@Kalmarv,5988731): the graphics arm ofwarm_oncekeeps agfx-<key>driver blob of each graphics pipeline it replays, as the compute arm andtranslated_graphics_psodo, and skips a pipeline whose blob is already there. Before, a replay's graphics coverage lived only in the driver's own cache, which evicts when full (their report: #1826).Tested
cargo build --release --workspace, thencargo test --release --workspace --no-fail-fast -- --test-threads=4on7ae2bb7: 1259 passed, 0 failed, 46 ignored. SKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwareand the wave64 cases oflower_dxil::tests::{integer,f16,f32,f64}_programs_on_the_gpuandmask_ff0_and_flbit_agree_with_hlsl_on_the_gpu(no wave64);heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows);pso_measurement_compiles_an_exact_synthetic_record(the driver cache cannot be turned off without Developer Mode);uploads_start_from_each_subresources_stateandtest_title_draws_with_a_root_signature_under_the_debug_layer(no D3D12 debug layer); the per-lane cases refused for #1426 semantics (V_CVT_F16_F32,V_PK_MUL_F16,V_MUL_F16).--shard 1/2and--shard 2/2run together with--limit 400each: both made 400 and ended cleanly (no.tryingleft); every hash inpipelines.shard1of2.doneis even and inpipelines.shard2of2.doneodd, with no overlap. Note: the start line's count of a share (30 254 and 30 260 here) usesleft(), which counts a pipeline the title used twice when it is also inrest(1 766 here); that is as on #759 without--shard.main930e8b4): one process 2.1 cores; four processes (--threads 4,XCL_PIPELINE_THREADS=3,XCL_BIG_COMPILES=2each) 9.6–10.6 cores, 14–20 GB of RAM free. Big compute pipelines (0.8–1.3 MB of DXIL) took 140–530 s each in the driver either way; sharding runs more of them at once, it does not make one faster.5988731(Kalmarv's):cargo test -p xcl --lib -- pipelines driver_cacheon it: 11 passed, 0 failed. Before the cherry-pick, the same commit had run on a local tree (main08db802with this PR, #2526, #2097, #2404, #2590 and #2615), replaying the retail title's journal with four--shard k/4processes and a local graphics-only filter: 55,973 graphics pipelines made, 0 failed, and 3,515gfx-*blobs kept. The next title run had 1 cold graphics compile; a run before the replay had 72.Regression run
main:
PR:
Not tested
--watchwith--shardbeside a running title; AMD and Intel GPUs (where the driver may not serialize, so sharding may gain less); Wine.xcl pipelines; they check that the runtime is unchanged.AI use
🤖 Generated with Claude Code
c02d059: the journal opens off the title's threads) into pipelines-3-tool dd66d20995568e7db) into pipelines-shard 103725092e426a5a7) into pipelines-shard 01db6f45ff1a0bbe3) into pipelines-shard 7ae2bb7184@futurepro62 on GitHub · 2026-11-24 22:39 UTC · original · edited 2026-11-24 22:47 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
c660438(on its basec160d86).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu: 866 passed, 0 failed, 42 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.the_heap_windows_flag_is_kept,graphics_round_trip,what_is_noted_while_the_journal_opens_is_written_after_in_order,a_torn_frame_written_over_is_read_again,trying_holds_only_the_pipelines_being_made,another_gpu_or_driver_starts_the_done_file_over,done_file_of_another_binary_is_replaced_and_a_torn_record_cut,used_pipelines_first_done_ones_skipped_journal_followed,shards_split_the_pipelines_without_overlap.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 867 passed, 0 failed, 42 ignored. SKIPPED:heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out five tests where this PR's base has them. They fail on main689f2dbtoo, not because of this PR: underXCL_REQUIRE_GPU=mesh,runner::skip_testturns their skips into failures. These areheap_window_out_of_memory_falls_back_to_the_switch_form(#1651) and the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests (follow-up on #1651). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-25 00:50 UTC · original
Test report — RTX 3060 Ti (Windows 11): does not compile after merging with current
main(1d027e5).cargo test -p xcl --libfails with 3 × E0425 incrates/xcl/src/hle/d3d12x/real.rs:vs_dxil/ps_dxilnot found at real.rs:4251 —mainrestructured the graphics-prep path (GraphicsPrep { desc, rs, rect_gs, _dxil }now carries the blobs differently).BIG_DRIVER_COMPILEnot found at real.rs:4612 —mainrenamed it toGIANT_DRIVER_COMPILE(real.rs:3575) and splitBIG_COMPILES/GIANT_COMPILESlanes.Git merged the files cleanly but the change is semantically stale — needs a rebase onto the new compile-slot layout.
@JJAutoCompare on GitHub · 2026-11-25 02:25 UTC · original
XCL PR #1826 verification
xcl pipelines --shard k/nassigns each process a share of the pipeline journal and shard-specific.doneand.tryingfiles.c6604385b250c6cd6e679c5dfcbfd114ccb1e581from liverefs/pull/1826/head. The detached worktree was clean before and after the suite.origin/mainat fetch wasaaa093657bd96a146c05c0c1a9b61149fe761453.git merge-tree --write-tree origin/main HEADexited 1 with conflicts incrates/xcl/src/gpu/uma.rsandcrates/xcl/src/hle/d3d12x/real.rs.What is in it
crates/xcl/src/pipelines.rsparses the shard argument, partitions the queue by pipeline hash, uses per-shard progress files, and tests partition completeness and disjointness. The full PR diff againstorigin/mainalso includes the pipeline journal and its runtime integration.Tested
32.0.101.9175, wave range 8–32,DoublePrecisionFloatShaderOps=0, and AMD Ryzen 7 3800X. Windows 11 Enterprise Evaluation build26200.9974, DXC/DXIL1.9.2609.5, andrustc 1.100.0 (0ef1bc386 2026-11-09). Cargo used unoptimized dev/test profiles with debug info and incremental compilation disabled.cargo build --workspaceandcargo test --workspace --no-runboth exited 0 outside the GPU lock.cargo test -p xcl --lib pipelines::tests::shards_split_the_pipelines_without_overlap -- --show-outputreported 1 passed, 0 failed, 0 ignored, and 839 filtered out outside the GPU lock.cargo test --workspace --no-fail-fast -- --test-threads=4 --show-outputviaInvoke-ArcTest.ps1under the A770 lock exited 101. Across 20 target summaries, Cargo reported 849 passed, 18 failed, 42 ignored, with 0 measured and 0 filtered out. The shard unit test passed in this pass too.CreateComputePipelineStateerror0x80070057. The other four were assertion failures for FMA overflow, implicit-LOD sampling,v_add_f16high-half preservation, and whole-wave pixel reductions. Thee2etarget had one failure intest_title_runs_and_game_folder_is_untouched. The dynamic depth-bias check (#94) produced blue where it expected green.SKIPPEDentries in its passed count. The skipped paths provide no coverage.L:\XclTooling\neon-slot-4\tmp\pr1826-suite.log.Not tested
origin/main. The regression status of the failures is undetermined.scripts/smoke.ps1regression comparison on main and PR head, end-to-end execution with concurrent--shardprocesses, and AMD or NVIDIA verification.XCL_SAMPLE_AWC,XCL_SAMPLE_RPF, andXCL_SAMPLE_TTPFand for missing audio or system XGameRuntime support.AI use
Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified the counts against
pr1826-suite.logand published this report.@DavidM1911 on GitHub · 2026-11-26 06:27 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
@Kalmarv on GitHub · 2026-11-26 08:43 UTC · original · edited 2026-11-26 09:09 UTC
xcl pipelines, at this PR's head7ae2bb71: the graphics arm ofwarm_once(crates/xcl/src/hle/d3d12x/real.rs:5507) builds the pipeline and drops it without keeping agfx-<key>driver blob. Only the compute arm writesdriver_cache. So a replay's graphics coverage lives only in the driver's own shader cache, and that cache evicts once it is full.Case (RTX 5070 Ti, driver 610.74, a retail title, this PR and #759 merged with main
b49be18and other PRs): the replay made 3797 pipelines and left 0gfx-*blobs. A title run after other precompiles had filled the 22.5 GB driver cache rebuilt 440 graphics pipelines at >= 250 ms each (709.8 s of driver time, 56.4 s of it on title threads; 0 frames from 73 to 168 s).With the fix below and nothing else changed (same tree, same env, the journal replayed again into a copy of the same cache), the replay kept 452 more
gfx-*blobs, and they covered all 440 of those pipelines. In the title run, 0 graphics builds took >= 250 ms (was 440), 5 driver builds ran after 70 s (was 1244), and fps over the title's opening sequence (80-370 s) went from 0.45 to 0.69. That run ended at 367 s with an access violation ingpu::tiling::Chain::detile_level<title_textures::subresources: the known title-texture read racing a decommit (#751 / #484), outside the replay path.Suggested fix: in the graphics arm, compute
graphics_blob_key(©, &vs_dxil, ps_dxil.as_deref(), rect_gs.as_deref(), &samplers)before the build. Return early whendriver_cache::graphics_pathexists. Otherwisedriver_cache::keepthe made pipeline'sGetCachedBlob()there, skipping it when the rect-list GS was dropped, as the compute arm andtranslated_graphics_psodo. 19 lines; it applies to7ae2bb71as is andcargo check -p xclpasses. The commit:github.com/Kalmarv/xcl@7f6d3424e4AI use: found, patched and measured with Claude Code (Claude Opus 5.5); the numbers are from our runs.
@VolenNakov on GitHub · 2026-11-26 14:42 UTC · original
@Kalmarv thank you, that was the gap. Your commit is in as
5988731, cherry-picked from7f6d342with your authorship, and the description lists it.I had been running it locally since your comment. On an RTX 4060 Ti 16 GB, a replay of the retail title's journal with four
--shard k/4processes made 55,973 graphics pipelines with 0 failed and kept 3,515gfx-*blobs. The next title run had 1 cold graphics compile, against 72 in a run before the replay. On the new head,cargo test -p xcl --lib -- pipelines driver_cache: 11 passed, 0 failed.AI use: Claude Code (Claude Opus 5.5) applied the commit, ran the tests and wrote this.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.