Repository navigation
Conversation
|
A note from Linux (Wine), in case it matters for the design. The boost does not take effect there.
Wine applies thread priorities as Linux nice values. Lowering a priority ( Two possible ways around it, untested: under Wine ( The game was not run with this PR yet; only the unit tests above. AI use: Hermes agent with Claude Opus 5.5 ( |
aceb50e to
4b3f440
Compare
|
Thanks for testing this on Wine/GE-Proton and catching the Updated the PR (rebased on
|
|
Linux / AMD RDNA3 run: this PR's three new boost tests fail deterministically under Wine. Merged state: head
Diagnosis lead, not a verdict: under Wine the boosted priority lands at -2 instead of NORMAL/0, i.e. the raise looks like it does not map through Wine's Everything else on the merge is green, including the rest of Counts only, no game data. Not tested: retail titles (none here), Windows, RDNA4. Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting. |
|
Thanks for testing on Linux/Wine! From the line numbers ( In |
|
Independent verification, merged onto current Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug.
AI use: test runs by Devin (Cognition, SWE-2); no code changes. |
|
Fix verification from the Wine/RDNA3 lane: re-merged the updated head All three now pass in isolation (
The Counts only, no game data. Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting. |
|
Superseded by commit Closing this PR — thanks to everyone who tested and reviewed! |
|
Linux (Wine + vkd3d-proton) + NVIDIA test of Setup: Fedora 44 (kernel 7.2.9), Wine 11.21 Staging (Wayland driver), vkd3d-proton 3.1 with the relaxed-vtable patch from #175 and a local dxil-spirv patch, Tested
A slow run presents more frames because it stays on the loading pictures at 29 fps. A normal run makes about 10,465 of those lines in that window and then thins out as the world loads. Read
Not tested: the demand-first order of AI use: Claude Code (Claude Fable 5.2) read both diffs, built the trees, ran the title with |
…e guard only integ already has upstream 25c6f7e: a bind that waits marks the pipeline wanted (Pending::want); a preload worker building it is raised to normal priority until the build is done (build / want, by thread id), and a wanted build skips the big-compile slot and the commit wait (real::big_compile_turn). That covers both parts of xcl-dev#1007: the boost of a preload worker a bind waits for, and demand builds going ahead of builds made ahead (they no longer queue for the slot at all). xcl-dev#1007's BoostToken / BoostGuard, its Slots rewrite, notify_big_compiles and their tests are not taken: a second priority mechanism and a second slot admission rule. Taken: the Wine guard (preload_runs_low). Under Wine a thread priority is a Linux nice value; raising it again needs RLIMIT_NICE / CAP_SYS_NICE, so a preload worker lowered once stayed at the lowest priority even while a bind waited for it (reported on the PR from GE-Proton). Under Wine the preload workers now stay at normal priority and build() neither raises nor lowers them.
Fixes a priority-inversion bottleneck in
pso_async+BIG_COMPILES(related to #675 / #505):xcl-pso-pre-0..3) run atTHREAD_PRIORITY_LOWESTon native Windows so speculative ahead-of-use compiles fromused-pipelines.txtstay out of the title's way.job, a later demand bind (resolve/resolve_wait) cannot run the job itself and must wait on thatTHREAD_PRIORITY_LOWESTworker. Worse,translated_compute_psoroutes both demand (xcl-pso-*) and preload (xcl-pso-pre-*) big compiles (>= 256 KiBDXIL) through the singleBIG_COMPILESslot (most = 1) in FIFO order: aTHREAD_PRIORITY_LOWESTpreload worker holdingBIG_COMPILESunder world-load CPU contention can stretch a ~25 s driver compile to ~90–100 s while starving demand-bound compute compiles behind it.This adds refcounted priority inheritance (
BoostToken) for preload workers and demand-first admission onBIG_COMPILESwithout skipping any compute dispatches:resolve,resolve_wait, orresolve_withinneeds a pipeline already owned by axcl-pso-pre-*worker, that worker is boosted toTHREAD_PRIORITY_NORMALuntil the build completes (and woken if queued onBIG_COMPILES).BIG_COMPILES, demand compiles (xcl-pso-*or a demand-promoted preload worker) always enter ahead of queued speculative preload workers, and anyTHREAD_PRIORITY_LOWESTpreload worker currently holding a slot is boosted toTHREAD_PRIORITY_NORMALuntil it releases the slot.BoostGuardrestoresTHREAD_PRIORITY_LOWEST.crate::util::under_wine()), lowering priority toTHREAD_PRIORITY_LOWESTmaps to raising Linuxnice(always allowed), while raising it back toNORMALrequiresRLIMIT_NICE/CAP_SYS_NICEand fails for a normal user. When running under Wine, preload workers stay atTHREAD_PRIORITY_NORMALandSetThreadPrioritycalls are skipped, whileBoostTokenrefcounting andBIG_COMPILESdemand-first admission remain active (thank you @sander110419 for testing and reporting this on GE-Proton).What is in it
crates/xcl/src/hle/d3d12x/pso_async.rs: addcan_lower_preload_priority()(!crate::util::under_wine()),BoostToken/BoostGuard(refcountedOpenThread(THREAD_SET_LIMITED_INFORMATION)+SetThreadPriority), thread-local preload token registration,Pending::promote_preload()inresolve,resolve_wait, andresolve_within, and unit tests (boost_token_refcounts_nested_guards,resolve_wait_boosts_preload_worker_priority_and_restores_it).crates/xcl/src/hle/d3d12x/real.rs: updateSlots(BIG_COMPILES) to trackdemand_waitingand activepreload_holders, boost holders on demand arrival, wake all waiters on release (notify_all), exposenotify_big_compiles()for promoted waiters, and add unit testbig_compile_slots_boost_preload_holder_and_run_demand_first.Tested
x86_64-pc-windows-msvc), debug + release.cargo test --workspace -- --test-threads=1: 740 passed, 0 failed, 41 ignored (1 SKIPPED GPU test:gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64)). All three new tests ran and passed (boost_token_refcounts_nested_guards,resolve_wait_boosts_preload_worker_priority_and_restores_it,big_compile_slots_boost_preload_holder_and_run_demand_first).Regression run
(local folder name redacted to
retail-titlein both blocks; all metrics are exact output of the 60 s runs withXCL_NETWORK=0)main:
PR:
Not tested
under_wine()path (verified by code inspection and native Windows test run; awaiting re-test on Wine/Proton).BIG_COMPILES(most > 1is supported structurally bypreload_holders: Vec<_>, thoughBIG_COMPILESstaysmost = 1here).AI use
pso_async.rs/real.rs, wrote the implementation, Wine fallback, unit tests, and PR description; all tests and paired smoke runs were executed locally on the hardware above and the diff was reviewed line by line.