Repository navigation
Conversation
…le-slots # Conflicts: # crates/xcl/src/hle/d3d12x/device_x.rs
- Default bind waits (pso_async::wait_budget) to 250 ms per PSO and 2,000 ms cumulative per PresentX frame (present::frame_generation) when running a title (XCL_PSO_WAIT_MS=0 restores unbounded waits; tests without a booted title stay unbounded). - Replace FIFO queues in pso_async::queue and dxc::pool with priority-aware queues so wanted and fresh/warm PSOs preempt late/unwanted builds without head-of-line blocking; clear wanted_flag and drop background xcl-pso-* / xcl-dxc-* worker priority to BELOW_NORMAL once a timed wait expires. - Add per-key in-flight coalescing (ComputeFlight / coalesce_compute_build) in real::translated_compute_pso so duplicate cold keys wait for the leader driver blob while distinct keys compile in parallel, and persist slow (>= 250 ms) <16 KiB compute driver blobs to driver_cache. - Close the resolve_wait + is_pending TOCTOU window in bind::execute_indirect via resolve_wait_checked. - Hook winhttp.dll!WinHttpConnect via a shared OnceLock detour (netoff::install_telemetry_block, wired in host::host_main) to refuse *.backtrace.io crash uploads with ERROR_WINHTTP_NAME_NOT_RESOLVED while forwarding all other hosts untouched.
|
World-loading test of Result: in 3 of 6 runs of this PR, the process's commit climbed from about 16 GB to over 30 GB within 6 – 8 s while the title was still on its menu (22 – 44 s into the run, at about 2.5 – 3 GB/s), and our memory guard stopped the run. None of the 4
The log shows no shader or PSO activity during the climbs, only the menu's normal presents (60 per 2 s). In the runs that reached world loading, the PR skipped 322 – 1 024 draws and 1 024 – 2 708 dispatches. Tested
Not tested: the suite on this head, AMD, a machine with more free commit (whether the PR gets to the end of the stall), and what allocates during the climbs. This PR is about 2 800 added lines and bundles several changes (PSO wait budget, DXC queue scheduling, skipped draws, target initialisation, AI use: Claude Code (Claude Opus 5.5): ran the tests and wrote this. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
@rdj415 a question before I write anything, so we don't end up with two PRs for the same thing again. Would you split the per-frame cap on bind waits out of this PR into a small one of its own? That's Why that piece on its own:
AI use: Claude Code (Claude Opus 5.5) drafted this. |
…late PSOs Add pso_async::resolve_wait_checked returning ResolveOutcome (Untracked, Ready, Pending, Failed) under a single p.done lock, and short-circuit already-late pipelines under a wait budget without constructing Held::new() so skipped draws do not freeze kernelx::Sleep via title_held(). Use resolve_wait_checked in bind::execute_indirect to close the TOCTOU window between resolve_wait and is_pending and stop failed translated graphics stand-ins from reaching the PC command list. Factor bind_abi_resolved so dispatch and execute_indirect skip a second PENDING lookup. Stacked on d3d12x/pso-async-lane-isolation. Part of xcl-dev#1452, xcl-dev#505, xcl-dev#1652. Assisted-by: T3 Code (Antigravity, gemini-4-neon)
|
@throny @milesah3ad Thanks for testing and the clear breakdown! I split out just the per-frame PSO bind wait cap ( For the open question on #1452: on a longer Windows RTX 5060 Ti run of #2114 alone ( Converting this PR to draft while breaking out the remaining pieces cleanly. |
…late PSOs Add pso_async::resolve_wait_checked returning ResolveOutcome (Untracked, Ready, Pending, Failed) under a single p.done lock, and short-circuit already-late pipelines under a wait budget without constructing Held::new() so skipped draws do not freeze kernelx::Sleep via title_held(). Use resolve_wait_checked in bind::execute_indirect to close the TOCTOU window between resolve_wait and is_pending and stop failed translated graphics stand-ins from reaching the PC command list. Factor bind_abi_resolved so dispatch and execute_indirect skip a second PENDING lookup. Stacked on d3d12x/pso-async-lane-isolation. Part of xcl-dev#1452, xcl-dev#505, xcl-dev#1652. Assisted-by: T3 Code (Antigravity, gemini-4-neon)
Stacked on #1274. Prevent title watchdog freezes and
DXGI_ERROR_DEVICE_HUNG(0x887A0006) during cold shader compilation by bounding PSO bind waits per frame, skipping draws/dispatches with pending or unready pipelines, auto-initializing uninitialized placed/reserved RT/DS targets before the first draw, keepingD3D12_HEAP_FLAG_CREATE_NOT_ZEROEDfor non-RT/DS streaming textures, and blocking Backtrace telemetry uploads.What is in it
crates/xcl/src/hle/d3d12x/pso_async.rs,crates/xcl/src/gpu/recomp/dxc.rs,crates/xcl/src/hle/d3d12x/present.rs: bound runtime PSO bind waits (wait_budget: 250 ms per PSO, 2,000 ms cumulative perPresentXframe viapresent::frame_generation;resolve_wait_criticalgrace capCRITICAL_FRAME_WAIT_CAP_MS= 2,000 ms;XCL_PSO_WAIT_MS=0for unbounded waits), replace FIFO queues inpso_asyncanddxcwith priority-aware scheduling so wanted/warm builds preempt unwanted cold builds, and drop expired background worker threads toBELOW_NORMAL.crates/xcl/src/hle/d3d12x/bind.rs: close theresolve_wait/is_pendingTOCTOU window viaresolve_wait_checked, skip draws andExecuteIndirectdispatches when a translated pipeline is still pending or failed (graphics_bound_with,note_compute_signature/is_compute_signature), and avoid passing unready stand-in PSOs to the PC driver.crates/xcl/src/hle/d3d12x/list_x.rs,crates/xcl/src/hle/d3d12x/real.rs,crates/xcl/src/hle/d3d12x/device_x.rs,crates/xcl/src/hle/d3d12x/vram.rs: track placed/reserved/committed RT/DS targets and RTV/DSV handles (note_uninit_target_if_rt_ds,ensure_bound_targets_initialized,cl_discard_resource), stripD3D12_HEAP_FLAG_CREATE_NOT_ZEROEDonly for RT/DS targets and indirect buffers (should_strip_not_zeroed_resource) while preservingCREATE_NOT_ZEROEDfor ordinary textures/streaming buffers, coalesce duplicate in-flight compute PSO compiles (ComputeFlight), and persist slow (>= 250 ms)<16 KiBcompute driver blobs todriver_cache.crates/xcl/src/hle/netoff.rs,crates/xcl/src/host.rs: hookwinhttp.dll!WinHttpConnect(install_telemetry_block) to reject*.backtrace.iouploads withERROR_WINHTTP_NAME_NOT_RESOLVEDwhile forwarding all other hosts untouched.Tested
rustc 1.98.0-nightly (096694416 2026-06-29), release build and debug unit tests on Windows.cargo test -p xcl --lib -- --nocapture(commitfb07ff8): 747 passed, 0 failed, 21 ignored (SKIPPED GPU tests on 32-lane hardware:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64).scripts/smoke.ps1 -Seconds 60on clean9e3831e(upstream/main) and cleanfb07ff8(pso-compile-watchdog-unblock).Regression run
main:
PR:
Not tested
cargo test --workspace -- --test-threads=4,cargo test -p xcl --test gpu_compute_e2e,cargo test -p xcl --test shaders_e2e, and Python helper tests on commitfb07ff8.<game folder>.AI use
d3d12x-console-vtable-slots(15fab80), resolving thereal.rsconflict, runningcargo test -p xcl --lib, and running thescripts/smoke.ps1verification.