GPU: add diagnostics for shader dependency wait times #1571

Open
github-bot wants to merge 7 commits from github-bot/gh-1571 into main AGit
Owner

@⁠srijann07 on GitHub · 2026-11-24 19:16 UTC · original
srijann07:diagnostics/pipeline-dependency-timing → main · +192 −4 · 3 files · 7 commits · open

Motivation

Related to #1509. Measure shader dependency waits before changing pipeline scheduling.

Changes

  • Cumulative shader initialization and dependency lookup timing.
  • Host pipeline creation and worker job timing.
  • Diagnostics-only instrumentation.
  • Four regression tests and Windows CI coverage.

Verification

Limitations

Approximate elapsed timings, not exact CPU utilization. Reporting occurs when the queue drains. Separate idle-worker and library-lock metrics are not included. No game assets used or in-game performance improvements claimed.

AI-assisted development.

**@⁠srijann07** on GitHub · 2026-11-24 19:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/1571) `srijann07:diagnostics/pipeline-dependency-timing` → `main` · +192 −4 · 3 files · 7 commits · open ## Motivation Related to #1509. Measure shader dependency waits before changing pipeline scheduling. ## Changes - Cumulative shader initialization and dependency lookup timing. - Host pipeline creation and worker job timing. - Diagnostics-only instrumentation. - Four regression tests and Windows CI coverage. ## Verification - Standard and diagnostics Clippy: passed. - Workspace: 342 passed, 0 failed, 6 ignored. - New regression tests: 4 passed, 0 failed. - CI: https://github.com/srijann07/VIctory/actions/runs/45466635156 ## Limitations Approximate elapsed timings, not exact CPU utilization. Reporting occurs when the queue drains. Separate idle-worker and library-lock metrics are not included. No game assets used or in-game performance improvements claimed. AI-assisted development.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:36:46 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:31 UTC · original · edited 2026-11-25 07:20 UTC

Automated triage for the maintainers.

Merge candidate (update after your reply). For #1509 this adds diagnostics-only timing. It splits shader translation time from time spent waiting on another worker's translation (timing::lookup around the OnceLock in Shader::translated, crates/victory-gpu/src/pipeline.rs). It also times host PSO creation (HostCreationTimer in HostPipeline::new) and worker jobs (work in make.rs). All three points from the last review are addressed. The CI workflow change is gone, and the timing tests now build under cfg(test), so the existing test step runs them. timing::report() now runs only inside the PEAK >= 10 branch of drained(). The weak tests have been replaced with ones that check how init and wait time are attributed. Builds without diagnostics behave as before.

One small nit: the body of the initialize closure in Shader::translated keeps its old indentation, so a cargo fmt pass would tidy it.

CI: passing (check).


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/1571#issuecomment-7149637120) · edited 2026-11-25 07:20 UTC <!-- victory-triage v1 head=45c29d95ef1b852e31a5e8924f70315d97f71f40 verdict=merge-candidate at=2026-11-25T07:20:23Z --> Automated triage for the maintainers. **Merge candidate (update after your reply).** For #1509 this adds diagnostics-only timing. It splits shader translation time from time spent waiting on another worker's translation (`timing::lookup` around the `OnceLock` in `Shader::translated`, `crates/victory-gpu/src/pipeline.rs`). It also times host PSO creation (`HostCreationTimer` in `HostPipeline::new`) and worker jobs (`work` in `make.rs`). All three points from the last review are addressed. The CI workflow change is gone, and the `timing` tests now build under `cfg(test)`, so the existing test step runs them. `timing::report()` now runs only inside the `PEAK >= 10` branch of `drained()`. The weak tests have been replaced with ones that check how init and wait time are attributed. Builds without `diagnostics` behave as before. One small nit: the body of the `initialize` closure in `Shader::translated` keeps its old indentation, so a `cargo fmt` pass would tidy it. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠srijann07 on GitHub · 2026-11-25 06:05 UTC · original

Thanks for the previous approval! Rebased onto upstream main (940d32f) and resolved all conflicts. Fresh Windows CI, both Clippy configurations and tests passed.

CI: https://github.com/srijann07/VIctory/actions/runs/45557320404

I'd appreciate a re-review when convenient. Thanks!

