D3D12.X: XCL_RT_LEAVE_OUT leaves out named compute programs while rays cannot hit #3026
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3026"
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 VolenNakov on 2026-11-27T13:47:41Z.
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+ #2526, #2097, #2404, #2590, #2615, #2618 (+ voiceovarian1-max'se9f4c457), #751, #2753, #2759, #759 / #1826, #2844, #2934, #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 (#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 #505).mainalone (the game runs used the tree above).AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by TaynanGT on 2026-11-27T13:51:52Z.
@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.
Imported from ivall/xcl. Originally posted by throny on 2026-11-27T14:38:28Z.
Test on
nvidia-dev, RTX 4080 16 GB (driver 621.40, 2 GiB shader-heap profile), i9-12900K, Windows 11 26300. Your diff is againstmain, so I fitted its code by hand ontonvidia-dev3f39671dwith my other test patches (the README / THIRD_PARTY hunks left out; in that tree the compute pipeline body lives incompute_pso, andnote_structurewent inside the branch that hasXCL_BVH_EMPTY). The PR's 4 unit tests pass there. Not your exact head, so take it as a functional check, not as a test of721121b1.Same build, same save, warm caches, 600 s each, the switch the only difference (two fragments, derived from the rule in another project's
make.rs;XCL_COHERENT_HEAPS=sparse XCL_SPARSE_SYSMEM=1 XCL_TEXTURE_LEVEL_PAGES=1 XCL_CS_PSO_WAIT_MS=200 XCL_TWO_PASS_MB=3072):XCL_RT_LEAVE_OUTsetSo 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.
Imported from ivall/xcl. Originally posted by TaynanGT on 2026-11-27T14:49:13Z.
@throny The 988-to-7-second driver-time change is a strong result for the
nvidia-devadaptation. Thanks for pinning the revision and scope. Before recommending the switch, I’d compare the same visible scene after a ray structure can be used. That’s the check that can show whether a skipped program changes the picture.Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-27T14:59:53Z.
Test report for
721121b1onmainalone (one of the gaps in Not tested), empty DXIL cache, 12 GB card. The title did not reach the world on this tree in any run, so this says nothing about world frame rates; what it shows is the switch on the cold start.Tested
721121b1(onmain06f90c19, nothing else applied), no uncommitted changes.XCL_PREPARE=0 XCL_NETWORK=0 XCL_ACTIVITY=1, an empty DXIL cache for every run, the driver's own shader cache not cleared (the same 1,802 files before each run), A pressed every 4 s from 6 to 300 s, 600 s each, nobody at the controller. Four runs of one build in the order off, on, on, off; the switch the only difference. On: the two program-name fragments of Vice-Tay'sleft_out.ExecuteIndirectcounts out of rangeNot tested
XCL_PREPAREunset); a tree with the other PRs of your runs.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.
Imported from ivall/xcl. Originally posted by TaynanGT on 2026-11-27T15:08:55Z.
@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.
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-11-27T15:09:51Z.
Note (2026-12-02): this report is on
9d52ec2. The head is nowd59642d7(main493dbd3dmerged in). I have not rerun on it. Foniass's merge-check on that head (https://github.com/xcl-dev/xcl/pull/3026#issuecomment-7311467340) says not yet: the rays-can-hit check cannot see the acceleration structuresmainnow records in GPU-only memory, and the branch needs a rebase.Rerun on the new head
9d52ec2(maind8bd9a3merged in; the four commits are unchanged): passes on NVIDIA, and the hand-resolved conflict inreal.rskeeps the switch's hook.cargo test --workspace --no-fail-fast -- --test-threads=4,9d52ec2SKIPPEDlines.maind8bd9a3here: 2618 passed, 0 failed, 49 ignoredrt_leave_out_skips_the_named_program_and_builds_the_otheralonegit merge-treeof94fdaa3andd8bd9a3conflicts indev_create_srv_inner(the raytracing-structure SRV). The merge keepsmain's new body (view_want,XCL_BVH_EMPTY,bvh_want::view_made) and callsrt_leave_out::note_structure(va)where a real structure is written. So withXCL_BVH_EMPTY=1no structure is noted, which fits rays that cannot hit. Same RTX 3060 (driver 610.88), Rust 1.100.0, debug.Rerun on the new head
94fdaa3(rebased ontomaine429936, plus thepso_corpus.rscommit): no new failure on NVIDIA. The 9 that fail aremain's own here (#3093). No test reaches the new corpus skip.cargo test --workspace --no-fail-fast -- --test-threads=4(head = merged)SKIPPEDlines. The 9 are the 3e2etitle tests and 6 split-wave64 GPU tests listed in #3093rt_leave_out_skips_the_named_program_and_builds_the_otheraloneif !rt_leave_out::left_out(&code)inpso_corpus.rsreplaced byif trueSame RTX 3060 (driver 610.88), Rust 1.100.0, debug.
Rerun on the new head
2217336: the no-root-signature case is fixed on NVIDIA too. The extended test passes, and with the fix's block disabled it fails with0x80070057, as in my scratch run.cargo test --workspace --no-fail-fast -- --test-threads=4,2217336(based on6089122)SKIPPEDlinesmain2c717a0(#3043, merges clean)SKIPPEDlinesrt_leave_out_skips_the_named_program_and_builds_the_otheralone, merged treeif left_out && … pRootSignature … == 0block disabled (scratch)compute PSO rejected (0x80070057), the fallback version tooSame RTX 3060 (driver 610.88), Rust 1.100.0, debug.
Rerun on the new head
358e420(rebased ontomain6089122, plus the enabled-path test): passes on NVIDIA, and the new test fails when the hook ignores the switch. ThepRootSignature-null case below is unchanged:real.rsandrt_leave_out.rsare the same as on721121b.cargo test --workspace --no-fail-fast -- --test-threads=4(head = merged)SKIPPEDlinesrt_leave_out_skips_the_named_program_and_builds_the_otheraloneleft_outforced tofalseindev_create_compute_pso(scratch)the named program is left outSame 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
CreateComputePipelineStatehook. WithXCL_RT_LEAVE_OUTset, the named program is left out and the next one is still translated and runs correctly. One case differs: with no root signature in the desc, the left-out create fails withE_INVALIDARG.Scratch test in
gpu_compute_e2e.rson721121b, same RTX 3060. The test runs itself as a child process, because the switch is read once per process. Two console programs (the wave64 mirror program fromconsole_wave64_compute_through_the_pso_hook_dispatch_and_read_back), one with the marker bytesScratchLeaveOutMarkerappended to its container. 3 runs each:XCL_RT_LEAVE_OUT=Other_Fragment,ScratchLeaveOutMarkerleft_out_count()1,translated_pipelines+0, not inTRANSLATED_COMPUTEleft_out_count()stays 1translated_pipelines+1)pRootSignaturenull, switch set (2 runs)CreateComputePipelineStatereturnsE_INVALIDARG(0x80070057)pRootSignaturenull, switch unset (2 runs)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
nvidia-devandmaintitle runs above do not mention failed creates.Full workspace suite on NVIDIA (the PR's Tested has only
cargo test -p xcl --lib): passes at the head and merged onto currentmain. The 4 new tests ran and passed.Tested:
721121b(its base ismain06f90c1, so head = merged then), and721121bmerged onto currentmain81693f0(#1824, merges clean). RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, 16 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug.cargo test --workspace --no-fail-fast -- --test-threads=4721121bSKIPPEDlines (no wave64, refused per-lane forms)721121b+main81693f0SKIPPEDlinesFrom reading: with
XCL_RT_LEAVE_OUTunset,rt_left_outreturns before it reads the desc, andnote_structure/check_structuresreturn at once, so the default path is unchanged. No test reaches the switch's shipped paths: the leave-out indev_create_compute_psoand the skip inprecompile. The new tests cover the helpers (fragments_of,holds_any,root_of).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.
Imported from ivall/xcl. Originally posted by TaynanGT on 2026-11-27T15:18:42Z.
@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.
Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-27T15:31:37Z.
Update for head
358e4207(rebased ontomainf9a0cb80; earlier results for721121bbelow).git range-diff: theXCL_RT_LEAVE_OUTcommit's code is unchanged apart from comments; the head adds the #880 commit (now inmain) and a tests commit. Same machine and setup as below (RX 9070 16 GB / Mesa 26.3.1 RADV / Proton Experimentalexperimental-11.0-20261112, vkd3d-proton masterec207194without the allocator / command-listlpVtblchecks, DXC 1.9.2609.5, Rust 1.96.0,x86_64-pc-windows-gnudebug build). The head itself, withmainf9a0cb80the same session as the baseline.Tests (
XCL_REQUIRE_GPU=wave64,--test-threads=1)cargo test -p xcl --lib -- rt_leave_out: 4 passed, 0 failed, 0 ignored.cargo test -p xcl --lib -- recompiler_statistics_count_wave32_by_the_header_flag: 1 passed, 0 failed, 0 ignored.cargo test -p xcl --test gpu_compute_e2e -- rt_leave_out: 1 passed, 0 failed, 0 ignored (rt_leave_out_skips_the_named_program_and_builds_the_other, on the GPU).--skip compositor_blends_ui_plane_over_scene_plane --skip failed_restore_stops_before_importing_an_unbacked_window --skip grooming_leaves_a_window_under_1_gib_only_its_hole(the first loses the RADV device here, the other two run out of memory under Wine): 1328 passed, 9 failed, 27 ignored;mainf9a0cb80lib the same session: 1323 passed, 9 failed, 27 ignored (--test-threads=1and two--test-threads=4runs). All failures are amongmain's. In the 4-thread workspace run the lib binary ended partway with a device removal (0x887a0005), whichmainalso does here (1 of its 3 four-thread runs). The other binaries fail the same 3 tests as onmainhere (e2e,pls_quota,predication_e2e).d3d12_resource_and_sync: 3 passed, 0 failed.Not tested on this head: a retail run (the runs below are for
721121b, whose switch code is the same); native Windows, NVIDIA / Intel.AI use: Claude Code (Claude Opus 5.5) ran the builds and tests on my machine and wrote this update.
Tested on AMD / Linux:
721121b(RX 9070 16 GB, RDNA4, Mesa 26.3.1 RADV; Ryzen 5 9600X, 32 GB; CachyOS, Proton Experimentalexperimental-11.0-20261112with vkd3d-proton masterec207194;x86_64-pc-windows-gnucross build)Tests (on
721121bitself)cargo test -p xcl --lib -- rt_leave_out --test-threads=1: 4 passed, 0 failed, 0 ignored.cargo test -p xcl --lib -- --test-threads=4 --skip compositor_blends_ui_plane_over_scene_plane --skip failed_restore_stops_before_importing_an_unbacked_window --skip grooming_leaves_a_window_under_1_gib_only_its_hole: 1,323 passed, 8 failed, 27 ignored. All 8 also fail onmainhere (main83b00818: 9 failures, the same 8 plus one inacphal). Skipped tests:compositor_…: RADV loses the device in it on this machine.uma_drivertests: under Wine their child processes, which reserve the free address space, use about 23 GB each, and when both run at once the machine runs out of memory.Retail title, A/B of the switch (the title of #505, same binary, only
XCL_RT_LEAVE_OUTdiffers). The binary is this commit cherry-picked ontomain83b00818(onlyTHIRD_PARTY.mdconflicted; I keptmain's), because06f90c19changes comments inrecomp/emit.rsand so the shader cache identity, and filling the cache again here takes over 40 minutes. Release build, warm cache,XCL_DIRECT_DXIL=1 XCL_PREPARE=1 XCL_PSO_PRELOAD=1 XCL_PSO_WAIT_MS=50 XCL_TEXTURE_LEVEL_PAGES=1 XCL_COHERENT_MB=1024, 300 s,Apressed every 10 s, each run from a fresh copy of the same state, off and on alternating. The fragments named the ray hit-shading and ray-start programs; the title stays in the intro the whole time.#1024)sparse: the queue has not reached fence value … after 5 sSo 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
main's cold runs here this morning (~14,300 vs 14,100 at 1,200 s). The first present came at 2,583 s, then the title crashed ~75 s later inucrtbase.dll+0x171d9(a write into title memory), which also happens here without this PR. No "has a root node" warning.Not tested
main's cold runs here were stopped after 20 min); more than 3 runs per arm; Windows; NVIDIA.AI use: Claude Code (Claude Opus 5.5) ran the builds, tests and runs on my machine and wrote this report.
Imported from ivall/xcl. Originally posted by TaynanGT on 2026-11-27T15:54:07Z.
@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.
Imported from ivall/xcl. Originally posted by VolenNakov on 2026-11-27T17:27:57Z.
Thanks @throny, @pvfreis, @fromthemoonx, @ClosetPie107 for the runs, and @TaynanGT for the review. Updated:
main6089122a. The only conflict was the precompile loop, wheremaindropped--used-only; the leave-out check sits in the same place as before.rt_leave_out_skips_the_named_program_and_builds_the_otherintests/gpu_compute_e2e.rs. Two console compute programs, one with a test fragment in its container:CreateComputePipelineStatehook, in a child process with the switch set: the named one gets the dummy console pipeline (is_console_compute, notis_translated_compute,translated_pipelinesunchanged,left_out_count1), and the other is translated;xcl shaders --precompile --pipelines: 1 pipeline made, 1 program passed over.cargo test -p xcl --lib: 1,340 passed, 0 failed, 27 ignored;cargo test -p xcl --test gpu_compute_e2e: 8 passed, 0 failed, including the new test;left_out_countstays 0.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
nvidia-devd1be8103(the diff fitted there, with #2987) showed the same: about 1 h 52 min for 26,503 records, leave-out lines from 6,625 s on. I have no cold run with the switch off to compare yet.@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.
Imported from ivall/xcl. Originally posted by TaynanGT on 2026-11-27T17:29:28Z.
@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.
Imported from ivall/xcl. Originally posted by VolenNakov on 2026-11-27T17:40:33Z.
@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
main:mainthe warning reads memory the GPU writes into directly.note_structureis called only wheredev_create_srvfinds the structure inside the coherent window (uma::get().contains(va)). Onmainthat window is system memory the GPU reads and writes in place (#2844's CUSTOM write-back heap), so a root the builder writes there is whatcheck_structuresreads.mainanyway: that branch writes an empty BVH descriptor (… is not in unified memory – writing empty BVH descriptor), and nothing is noted. So onmain, either the warning can see the root, or the shaders are given an empty structure. Leaving the programs out cannot hide hits in that case.nvidia-devyour point holds. There,view_wantmakes a structure in a GPU view count as present, and its tiles can live in a sparse window whose GPU writes the CPU does not see. My runs 86–87 here were on such a fit (nvidia-devd1be8103+ #2987,XCL_COHERENT_HEAPS=sparse), so their silent warning is no evidence. Themain-based runs in the description (82–85) are, for the reason above. Before this goes tonvidia-dev,check_structuresshould read the header through a GPU readback, like your diagnostic does withsparse::readback_now.Your readback also answers the gate itself: bottom levels get bounds and a node count, but byte
0x30stays0xFFFFFFFFin every structure, and the top level stays nearly empty. So on that tree too the rays have no root to start from, and leaving out the programs that would shade their hits changes nothing.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.
Imported from ivall/xcl. Originally posted by TaynanGT on 2026-11-27T17:44:53Z.
@VolenNakov The coherent-window check answers the question for
main. The sparse path needs evidence from the GPU side before the warning can stand in for a scene comparison there. The enabled-path test still covers the skip decision, and you can keep that result alongside the scope note in the PR.Imported from ivall/xcl. Originally posted by VolenNakov on 2026-11-27T21:52:43Z.
@fromthemoonx thanks, the null-
pRootSignaturecase was a real hole: fixed in22173361.rt_leave_out_skips_the_named_program_and_builds_the_othernow also creates the named program from a desc without a root signature. It passes with the fix, and without it fails with0x80070057, as in your scratch run.cargo test --release --workspace -- --test-threads=4: 1,470 passed, 0 failed, 47 ignored. The PR's smoke block was redone on22173361(5,070 frames againstmain's 4,789 in 180 s, no removal or crash), and the description is updated.AI use: Claude Code (Claude Opus 5.5) wrote the fix and the test, ran them on my machine and wrote this reply.
Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-28T08:44:02Z.
Ran the ray leave-out tests at
94fdaa31on an NVIDIA Blackwell desktop part: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
CreateComputePipelineStatehook the named program is left out while the other is translated. I did not run a retail title withXCL_RT_LEAVE_OUTset, so the structure-watch warning was not exercised. The thread has runs on RTX 4080, RTX 3060 and RX 9070, but no 5070 Ti.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.
Imported from ivall/xcl. Originally posted by VolenNakov on 2026-11-28T15:06:37Z.
@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
94fdaa31(onmaine429936c), release.xcl shaders <the pack> --precompile --pipelines: the same loop the startup preparation runs, all 26,503 records of the retail title of #505.XCL_DXIL_CACHE.time)direct DXIL fallback stage=CS reason="direct DXIL builder error: instruction after a terminator in block Block(0)"on one of the left-out programs; it fell back to the HLSL path, so the loop counts no error. With the switch, that program is not translated.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.
Imported from ivall/xcl. Originally posted by TaynanGT on 2026-11-29T11:23:44Z.
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.
Imported from ivall/xcl. Originally posted by VolenNakov on 2026-11-29T12:05:04Z.
The red
Build and teston9d52ec26(run 46256841607) is not this PR's: four ofmain's own tests inshaders::pipeline_libraryandshaders::warm_libraryfailed together.builder_deduplicates_names_and_atomically_replaces_output, got 4 entries where it expects 2 (pipeline_library.rs:414). The other three,graphics_pipeline_round_trips_through_serialized_library,mesh_pipeline_round_trips_through_serialized_libraryandcold_publish_makes_an_unchanged_corpus_reusable, then failed on aPoisonError, the lock the first one left behind. That looks like tests sharing state across test threads.main(d8bd9a38), and locally on this head:cargo test -p xcl --lib -- --test-threads=2, 2483 passed, 0 failed.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.
Imported from ivall/xcl. Originally posted by VolenNakov on 2026-11-29T12:18:21Z.
@fromthemoonx thank you for the rerun on
9d52ec26, and for checking the merge indev_create_srv_inner.@Aniseto your Blackwell report was on
94fdaa31, beforemain(d8bd9a38) was merged in. If you have time, a rerun on the current head9d52ec26would be the second report on this head. The four commits of the change are unchanged; the merge resolved one conflict, in the acceleration-structure SRV path (note_structurenow sits insidemain's new body). The redBuild and testismain's flakypipeline_librarytests (comment above), not this PR.AI use: Claude Code (Claude Opus 5.5) drafted this; I checked it.
Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-29T18:17:41Z.
Re-ran the ray leave-out tests at
9d52ec26after the merge ofmaininto the branch; this is a new response in the same thread, not an edit of my earlier report at94fdaa31: https://github.com/xcl-dev/xcl/pull/3026#issuecomment-7236774521System
Results
XCL_ADAPTER=NVIDIA cargo test -p xcl --lib gpu::rt_leave_out:: -- --test-threads=1: 4 passed, 0 failed, 0 ignored.XCL_ADAPTER=NVIDIA cargo test -p xcl --test gpu_compute_e2e rt_leave_out_skips_the_named_program_and_builds_the_other -- --test-threads=1: 1 passed, 0 failed, 0 ignored.What this adds
The same four unit tests and the same e2e test pass on the merged head, so this is the second report on
9d52ec26from a Blackwell host. It does not exercise a retail title withXCL_RT_LEAVE_OUTset or the structure-watch path.Not tested
A retail title, the structure watch, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.
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.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:22:02Z.
Triage (#1607) – head
d59642dClosest open overlap is #2527 (
XCL_REFUSE_CS): it also keeps listed compute programs from the driver and skips their dispatches, but selects them by record hash for driver compiles that never end. This PR selects them by container name fragment, adds the acceleration-structure root watch, and skips them in the precompile and staged corpus too. amd-dev already carries a version ofgpu/rt_leave_out.rs(plusXCL_RT_LEAVE_OUT_COUNT); main does not.No problems found in the diff:
compute_psotakes the existing untranslatable-console-shader dummy path, and a desc without a root signature gets the ABI root signature.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T12:39:51Z.
merge-check
base:
493dbd3dd0head:
d59642d7b4merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2905 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read the whole diff (+344/-3). With
XCL_RT_LEAVE_OUT=<fragments>set, compute programs whose names match are left out, and a check warns if rays could hit. Unset, it costs one cached check. Findings: (1) The safety check can't see the structures on current main. Main now also records acceleration structures that sit in the title's GPU-only memory (real.rs~3291-3306), which the CPU can't read (uma.rs~474).check_structuresskips those silently (rt_leave_out.rs~171), so the "rays can hit" warning can never fire; the description's argument that main gives such structures an empty one is out of date. #3521 would move build outputs to video memory too. (2) "While rays cannot hit" isn't enforced: programs are left out for the whole process and the check only warns. (3) The ray-start program is left out too. The "no root, no hits" argument covers only the hit-shading programs, so the skipped dispatches' outputs stay stale for later passes (unverified that any read them). (4) The structure list never forgets an address, so reused memory can raise a false warning. A program seen by both startup preparation and pipeline creation is counted twice. (5) The branch carries three merges of main and a separate fixup commit for the root signature; CONTRIBUTING asks for a rebase and squash. Fine: dispatch and ExecuteIndirect skips go through the existing paths (bind.rs~3772, ~4788), the null-root-signature case is fixed and tested, and the end-to-end test fails when the switch is ignored. #2527 (XCL_REFUSE_CS, by hash) overlaps. The smoke below is the unset default path, run to check the +12.5 % peak commit in the PR's own pair; the diff has no cause for it.performance: 60 s smoke of a retail title, main
493dbd3dvs this merge (d59642d7): 1670 -> 1689 frames shown (101 %; last presents per 2 s: 61 60 60), peak commit 17083 -> 17033 MB, 0 device removals, 0 crashes. Unset default path only. The first run of this merge reached 18878 MB peak commit before its lib tests hit an unrelated abort; this rerun is 17033 MB, so the +12.5 % peak in the PR's own pair looks like run-to-run variation rather than this diff.verdict: not yet: the "rays can hit" check can't see the acceleration structures main now records in GPU-only memory, so its warning can never fire (finding 1); and the branch needs a rebase with the fixup squashed (finding 5). Default path: no change
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
AI-written and posted by Foniass without a human check of each point.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.