perf(gpu): gate DRAWS and DISPATCHES atomic counters behind diagnostics #628

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

@⁠chefulano on GitHub · 2026-12-05 20:27 UTC · original
chefulano:perf/gate-hot-path-counters → main · +64 −32 · 2 files · 1 commits · open

In default (non-diagnostics) builds, crates/victory-gpu/src/list.rs still updates the global DRAWS and DISPATCHES atomic counters alongside TOTALS, even though DRAWS and DISPATCHES are only consumed by the power-of-two frame presented diagnostic log in crates/victory-gpu/src/queue.rs.

Building cleanly on #511's CountBatch batching, this change gates the DRAWS and DISPATCHES atomic updates (in both CountBatch::drop and count_add) and the power-of-two take_counts() log in queue.rs behind cfg!(feature = "diagnostics"). TOTALS continues to be updated unconditionally so frame-to-frame metrics (crate::popwatch) are unchanged.

Ported cleanly from gamingwithhomie/larp (PR #28) and adapted onto main post-#511.

Queue check

  • Follows #511 (already merged); removes the remaining non-diagnostic DRAWS/DISPATCHES atomic updates on top of CountBatch. No open PR duplicates this.

Checks

  • cargo xtask policy — pass (368 files ok)
  • cargo check --locked --release --target x86_64-pc-windows-msvc -p victory-gpu -p victory --tests (default and --features diagnostics) — pass
  • cargo clippy --no-deps --locked --release --target x86_64-pc-windows-msvc -p victory-gpu --all-targets — 0 new warnings
  • PKG=victory-gpu ./build.sh test --lib -- draws_and_dispatches_counters_are_gated_by_diagnostics — 1/1 passed (verifies TOTALS always increments across direct and CountBatch paths while DRAWS/DISPATCHES stay 0 without diagnostics)
  • Cost: power-of-two "frame presented (since the last line: draws and dispatches...)" log line is now emitted only in diagnostics builds.

Created with Gemini 4 Neon in T3 Code.

**@⁠chefulano** on GitHub · 2026-12-05 20:27 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/628) `chefulano:perf/gate-hot-path-counters` → `main` · +64 −32 · 2 files · 1 commits · open In default (non-`diagnostics`) builds, `crates/victory-gpu/src/list.rs` still updates the global `DRAWS` and `DISPATCHES` atomic counters alongside `TOTALS`, even though `DRAWS` and `DISPATCHES` are only consumed by the power-of-two `frame presented` diagnostic log in `crates/victory-gpu/src/queue.rs`. Building cleanly on #511's `CountBatch` batching, this change gates the `DRAWS` and `DISPATCHES` atomic updates (in both `CountBatch::drop` and `count_add`) and the power-of-two `take_counts()` log in `queue.rs` behind `cfg!(feature = "diagnostics")`. `TOTALS` continues to be updated unconditionally so frame-to-frame metrics (`crate::popwatch`) are unchanged. Ported cleanly from `gamingwithhomie/larp` (PR #28) and adapted onto `main` post-#511. ### Queue check - Follows #511 (already merged); removes the remaining non-diagnostic `DRAWS`/`DISPATCHES` atomic updates on top of `CountBatch`. No open PR duplicates this. ### Checks - `cargo xtask policy` — pass (`368 files ok`) - `cargo check --locked --release --target x86_64-pc-windows-msvc -p victory-gpu -p victory --tests` (default and `--features diagnostics`) — pass - `cargo clippy --no-deps --locked --release --target x86_64-pc-windows-msvc -p victory-gpu --all-targets` — 0 new warnings - `PKG=victory-gpu ./build.sh test --lib -- draws_and_dispatches_counters_are_gated_by_diagnostics` — 1/1 passed (verifies `TOTALS` always increments across direct and `CountBatch` paths while `DRAWS`/`DISPATCHES` stay 0 without `diagnostics`) - Cost: power-of-two `"frame presented (since the last line: draws and dispatches...)"` log line is now emitted only in `diagnostics` builds. Created with Gemini 4 Neon in T3 Code.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 20:30:45 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/628/head:github-bot/gh-628'
git switch 'github-bot/gh-628'

Merge

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