**@⁠srijann07** on GitHub · 2026-11-25 06:05 UTC · [original](https://github.com/Marvisak/VIctory/pull/1571#issuecomment-7154433072) Thanks for the previous approval! Rebased onto upstream main (940d32f) and resolved all conflicts. Fresh Windows CI, both Clippy configurations and tests passed. CI: https://github.com/srijann07/VIctory/actions/runs/45557320404 I'd appreciate a re-review when convenient. Thanks!
Author
Owner

@⁠srijann07 on GitHub · 2026-11-25 07:11 UTC · original

Thanks for the feedback!

All review points have been addressed:

  • Timing reports now follow the existing batch threshold of 10.
  • CI workflow changes have been removed.
  • Timing attribution tests now run in the standard Windows test suite.
  • Replaced weaker tests with targeted initialization and dependency lookup attribution tests.

Fresh Windows CI and both Clippy configurations passed.

https://github.com/srijann07/VIctory/actions/runs/45565487083

Ready for re-review. Thanks!

**@⁠srijann07** on GitHub · 2026-11-25 07:11 UTC · [original](https://github.com/Marvisak/VIctory/pull/1571#issuecomment-7155596528) Thanks for the feedback! All review points have been addressed: - Timing reports now follow the existing batch threshold of 10. - CI workflow changes have been removed. - Timing attribution tests now run in the standard Windows test suite. - Replaced weaker tests with targeted initialization and dependency lookup attribution tests. Fresh Windows CI and both Clippy configurations passed. https://github.com/srijann07/VIctory/actions/runs/45565487083 Ready for re-review. Thanks!
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 01:37 UTC · original

Code review and RTX 5090 + WARP verification at head 45c29d95ef1b merged cleanly onto main (63bcca43c6a0):

  • Feature-gating & concurrency audit (pipeline.rs:140-221, 317-320, pipeline/host.rs:216-244, pipeline/make.rs:324-346):
    • Global counters (INITIALIZE/WAIT/HOST/WORK), report(), HostCreationTimer, and make.rs hooks stay strictly under #[cfg(feature = "diagnostics")] (zero default-build overhead).
    • Entirely lock-free (AtomicU64 + OnceLock), keeps cached cell.get() lookups off the timing path, distinguishes INITIALIZE vs WAIT around get_or_init, and times host PSO creation via RAII Drop after s.translated()?.
  • Verified (Windows 11, NVIDIA RTX 5090 + WARP, VICTORY_D3D12_DEBUG=1, Rust 1.98.1):
    • cargo xtask policy: 191 files ok; cargo clippy --locked -p victory-gpu --tests -- -D warnings (default + --features diagnostics): 0 warnings
    • victory-gpu -- pipeline::: 27/27 passed default on RTX 5090; 30/30 passed (--features diagnostics) on both RTX 5090 and WARP.

LGTM.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 01:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/1571#issuecomment-7179955128) Code review and RTX 5090 + WARP verification at head `45c29d95ef1b` merged cleanly onto `main` (`63bcca43c6a0`): - **Feature-gating & concurrency audit (`pipeline.rs:140-221, 317-320`, `pipeline/host.rs:216-244`, `pipeline/make.rs:324-346`)**: - Global counters (`INITIALIZE`/`WAIT`/`HOST`/`WORK`), `report()`, `HostCreationTimer`, and `make.rs` hooks stay strictly under `#[cfg(feature = "diagnostics")]` (zero default-build overhead). - Entirely lock-free (`AtomicU64` + `OnceLock`), keeps cached `cell.get()` lookups off the timing path, distinguishes `INITIALIZE` vs `WAIT` around `get_or_init`, and times host PSO creation via RAII `Drop` after `s.translated()?`. - **Verified (Windows 11, NVIDIA RTX 5090 + WARP, `VICTORY_D3D12_DEBUG=1`, Rust 1.98.1)**: - `cargo xtask policy`: `191 files ok`; `cargo clippy --locked -p victory-gpu --tests -- -D warnings` (default + `--features diagnostics`): 0 warnings - `victory-gpu -- pipeline::`: **27/27 passed** default on RTX 5090; **30/30 passed** (`--features diagnostics`) on both RTX 5090 and WARP. LGTM.
Author
Owner

@⁠DenRakEiw on GitHub · 2026-11-24 19:30 UTC · original · approved these changes

Verified locally merged onto origin/main (Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):

  • cargo test -p victory-gpu — 50 passed, 0 failed (1 ignored) on both RTX 5090 hardware and VICTORY_D3D12_WARP=1
  • cargo test -p victory-gpu --features diagnostics pipeline::timing::tests — 4 passed, 0 failed
  • cargo clippy -p victory-gpu --all-targets and cargo clippy -p victory-gpu --features diagnostics --all-targets — 0 warnings
  • cargo xtask policy — ok

Clean feature-gated diagnostics for shader dependency wait times with solid unit tests and CI coverage. Looks good.

AI-assisted (Gemini 4 Neon).

**@⁠DenRakEiw** on GitHub · 2026-11-24 19:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/1571#pullrequestreview-6045957953) · **approved these changes** Verified locally merged onto `origin/main` (Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC): - `cargo test -p victory-gpu` — 50 passed, 0 failed (1 ignored) on both RTX 5090 hardware and `VICTORY_D3D12_WARP=1` - `cargo test -p victory-gpu --features diagnostics pipeline::timing::tests` — 4 passed, 0 failed - `cargo clippy -p victory-gpu --all-targets` and `cargo clippy -p victory-gpu --features diagnostics --all-targets` — 0 warnings - `cargo xtask policy` — ok Clean feature-gated diagnostics for shader dependency wait times with solid unit tests and CI coverage. Looks good. AI-assisted (Gemini 4 Neon).
Author
Owner

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

Reviewed and verified 45c29d95 merged locally onto origin/main (63bcca43) on Windows 11 x64 (NVIDIA GeForce RTX 5090 and WARP, Rust 1.98.1 MSVC, Windows SDK 10.0.26100.0 dxil.dll; synthetic tests only, no game files).

Verification

  • git merge-tree against origin/main (63bcca43) and combined with #1993: clean.
  • cargo xtask policy (PR head): 182 files ok.
  • cargo clippy --locked -p victory-gpu --all-targets -- -D warnings (default and --all-features, PR head, merged, and combined #1993 + #1571): 0 warnings.
  • cargo check --locked --release -p victory (merged): passes cleanly.
  • RTX 5090 (merged, default dev & --release): pipeline:: — 27 passed, 0 failed in both dev and --release (including all 4 pipeline::timing::tests).
  • RTX 5090 & WARP (VICTORY_D3D12_DEBUG=1, --features diagnostics, merged): pipeline:: — 30 passed, 0 failed on both adapters.
  • Combined #1993 + #1571 on 63bcca43 (RTX 5090, VICTORY_D3D12_DEBUG=1, --features diagnostics): 31 passed, 0 failed.

Review Notes

  • Feature and platform gating are clean: mod timing (crates/victory-gpu/src/pipeline.rs:107-272) is under #[cfg(all(windows, any(feature = "diagnostics", test)))] (keeping non-Windows builds of pipeline.rs clean while running the 4 unit tests in default test builds), and all global counters, shader_lookup (:309-313), HostCreationTimer (crates/victory-gpu/src/pipeline/host.rs:312-320, 360-361), and worker hooks (crates/victory-gpu/src/pipeline/make.rs:308-313, 329-330) stay strictly under #[cfg(feature = "diagnostics")] for zero default/release overhead.
  • Lock-free AtomicU64 counters avoid contention, lookup() skips Instant::now() on cached OnceLock::get() hits, HostCreationTimer sits after s.translated()? so host PSO creation time is cleanly separated from shader init/wait time, and timing::report() respects the existing PEAK >= 10 threshold in drained().

Looks good to merge.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 13:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/1571#pullrequestreview-6075006140) · **approved these changes** Reviewed and verified `45c29d95` merged locally onto `origin/main` (`63bcca43`) on Windows 11 x64 (NVIDIA GeForce RTX 5090 and WARP, Rust `1.98.1` MSVC, Windows SDK `10.0.26100.0` `dxil.dll`; synthetic tests only, no game files). ### Verification - `git merge-tree` against `origin/main` (`63bcca43`) and combined with `#1993`: clean. - `cargo xtask policy` (PR head): `182 files ok`. - `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings` (default and `--all-features`, PR head, merged, and combined `#1993 + #1571`): 0 warnings. - `cargo check --locked --release -p victory` (merged): passes cleanly. - **RTX 5090 (merged, default dev & `--release`):** `pipeline::` — **27 passed, 0 failed** in both dev and `--release` (including all 4 `pipeline::timing::tests`). - **RTX 5090 & WARP (`VICTORY_D3D12_DEBUG=1`, `--features diagnostics`, merged):** `pipeline::` — **30 passed, 0 failed** on both adapters. - **Combined `#1993 + #1571` on `63bcca43` (RTX 5090, `VICTORY_D3D12_DEBUG=1`, `--features diagnostics`):** **31 passed, 0 failed**. ### Review Notes - Feature and platform gating are clean: `mod timing` (`crates/victory-gpu/src/pipeline.rs:107-272`) is under `#[cfg(all(windows, any(feature = "diagnostics", test)))]` (keeping non-Windows builds of `pipeline.rs` clean while running the 4 unit tests in default test builds), and all global counters, `shader_lookup` (`:309-313`), `HostCreationTimer` (`crates/victory-gpu/src/pipeline/host.rs:312-320, 360-361`), and worker hooks (`crates/victory-gpu/src/pipeline/make.rs:308-313, 329-330`) stay strictly under `#[cfg(feature = "diagnostics")]` for zero default/release overhead. - Lock-free `AtomicU64` counters avoid contention, `lookup()` skips `Instant::now()` on cached `OnceLock::get()` hits, `HostCreationTimer` sits after `s.translated()?` so host PSO creation time is cleanly separated from shader init/wait time, and `timing::report()` respects the existing `PEAK >= 10` threshold in `drained()`. Looks good to merge.
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/1571/head:github-bot/gh-1571'
git switch 'github-bot/gh-1571'

Merge

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