GPU: the frame line times the title's calls, and how long they waited #3224

Open
github-bot wants to merge 1 commit from github-bot/gh-3224 into main AGit
Owner

@⁠borosf on GitHub · 2026-11-26 13:39 UTC · original
borosf:vibe/call-counters-842ca5 → main · +34 −3 · 2 files · 1 commits · open

Summary

Every counter on the frame line times submission-side work — preparing, copying back, guarding, heaps, descriptors. Nothing times the recording side: the title's calls into its command lists, which #2590 puts at "about 42,000 list calls a frame … roughly 20 µs each (RTX 4050 Laptop): the largest CPU cost of a frame".

That figure cannot be checked against this tree today, and the two readings of it want opposite fixes: ~2–4 µs of instructions per call is a code problem, tens of microseconds is a call waiting on the submission's locks — a different problem, mostly with a different owner (NEW-74/@RVZO6's sync_heaps hold on SHADER_HEAPS, which FIND-30 already prices at 48 ms a frame of title threads waiting).

list::with_state is where every list handler's body runs, so it now reports:

  • Calls — the calls that did work,
  • CallUs — how long their bodies took,
  • CallWaitUs — how long they waited for the list's own locks (the segment's host list, then the draw state) before doing anything.

Split that way, the frame line says which of the two a frame's recording time is. Printed at the end of the existing line, as list calls N in X ms, Y ms waiting for the list.

Diagnostics builds only, like every other counter in this file: with the feature off, nothing is measured and nothing is added to the call.

Verification

Intel Arc B580, Windows 11:

  • cargo test -p victory-gpu --lib --features diagnostics --locked -- --test-threads=1 → 244 passed, 2 failed, 1 ignored. The two are the known Intel heap-cap pair (descriptor::host::tests::dynamic_slots_are_held_until_released, memory::tests::lists_share_a_table_and_copies_keep_their_views — #1744/#1829) that pristine main 63bcca4 also fails on this card.
  • The wiring was checked against a real call rather than compilation: with_state on a created list raised Calls by exactly one, then the probe was removed (final diff: two files, +34/−3).
  • cargo clippy -p victory-gpu --all-targets -- -D warnings clean with and without the diagnostics feature.
  • cargo xtask policy → 193 files ok.

No game data used; synthetic tests only. Measurement only — no behaviour change on any path.

claiming: GPU: the frame line times the title's calls into its command lists (how many, how long, and how long they waited for the list's locks) — the recording side of a frame, which no counter measures today

