GPU: count single-list submissions in the GPU timing summary #3313

Open
github-bot wants to merge 2 commits from github-bot/gh-3313 into main AGit
Owner

@⁠neonbyte1 on GitHub · 2026-11-26 17:08 UTC · original
neonbyte1:pr/gpu-timing-all → main · +147 −23 · 2 files · 2 commits · open

VICTORY_GPU_TIMING=1 splits a host submission into one group per host list, but gpu_times() ran only when a submission had more than one group. A submission with exactly one host list was counted in the fps line's on the GPU, but was missing from GPU timing: lists ... their commands ....

This change:

  • calls gpu_times() whenever timing is on, including for single-list submissions. The slow-list and device-removed checks still apply only to multi-list submissions, which is what they're about.

  • reads the preparing/GPU/copy-back counters in the 5 s block where log_gpu_times() runs, so those parts of the fps line and the GPU timing line cover the same frames. Before, those counters were swapped every ~1 s. fps, ms/frame and draws/frame on that line still describe the last 1 s.

  • (by @⁠andrewpozdnakov7-jpg, 7592bb4) records the timestamp queries and labels whenever timing is on, not only with DRED, so VICTORY_GPU_TIMING=1 alone gives per-command times. The GPU breadcrumb markers stay DRED-only, and with DRED on the path is unchanged. It also adds an opt-in WARP test (timing_report_uses_each_submitted_list, ignored by default).

Nothing changes when timing is off: then each submission is a single group, and that path is untouched.

Measured on an RTX 5090 under Wine (vkd3d-proton), GTA VI's opening yard. The build is main plus a few unmerged PRs that this setup needs, with this commit cherry-picked unchanged:

GPU timing: lists fps line on the GPU
without this change 358–370 ms/frame ~465 ms/frame
with it (4 consecutive reports) 742.0 / 749.4 / 753.7 / 765.5 ms/frame 751.2 / 757.7 / 762.6 / 796.9 ms/frame

Without the change, about 100 ms/frame of GPU work (≈9.5 single-list submissions per frame in a diagnostics count) was missing from the timing summary and its per-command breakdown. The two runs measure different builds, so compare the gap within each row, not the absolute numbers.

Thanks to @⁠Ingenioeren, who independently found the same single-list gap on WARP in #3028.

Tested:

  • cargo clippy --workspace --all-targets -D warnings, with and without --features diagnostics, and cargo xtask policy: all clean.
  • The in-game run above.

There's no unit test: the condition sits in Host::execute after ExecuteCommandLists and a fence wait, and HostList::slowest() reads DRED timestamps from a live GPU.

AI-assisted (Claude); measured on my machine, no game data shared.

