kernelx: Sleep does not count the time a bind waits for a pipeline build #1288
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!1288
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1288/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?
@imnicho on GitHub · 2026-11-24 14:20 UTC · original
imnicho:kernelx-sleep-hold→main· +184 −0 · 2 files · 1 commits · merged 2026-11-24 19:48 UTCA retail title ends itself half a minute to a little over a minute after the set-up of its world begins. Its own stall check – a thread that ticks once a second with
Sleepand gives up after 30 ticks without a sign of the main thread, decoded in #505 – fires while the main thread is held in binds for compute pipelines the driver is still building. A console title never waits there. The ways around it so far skip the dispatches of a pipeline not built yet (XCL_PSO_WAIT_MS, #891: later passes then run on what the skipped ones left unwritten, #675) or change the title.Here XCL takes the title's
Sleep, and the time a bind is waiting for a pipeline's build does not count as the title's time: the check does not tick while XCL holds the thread it watches. Only a sleep of 100 ms or more is taken so; a shorter one is a poll and goes on as before (changed after @Royalflamejlh's question below, with the comparison under Tested). Nothing of the title is changed and no dispatch is skipped. The plan was posted in #505 (https://github.com/ivall/xcl/issues/505#issuecomment-7130709574). Part of #505.What is in it
crates/xcl/src/hle/d3d12x/pso_async.rs:title_held()– whether a bind is waiting inresolve_waitfor a pipeline still being built (a counter around the wait, with or withoutXCL_PSO_WAIT_MS). Testa_bind_waiting_for_a_build_holds_the_title.crates/xcl/src/hle/kernelx.rs:Sleep(a title imports it throughapi-ms-win-core-synch, which XCL resolves to kernelx): a sleep of 100 ms or more returns aftermsof time in which the title was not held, taken in steps of at most 20 ms; a shorter sleep, a yield (0) andINFINITEare passed on as they are.XCL_SLEEP_HOLD=<ms>sets that length,0leaves the PC'sSleep. Testsa_sleep_does_not_count_the_time_the_title_is_held,a_sleep_stops_counting_when_the_title_gets_held,a_short_sleep_is_passed_on_while_the_title_is_held,a_sleep_of_a_title_not_held_takes_its_time.Sleeptests and thepso_asyncone fail ("back after 300.8 ms: the 300 ms held were counted", "a bind waits for a build, but the title is not held").Tested
stable-x86_64-pc-windows-msvc; debug for the tests, release for the title.cargo build --workspace && cargo test --workspace -- --test-threads=4on9cdae10: 754 passed, 0 failed, 41 ignored (SKIPPED GPU tests:gpu_wave32_program_in_wave64_hardware,gpu_geometry_wave32_prefix_count_over_a_mask– no wave64).XCL_NETWORK=0, scripted pad, binds waiting (noXCL_PSO_WAIT_MS). First, with this PR's first head (95299f4, every sleep held):mainb8b1f49+ #684 (without #684 the title stops earlier, at itsCopyFromSubresourcecall) against the same + the PR; 330 s runs, the two builds in turn, 3 rounds, release. Every run starts from the same DXIL and driver-blob cache: the folder is put back before each run to the state one earlier run of the first build left (3,051 files, 109 driver blobs).main+ #68495299f4main+ #68495299f4main+ #68495299f425c6f7eand9a272d4a build or a compile the title waits for goes on at once onmain; the runs above have both. Before the rebase, on47efa2e+ #684, it was the same: the title's exit 32.1 s and 31.5 s after the set-up in two runs without the rule, and running at the limit in the one run with it.resolve_wait: https://github.com/ivall/xcl/issues/505#issuecomment-7133841574). @sander110419 ran a local implementation of the plan on Linux / Wine: the title did not end itself in 930 s after the set-up, 0 dispatches skipped (https://github.com/ivall/xcl/issues/505#issuecomment-7133063012).mainb8b1f49+ #684, in turn, 330 s runs from the same cache start state as above. What the load did is counted over the 170 s after the set-up began, or up to the time limit where that came first:95299f4)95299f4)95299f4)tiling::Chain::detile_levelundertitle_textures::subresources).Sleepis not on that stack; one event, so I cannot say whether the timing had a part in it. It did not come in the 14 other runs of these three builds today (4 without the PR, 6 of the first head, 4 of this one).Regression run (default settings)
main:
PR:
A second round of the same two binaries:
main1405 frames, PR 1377. The PR's head is onb8b1f49, the commit of the main block;mainhas gone on tob7aa9f3since (no file in common with this PR, and it merges cleanly).Not tested
XCL_SLEEP_HOLDis set lower.SleepEx, waits with a timeout and the title's clocks are not taken. A check that reads a clock is not covered – this title's other route (a scope older than 300 s) is one; it did not come in these runs.AI use
Duplicate check (16:47 UTC, 24 Nov): no open PR takes the title's
Sleepor keeps its stall check from counting a bind's wait; read #889, #1007, #828, #1442 (build ahead: they shorten the wait), #1273 (withXCL_PSO_WAIT_MS, a bind does not wait for a build behind the workers' queue), #1046 (the release of GPU waits), #967 and #1062 (what happens after the title's exit), and the closed #980 (stepped over the title's exit), #533 and #267 (bound the wait and skip).🤖 Generated with Claude Code
@thehollowedone on GitHub · 2026-11-24 14:27 UTC · original
Independent overlapping-bind check on
95299f4, Windows 11 build 26300, Ryzen 7 9800X3D, Rust 1.99.1 MSVC, debug.I gated two synthetic pipeline builds and called the production
kernelx::Sleep(60)from a third thread. A 500 ms bind returned its stand-in while the other bind was still held.Sleepstayed pending, then returned after the last bind was released and its 60 ms elapsed (664 ms total in this run). In a fresh process withXCL_SLEEP_HOLD=0, the same call returned in 61 ms while both binds were still waiting. The bounded pipeline also resolved to its built result once its gate opened.Both runs and all three stock
a_sleep_tests passed. This covers synthetic scheduler timing. Retail and driver compile behavior were outside this run. AI-assisted. Codex (GPT-6, exact variant unavailable) wrote and ran the scratch fixture and drafted this report.@DavidM1911 on GitHub · 2026-11-24 14:33 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:Thanks!
@futurepro62 on GitHub · 2026-11-24 14:37 UTC · original
Full-suite run to go with the subset check above. Tested exact head
95299f4(on its baseb8b1f49).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 753 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.a_bind_waiting_for_a_build_holds_the_title,a_sleep_does_not_count_the_time_the_title_is_held,a_sleep_stops_counting_when_the_title_gets_held,a_sleep_of_a_title_not_held_takes_its_time.Not tested
AI use
@Royalflamejlh on GitHub · 2026-11-24 14:53 UTC · original
Linux (Wine + vkd3d-proton) + NVIDIA test of
95299f4onmain930e8b4+ #684, 2 runs of 140 s each way of a retail title: without it the title's watchdog ended the run at 132.6 s and 131.6 s; with it the watchdog had not fired by 140 s in either run, and pipeline builds went on to the end. Presents did not come back within those 140 s.Setup: Fedora 44 (kernel 7.2.9), Wine 11.21 Staging (Wayland driver), vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch,
VKD3D_CONFIG=ignore_shared_fence. RTX 4070 12 GB (driver 615.71.09, 32-lane waves), Ryzen 9 9950X3D, 64 GB RAM. Release, cross-compiled tox86_64-pc-windows-gnu(rustc 1.98.0), DXC 1.9.2609.5,XCL_NETWORK=0,XCL_PSO_PRELOAD=0,XCL_PSO_WAIT_MSunset. Retail title 1.0.2.1, the first-run screens completed once and no story progress, one A press at 44.8 s throughXCL_PRESS_AT.95299f4merged ontomain930e8b4+ #684 (e56dbc3) without conflicts; #684 is there becausemainalone faults incopy_frombefore this point.Tested
cargo test --release -p xcl --libfora_sleepanda_bind_waitingunder Wine, on the merge: 4 passed, 0 failed.930e8b4+ #684, run 1 / 295299f4, run 1 / 2game+0x23cf683The card's video memory was full (9.6 to 9.7 GB local) from about 76 s in all four, as in every run of ours that reaches the world load on this 12 GB card.
Read
pso_async.rs:145(title_held) is one counter for the process, andkernelx.rs:1405(title_sleep) checks it for everySleepthe title makes. So while one bind waits, every thread of the title that paces itself withSleepstops, not only the stall check: in these runs that is the 38 s and more from the last present to the end of the run. Is that the intent, or should only the thread that counts the ticks be held? A thread that polls withSleep(1)for streaming or sound would resume all at once when the build ends.pso_async.rs:543: the hold covers the wait inresolve_waitwith or withoutXCL_PSO_WAIT_MS, as the description says. With the limit unset, as here, nothing was skipped (0 draws and 0 dispatches skipped in both runs with the change), so what it buys is time: the builds that were cut off at 132 s without it went on.Not tested: past 140 s (the card would be measured, not the change);
XCL_SLEEP_HOLD=0; the preload of #690 on; the rest of the test suite; AMD and Intel.AI use: Claude Code (Claude Fable 5.2) read the diff, built the trees, ran the tests and the four runs with
XCL_PRESS_AT, compared the logs and wrote this report.@jessenic on GitHub · 2026-11-24 15:04 UTC · original
Test report for 95299f4, on the retail title's story load, without pre-built pipelines.
Tested
main930e8b4+ this PR (95299f4) + #684 (e56dbc3), merged locally.XCL_NETWORK=0,XCL_ACTIVITY=1, noXCL_PSO_WAIT_MS(binds wait). Scripted input (XCL_PRESS_AT), save past the first-run menus. Driver-blob and DXIL caches kept from earlier runs. Noxcl pipelinespass.cargo test -p xcl --libwith the PR's tests andfine_timer_makes_short_sleeps_short: 5 passed, 0 failed. The whole suite was not run.Runs (the same build and caches; the off run uses
XCL_SLEEP_HOLD=0)#101+0x23cf683at 129.6 sNot tested
xcl pipelines(#759) or #889 / #1007. AMD.XCL_PSO_WAIT_MStogether with the rule.AI use: Claude Code (Claude Opus 5.5) built the tree, ran the runs on this PC, read the logs and wrote this report.
@JoaoPauluu on GitHub · 2026-11-24 15:28 UTC · original
A regression run under Wine on Linux, on a retail title.
Tested
x86_64-pc-windows-gnu.95299f4as it is andmain930e8b4, no uncommitted changes. This PR's merge base isb8b1f49; themainruns are of930e8b4, a later commit ofmain. Retail title 1.0.2.1,scripts/linux/smoke.sh(#257) for 60 s, no input. Nine runs in a row,mainfirst and last, other PRs in between.Regression run
main (first run):
this PR:
The last
mainrun: 1338 frames,exit: 0x0, no device removal, no crash. Under Wine,peak commitreads 0 MB, so these blocks do not check memory.Not tested
AI use
@mastrr9 on GitHub · 2026-11-24 15:30 UTC · original
Verified head
95299f47ddc4dc842045f4c1b48cc7910eb7aa68on Windows 11 / NVIDIA RTX 5080 (DXC 1.9.2602.17, Rust MSVC, debug build, clean worktree):cargo build --workspace+cargo test --workspace -- --test-threads=4: 753 passed, 0 failed, 41 ignored (0 new compiler warnings).Not tested: AMD, Linux/Wine, retail smoke (
scripts/smoke.ps1).AI use: T3 Code (Antigravity / Claude Sonnet 5.5) ran the build and tests on our RTX 5080 and drafted this report.
@imnicho on GitHub · 2026-11-24 15:39 UTC · original
@Royalflamejlh thanks for the runs and for reading the diff. On your question:
Yes, as written it is every
Sleepof the title, on purpose: XCL does not know which thread counts the ticks, so the rule is "the time a bind is held is not the title's time" for all of them. The cost you name is real. A thread that polls with short sleeps (streaming, sound) stands still for the hold as well and gets going again all at once; the description's "Not tested" only says that sound and video were not judged.A narrower rule is possible without knowing the thread: pass a short sleep on as it is and hold only a sleep that is long enough to be a wait for time. @sander110419's local version of the plan did that (100 ms or more) and their title stayed alive under Wine for 930 s after the set-up, so a threshold does not have to cost the fix. What I do not know is whether it changes how the load goes on (pipelines built and dispatches in the same time), or lets another time-out of the title through.
I will measure it here, the PR as it is against a variant that holds only sleeps of 100 ms or more: same
main+ #684, the same cache start state for every run, three rounds in turn. I will post the numbers in this thread and change the PR to the narrower rule if it keeps the title alive in every run and the load is not worse.AI use: Claude Code with Claude Fable 5.2 wrote this reply.
@HKEY-Funk-Machine on GitHub · 2026-11-24 16:00 UTC · original
Test report: #1288 (
95299f4) with #751 (1a480bc) on AMD RDNA4, Windows: the watchdog no longer fires, and the intro rendersTested
main930e8b4+ #7511a480bc+ #128895299f4, both applied cleanly. Also one local patch that skipsInitializeApiImplEx2(it hangs for this title here).XCL_NETWORK=0, otherwise defaults.Why #751 is in the tree: on a warm run of plain
main, the run died at 1m14s with0xC0000005inVCRUNTIME140.dll(memcpy) ←title_textures::subresources← asubresources_onworker, which is the fault #751 fixes. With #751 alone, the run went past that point and hit the usual+0x23cf683watchdog at 2m50s.main(cold)main(warm)After 1500 frames, presents stop for the rest of the run (about 10 minutes). During that time the log shows 85 compute PSOs taking 554 s of driver time in total, the longest 47.1 s. So the title is held in binds for pipelines the driver is still building, as #1288 describes, and its stall check no longer counts that time. #1288 does what it says on AMD. The remaining wall is the driver's compile time for these programs, the subject of #1269.
Not tested
scripts/smoke.ps1pair.AI use: Claude Code (Claude Opus 5.5) built the trees, ran the title, extracted counts and timings from the XCL logs, symbolised the memcpy fault against
xcl.pdb, and drafted this report.@DavidM1911 on GitHub · 2026-11-24 16:04 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib -- --test-threads=1: all passed, 0 failed, 21 ignored.Thanks!
@iLucasRT on GitHub · 2026-11-24 16:35 UTC · original
Test report: #1288 (
95299f4) on AMD RDNA3, Windows: the watchdog no longer fires (2 of 2 runs); presents do not come back within 300 s, and audio decoding nearly stopsTested
mainb7aa9f3againstb7aa9f3+ this PR's diff (95299f4, applied cleanly withgit apply, uncommitted). Without #684 and #751.XCL_NETWORK=0,XCL_ACTIVITY=1,XCL_RUN_SECONDS=300, A every 5 s (XCL_PRESS_A_AT), binds waiting (noXCL_PSO_WAIT_MS).main. Order: main, PR, PR, main.fine_timer_makes_short_sleeps_shortpass on that tree (5 passed, 0 failed).mainr1mainr2+0x23cf683at 112.7 s+0x23cf683at 115.7 sxapupackets decoded (report.json)main: the stall exit comes 28.7 s and 29.6 s after the last present. With the PR it does not come in either run; pipelines are still being built at the end (last one at 296 s). No present after 82–84 s. No device removal, no failed pipeline, no GPU-wait timeout. Dispatches skipped: 0 in the last counter line of each log (78–153 s; it does not cover the rest).0x89240009, 54–78 s): 259 and 1686 onmain, 5516 and 15 with the PR. They vary too much between equal runs to say anything about the PR.mainthis goes up to ~1300–1600 (r1) and ~1900–2700 (r2) packets/s until the crash. With the PR there are no morexapulines after 81 s, and ~430–620 more packets in total by 300 s. I did not listen to these runs; this is the counter only. It is in line with the "threads that pace themselves withSleepstand still" point above.Not tested
XCL_SLEEP_HOLD=0; with #684, #751, #889 or #1007; other titles.scripts/smoke.ps1(no smoke blocks); sound by ear; more than 2 runs per build.AI use: Claude Code (Claude Opus 5.5) read the diff, built the trees, ran the unit tests and the runs on this machine, read the logs and wrote this report.
@HQasper on GitHub · 2026-11-24 16:09 UTC · original · edited 2026-11-24 16:39 UTC
RTX 5090 test of #1288 (
95299f4): the watchdog no longer ends the run, but presents stay at 0 from 82 s to 300 sSetup
XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PRESS_AT=30:A,40:A,scripts/smoke.ps1 -Seconds 300; noXCL_PSO_WAIT_MSRuns
930e8b4+0x23cf683write at 0x0, 110.1 s930e8b4+0x23cf683, 110.4 s95299f495299f495299f4xcl shaders --precompile --only cs --pipelinesmain,ListX #101is first called at 62–78 s, presents stop at ~82 s and the title's watchdog fires about 30 s later in both runs.0xc0000005inVCRUNTIME140.dll+0x1c45a(read at0xc49059f00) on atitle_textures::subresources_onworker:tiling::Chain::detile_level(tiling.rs:438) ←title_textures::subresources(title_textures.rs:1182). That is the in-place title memory read that #751 replaces. I don't think #1288 causes it: the code is not touched, and the same build ran clean twice after.What the title waits for in the #1288 runs
s_mul_i32(e.g. 23 vs 31) and the header nop literals. Each one needs its own driver compile (details in #505: https://github.com/ivall/xcl/issues/505#issuecomment-7137870075).xcl shaders shaders.rpf --precompile --only cs --pipelinessaved 425 pipelines in ~45 min, then stayed on a single driver compile for over 30 min at 85 GB private / one core, so I stopped it (it can be resumed). This matches what #1278 says about the screen-probe programs.Tests on
95299f4cargo test --workspace -- --test-threads=4: 753 passed, 0 failed, 41 ignored (19 test binaries)gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64)a_sleep_*,a_bind_waiting_for_a_build_holds_the_title) passNot tested
930e8b4(the PR head is onb8b1f49, so it doesn't have930e8b4's copy-scratch fix); runs longer than 300 s; AMD;XCL_PSO_WAIT_MStogether with #1288; #1273 / #1278 on this machine.Smoke blocks (same title, 300 s)
AI use: Claude Code with Claude Opus 5.5 ran the builds, tests and game runs on this machine, read the logs and wrote this report.
@imnicho on GitHub · 2026-11-24 16:47 UTC · original
@Royalflamejlh the comparison is done, and the PR now has the narrower rule (head
9cdae10, one commit; the description has both tables).The first head (every sleep held,
95299f4) against the new rule (only a sleep of 100 ms or more is held), each onmainb8b1f49+ #684, in turn, 330 s runs from the same cache start state. Counted over the 170 s after the world's set-up began, or up to the time limit where that came first:tiling::Chain::detile_levelundertitle_textures::subresources).Sleepis not on that stack. It is one event in 15 runs of these builds today, so I cannot say whether the timing had a part in it.title_sleeppasses a sleep shorter thanSLEEP_HOLD_MIN_MS(100) on as it is, like a yield;XCL_SLEEP_HOLD=<ms>sets that length and0still turns the rule off. One more test,a_short_sleep_is_passed_on_while_the_title_is_held.mainb8b1f49, 1383 on the PR (second round 1405 and 1377).The earlier test reports here were on
95299f4. What differs for them is only which sleeps go through the rule.AI use: Claude Code with Claude Fable 5.2 ran the builds and runs on the machine named in the description and wrote this.
@alpz1000 on GitHub · 2026-11-24 17:07 UTC · original
I ran a paired test on an RTX 3060 12 GB / Core i5-8400 / Windows 11. Both runs used the same local release binary from
9cdae10withb8b1f49reverted to avoid the separate memory regression reported in #1307. Each run started with a copy of the same profile and caches. Networking was disabled, and no pipeline wait budget was set.XCL_SLEEP_HOLD=00xc0000005at 145.3 sXCL_SLEEP_HOLD=100Both runs reached world loading and logged zero GPU device removals. With the change enabled, the process survived for the rest of the test, but it did not resume presenting frames. The end reports showed 1,252 built / 57,511 queued with the change off and 1,329 built / 57,434 queued with it on. Those totals do not identify the pipeline holding up the game.
This was one run per setting. AI assistance: OpenAI Codex ran the comparison and drafted this report.
@not-rex on GitHub · 2026-11-24 17:40 UTC · original
RTX 3080 (10 GB, driver 610.88, Windows 11), retail 1.0.2.1 into the world: with this PR and without
XCL_PSO_WAIT_MS, the title's watchdog no longer fires and the GPU never hangs. The world then waits on pipeline builds that drain at about 1.5 per second.Tested
main930e8b4+ #1123 + #1254 (diagnostics) + this PR at95299f4(its head when I ran it; it has since been amended to9cdae10f, kernelx.rs only), clean merge, release. Warm DXIL cache and save from earlier runs (setup screens done), no full pipeline precompile. A pressed at 30 and 40 s,XCL_ACTIVITY=1,XCL_NETWORK=0, 400 s limit, GPU sampled withnvidia-smievery 2 s.XCL_PSO_WAIT_MS=50and one without. Same machine as my #1252 runs, wheremainalone ends in0x887A0006at 168.5 s.XCL_PSO_WAIT_MS=50XCL_PSO_WAIT_MSListX #101#101GPU queue.Wait … did not complete within 5000 ms0x887A0006at 171.1 s, then0x80000003at+0x24746060x0+0x23cf683)Without the PSO wait, presents and submissions stop at about 100 s and the GPU goes idle. The window's title bar shows the pipeline queue: "compiling shaders: 1 running, 37 done, 58185 queued" at 121 s and "1 running, 443 done, 57818 queued" at 394 s. So a title thread is held in a bind for a pipeline still building, as this PR intends, and it is the build rate (one at a time, ~1.5/s) that keeps the world from resuming within 400 s. With the PSO wait, the skipped binds bring back the GPU stall and the hang, as on
main.Next on this machine: the same run after a full offline pipeline precompile, to see whether the world resumes once the builds are cached.
Not tested: a precompiled pipeline cache; more than one run per arm; AMD; Linux.
AI use: Claude Code (Claude Opus 5.5) ran the runs on my machine through a scripted runner and wrote this report.
@Royalflamejlh on GitHub · 2026-11-24 18:00 UTC · original · edited 2026-11-24 18:06 UTC
@imnicho the narrower rule holds here too. On Linux (Wine + vkd3d-proton) + NVIDIA,
9cdae10onmain9e3831e+ #684, 2 runs of 140 s each way: without it the title's watchdog ended the run at 119.9 and 107.8 s, with it there was no watchdog by 140 s in either run.Setup: as in my comment above, except:
mainis9e3831enow, and the A press comes at 16 to 18 s instead of 44.8 s, so the times are 8 to 24 s earlier than in that comment, and this card's shader caches have had a 3-minute offline pipeline pass since (200 pipelines; both trees here share them).9cdae10merged onto9e3831e+ #684 (e56dbc3) without conflicts.XCL_PSO_PRELOAD=0,XCL_PSO_WAIT_MSandXCL_SLEEP_HOLDunset.Tested
9e3831e+ #684, run 1 / 29cdae10, run 1 / 2game+0x23cf683Presents did not come back within 140 s, as before. With no present after 94.1 and 90.4 s and no watchdog by 140 s, the title's stall check sleeps 100 ms or more at a time here as well, and the threshold costs the fix nothing in these runs.
Read
kernelx.rs:1419(intitle_sleep): a sleep shorter thanminnow returns through the PC'sSleepon the first line, with the yield and the endless sleep. That is the change I asked about, anda_short_sleep_is_passed_on_while_the_title_is_heldcovers it.Not tested: past 140 s (this 12 GB card is full from about 50 s);
XCL_SLEEP_HOLDset to anything; sound and video during the hold; the preload of #690 on; AMD and Intel.AI use: Claude Code (Claude Fable 5.2) read the new commit, built the trees, ran the tests and the four runs, compared the logs and wrote this reply.
Edited 2026-11-24: removed a sentence that said the runs with the change logged NVIDIA kernel messages and the runs without it did not. All four runs logged the same 12 lines (
_threadNodeCheckTimeout) about 12 s after XCL's process had ended; our harness had caught them in two of the four. The setup line now says 8 to 24 s where it said "about 12 s", and names the offline pass.@Gruzzberry on GitHub · 2026-11-24 18:14 UTC · original
Test report for #1288 (Sleep does not count the time a bind waits for a pipeline build) – PR head
95299f4merged intomainb7aa9f3(local mergec074057, no conflicts). Written for the stop atgame_scarlett_master.exe+0x23cf683(#846, #675).Tested
stable-x86_64-pc-windows-msvc, release build; DXC 1.9.2609 (XCL_DXC_DIR).XCL_NETWORK=0, warm DXIL and driver-blob caches, first-run setup done; menus walked withXCL_PRESS_A_AT(same script every run). NoXCL_PSO_WAIT_MS.mainb7aa9f3against the merge above, one clean run each (330 s limit, started only after the machine-wide shader precompile had exited);XCL_PRESS_A_AT=30,45,60,90,120, nobody at the controls.b7aa9f30xc0000005write at 0,+0x23cf683, 140.0 s#101)+0x23cf683), but it stopped presenting at ~92 s and never recovered: 0 presents and 0 draws in every 2 s window from 94 s to 330 s, and no dispatches apart from one at ~146 s, right after a background compute PSO build finished (360 KB DXIL, 12.0 s). The window title read0.0 FPS | compiling shaders: 0 running, 1 done, 56995 pipelines queued(seen by eye); the screen went black after the opening cutscene played normally.Wait64BitValueX ... bridged to GPU queue.Wait (wait-before-signal, prod=qNone)lines are logged, the last activity before the stop. So the watchdog no longer ends the run here, and the next stop is a wait for a signal that is never submitted (#505 family).Not tested
cargo teston the merge (not run).AI use
@ezamelczyk on GitHub · 2026-11-24 18:17 UTC · original
Linux / AMD RDNA4 run of #1288 (
9cdae10): the title's stall check no longer ends the run. With #1288 it went 93 s without a present while its render thread built compute pipelines, and nothing fired. On the same machine without #1288 the title ended itself at+0x23cf683about 30 s into such a stall, in 12 of 12 runs.Setup
53aac418, DXVK from GE-Proton, DXC 1.9.2609.5x86_64-pc-windows-msvc:main47efa2e+ #1316c3d119c+ this PR9cdae10, merged locally without conflicts. So this is not this PR's head aloneXCL_NETWORK=0,XCL_COHERENT_MB=512, scripted A presses,XCL_PSO_PRELOAD=0, dxil-spirv's legacy structurizer through a local vkd3d-proton switch (see my comment on #1316)What happened
main,main+ diagnostics, and #1316 without this PR): the title stopped presenting when world loading started and ended itself 29–31 s later at+0x23cf683. At that point, thread dumps showed title threads inbind::set_pipeline_state → pso_async::resolve_for_bind → resolve_wait, with one of them inreal::build_compute → finish_psoinside vkd3d-proton.Not tested
Sleepnoticed the held time (XCL_SLEEP_HOLDwas left at its default)AI use: Claude Code (Claude Opus 5.5) ran the game on this machine, read the logs and thread dumps, and wrote this report.
@Daydream3r on GitHub · 2026-11-24 18:32 UTC · original
Independent Windows 11 / NVIDIA test of exact PR head
9cdae10f0b, clean tree, 2026-11-24.Tested
cargo build --release --workspace --lockedandcargo build --workspace --locked: exit 0.cargo test --workspace --locked --no-fail-fast -- --test-threads=4: 754 passed, 0 failed, 41 ignored, exit 0. Two explicit skips inside the passing count:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64). All XCL_SAMPLE_* inputs were unset for this full suite.scripts/smoke.ps1 -Game <local folder> -Seconds 180, XCL_NETWORK=0, default Sleep hold, no XCL_PSO_WAIT_MS: the process remained alive until XCL_RUN_SECONDS ended it at 180.001 s, exit 0. 1858 frames/PresentX calls, 0 device-removal matches and 0 crash matches, peak commit 31915 MB. The final three activity samples had 0 presents.Baseline / limits of the comparison
9e3831e1f5, an earlier interactive run really crashed at 162.790 s: 0xc0000005 atgame_scarlett_master.exe+0x23cf683, write to 0x0; stack included +0x2215c35. No device removal. It was not the automatic time limit. The smoke script'scrashes: 2counts the exception and process-exit log lines of this one process crash.b8b1f49, while the tested main is9e3831e: other changes differ too. These runs do not isolate the Sleep change or prove it fixes the earlier crash.Not tested
AI use
@emirduran707 on GitHub · 2026-11-24 18:14 UTC · original · edited 2026-11-24 18:34 UTC
Test report:
9cdae10on AMD RDNA4 (Windows), world load: the watchdog no longer fires in 600 s; presents do not come back, and compute pipelines are still being built at the endmain9e3831e+ this PR9cdae10+ #13210936337(its conflict with #680 inrecomp::translateresolved by keeping both blocks; needed here becausemainalone runs out of memory at 68 s in this load, #1307) + #7511a480bc+ #684e56dbc3scripts/smoke.ps1(soXCL_NETWORK=0),XCL_ACTIVITY=1, A at 14, 17, 21 s and every 6 s from 125 to 197 s (XCL_PRESS_A_AT), noXCL_PSO_WAIT_MS. Warm DXC cache; the driver blobs of earlier runs were kept.XCL_SLEEP_HOLD=0(PR off)+0x23cf683, write at 0)smoke.ps1, exit 0x0XCL_THREAD_DUMP_AT=100,200,400. It ended at 100.05 s, the moment of the first dump, inntdll.dll+0x1ff2a(read at 0x58), undervfs_hooks::hk_create_file_w. TheXCL_SLEEP_HOLD=0run with dumps at 100 and 200 s did not crash there, and the PR run without dumps did not crash. One run, so I cannot say whether the dump or the hold is involved.Not tested: this PR on
mainalone (the out-of-memory comes first), more than one run per arm, a full offline pipeline precompile, a run long enough for the builds to finish.Update: two more runs of the same tree on warm caches (driver blobs of the runs above kept)
0xc0000409at 43.7 GB of commit. The machine has 32 GB of RAM, so that is about its commit limit. Commit was 38–40 GB at 380–466 s, then rose 5 GB in 8 s.XCL_THREAD_DUMP_AT=440,450,456,460,464,468,472: exit 0x0, no present after 102 s, peak commit 45.5 GB. Commit rose and fell by 4–6 GB several times: 40.9 → 45.5 GB at 432–438 s, then up again at 450 and 460 s, and 37.8 → 41.5 GB at 490 s.bind → pso_async::resolve_wait(title+0x248c341 ← +0x56b07), as in @leondood1298's dumps.xcl-pso-pre-0is at the sameamdxc64.dll+0x853cbc.xcl-pso-pre-1and one more XCL thread are also insideamdxc64.dllfrom 460 s, and onexcl-dxcthread is in DXC.Written with Claude Code (Claude Opus 5.5); the runs are mine.
@Kalmarv on GitHub · 2026-11-24 18:44 UTC · original
Test report for #1288 at
9cdae10, on top ofmainb7aa9f3+ #889e1d3b9d(local mergea4f39b6). It is compared withb7aa9f3+ #889 alone (44097dc). The title is the newer retail one, at its world load; one run each.Tested
scripts/smoke.ps1, 300 s,XCL_NETWORK=0, A presses at 14/17/21 s and every 6 s from 125 s, noXCL_PSO_WAIT_MS.XCL_DXIL_CACHE. The NVIDIA driver's own shader cache (%USERPROFILE%\AppData\LocalLow\NVIDIA\DXCache) is shared and was not cleared.#101game+0x23cf683(the title's watchdog), 212.9 sRead
#101, with only 2.9 s in the driver in all. The run of #889 alone, just before this one, had built the same programs cold (188 s in the driver). The NVIDIA driver's cache then served them here. This run's first 70 s therefore tell nothing about #1288.#101, per 30 s (driver time counted when the build ends):#101#101, the builds are big programs new to the driver, coming one at a time at 10–80 s each.Not tested
b7aa9f3without #889.AI use
@madaraXor on GitHub · 2026-11-24 19:40 UTC · original
Retail title on RDNA2: no stall-check abort while binds wait for long driver compiles, without
XCL_PSO_WAIT_MSSetup: AMD Radeon RX 6700 XT 12 GB (RDNA2), driver 32.0.21045.29003, Ryzen 5 5600X, 16 GB RAM, Windows 10 Pro 22H2, Agility SDK 1.620.2, Rust 1.90.0, release. Retail title 1.0.2.1,
device_type = "lockhart",XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PSO_PRELOAD=0 XCL_DXC_THREADS=3, noXCL_PSO_WAIT_MS(with it, a skipped dispatch on this card ended a run in a GPU hang at 664 s, the #675 pattern). Tree:main930e8b4+ this PR's head95299f47d+ #684, #615, #495, #1291, #1182, #1248, #1315/#1316 (#1195 and #757–#759 in the later runs) and local changes outsidekernelx(a cap of two driver compiles at once, compact-form tweaks, a list of programs left untranslated).On this card the driver takes 10 – 120 s for each of the world's 0.3 – 1.4 MB compute programs, and much longer for the biggest, so the title's threads wait in binds for a long time once the world starts:
XCL_RUN_SECONDS; none on+0x2215c35/+0x23cf683.Before, on the same machine without this PR and without
XCL_PSO_WAIT_MS(main+ #684), the stall check ended a run at 622 s with the title's threads waiting inresolve_waitfor an 18.5 s driver compile (#505).Not tested: this PR alone on
main(it was always with the others above); NVIDIA; theXCL_SLEEP_HOLD=0switch.AI use: Claude Code, Claude Opus 5.5 ran the builds and runs on my PC and wrote this report. Counts and times only.
@raylitebull on GitHub · 2026-11-24 19:44 UTC · original
Tested on Windows 11 with an AMD Radeon RX 9070 XT (16191 MiB VRAM, RDNA4, native wave64) on local merge branches based on
c160d86(release builds,XCL_NETWORK=0,XCL_SKIP_BINK=1,XCL_MUTE_TTS=1, newer retail title).1.
c160d86+#1288(9cdae10) +#751,#1005,#1053,#1195,#1529,#1584,#1661(XCL_DIRECT_DXIL=0,XCL_HEAP_WINDOWS=1, 240 s target)Game State: Game Running(Frame: 657,TileHeap 1,995/6,236 MB,7,319buildings,197vehicles,4,194objects,18,453instances,1,760frames shown,0device removals,22,349 MBpeak commit).180.16 s:GPU Loc Sig 7333478d(0xc0000005at+0x23cf683) still fired after30 s(150.27 s -> 180.16 s) of0presents. In the thread state at abort, the game's submission thread was blocked synchronously insideD3D12Core.dll -> amdxc64.dllwhilexcl-pso-pre-0..3workers were idle — soSleepwas not paused during that synchronous driver call (pso_asyncbind-wait condvar wasn't held).2. Same bundle +
#1693(b5d6322) +#1679(ee85bc2) (XCL_DIRECT_DXIL=1,XCL_HEAP_WINDOWS=1, 300 s)300.00 s(0x0,0crashes,0device removals),1,914frames shown (PresentX 1914),75,653DirectStorage requests (4,201 MB),8,791 MBtarget pages,25,644 MBpeak commit. (Between93.6 sand212.7 s, presents trickled every10–22.4 s, staying under the30 swatchdog threshold.)Not tested
#1288without the other bundle PRs,cargo test --workspaceon these merged branches, or cold-cache builds (dxil_cachehad1,288–1,295hits /0misses).@RodrigoTorreao on GitHub · 2026-11-24 19:52 UTC · original
Test report on AMD RDNA2 for
9cdae10alone onmain(c160d86, before this PR was merged), on Windows 11 with 16 GB RAM. It goes with @madaraXor's RDNA2 report above: same driver and memory, but Windows 10 and this PR combined with others, and "this PR alone onmain" is in his Not tested.Tested
GamingServices.exe10.0.26100.9656).mainc160d86+ this PR at9cdae10, a local merge with no conflicts (49bea87).cargo test -p xcl --lib -- sleep holds_the_title, 6 passed, 0 failed.XCL_NETWORK=0 XCL_ACTIVITY=1,XCL_RUN_SECONDS=600, noXCL_PSO_WAIT_MS, noXCL_SLEEP_HOLD.XCL_DXIL_CACHE(so noused-pipelines.txtpreload),XCL_PSO_DISK_CACHE=0,XCL_TRANSLATED_CACHE=0, and a renamed copy ofxcl.exe.Runs with this PR
+0x23cf683, a device removal or an access violation. Presents did not come back in any of them.main9e3831eended at+0x23cf68329.0 – 29.5 s after the last presents (#1524, my A/B there).How they ended: Gaming Services each time
process ends …(itsNtTerminateProcesshook, even for status 0), as well as a close of its window. Neither appears in any of the three logs, so the process was ended from outside.MoBEXforMicrosoft.GamingServices_39.118.30001.0within seconds of each exit (15:57:02, 16:09:02).xapuand a compute PSO line). Nothing more is written.GamingServices.execrashes,0xc0000409inGamingServices.DLL10.0.26100.9656 at offset0x18b27e(event 1000), reported asMoBEXat 16:21:22.LiveKernelEventreports: 141 and 117 (GPU engine timeout and TDR), plus 15e, 1a8, 1b8, 144, a1000001, a2000002.+0x23cf683(the four of the A/B above, and one more with #1524's commit 1 that ended inD3D12 device removed: 0x887a0007), there was no Gaming Services crash.Not tested
XCL_SLEEP_HOLDother than the default, andXCL_PSO_WAIT_MStogether with this PR.AI use
xcl.log, the launcher output and the event log.@imnicho on GitHub · 2026-11-24 19:55 UTC · original · edited 2026-11-24 20:36 UTC
Update: it is up as #1782. After seeing #1747 I widened it: the guard covers the whole submission (XCL's uploads and tile mappings before the lists as well as the PC
ExecuteCommandLists), a texture's placement, and a pipeline built in the title's call. Suite 890 passed, 0 failed; regression pair 1398 / 1397 frames.@raylitebull thank you for merging, and for the edge case: a title thread blocked inside the driver's own call is a hold this rule does not see, because
title_held()only knows the bind's wait inresolve_wait.Plan for a small follow-up PR (written, its unit test passes, the suite and the regression pair still to run):
pso_async:pc_call()gives a guard for a call into the PC's D3D12 made on one of the title's threads. A call that has lasted 250 ms or more holds the title (title_held()), a shorter one does not, so a normal submission changes nothing.real.rs: the guard is taken around the PCExecuteCommandListsinq_execute_command_lists, and around the driver's pipeline creation infinish_psowhen it runs in the title's own call (no stand-in; a worker's build is left out).One thing would help me aim it: in the thread state at your abort, which XCL function was above
D3D12Core.dllon the submission thread –q_execute_command_lists, a pipeline creation (finish_pso/dev_create_…pipeline_state), or something else (aMap, an upload intitle_textures::refresh)? If it was something else, I would rather put the guard there than guess.I cannot reproduce it here (NVIDIA, where the long waits are all in
resolve_wait), so the PR will say what I measured on this card (no change in the regression runs, the title run as before) and that the AMD case rests on your trace. If you can run the branch once on the RX 9070 XT, that would be the real test; I will post it here when the suite is through.AI use: Claude Code with Claude Fable 5.2 wrote the change and this reply.
@leondood1298 on GitHub · 2026-11-24 17:06 UTC · original · edited 2026-11-24 21:30 UTC
Update, 2026-11-24 21:30 UTC – the run on the full cache (the follow-up promised below). Short answer: with every compute pipeline prebuilt the title gets 14 s further (last present 82 s instead of 64–68 s, list slot #101 is reached), then presents nothing more; a title thread waits in a pipeline bind for 700 s and the run ends in a device removal at 799 s.
XCL_FRAME_DUMP=1; one 900 s run. The commit limit is 95.8 GB now (larger page file).xcl shaders <pack> --precompile --only cs --pipelinesover the whole pack: 2,689 pipelines made, 0 refused, 0 errors. One process builds about one pipeline at a time here, so it ran as 9 processes over a local "record index modulo n" switch (9.2 pipelines/min; system commit up to 55 GB, about 25 GB of it theirs). A second pass in one process then loaded 2,689 of 2,689 from the driver blob cache in 270 s. 2,574 blob files: 115 programs have the DXIL of another.Wait64BitValueX … bridged to GPU queue.Wait(waiters q0 and q1, type 2, no producer queue, wait-before-signal). Nodid not complete withinline and nowould close a GPU cycleline in the whole run.bind::execute_indirect → pso_async::resolve_wait(title+0x248d19f ← +0x35dc74f, recording a type 2 list), and one to four of the fourxcl-pso-preworkers are insidenvgpucomp64.dll(all four at 480 s and 600 s). No pipeline line is logged after 83.2 s, so I cannot say what they were building: the dumps end before XCL's frames, and this tree logs the start of a compute build only when it has no cached blob.split command list (type 2) around mid-list Wait after Write64 (#2)), the nextCreatePlacedResourceXfails with0x887a0005, the device is removed and the title breaks at+0x2474606(rsi=0x887a0005). When the device was lost is not known: nothing used it between 84 s and 799 s. No nvlddmkm / Display event in the System log during the run.+0x23cf683did not fire. Peak process commit 34.2 GB; local video memory 14.55 GB on the 12 GB card from 84 s.Not tested for this update:
mainas it is now (this PR and #1321 are merged; this tree predates both merges); which pipelines the workers were building (it needs a log line and another run); the test suite and a smoke pair on this tree; AMD and 64-lane GPUs.Test report: five 900 s runs of the retail title with this PR and #1316 together on an RTX 4070 SUPER 12 GB – for the "whether the world is drawn once the pipelines are built" gap. Short answer: not reached in 75 minutes of title time; what holds it is a chain of ~1 MB compute programs at about two minutes each in the NVIDIA compiler.
Tested
5e312d5+ this PR at95299f4(cherry-picked; the old head, before the 100 ms threshold) + local revert ofb8b1f49(#1307) + one local log line at the start of each compute pipeline build. Not a clean commit.XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=900, A every 2 s from 8 to 90 s, thread dumps every 120 s. NoXCL_PSO_WAIT_MS. The driver blob ofActivateRays(14,104,656 B of DXIL) was already in the cache from the 120-minute build I reported in #505, so that program loads in 135 ms here;ActivateProbestakes the compact form (723,453 B of HLSL).+0x23cf68328–30 s after the last present in six of six runs). No device removal, no WARN or ERROR line after 60 s, 0 dispatches skipped.bind::set_pipeline_state → pso_async::resolve_wait(title+0x248c341 ← +0x248cb78 ← +0x35950f6) while the other one of the same pair is insidenvgpucomp64.dll; the render loop sits in+0x43c3d5d ← +0x23cf4f2and the main thread in+0x56a0d ← +0x23cf735throughout. The builds after 60 s are 13 programs of 869–1,173 KB of DXIL (11 finished, 59.6–147.7 s each, median 107 s; 2 still building at the limit) and 8 small ones at 0.5–5.2 s. They come one after another: the next one starts when the previous bind returns, so a 900 s run gets through about ten.Not tested
9cdae10here,ee904f1of #1316); the test suite on this tree; a smoke pair.AI use
@DavidM1911 on GitHub · 2026-11-26 04:40 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin