Skip to content

[upstream #1782] kernelx: Sleep does not count a long PC call on one of the title's threads - #352

Open
ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1782
Open

ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1782

Conversation

@ufoptg

@ufoptg ufoptg commented Nov 25, 2026

Copy link
Copy Markdown
Owner

A follow-up to xcl-dev#1288 for the case @raylitebull reported when merging it (xcl-dev#1288 (comment)): on an AMD RX 9070 XT a retail title's stall check still ended it after 30 s without a present, with the title's submission thread inside the driver (D3D12Core.dll → amdxc64.dll) and no bind waiting. xcl-dev#1288 only sees a bind's wait in resolve_wait, so Sleep went on counting.

Here a call of the title into D3D12 that XCL or the PC's driver keeps for 250 ms or more holds the title as well. A shorter call holds nobody, so an ordinary submission changes nothing. Part of xcl-dev#505.

What is in it

  • crates/xcl/src/hle/d3d12x/pso_async.rs: pc_call(), a guard for such a call on one of the title's threads; title_held() is also true while one has lasted PC_CALL_HOLDS_AFTER (250 ms) or more; building_here(), whether this thread is a worker building a pipeline. Test a_long_pc_call_holds_the_title.
  • crates/xcl/src/hle/d3d12x/real.rs: the guard for the whole of q_execute_command_lists (XCL's uploads and tile mappings before the lists, the PC ExecuteCommandLists, what follows it), and in finish_pso around the driver's pipeline creation when that runs in the title's own call (no stand-in; a worker's build holds nobody).
  • crates/xcl/src/hle/d3d12x/device_x.rs: the guard in create_placed_resource_x (a texture placed on reserved memory: the PC's reserved resource and its tile mappings).
  • 68 lines added, 3 removed in 3 files. With held_by_pc_call made to answer false, the test fails ("a PC call has lasted 500.0099ms, but the title is not held").

Tested

Regression run (default settings)

main:

xcl-smoke v1
commit: b9b6ea62080cc62fc19e212033372d01c6214e5c
gpu: NVIDIA GeForce RTX 5080
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1398 (PresentX 1399)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14315 MB

PR:

xcl-smoke v1
commit: fb9c082c210cc64c2ec7067e099c473065853545
gpu: NVIDIA GeForce RTX 5080
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1397 (PresentX 1398)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14332 MB

A second round of the same two binaries: main 1396 frames, PR 1383. The head is on b9b6ea6, the commit of the main block; main has gone on to 4178e88 since (no file in common with this change, and it merges cleanly).

Not tested

AI use

  • Claude Code with Claude Fable 5.2: wrote the change and its test, ran the suite and the title runs on the machine named, and wrote this description.

Duplicate check (20:36 UTC, 24 Nov): no open PR counts a long call as holding the title; read xcl-dev#1747 (removes tile-mapping stalls themselves), xcl-dev#1046 (when a stalled GPU wait is released), xcl-dev#1429 (the sync watchdog after CPU releases), xcl-dev#1442 and xcl-dev#889 (build ahead: they shorten the waits).

🤖 Generated with Claude Code


Mirror of xcl-dev#1782 (auto-synced, do not edit).

…reads

A title's Sleep does not count the time a bind waits for a pipeline still being
built (pso_async::title_held). A title's thread can also be kept inside a call that
takes no time on the console: a submission, where XCL uploads and maps tiles before
the lists and a driver can compile in them, a texture's placement on reserved
memory, or a pipeline built in the title's call because it got no stand-in. On an
AMD RX 9070 XT a retail title's stall check still ended it after 30 s without a
present, with its submission thread inside the driver and no bind waiting (reported
on xcl-dev#1288).

pso_async::pc_call() is a guard for such a call. A call that has lasted 250 ms or
more holds the title, a shorter one does not, so an ordinary submission changes
nothing. It is taken for the whole of q_execute_command_lists, in
create_placed_resource_x, and around the driver's pipeline creation when that runs
in the title's own call (a worker's build holds nobody).

Test: a_long_pc_call_holds_the_title.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants