Skip to content

D3D12.X: the looks line splits "the rest" and shows the longest look - #2144

Draft
ozimchuk wants to merge 2 commits into
xcl-dev:mainfrom
ozimchuk:activity-submit-work
Draft

ozimchuk wants to merge 2 commits into
xcl-dev:mainfrom
ozimchuk:activity-submit-work

Conversation

@ozimchuk

@ozimchuk ozimchuk commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #1832 (@marquezinii); only the top commit, f8eeef4, belongs here. It replaces this PR's earlier version, which added a second XCL_ACTIVITY line for the same looks – I had missed #1832 when I opened it.

#1832's looks before submits line gives the write-watch and the copies into sparse video memory, and leaves "the rest" as one number. On a retail title under Linux that rest was a large part of the look, so this splits it, and adds the longest look of the period: one slow look is a stall that the 2 s sum hides.

looks before submits (2 s): 181 looks took 1566 ms (78.3 % of the time, longest 14 ms): write-watch 1180 ms (14329.7 MB watched a look, 171831 pages written), copies into sparse video memory 112 ms, the rest 273 ms (view-source recheck 0, VRAM pages 0, streamed-texture recheck 1, choosing uploads 195, uploads 11 MB: hash 30, detile 11, submit 38; other 0)

(retail title, world load, main 06c9f55 + #1832 + this commit; Linux, NVIDIA (32-lane waves))

What is in it

  • crates/xcl/src/hle/d3d12x/title_textures.rs: with XCL_ACTIVITY, refresh_once and upload_all time the parts of the rest – the view-source recheck, vram::before_execute, the streamed-texture recheck (D3D12.X: re-fingerprint unwatched streamed textures at spaced frame milestones #2029), choosing the uploads, and per batch the content hash (with its read), the detile and the submit (with its wait), plus the bytes uploaded; look_parts().
  • crates/xcl/src/hle/d3d12x/sparse.rs: note_look keeps the longest look (take_longest_look); look_line takes the parts and the longest look; what the parts do not cover is "other". The unit test covers the new fields and an idle period.
  • crates/xcl/src/host.rs: passes both to the line.
  • HANDOFF.md: the line's description.

Without XCL_ACTIVITY nothing is timed (one OnceLock read per part).

Tested

Not tested

AI use

  • Claude Code, Claude Opus 5.5 wrote the code and this description and ran the tests and runs.

🤖 Generated with Claude Code

https://claude.ai/code/session_01H6JBZXaFw99FcnmUV1mPWj

AI-assisted.

@ozimchuk
ozimchuk marked this pull request as ready for review November 25, 2026 06:19
@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

Thanks!

marquezinii and others added 2 commits November 25, 2026 16:49
Before every title submit XCL looks for the CPU's writes (write-watch
over the watched ranges), copies them into sparse video memory and
uploads changed title textures, on the title's own thread. On slower
CPUs that look is most of the frame (2-6 fps on an i9-9900K in xcl-dev#582),
but the only record of it is the cumulative timing line logged at
power-of-two submit counts, so a report at a few fps cannot say how
much of each second went there.

With XCL_ACTIVITY=1 every 2 s now also logs the looks of the last 2 s:
how many, their whole time and its share of the 2 s, the write-watch
scan with the megabytes it watched a look and the pages it found, the
copies into sparse video memory, and the rest. Without XCL_ACTIVITY
only counters are added: two Instant::now() calls per look and a sum
over the cached ranges.
The `looks before submits` line (xcl-dev#1832) leaves "the rest" of a look as one number. Its parts
are timed now: the view-source recheck, the VRAM pages' sync, the recheck of streamed textures
outside the write-watch, choosing the textures to upload, and the uploads (MB; the content hash
with its read, the detile, the submit with its wait), with what is left as "other". The line
also gives the longest look of the period: one slow look is a stall an average hides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ozimchuk
ozimchuk force-pushed the activity-submit-work branch from c871a54 to f8eeef4 Compare November 25, 2026 14:59
@ozimchuk ozimchuk changed the title D3D12.X: XCL_ACTIVITY shows the time submits spend in XCL first D3D12.X: the looks line splits "the rest" and shows the longest look Nov 25, 2026
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.

3 participants