D3D12.X: CPU-write looks on the submit path: measure and turn on XCL_LOOK_AHEAD (former workstream 8, part 3) #3435
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-29T16:06:56Z.
The CPU-write looks before each
ExecuteCommandListsstill take a large share of the submittingthread's time, and two switches that move part of that work off the thread are off by default
with no measurement on a title. This picks up the write-watch cadence part of the former
workstream 8 (per-frame memory traffic on the submit path). That workstream was claimed in #2688,
which no longer opens. It was part 3 of @Decodere's plan: "evaluate whether per-frame write-watch
look coalescing beyond
XCL_LOOK_SKIPhelps". Parts 1 and 2 (#2729, #2749) and theXCL_LOOK_SKIPfix (#2768) were merged on 2026-11-28; part 3 has had no activity since 2026-11-26.@Decodere, if you are still on it, say so and I will step back.
What was measured (main
d8bd9a38, which has #2729 / #2749 / #2768; RTX 2070 SUPER 8 GB, retailgame,
XCL_ACTIVITY=1): the "looks before submits" took a mean of 8.8 % of wall time in menus and14-16 % in 300-600 s runs. The peak was 65 % of one 2 s window. In one example window: write-watch
86 ms over 5.5 GB, sparse uploads 102 ms.
What already exists (
hle/d3d12x/title_textures.rs):XCL_WATCH_HOT(on): a look takes only recently written 2 MiB blocks, and a thread walks the rest.XCL_LOOK_AHEAD=<ms>(off): a thread takes the hot blocks' written pages between submits. Whatis uploaded, and when, stays the same; the cost moves off the submitting thread.
XCL_LOOK_SKIP=1(off): a submit whose lists were all closed before the last look began skipsits own look. Unlike look-ahead, this changes what a submit sees: a CPU write between the list's
close and its submit waits for the next look.
Plan:
XCL_LOOK_AHEAD=2vsXCL_LOOK_AHEAD=2 XCL_LOOK_SKIP=1, all withXCL_LOOK_STATS=2. Results posted here with theexact commands.
XCL_LOOK_AHEAD=0toturn it off.
XCL_LOOK_SKIPstays opt-in unless the measurement makes a case for it, in aseparate PR.
sparse::before_execute(chunk compare plus upload) or in thetexture uploads, a proposal here before any code.
Related, not covered here: #2891 (write-watch merge gap, cold-chunk tiering), #3010
(tile-mapping fence), #2955 (present split under
XCL_LOOK_STATS=2), and @oni-swr's measurement ofthe untimed
vram::before_execute.Machine for my runs: RTX 2070 SUPER 8 GB (driver 621.40, 32-lane waves), Ryzen 5 3600XT, 32 GB,
Windows 11 26300, release builds. AMD runs would help once step 1 is posted.
AI use: Claude Code (Claude Opus 5.5) read the code and drafted this issue.
Imported from ivall/xcl. Originally posted by clusterbrandon65 on 2026-11-29T16:07:48Z.
d3d12xLookAhead.zip
Seeing the same spike here: looks ahead of ExecuteCommandLists eating 14-16%, and that 65% window is rough. Run the attached build once with XCL_LOOK_STATS=2, then again with XCL_LOOK_AHEAD=2, and diff the per-window timings — it replays the warm-cache submit path, so you can tell whether the work actually moves off the submitting thread.
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-29T16:32:16Z.
@clusterbrandon65 Could you please tell me what you compiled the .exe in the zip from? I'd rather not run random .exe's from zips... If you could detail what commit you compiled from, and all the flags you used!