GPU: add diagnostics for shader dependency wait times #1571
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1571
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1571"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@srijann07 on GitHub · 2026-11-24 19:16 UTC · original
srijann07:diagnostics/pipeline-dependency-timing→main· +192 −4 · 3 files · 7 commits · openMotivation
Related to #1509. Measure shader dependency waits before changing pipeline scheduling.
Changes
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.
@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::lookuparound theOnceLockinShader::translated,crates/victory-gpu/src/pipeline.rs). It also times host PSO creation (HostCreationTimerinHostPipeline::new) and worker jobs (workinmake.rs). All three points from the last review are addressed. The CI workflow change is gone, and thetimingtests now build undercfg(test), so the existing test step runs them.timing::report()now runs only inside thePEAK >= 10branch ofdrained(). The weak tests have been replaced with ones that check how init and wait time are attributed. Builds withoutdiagnosticsbehave as before.One small nit: the body of the
initializeclosure inShader::translatedkeeps its old indentation, so acargo fmtpass would tidy it.CI: passing (
check).Generated by Claude Code
@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 07:11 UTC · original
Thanks for the feedback!
All review points have been addressed:
Fresh Windows CI and both Clippy configurations passed.
https://github.com/srijann07/VIctory/actions/runs/45565487083
Ready for re-review. Thanks!
@fuzeofficlal on GitHub · 2026-11-26 01:37 UTC · original
Code review and RTX 5090 + WARP verification at head
45c29d95ef1bmerged cleanly ontomain(63bcca43c6a0):pipeline.rs:140-221, 317-320,pipeline/host.rs:216-244,pipeline/make.rs:324-346):INITIALIZE/WAIT/HOST/WORK),report(),HostCreationTimer, andmake.rshooks stay strictly under#[cfg(feature = "diagnostics")](zero default-build overhead).AtomicU64+OnceLock), keeps cachedcell.get()lookups off the timing path, distinguishesINITIALIZEvsWAITaroundget_or_init, and times host PSO creation via RAIIDropafters.translated()?.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 warningsvictory-gpu -- pipeline::: 27/27 passed default on RTX 5090; 30/30 passed (--features diagnostics) on both RTX 5090 and WARP.LGTM.
@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 andVICTORY_D3D12_WARP=1cargo test -p victory-gpu --features diagnostics pipeline::timing::tests— 4 passed, 0 failedcargo clippy -p victory-gpu --all-targetsandcargo clippy -p victory-gpu --features diagnostics --all-targets— 0 warningscargo xtask policy— okClean feature-gated diagnostics for shader dependency wait times with solid unit tests and CI coverage. Looks good.
AI-assisted (Gemini 4 Neon).
@fuzeofficlal on GitHub · 2026-11-26 13:32 UTC · original · approved these changes
Reviewed and verified
45c29d95merged locally ontoorigin/main(63bcca43) on Windows 11 x64 (NVIDIA GeForce RTX 5090 and WARP, Rust1.98.1MSVC, Windows SDK10.0.26100.0dxil.dll; synthetic tests only, no game files).Verification
git merge-treeagainstorigin/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.--release):pipeline::— 27 passed, 0 failed in both dev and--release(including all 4pipeline::timing::tests).VICTORY_D3D12_DEBUG=1,--features diagnostics, merged):pipeline::— 30 passed, 0 failed on both adapters.#1993 + #1571on63bcca43(RTX 5090,VICTORY_D3D12_DEBUG=1,--features diagnostics): 31 passed, 0 failed.Review Notes
mod timing(crates/victory-gpu/src/pipeline.rs:107-272) is under#[cfg(all(windows, any(feature = "diagnostics", test)))](keeping non-Windows builds ofpipeline.rsclean 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.AtomicU64counters avoid contention,lookup()skipsInstant::now()on cachedOnceLock::get()hits,HostCreationTimersits afters.translated()?so host PSO creation time is cleanly separated from shader init/wait time, andtiming::report()respects the existingPEAK >= 10threshold indrained().Looks good to merge.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.