**@⁠borosf** on GitHub · 2026-11-26 13:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/3224) `borosf:vibe/call-counters-842ca5` → `main` · +34 −3 · 2 files · 1 commits · open ## Summary Every counter on the frame line times **submission-side** work — preparing, copying back, guarding, heaps, descriptors. Nothing times the **recording** side: the title's calls into its command lists, which #2590 puts at "about 42,000 list calls a frame … roughly 20 µs each (RTX 4050 Laptop): the largest CPU cost of a frame". That figure cannot be checked against this tree today, and the two readings of it want opposite fixes: ~2–4 µs of instructions per call is a code problem, tens of microseconds is a call **waiting** on the submission's locks — a different problem, mostly with a different owner (`NEW-74`/@RVZO6's `sync_heaps` hold on `SHADER_HEAPS`, which FIND-30 already prices at 48 ms a frame of title threads waiting). `list::with_state` is where every list handler's body runs, so it now reports: - `Calls` — the calls that did work, - `CallUs` — how long their bodies took, - `CallWaitUs` — how long they waited for the list's own locks (the segment's host list, then the draw state) before doing anything. Split that way, the frame line says which of the two a frame's recording time is. Printed at the end of the existing line, as `list calls N in X ms, Y ms waiting for the list`. Diagnostics builds only, like every other counter in this file: with the feature off, nothing is measured and nothing is added to the call. ## Verification Intel Arc B580, Windows 11: - `cargo test -p victory-gpu --lib --features diagnostics --locked -- --test-threads=1` → **244 passed, 2 failed, 1 ignored**. The two are the known Intel heap-cap pair (`descriptor::host::tests::dynamic_slots_are_held_until_released`, `memory::tests::lists_share_a_table_and_copies_keep_their_views` — #1744/#1829) that pristine `main` `63bcca4` also fails on this card. - The wiring was checked against a real call rather than compilation: `with_state` on a created list raised `Calls` by exactly one, then the probe was removed (final diff: two files, +34/−3). - `cargo clippy -p victory-gpu --all-targets -- -D warnings` clean with and without the `diagnostics` feature. - `cargo xtask policy` → 193 files ok. No game data used; synthetic tests only. Measurement only — no behaviour change on any path. claiming: GPU: the frame line times the title's calls into its command lists (how many, how long, and how long they waited for the list's locks) — the recording side of a frame, which no counter measures today
Every counter on the frame line times submission-side work -- preparing,
copying back, guarding, heaps. Nothing times the recording side: the
title's calls into its command lists, which #2590 puts at about 42,000 a
frame and about 20 us each on an RTX 4050 Laptop, "the largest CPU cost of
a frame". That number cannot be checked against this tree, and the two
readings of it want opposite fixes: ~2-4 us of instructions per call is a
code problem, tens of microseconds is a call waiting on the submission's
locks, which is a different problem with a different owner.

`with_state` is where every list handler's body runs, so it now reports
`Calls`, `CallUs` and `CallWaitUs`: how many calls did work, how long they
took, and how long they waited for the list's own locks (the segment's
host list and the draw state) before doing anything. Split that way, the
line says which of the two a frame's recording time is.

Diagnostics builds only, as every counter here is: without the feature
nothing is measured and nothing is added to the call.

Verified on an Intel Arc B580, Windows 11:
- `cargo test -p victory-gpu --lib --features diagnostics --locked --
  --test-threads=1`: 244 passed, 2 failed -- the known Intel heap-cap pair
  (#1744/#1829) that pristine main also fails on this card.
- The wiring checked against a real call: `with_state` through a created
  list raised `Calls` by one, then the probe was removed (the diff is two
  files, +34/-3).
- `cargo clippy -p victory-gpu --all-targets -- -D warnings` clean with
  and without the `diagnostics` feature; `cargo xtask policy`: 193 files ok.

No game data used; synthetic tests only.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 13:41:53 +00:00
Author
Owner

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

Verified on RTX 5090 against origin/main (63bcca4):

  • cargo test -p victory-gpu --lib draw:: -- --test-threads=1: 20/20 passed.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings & --features diagnostics: clean.
  • cargo xtask policy: 191 files ok.

Cleanly times title command-list calls and their wait durations in the frame summary line.

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

**@⁠Dukestar69** on GitHub · 2026-11-26 13:50 UTC · [original](https://github.com/Marvisak/VIctory/pull/3224#pullrequestreview-6075258906) · **approved these changes** Verified on RTX 5090 against `origin/main` (`63bcca4`): - `cargo test -p victory-gpu --lib draw:: -- --test-threads=1`: 20/20 passed. - `cargo clippy -p victory-gpu --all-targets -- -D warnings` & `--features diagnostics`: clean. - `cargo xtask policy`: 191 files ok. Cleanly times title command-list calls and their wait durations in the frame summary line. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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/3224/head:github-bot/gh-3224'
git switch 'github-bot/gh-3224'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3224'
git switch 'github-bot/gh-3224'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3224'
git switch 'github-bot/gh-3224'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3224'
git switch 'main'
git merge --squash 'github-bot/gh-3224'
git switch 'main'
git merge --ff-only 'github-bot/gh-3224'
git switch 'main'
git merge 'github-bot/gh-3224'
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!3224
No description provided.