feat(queue): VICTORY_QUEUE_STATS counts the title's queue work by kind, and stats: lane_stood tells what the submitting thread stood at (off by default) #640

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

@⁠Raptorbk45 on GitHub · 2026-12-05 22:37 UTC · original
Raptorbk45:feat/queue-stats → main · +536 −5 · 10 files · 1 commits · open

A diagnostic, off by default (VICTORY_QUEUE_STATS=1; 2 adds a per-part trace every 512th frame):

  • queue stats per frame: by the title's queue kind (direct, compute, copy, other) submissions, lists, joined parts, value waits, signals, queue waits, presents, page mappings, draws, dispatches and translated calls a frame; which kind's work each value wait waits for; some host passes recorded inside compute lists.
  • stats: lane_stood: ms a frame the submitting thread (the lane) stood with nothing to run, by what its oldest entry waited for (fence_ms, value_ms, lists_ms, other_ms), the three fences it stood at longest (set by the title from the CPU or behind a queue's work), and its working time by job (worked_send_ms, worked_map_ms, worked_present_ms, worked_other_ms; their sum is the sender line's busy_ms).
  • With VICTORY_RT_STAMPS=1 VICTORY_PASS_SAMPLE=1 (diagnostics build): the card's time by the title list's kind.

We used these lines to find what a slow streaming frame is made of on our machine (the lane's page mappings and its stands behind the frame's texture pass, see #636). With the switch off every entry point returns after one cached OnceLock read (one per draw/dispatch, one per submission, one per fence signal from the CPU).

How it was checked

Run after the final edit, on Linux (CachyOS), against main at 8c4e6633:

  • ./build.sh check (release, MSVC target): passes; the one warning (room_lately never used, resource.rs) is already on main
  • cargo xtask policy: passes
  • PROFILE=diag ./build.sh check (the rtstamps part is diagnostics-only): passes

Not run: the game, on this branch. The lines were used for days on our fork, where this code comes from (adapted to current list.rs/thin.rs).

Branch head: f7772264.

No unit test: the counters are fed from the queue, list and fence paths that need a running title. Output unchanged with the switch off (every new line is behind level() != 0).

Checks

  • One subject (queue and lane counters)
  • Off by default
  • Docs: docs/DIAGNOSTICS.md
  • N/A: unit test (see above)
  • Queue checked: #628 gates the draw/dispatch counters in list.rs/queue.rs behind diagnostics; it touches count_draw/count_dispatch where this adds one call each, so whichever lands second needs a one-line rebase. Otherwise independent.
  • cargo xtask policy
**@⁠Raptorbk45** on GitHub · 2026-12-05 22:37 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/640) `Raptorbk45:feat/queue-stats` → `main` · +536 −5 · 10 files · 1 commits · open A diagnostic, off by default (`VICTORY_QUEUE_STATS=1`; `2` adds a per-part trace every 512th frame): - `queue stats per frame`: by the title's queue kind (direct, compute, copy, other) submissions, lists, joined parts, value waits, signals, queue waits, presents, page mappings, draws, dispatches and translated calls a frame; which kind's work each value wait waits for; some host passes recorded inside compute lists. - `stats: lane_stood`: ms a frame the submitting thread (the lane) stood with nothing to run, by what its oldest entry waited for (`fence_ms`, `value_ms`, `lists_ms`, `other_ms`), the three fences it stood at longest (set by the title from the CPU or behind a queue's work), and its working time by job (`worked_send_ms`, `worked_map_ms`, `worked_present_ms`, `worked_other_ms`; their sum is the `sender` line's `busy_ms`). - With `VICTORY_RT_STAMPS=1 VICTORY_PASS_SAMPLE=1` (diagnostics build): the card's time by the title list's kind. We used these lines to find what a slow streaming frame is made of on our machine (the lane's page mappings and its stands behind the frame's texture pass, see #636). With the switch off every entry point returns after one cached `OnceLock` read (one per draw/dispatch, one per submission, one per fence signal from the CPU). ## How it was checked Run after the final edit, on Linux (CachyOS), against `main` at 8c4e6633: - `./build.sh check` (release, MSVC target): passes; the one warning (`room_lately` never used, `resource.rs`) is already on `main` - `cargo xtask policy`: passes - `PROFILE=diag ./build.sh check` (the `rtstamps` part is diagnostics-only): passes Not run: the game, on this branch. The lines were used for days on our fork, where this code comes from (adapted to current `list.rs`/`thin.rs`). Branch head: `f7772264`. No unit test: the counters are fed from the queue, list and fence paths that need a running title. Output unchanged with the switch off (every new line is behind `level() != 0`). ## Checks - [x] One subject (queue and lane counters) - [x] Off by default - [x] Docs: `docs/DIAGNOSTICS.md` - N/A: unit test (see above) - [x] Queue checked: #628 gates the draw/dispatch counters in `list.rs`/`queue.rs` behind diagnostics; it touches `count_draw`/`count_dispatch` where this adds one call each, so whichever lands second needs a one-line rebase. Otherwise independent. - [x] `cargo xtask policy`
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 22:39:30 +00:00
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/640/head:github-bot/gh-640'
git switch 'github-bot/gh-640'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-640'
git switch 'github-bot/gh-640'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-640'
git switch 'github-bot/gh-640'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-640'
git switch 'main'
git merge --squash 'github-bot/gh-640'
git switch 'main'
git merge --ff-only 'github-bot/gh-640'
git switch 'main'
git merge 'github-bot/gh-640'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.