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

Open
ozimchuk wants to merge 2 commits from upstream-pr/2144 into main
ozimchuk commented 2026-11-25 06:13:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ozimchuk on 2026-11-25T06:13:04Z.


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 (#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

  • NVIDIA (32-lane waves), Linux, Wine 11.21 + vkd3d-proton (dxil-spirv 694cc67), release build for x86_64-pc-windows-gnu, Rust 1.100.0.
  • cargo test -p xcl --lib --release -- --test-threads=4 on this head: 1 186 passed, 11 failed, 26 ignored. 10 of them fail on main aaa931b here too (test data, DXIL validator and precision cases of this setup); the 11th, list_x::tests::mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares, passes when run alone. d3d12x::sparse and d3d12x::title_textures alone: 16 and 18 passed, 0 failed, including the_look_line_splits_the_time.
  • The retail title, 120 s, XCL_ACTIVITY=1: the line above every 2 s, "other" 0–1 ms throughout. The run ends at ~82 s in xg::copy_from as main does here (#662; #684 fixes it).

Not tested

  • Windows, and a run past the world load on this exact head (main crashes at it here without #684).

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.

<!-- greyfinch-sync:ivall/xcl:issue:5486197010 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2144). Originally posted by [ozimchuk](https://github.com/ozimchuk) on 2026-11-25T06:13:04Z. --- 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 (#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** - NVIDIA (32-lane waves), Linux, Wine 11.21 + vkd3d-proton (dxil-spirv `694cc67`), release build for `x86_64-pc-windows-gnu`, Rust 1.100.0. - `cargo test -p xcl --lib --release -- --test-threads=4` on this head: 1 186 passed, 11 failed, 26 ignored. 10 of them fail on `main` `aaa931b` here too (test data, DXIL validator and precision cases of this setup); the 11th, `list_x::tests::mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares`, passes when run alone. `d3d12x::sparse` and `d3d12x::title_textures` alone: 16 and 18 passed, 0 failed, including `the_look_line_splits_the_time`. - The retail title, 120 s, `XCL_ACTIVITY=1`: the line above every 2 s, "other" 0–1 ms throughout. The run ends at ~82 s in `xg::copy_from` as `main` does here (#662; #684 fixes it). **Not tested** - Windows, and a run past the world load on this exact head (`main` crashes at it here without #684). **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.com/claude-code) https://claude.ai/code/session_01H6JBZXaFw99FcnmUV1mPWj AI-assisted.
DavidM1911 commented 2026-11-25 07:05:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T06:49:25Z.


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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7155195416 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2144#issuecomment-7155195416). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T06:49:25Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
upstream-sync changed title from [PR #2144] D3D12.X: XCL_ACTIVITY shows the time submits spend in XCL first to [PR #2144] D3D12.X: the looks line splits "the rest" and shows the longest look 2026-11-25 15:06:34 +00:00
DavidM1911 commented 2026-11-26 09:07:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T08:15:20Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7186373811 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2144#issuecomment-7186373811). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T08:15:20Z. --- 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
Foniass commented 2026-12-01 07:28:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:28:48Z.


Triage (#1607) – head f8eeef4

Stacked on #1832: fa2dca5 is the same patch as #1832's commit, and only f8eeef4 (the split of "the rest" and the longest look) belongs here. That is not a duplicate. No other open PR splits the looks line.
Minor: the commit edits HANDOFF.md. CONTRIBUTING asks feature PRs to point out a stale statement in the description, not to edit that file. The PR is a draft and conflicts with main.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7304106138 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2144#issuecomment-7304106138). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:28:48Z. --- **Triage (#1607)** – head f8eeef4 Stacked on #1832: fa2dca5 is the same patch as #1832's commit, and only f8eeef4 (the split of "the rest" and the longest look) belongs here. That is not a duplicate. No other open PR splits the looks line. Minor: the commit edits `HANDOFF.md`. CONTRIBUTING asks feature PRs to point out a stale statement in the description, not to edit that file. The PR is a draft and conflicts with main. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2144:upstream-pr/2144'
git switch 'upstream-pr/2144'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2144'
git switch 'upstream-pr/2144'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2144'
git switch 'upstream-pr/2144'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2144'
git switch 'main'
git merge --squash 'upstream-pr/2144'
git switch 'main'
git merge --ff-only 'upstream-pr/2144'
git switch 'main'
git merge 'upstream-pr/2144'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!2134
No description provided.