Repository navigation
Conversation
`q_execute_command_lists` is the one choke point every title submission goes through, and nothing measures it. When a world load leaves the screen on a spinner and the GPU watchdog ends the run (issue xcl-dev#505), there is no way to tell a slow submission from a stalled one. With `XCL_GPU_TIMING=1`, wrap the submission in a clock and keep the slowest in `report.json`: `d3d12.submissions`, `d3d12.slowest_submission_ms` and `d3d12.slowest_submission_lists` (how many command lists that submission carried). Any submission at or above `XCL_GPU_TIMING_MS` (default 50 ms) is logged as a warning. It measures the CPU side of the call only, and the field comment says so: the call returns before the GPU is finished, so this shows pipeline and allocator cost under the submission, not GPU execution time. Off by default. Counters only exist while the flag is on, so an ordinary run's `report.json` gains three zero fields and nothing else.
|
Tested on AMD Radeon RX 9070 XT (RDNA4) at Ryzen 7 5700X3D, 32 GB, Windows 11 Pro 26300.9974, AMD driver 32.0.32015.7029, Rust 1.100.0 msvc, DXC 1.9.2602.17, debug build. Tested (PR head is 0 commits behind main 47efa2e, so no merge was needed; the bare head was tested):
Not tested: retail title / Report written by Claude Code (Claude Sonnet 5.5) from a real run on this machine. Do the maintainers find these AMD/RDNA4 test reports useful, or would something else (different tests, a different format) help more? |
|
Regression pair for Tested
this PR,
Not tested
AI use: Claude Code (Claude Opus 5.5) |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
Adapt the opt-in timing from upstream PR xcl-dev#1065 to the exact native chunks emitted by the current submission planner. Keep count and slowest duration/list count as one coherent sample in report.json; ordinary submissions read no clock. Assisted-by: Codex (GPT-5.6-sol)
Adapt the opt-in timing from upstream PR xcl-dev#1065 to the exact native chunks emitted by the current submission planner. Keep count and slowest duration/list count as one coherent sample in report.json; ordinary submissions read no clock. Assisted-by: Codex (GPT-5.6-sol)
Adapt the opt-in timing from upstream PR xcl-dev#1065 to the exact native chunks emitted by the current submission planner. Keep count and slowest duration/list count as one coherent sample in report.json; ordinary submissions read no clock. Assisted-by: Codex (GPT-5.6-sol)
Adapt the opt-in timing from upstream PR xcl-dev#1065 to the exact native chunks emitted by the current submission planner. Keep count and slowest duration/list count as one coherent sample in report.json; ordinary submissions read no clock. Assisted-by: Codex (GPT-5.6-sol)
Adapt the opt-in timing from upstream PR xcl-dev#1065 to the exact native chunks emitted by the current submission planner. Keep count and slowest duration/list count as one coherent sample in report.json; ordinary submissions read no clock. Assisted-by: Codex (GPT-5.6-sol)
Adapt the opt-in timing from upstream PR xcl-dev#1065 to the exact native chunks emitted by the current submission planner. Keep count and slowest duration/list count as one coherent sample in report.json; ordinary submissions read no clock. Assisted-by: Codex (GPT-5.6-sol)
Adapt the opt-in timing from upstream PR xcl-dev#1065 to the exact native chunks emitted by the current submission planner. Keep count and slowest duration/list count as one coherent sample in report.json; ordinary submissions read no clock. Assisted-by: Codex (GPT-5.6-sol)
Adapt the opt-in timing from upstream PR xcl-dev#1065 to the exact native chunks emitted by the current submission planner. Keep count and slowest duration/list count as one coherent sample in report.json; ordinary submissions read no clock. Assisted-by: Codex (GPT-5.6-sol)
Adapt the opt-in timing from upstream PR xcl-dev#1065 to the exact native chunks emitted by the current submission planner. Keep count and slowest duration/list count as one coherent sample in report.json; ordinary submissions read no clock. Assisted-by: Codex (GPT-5.6-sol)
Adapt the opt-in timing from upstream PR xcl-dev#1065 to the exact native chunks emitted by the current submission planner. Keep count and slowest duration/list count as one coherent sample in report.json; ordinary submissions read no clock. Assisted-by: Codex (GPT-5.6-sol)
Adapt the opt-in timing from upstream PR xcl-dev#1065 to the exact native chunks emitted by the current submission planner. Keep count and slowest duration/list count as one coherent sample in report.json; ordinary submissions read no clock. Assisted-by: Codex (GPT-5.6-sol)
Part of #505. Diagnostics only: a switch and three
report.jsonfields, no behaviour change withthe flag off.
What is in it
crates/xcl/src/hle/d3d12x/real.rs—D3d12Statsgainssubmissions,slowest_submission_ms,slowest_submission_lists, all#[serde(default)]so an oldreport.jsonstill parses.crates/xcl/src/hle/d3d12x/real.rs—SUBMISSIONS,SLOWEST_SUBMISSION_US,SLOWEST_SUBMISSION_LISTScounters,gpu_timing_on()(XCL_GPU_TIMING=1) andslow_submission_us()(XCL_GPU_TIMING_MS, default 50).crates/xcl/src/hle/d3d12x/real.rs—q_execute_command_liststakes oneInstantbeforeexecute_with_waits_onand updates the counters afterpresent::note_execute; any submissionat or above the threshold logs
ExecuteCommandLists: <us> µs on the CPU for <n> list(s).crates/xcl/src/hle/d3d12x/real.rs—stats()fills the three fields.Why
q_execute_command_listsis the single choke point for every title submission, and nothingmeasures it. In #505 the run reaches the world, the title's state reads
Game Running, the screenstays on a spinner and the watchdog ends it 3–14 minutes in. From outside that looks identical
whether the CPU is spending seconds per submission (pipeline builds, allocator pools, texture
refresh) or the CPU is fine and the GPU never completes.
presentsandframe_boundariesdo notseparate the two.
This separates them, cheaply, at the one place both cases pass through.
What it does not measure — stated in the field doc comment
ExecuteCommandListsreturns before the GPU is done, so this is CPU submission cost, not GPUexecution time. It shows pipeline, allocator and texture-refresh cost under the call. Real GPU
time needs fence timestamps per submission, which is a larger change and not in this PR.
Tested
Regression run
scripts/smoke.ps1on Windows with a GPU and a retail title.Not tested
cargo test --workspace, no GPU run, noxcl-smokeblocks (main and head). All arerequired before merge.
exempts logging from tests; the counters sit behind
OnceLockand a device, so a unit test wouldneed a device or a restructure of the statics. Say if you want it restructured to be testable and
I will do that instead.
Cost when off
One
OnceLockread per submission and nothing else:gpu_timing_on()is cached after the firstcall,
timedisNone, and the counters are never touched. A world load submitting thousands oftimes pays thousands of atomic-free branch checks.
AI use
What I would run, if I had the hardware
For the two
xcl-smokeblocks, plus:Then
logs\report.json→d3d12.submissions,d3d12.slowest_submission_ms,d3d12.slowest_submission_lists, and the warnings inxcl.log. If the slowest submission is a fewms while frames still do not come, the wall is GPU-side and this PR has done its job by ruling the
CPU out.
If you want the GPU side too, the next PR should be fence-completion timestamps per submission —
say so and I will write it as a stack on top of this one.