Skip to content

xcl run: XCL_RT_LEAVE_OUT leaves out a title's ray-tracing programs - #3302

Closed
Foniass wants to merge 1 commit into
xcl-dev:mainfrom
Foniass:gpu-rt-leave-out
Closed

Foniass wants to merge 1 commit into
xcl-dev:mainfrom
Foniass:gpu-rt-leave-out

Conversation

@Foniass

@Foniass Foniass commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

A title's ray-tracing programs that start rays or shade their hits (on
a retail title about 1,000 programs of ~1 MB of DXIL each, the largest
of its cold driver compiles) do nothing while the title has built no
acceleration structure: every ray misses. On amd-dev's runs, allowing
them pushed the title's commit at world entry from about 10 to 21 GB.

XCL_RT_LEAVE_OUT=[,...] (off by default) leaves out
the compute programs whose shader container holds one of the fragments:
the title's pipeline gets the dummy program an untranslatable console
shader gets, so its dispatches are skipped, and the shader preparation
and xcl shaders --precompile pass them over (and say how many). The
fragments name the programs (names in the container's debug data, found
with xcl rpf <pack> --find); XCL's source names no title's programs.
So that leaving them out stays harmless, XCL watches the acceleration
structures the title's views name and warns once when one gets a root
node.

Ported from amd-dev (raylitebull's WIP 6fa964d, gpu/rt_leave_out.rs as
on amd-dev, and its hooks), itself ported from Vice-Tay
(GPL-3.0-or-later, commit 1f69d67, left_out in
crates/victory-gpu/src/pipeline/make.rs); THIRD_PARTY.md names it.

What is in it

  • crates/xcl/src/gpu/rt_leave_out.rs (new): fragments, left_out, the acceleration-structure watch, tests
  • crates/xcl/src/hle/d3d12x/real.rs: rt_left_out in compute_pso (the dummy program), note_structure where a ray-tracing view is made; present.rs: check_structures every 300 frames
  • crates/xcl/src/shaders.rs: the preparation and --precompile pass left-out programs over and say how many
  • THIRD_PARTY.md: Vice-Tay (GPL-3.0-or-later); README.md: the switch

Tested

  • NVIDIA GeForce RTX 5070 Ti (driver 32.0.16.2114), AMD Ryzen 7 7800X3D, Windows 11 build 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), debug tests, release smoke
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on 0ab2fb4: 2608 passed, 4 failed, 49 ignored (lib: 2469 / 4 / 29 in a rerun, other targets 139 / 0 / 20). The 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (E_OUTOFMEMORY from CreateComputePipelineState, seeds 70 / 545 / 1019 / 1507), the same as on main on this machine; they pass on another RTX 5070 Ti. SKIPPED GPU tests: 44 notices, almost all no wave64.
  • The first full run's lib tests stopped with exit code 0x7C10003 after the known UMA mixed-window test failure (the one Tests: the mixed-window remake tests run in a child process #3187 moves into a child process; coherent window could not be restored ... E_OUTOFMEMORY); a rerun of cargo test -p xcl --lib on this head: 2469 passed, 4 failed (the fuzz tests), 29 ignored.
  • Retail title: 60 s smoke run below (no device removal or crash, frames and peak commit within the limits).

Regression run

main:

xcl-smoke v1
commit: b10cc4c6766adc947c2054ada4a2af98be15108d
gpu: NVIDIA GeForce RTX 5070 Ti
title: 3cb1d8e0
seconds: 60
exit: 0x0
frames shown: 1565 (PresentX 1565)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16026 MB

this PR:

xcl-smoke v1
commit: 0ab2fb4d03e7f91f9dae314633685a8882b57d27
gpu: NVIDIA GeForce RTX 5070 Ti
title: 3cb1d8e0
seconds: 60
exit: 0x0
frames shown: 1670 (PresentX 1670)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16889 MB

Not tested

  • a run with XCL_RT_LEAVE_OUT set on the retail title (the smoke run is without it, so it only shows the default is unchanged); the memory effect is amd-dev's report, not measured here
  • AMD GPUs

AI use

  • Claude Code with Claude Opus 5.5: ported this part of the amd-dev commit named above to main, wrote the commit message and this description, ran the tests and the smoke run.

🤖 Generated with Claude Code

A title's ray-tracing programs that start rays or shade their hits (on
a retail title about 1,000 programs of ~1 MB of DXIL each, the largest
of its cold driver compiles) do nothing while the title has built no
acceleration structure: every ray misses. On amd-dev's runs, allowing
them pushed the title's commit at world entry from about 10 to 21 GB.

XCL_RT_LEAVE_OUT=<fragment>[,<fragment>...] (off by default) leaves out
the compute programs whose shader container holds one of the fragments:
the title's pipeline gets the dummy program an untranslatable console
shader gets, so its dispatches are skipped, and the shader preparation
and `xcl shaders --precompile` pass them over (and say how many). The
fragments name the programs (names in the container's debug data, found
with `xcl rpf <pack> --find`); XCL's source names no title's programs.
So that leaving them out stays harmless, XCL watches the acceleration
structures the title's views name and warns once when one gets a root
node.

Ported from amd-dev (raylitebull's WIP 6fa964d, gpu/rt_leave_out.rs as
on amd-dev, and its hooks), itself ported from Vice-Tay
(GPL-3.0-or-later, commit 1f69d67, `left_out` in
crates/victory-gpu/src/pipeline/make.rs); THIRD_PARTY.md names it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:docs-ci Documentation, scripts, workflows, repo governance area:shaders Shader cache, PSO compilation, pipeline libraries, precompilation gpu:amd Code is specific to AMD / RDNA / wave64 GPUs (scope tag; see needs:amd-test) labels Nov 29, 2026
@Foniass Foniass closed this Nov 29, 2026
@Foniass Foniass reopened this Nov 29, 2026
@Foniass Foniass closed this Nov 29, 2026
@Foniass Foniass reopened this Nov 29, 2026
@Foniass

Foniass commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

Note for the maintainers: this PR duplicates #3026 (VolenNakov, opened 2026-11-27, two days before this one). It is the same feature: the same XCL_RT_LEAVE_OUT switch, the same gpu/rt_leave_out.rs, and the same Vice-Tay source (1f69d67, left_out). This one came from the amd-dev copy of it. I missed #3026 when I checked for duplicates.

Only one of the two should be merged. #3026 is older but currently conflicts with main; this one merges cleanly and has a full suite and smoke run on an RTX 5070 Ti. I'll close this PR if you keep #3026.

(Written with Claude Code, Claude Opus 5.5.)

@Foniass

Foniass commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favour of #3026 (VolenNakov). It is the same feature, opened earlier and still kept up to date, with test reports. This PR now conflicts with main too, so it no longer has any advantage over #3026.

(Written with Claude Code, Claude Opus 5.5.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:docs-ci Documentation, scripts, workflows, repo governance area:shaders Shader cache, PSO compilation, pipeline libraries, precompilation gpu:amd Code is specific to AMD / RDNA / wave64 GPUs (scope tag; see needs:amd-test)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant