Repository navigation
D3D12.X: XCL_RT_LEAVE_OUT leaves out named compute programs while rays cannot hit - #3026
VolenNakov wants to merge 2 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 Vice-Tay'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
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. |
|
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. |
…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>
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 |
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 (two commits: the change, +224 / −2, and its end-to-end test, +103)
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.README.md: the switch.THIRD_PARTY.md: the Vice-Tay entry.Tested
cargo test --release --workspace -- --test-threads=4at the head358e4207(onmain6089122a): 1,470 passed, 0 failed, 47 ignored. 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)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 180for both, the same title (ea3b5e4d) for the same time, withXCL_PREPARE=0for both. Without it,main's startup preparation runs cold for this build, for hours, beyond the script's startup limit. An unrecorded warm-up run came first, so both start from the same cache. The switch is unset, so this is the default path, which is meant to be unchanged.main:
PR:
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