**@⁠neonbyte1** on GitHub · 2026-11-26 17:08 UTC · [original](https://github.com/Marvisak/VIctory/pull/3313) `neonbyte1:pr/gpu-timing-all` → `main` · +147 −23 · 2 files · 2 commits · open `VICTORY_GPU_TIMING=1` splits a host submission into one group per host list, but `gpu_times()` ran only when a submission had more than one group. A submission with exactly one host list was counted in the fps line's `on the GPU`, but was missing from `GPU timing: lists ... their commands ...`. **This change:** - calls `gpu_times()` whenever timing is on, including for single-list submissions. The slow-list and device-removed checks still apply only to multi-list submissions, which is what they're about. - reads the preparing/GPU/copy-back counters in the 5 s block where `log_gpu_times()` runs, so those parts of the fps line and the `GPU timing` line cover the same frames. Before, those counters were swapped every ~1 s. `fps`, `ms/frame` and `draws/frame` on that line still describe the last 1 s. - (by @⁠andrewpozdnakov7-jpg, `7592bb4`) records the timestamp queries and labels whenever timing is on, not only with DRED, so `VICTORY_GPU_TIMING=1` alone gives per-command times. The GPU breadcrumb markers stay DRED-only, and with DRED on the path is unchanged. It also adds an opt-in WARP test (`timing_report_uses_each_submitted_list`, ignored by default). Nothing changes when timing is off: then each submission is a single group, and that path is untouched. **Measured** on an RTX 5090 under Wine (vkd3d-proton), GTA VI's opening yard. The build is `main` plus a few unmerged PRs that this setup needs, with this commit cherry-picked unchanged: | | `GPU timing: lists` | fps line `on the GPU` | |---|---|---| | without this change | 358–370 ms/frame | ~465 ms/frame | | with it (4 consecutive reports) | 742.0 / 749.4 / 753.7 / 765.5 ms/frame | 751.2 / 757.7 / 762.6 / 796.9 ms/frame | Without the change, about 100 ms/frame of GPU work (≈9.5 single-list submissions per frame in a diagnostics count) was missing from the timing summary and its per-command breakdown. The two runs measure different builds, so compare the gap within each row, not the absolute numbers. Thanks to @⁠Ingenioeren, who independently found the same single-list gap on WARP in #3028. **Tested:** - `cargo clippy --workspace --all-targets -D warnings`, with and without `--features diagnostics`, and `cargo xtask policy`: all clean. - The in-game run above. There's no unit test: the condition sits in `Host::execute` after `ExecuteCommandLists` and a fence wait, and `HostList::slowest()` reads DRED timestamps from a live GPU. _AI-assisted (Claude); measured on my machine, no game data shared._
A one-list host submission is timed with VICTORY_GPU_TIMING but was excluded from gpu_times. Read the fps line counters in the five-second block so it covers the same frames as GPU timing.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 17:09:07 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 17:29 UTC · original · approved these changes

Reviewed the diff and verified locally on Windows 11 x64 (RTX 5090):

  • Guarding gpu_times with if timing() instead of if groups.len() > 1 includes single-list submissions in GPU timing, and moving the SUBMISSION_US / PREPARING / COPY_BACK swaps into the 5-second report_frames window keeps both summary lines aligned to the same frames.
  • cargo test -p victory-gpu --lib host::tests:: -- --test-threads=1 (RTX 5090): 12 passed, 0 failed.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo clippy -p victory-gpu --features diagnostics --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-26 17:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/3313#pullrequestreview-6078388456) · **approved these changes** Reviewed the diff and verified locally on Windows 11 x64 (RTX 5090): - Guarding `gpu_times` with `if timing()` instead of `if groups.len() > 1` includes single-list submissions in `GPU timing`, and moving the `SUBMISSION_US` / `PREPARING` / `COPY_BACK` swaps into the 5-second `report_frames` window keeps both summary lines aligned to the same frames. - `cargo test -p victory-gpu --lib host::tests:: -- --test-threads=1` (RTX 5090): 12 passed, 0 failed. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo clippy -p victory-gpu --features diagnostics --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 17:46 UTC · original

I checked the single-list timing path on exact b3d738a with a synthetic WARP copy workload. With VICTORY_GPU_TIMING=1 and DRED enabled, the PR records 2 commands for one list, 4 for two lists, and 4 for the same list submitted twice. With DRED off, it records the list wall time, but all three command counts are zero because HostList::note still gates the timestamp labels on DRED.

Follow-up 003f1e2 records the timestamp queries and labels whenever timing is on, with the GPU breadcrumb markers still gated on DRED. The same copy readbacks and counts passed in three fresh runs per DRED setting on verified app-local Agility 1.620.2/WARP 1.0.22. With both flags disabled, the full diagnostics suite passed 247 tests with 2 ignored, including the opt-in timing test. Strict Clippy in both configurations and asset policy passed. This uses the copy fixture from the earlier #1735 investigation.

@⁠neonbyte1 the patch is directly on your head if you want to take it. Please retain its Git author on cherry-pick, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding it into another commit. AI-assisted with Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 17:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/3313#issuecomment-7199630106) I checked the single-list timing path on exact `b3d738a` with a synthetic WARP copy workload. With `VICTORY_GPU_TIMING=1` and DRED enabled, the PR records 2 commands for one list, 4 for two lists, and 4 for the same list submitted twice. With DRED off, it records the list wall time, but all three command counts are zero because `HostList::note` still gates the timestamp labels on DRED. [Follow-up `003f1e2`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/003f1e2d4d1f03f8c82547d8709475667ac11b49) records the timestamp queries and labels whenever timing is on, with the GPU breadcrumb markers still gated on DRED. The same copy readbacks and counts passed in three fresh runs per DRED setting on verified app-local Agility 1.620.2/WARP 1.0.22. With both flags disabled, the full diagnostics suite passed 247 tests with 2 ignored, including the opt-in timing test. Strict Clippy in both configurations and asset policy passed. This uses the copy fixture from the earlier #1735 investigation. @⁠neonbyte1 the patch is directly on your head if you want to take it. Please retain its Git author on cherry-pick, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding it into another commit. AI-assisted with Codex.
Author
Owner

@⁠neonbyte1 on GitHub · 2026-11-26 17:49 UTC · original

@⁠andrewpozdnakov7-jpg thanks, good find. I took your commit as is, keeping you as author: 7592bb4 on the PR branch, and the PR description now mentions it.

I checked it before pushing: with DRED on, note() does exactly what it did before (timestamp, marker, label), so the in-game numbers above still hold. With DRED off, the timestamps and labels are recorded without the markers, which is what timing needs. Clippy --workspace --all-targets -D warnings passes with and without diagnostics, as do the policy check and formatting.

This also means the README note from #1703 (per-command times need DRED) no longer applies once this lands.

AI-assisted (Claude); measured on my machine, no game data shared.

**@⁠neonbyte1** on GitHub · 2026-11-26 17:49 UTC · [original](https://github.com/Marvisak/VIctory/pull/3313#issuecomment-7199719507) @⁠andrewpozdnakov7-jpg thanks, good find. I took your commit as is, keeping you as author: `7592bb4` on the PR branch, and the PR description now mentions it. I checked it before pushing: with DRED on, `note()` does exactly what it did before (timestamp, marker, label), so the in-game numbers above still hold. With DRED off, the timestamps and labels are recorded without the markers, which is what timing needs. Clippy `--workspace --all-targets -D warnings` passes with and without `diagnostics`, as do the policy check and formatting. This also means the README note from #1703 (per-command times need DRED) no longer applies once this lands. _AI-assisted (Claude); measured on my machine, no game data shared._
Author
Owner

@⁠borosf on GitHub · 2026-11-26 19:03 UTC · original

Independent local verification on Windows 11 x64, Intel Arc B580 12 GB (12 cores), at this PR's head 7592bb4:

cargo test -p victory-gpu --lib --locked --no-fail-fast -- --test-threads=1
cargo clippy -p victory-gpu --all-targets --locked -- -D warnings
cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings

Result: victory-gpu lib: 229 passed / 2 failed (both known baseline); flakes passed first run.

Both clippy runs exit 0 (-D warnings, both feature sets). The B580 baseline failures pristine main also hits are: victory-gpu descriptor::host::tests::dynamic_slots_are_held_until_released + memory::tests::lists_share_a_table_and_copies_keep_their_views (#1744/#1829); victory-shader emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros + emit::valu_tests::fspx_programs_run_with_the_hardwares_dot_products. No PR regressions.

Synthetic tests only; no game data used. Full log kept locally. — borosf

**@⁠borosf** on GitHub · 2026-11-26 19:03 UTC · [original](https://github.com/Marvisak/VIctory/pull/3313#issuecomment-7201152090) Independent local verification on Windows 11 x64, Intel Arc B580 12 GB (12 cores), at this PR's head `7592bb4`: ``` cargo test -p victory-gpu --lib --locked --no-fail-fast -- --test-threads=1 cargo clippy -p victory-gpu --all-targets --locked -- -D warnings cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings ``` Result: victory-gpu lib: 229 passed / 2 failed (both known baseline); flakes passed first run. Both clippy runs exit 0 (-D warnings, both feature sets). The B580 baseline failures pristine main also hits are: victory-gpu descriptor::host::tests::dynamic_slots_are_held_until_released + memory::tests::lists_share_a_table_and_copies_keep_their_views (#1744/#1829); victory-shader emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros + emit::valu_tests::fspx_programs_run_with_the_hardwares_dot_products. No PR regressions. Synthetic tests only; no game data used. Full log kept locally. — borosf
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3313/head:github-bot/gh-3313'
git switch 'github-bot/gh-3313'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3313'
git switch 'github-bot/gh-3313'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3313'
git switch 'github-bot/gh-3313'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3313'
git switch 'main'
git merge --squash 'github-bot/gh-3313'
git switch 'main'
git merge --ff-only 'github-bot/gh-3313'
git switch 'main'
git merge 'github-bot/gh-3313'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3313
No description provided.