D3D12.X: a build the title already draws without waits for half the commit headroom #2894
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!2894
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2894/head"
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?
@Prime1997 on GitHub · 2026-11-26 22:16 UTC · original
Prime1997:contrib/nv-late-build-half-headroom→nvidia-dev· +30 −1 · 2 files · 1 commits · merged 2026-11-26 22:59 UTCRequested by Prime · project thread
With a wait budget (
XCL_GFX_PSO_WAIT_MS,XCL_CS_PSO_WAIT_MS) a bind gives up on a pipeline after its budget and the build is no longer wanted, so its huge driver compile waits at the gate for the full commit headroom (3 GB). A build of a pipeline the title already draws or dispatches without (late) now waits for half of it: 1.5 GB for the class from 256 KB, what one such compile takes. Builds ahead of first use and builds nobody used wait as before.Part of #2688.
Why
On a machine with 4.5 GB of commit left (44.6 of 49.1 GB) 33 such builds stood at the gate, one for 129 s, while 44,596 draws of a retail title's world were left out for want of them. With this change, in the same run: 132 driver compiles against 112, 724 s at the gate against 1,130 s (longest 90 s against 129 s), 35,618 draws skipped against 44,596. The frames shown in the world did not change in that run; the change is about how soon late pipelines arrive.
What is in it
crates/xcl/src/hle/d3d12x/real.rs:headroom_for(bytes, late)used byhuge_compile_turn; testa_late_build_waits_for_half_the_headroom.crates/xcl/src/hle/d3d12x/pso_async.rs:build_is_late(the worker's build was given up on by a bind).Tested
cargo test --locked --workspace --no-fail-fast -- --test-threads=4withXCL_DXC_DIRset to DXC 1.9.2609.5: 1817 passed, 9 failed, 48 ignored. The 9 failures are the same tests that fail onnvidia-deveae01502itself (1816passed,9failed,48ignored there, same command):async_compute_pso_registers_real_pso_and_not_standin,console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly,gpu::recomp::tests::gpu_compute_thread_limits_leave_the_lanes_past_them_out,hle::d3d12x::texture_upload::tests::gpu_parts_of_a_texture_go_up_and_the_rest_stays,hle::d3d12x::texture_upload::tests::pieces_hold_the_texels_of_their_levels,split_compute_prefers_the_offline_whole_pipeline,two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs.Build and test (Windows, no GPU)fails here onhle::d3d12x::sparse::tests::a_gpu_write_into_a_gpu_view_lands_in_its_cpu_view(the WARP device is removed, 0x887a0005). That test passes on the card above, on this branch and oneae01502, and fails the same way on the other open pull requests againstnvidia-dev(#2905, for one).Regression run
A commit of
main(b49be183, the last one before the shader preparation screen of #2555, which prepares every record before the title and so does not fit a 60 s run):The base of this PR,
nvidia-deveae01502:This PR's head:
Not tested
AI use
Claude Code (Claude Fable 5.2 and Claude Opus 5.5) wrote the code, ran the suite and the regression runs on the hardware above, and wrote this description; Prime asked for it and owns the account. We coordinate the 8 GB work on the XCL Discord too: https://discord.gg/gK3y7WRRY
🤖 Generated with Claude Code
@saintwolf on GitHub · 2026-11-26 22:55 UTC · original
Tested and reviewed commit
7716b4cf(merged cleanly ontonvidia-deveae01502alongside#2892,#2893,#2895–#2897, zero conflicts).Tested
32.0.16.2140), AMD Ryzen 7 7800X3D, Windows 11 build 26300,rustc 1.100.0, debug test buildcargo test -p xcl --lib hle::d3d12x::real::big_compile_tests -- --test-threads=1: 15 passed, 0 failed, 0 ignored, 0 skipped (includinga_late_build_waits_for_half_the_headroom)Review notes
pso_async::build_is_late()andheadroom_for(bytes, late)are small, clear, and covered by the new unit test. No issues spotted.Not tested
AI use
@upipibi on GitHub · 2026-11-26 23:43 UTC · original
Thanks, the numbers for the 3 GB class are convincing. One question about the giant class, by reading at
eff3bcab, not run:headroom_for(crates/xcl/src/hle/d3d12x/real.rs:4691) halves the headroom of every late build, including those above 6 MiB of DXIL. For those,big_compile_headroom(real.rs:4701) is 512 x the DXIL size, and its doc comment (:4698) says the reason: the driver's compile of a 29.8 MB program grew past 14 GB of free commit before it was stopped. With the halving, a late build of that program waits for about 7.6 GB. The PR's reasoning (1.5 GB is what one such compile takes) covers the floor class. The new test asserts the giant case at32 MiB * 256(:4720 onward), so it records the choice but can't catch it.Was halving the giant class intended? If not, could the halving apply only to the floor (for example,
full - (3 << 29)for late builds, or halving only below 6 MiB)? Then a late giant compile would not start with less commit free than it was measured to use.AI-assisted (Claude Code, Claude Opus 5.5): read the code at
eff3bcaband wrote this; nothing was run for these points.