Repository navigation
D3D12.X: XCL_RT_LEAVE_OUT leaves out named compute programs while rays cannot hit - #3026
VolenNakov wants to merge 7 commits into
Conversation
|
@VolenNakov Thanks for carrying the attribution over. The opt-in name matching fits the experiment. Since the title builder can become active during a run, the structure check is important; keep testing the point where a valid root first appears and how that changes the skip decision. |
|
Test on Same build, same save, warm caches, 600 s each, the switch the only difference (two fragments, derived from the rule in another project's
So it does what it says here: the cold-compile load of those programs disappears almost entirely (988 s → 7 s of driver time in 10 minutes) and the world gets somewhat faster. The gain in presents is smaller than your +32 %, which fits a card that is GPU-bound elsewhere. Not tested: the picture (the world is black on this machine on every build, see #505, so I cannot say whether leaving the programs out changes it), a cold cache, a run longer than 10 minutes, whether an acceleration structure ever gets a root node here (the warning did not appear in the log), AMD. Numbers are from the logs of these two runs. AI use: Claude Code (Claude Fable 5.2) ran the tests and wrote this; a Claude Sonnet 5.5 sub-agent fitted the diff. |
|
@throny The 988-to-7-second driver-time change is a strong result for the |
|
Test report for Tested
Not tested
AI use: Claude Code (Claude Opus 5.5) built the commit, ran the runs on this machine and wrote this report; Claude Fable 5.2 rechecked it against the logs. |
|
@pvfreis These four exact-head runs give us a cold-start reference. The switch completed 444 and 504 translated compute pipelines versus 312 and 307 with it off. World entry, image quality and world frame rate are still open on this setup. I’ll keep those numbers tied to the 600-second startup window. |
|
Rerun on the new head
Rerun on the new head
Same RTX 3060 (driver 610.88), Rust 1.100.0, debug. Rerun on the new head
Same RTX 3060 (driver 610.88), Rust 1.100.0, debug. Rerun on the new head
Same RTX 3060 (driver 610.88), Rust 1.100.0, debug. Update, on the enabled path TaynanGT asked about: a scratch GPU check (never pushed) through the Scratch test in
With the switch set, a left-out program gets the dummy program with the desc's root signature. When the desc has none, the driver refuses it, while the translated program brings its own. A title whose console containers carry their root signature and that passes none would get a failed create for each program left out. I do not know whether #505's title creates its pipelines that way. The Full workspace suite on NVIDIA (the PR's Tested has only Tested:
From reading: with Not tested: a title, the switch set (on this machine), a release build, AMD / Intel. AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report. |
|
@fromthemoonx The 1,464 passing tests on the merged tree cover the workspace integration. The gap you found is the enabled path. A synthetic check that skips one named compute pipeline and compiles a second one would exercise the PSO and preload entry points before another gameplay comparison. |
|
Update for head Tests (
Not tested on this head: a retail run (the runs below are for AI use: Claude Code (Claude Opus 5.5) ran the builds and tests on my machine and wrote this update. Tested on AMD / Linux: Tests (on
Retail title, A/B of the switch (the title of #505, same binary, only
So on this card it cuts the compute compiles by about three quarters and the intro starts 6–8 s earlier. It does not raise the present rate in the intro: fewer presents between 100 and 200 s with the switch on (it may only be the title being further along by then; 3 runs each cannot tell). The sparse-queue warnings came only in runs with the switch on, but earlier runs without this PR had a few too (up to 27), so I don't count them as caused by it. Cold cache, switch on, 1 run (empty XCL shader cache, the same state otherwise): the startup preparation took ~43 min; the leave-out lines came only in its last ~40 s (2,539–2,547 s), and until then it wrote cache files at the same pace as Not tested
AI use: Claude Code (Claude Opus 5.5) ran the builds, tests and runs on my machine and wrote this report. |
|
@ClosetPie107 The AMD runs show earlier intro drawing and fewer compiles. The later presents and sparse-queue warnings are the reasons to compare the same scene rather than the same wall-clock window. The cold-cache run also pins down how late the skip begins during preload. |
…ecompile Two console compute programs, one holding a test fragment in its container: through the CreateComputePipelineState hook (a child process with the switch set) the named one gets the dummy console pipeline and is not translated, the other is translated; `xcl shaders --precompile --pipelines` makes one pipeline and passes one over. Asked for in review of xcl-dev#3026. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
721121b to
358e420
Compare
|
Thanks @throny, @pvfreis, @fromthemoonx, @ClosetPie107 for the runs, and @TaynanGT for the review. Updated:
On the cold preparation (@ClosetPie107's "the leave-out lines came only in its last ~40 s"): the skip applies to each record as the loop reaches it. In this title's pack the ray-tracing records come late in the loop's order, so the saving shows at the end, not as a lower pace earlier. A cold run of mine on @TaynanGT, on comparing the same scene once a structure can be used: agreed, that is the check that would show a picture change. No run here has reached a point where a structure gets a root node (runs 82–87 here, 10–180 min, no warning), so I can't make that comparison yet. When the warning fires in someone's run, the frame dumps from just before and after it, with and without the switch, are the comparison to make. Not tested (unchanged): the picture (grey or black world on the testers' NVIDIA trees); a scene with built structures; a cold run with the switch off as a baseline. AI use: Claude Code (Claude Opus 5.5) wrote the test, rebased, ran the tests and wrote this reply. |
|
@VolenNakov That covers the enabled path I asked for. The hook and precompile both skip the named program and still build the other one. The picture comparison can wait for a run that reaches a usable root on the same revision. A cold off/on pair would give the preload saving its own measurement. |
|
@Lakanya thanks, that is a real limit of the check, and your GPU readback is the better measurement. How it applies to this PR, which targets
Your readback also answers the gate itself: bottom levels get bounds and a node count, but byte I'll add a line to the PR description: on trees whose structures can live outside the coherent window, the warning needs a GPU readback. AI use: Claude Code (Claude Opus 5.5) checked the code paths and wrote this reply. |
|
@VolenNakov The coherent-window check answers the question for |
…when the desc has none A title whose console containers carry their root signature can create a compute pipeline with none in the desc. The translated program brings XCL's, but the dummy a left-out program gets kept the desc's (none), and the driver refused the pipeline with E_INVALIDARG. It now gets XCL's ABI root signature (it binds nothing; its dispatches are skipped). The enabled-path test covers a desc without a root signature and fails without this change with 0x80070057. Found by @fromthemoonx in review of xcl-dev#3026. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@fromthemoonx thanks, the null-
AI use: Claude Code (Claude Opus 5.5) wrote the fix and the test, ran them on my machine and wrote this reply. |
…s cannot hit Port of Vice-Tay's ray-tracing leave-out (crates/victory-gpu/src/pipeline/make.rs, `left_out`, commit 1f69d67; added in codec_d's 8cc31ab), GPL-3.0-or-later. The programs are named by the user's fragments (XCL_RT_LEAVE_OUT), not by names in the source. A watch of the acceleration structures the title's views name warns once when one gets a root node. The shader preparation and --precompile pass the programs over. Part of xcl-dev#3011 (C3). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ecompile Two console compute programs, one holding a test fragment in its container: through the CreateComputePipelineState hook (a child process with the switch set) the named one gets the dummy console pipeline and is not translated, the other is translated; `xcl shaders --precompile --pipelines` makes one pipeline and passes one over. Asked for in review of xcl-dev#3026. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…when the desc has none A title whose console containers carry their root signature can create a compute pipeline with none in the desc. The translated program brings XCL's, but the dummy a left-out program gets kept the desc's (none), and the driver refused the pipeline with E_INVALIDARG. It now gets XCL's ABI root signature (it binds nothing; its dispatches are skipped). The enabled-path test covers a desc without a root signature and fails without this change with 0x80070057. Found by @fromthemoonx in review of xcl-dev#3026. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…RT_LEAVE_OUT leaves out main's new corpus preparation (shaders/pso_corpus.rs) builds compute pipelines through its own call; a program the title's pipeline would leave out is not built there either, as in the pack precompile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2217336 to
94fdaa3
Compare
|
Ran the ray leave-out tests at Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build. All four unit tests pass, and the end-to-end test passes: through the Not tested: a real title with named fragments, the structure watch, a paired smoke run, the full workspace suite and its seven known failures, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data. AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used. |
|
@TaynanGT the cold off/on pair you suggested: with the switch, a first-time preparation of the whole pack took 2 h 17 min; without it, over 5 h 3 min, and it was still building ray-tracing pipelines when I stopped it. So the off time below is a lower bound. Setup
Not tested: more than one pair; the off run to its end; a cleared driver cache; another machine. AI use: Claude Code (Claude Opus 5.5) ran the pair on my machine and wrote this. |
main's acceleration-structure SRV path (view_want, XCL_BVH_EMPTY, bvh_want) is kept; the structure is noted for XCL_RT_LEAVE_OUT inside it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for running the cold comparison. Saving at least 2h46m even with the driver cache favoring the off run is a strong result. The unfinished off run is a lower bound, not a completed benchmark pair. |
|
The red
I can't re-run checks on this repository. Could someone with the rights re-run the failed job? AI use: Claude Code (Claude Opus 5.5) read the CI log and wrote this; I checked it. |
|
@fromthemoonx thank you for the rerun on @Aniseto your Blackwell report was on AI use: Claude Code (Claude Opus 5.5) drafted this; I checked it. |
|
Re-ran the ray leave-out tests at System
Results
What this adds Not tested AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - ran the commands above on this machine and wrote this report; no game data was used. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Closest open overlap is #2527 ( AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
|
merge-check AI-written and posted by Foniass without a human check of each point. |
Part of #3011 (C3). Ports Vice-Tay's ray-tracing leave-out: while a title builds no acceleration structure, its ray hit-shading and ray-start compute programs have nothing to do, so they are not translated, compiled or dispatched. Off by default.
XCL_RT_LEAVE_OUT=<fragment>[,<fragment>…]: a console compute program whose shader container holds one of the fragments (at least 6 bytes each) gets the dummy program that an untranslatable console shader already gets, so its dispatches are skipped. The shader preparation andxcl shaders --precompilepass it over. The fragments come from the user, and XCL's source names no title's programs. The program names are in the containers' debug data:xcl rpf <pack> --find <name>lists them.Why it is safe to leave them out, and how XCL notices when it no longer is: XCL keeps the acceleration structures the title's views name (
D3D12_SRV_DIMENSION_RAYTRACING_ACCELERATION_STRUCTUREin the coherent window). Every 300 frames it checks their headers. When one gets a root node (header dword0x30, asgpu/bvh.rsreads it), it warns once that rays can hit now and that the setting should come off for this title. Onmaina structure outside the coherent window is given to the shaders as an empty one, so it can produce no hits either.Upstream and credit: Vice-Tay (https://github.com/TaynanGT/Vice-Tay, GPL-3.0-or-later)
1f69d67,crates/victory-gpu/src/pipeline/make.rs,left_out(VICTORY_RT_RESOLVE,VICTORY_ACTIVATE_RAYS,VICTORY_BVH_BUILDER), added there in codec_d's8cc31ab. Thanks to codec_d and @TaynanGT, and to @throny for the candidate list. Changes from upstream:What is in it (four commits: the change, +224 / −2; its end-to-end test, +103; a fix found in review, +21 / −8; and the staged corpus, +4 / −1)
gpu/rt_leave_out.rs(new): the fragments, the match, the counters and the structure watch, with the provenance header. Unit tests:fragments_are_trimmed_and_short_ones_dropped,a_container_is_matched_by_any_fragment_anywhere,a_header_without_a_root_has_none,a_built_structure_from_the_builder_has_a_root(the watch reads the root XCL's own BVH builder writes).hle/d3d12x/real.rs:dev_create_compute_psotakes the existing failed-console-shader path for a program left out (dummy program,note_console_compute), without the fallback warning. The acceleration-structure SRV path notes the structure.hle/d3d12x/present.rs: the check, next to the 300-frame rate line.shaders.rs: the preparation / precompile loop passes the programs over and prints how many.tests/gpu_compute_e2e.rs:rt_leave_out_skips_the_named_program_and_builds_the_other. Two console compute programs, one with a test fragment in its container. Through theCreateComputePipelineStatehook (a child process with the switch set), the named one gets the dummy console pipeline and is not translated, and the other is translated. Throughxcl shaders --precompile --pipelines, 1 pipeline is made and 1 program passed over.E_INVALIDARG. The dummy now gets XCL's ABI root signature in that case; it binds nothing, and its dispatches are skipped. The end-to-end test covers that desc and fails without the fix with0x80070057.shaders/pso_corpus.rs:main's staged pipeline corpus (new since the first version of this PR) builds compute pipelines through its own call; a program the switch leaves out is not built there either.README.md: the switch.THIRD_PARTY.md: the Vice-Tay entry.Tested
cargo test --release --workspace --no-fail-fast -- --test-threads=4at the head94fdaa31(onmaine429936c): 2,133 passed, 7 failed, 48 ignored. All 7 also fail onmaine429936con this machine, run the same way:gpu::dxil::module::split::tests::dispatch_chain_oversized_loop_matches_whole,…dispatch_chain_wave32_live_loops,…dispatch_chain_wave64_live_loops_and_exchange,gpu::recomp::heap_window_tests::gpu_heap_flat_reads_match_guarded_and_root_output,gpu::recomp::tests::gpu_compute_mode_dispatch_abi,gpu::recomp::tests::gpu_float_cas_uses_ieee_equality, andtest_title_runs_and_game_folder_is_untouched. SKIPPED GPU tests: 29 lines (21 "no wave64", 3 per-lane forms refused, 3 without the D3D12 debug layer, 1 without heap windows, 1 PSO measurement). The new tests pass. The end-to-end test fails if the switch is ignored (left_out_countstays 0).ea3b5e4d, Series X profile). A local probe, not in this PR, logged the structures the views name every 300 frames for 900 s. The title names 5 acceleration structures from about 170 s in the world, and none ever has a root node, so every ray misses. One disassembled hit-shading program contains noimage_bvh*_intersect_ray: these programs shade hits that tracing programs found. They do not trace.main08db802+ D3D12.X: compute pipelines not used for a while are released on NVIDIA #2526, Recompiler: split wave64 compute groups of several waves across dispatches #2097, D3D12.X: an ExecuteIndirect of a split program runs its pieces #2404, xcl run:xcl nvprofileputs xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2590, D3D12.X: a bind never builds a cold pipeline on the title's thread #2615, Console CPU instructions: monitorx / mwaitx are rewritten in place at their first fault #2618 (+ voiceovarian1-max'se9f4c457), D3D12.X: title texture reads outside the coherent window use the safe copy #751, D3D12.X: a 3-D texture XG cannot size is taken at its texels' bytes #2753, D3D12.X: zero recycled vram::Pages tiles before reuse #2759, Shaders: xcl pipelines compiles a run's queued pipelines outside the title #759 / Shaders: xcl pipelines --shard k/n splits the journal over processes #1826, D3D12.X: UMA windows in a driver heap on NVIDIA, 4.9x FPS (0.62 -> 3.03) #2844, D3D12.X: XCL_WATCH_TRAP=1 leaves memory nobody writes out of the write-watch looks (off by default) #2934, D3D12.X: a view's padding does not make a second texture #2762, with the first commit cherry-picked. Env:XCL_DIRECT_DXIL=all XCL_TEXTURE_LEVEL_PAGES=1 XCL_SPLIT_INDIRECT_ROUNDS=2 XCL_DIRECT_SPLIT_INSTRUCTIONS=0 XCL_WATCH_TRAP=1, 2 GiB shader heap (xcl run:xcl nvprofileputs xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2590), warm caches, 900 s, A pressed from 6 to 300 s. The fragments named this title's ray hit-shading programs (1,004 records in its pack) and its ray-start program.nvidia-smievery 5 s, 200–880 s)xcl shaders <the pack> --precompile --pipelinesfrom an empty XCL cache at94fdaa31. With the switch: 8,232 s, 1,005 compute programs passed over, 1,682 pipelines. Without it: more than 18,167 s, still building ray-tracing pipelines when stopped. The switch ran first, so the driver cache favoured the run without it; the saving is a lower bound.nvidia-dev), @pvfreis (RTX 3060,main, cold cache), @fromthemoonx (workspace suite) and @ClosetPie107 (RX 9070, Linux).Regression run
scripts/smoke.ps1 -Game <the title> -Seconds 60for both, rerun after mergingmain(493dbd3d) into this branch, the same title (ea3b5e4d), withXCL_PREPARE=0for both (without itmain's startup preparation runs cold for this build, for hours, beyond the script's startup limit), after an unrecorded warm-up run, so both start from the same cache. The switch is unset: this is the default path, meant to be unchanged.Why 60 s and not 180 s: a 180 s pair on earlier builds of both showed the PR with 2,294 frames and 30.4 GB of commit against
main's 4,573 and 21.2 GB. The logs show both at 28–30 fps through the intro; the PR run (and the warm-up, with the same build) left the intro for the world loading at ~80–100 s andmain's at ~170 s, depending on when the scripted presses skip the cutscene. The loading runs at ~6 fps and fills memory, so at 180 s the two runs compared different parts of the game. At 60 s both are in the intro.main:
PR:
Peak commit differs this time: the PR's warm-up and recorded runs peaked at 18,650 and 17,333 MB,
main's three runs of493dbd3d(warm-up, one recorded run started from the wrong folder, this one) at 15,187-15,408 MB. Both builds were still in the intro at 60 s (~60 presents per 2 s). The previous pair (9d52ec26vsd8bd9a38) peaked at 15,222 and 15,308 MB; one pair can't tell whether the difference is the merge or the run.Not tested
nvidia-dev'sview_wantpath,XCL_COHERENT_HEAPS=sparse). There the GPU's writes are not in the memory the check reads, so it needs a GPU readback before the switch is used on such a tree (@Lakanya on Newer retail title (TitleID 7952987A): reaches world loading, then the title's GPU watchdog ("GPU Loc Sig") after ListX #101 stub #505).mainalone (the game runs used the tree above).AI use
🤖 Generated with Claude Code