GPU diagnostics: measure pipeline worker backlog during shared shader waits #1603

Closed
ToxicmaggotRP wants to merge 8 commits from upstream-pr/1604 into main
ToxicmaggotRP commented 2026-11-24 19:42:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ToxicmaggotRP on 2026-11-24T19:42:13Z.


[## Summary

Adds diagnostics-only measurements for pipeline worker occupancy while shader translations are shared through OnceLock.

This is a measurement step related to #1509. Existing translation-wait timings show that workers can block on another worker's shader initialization, but they do not show whether more pipeline jobs remain queued during those waits.

This patch measures that overlap before proposing any scheduling change.

Changes

  • Track the number of pipeline worker threads, active jobs and queued jobs.
  • Count workers currently waiting on another pipeline worker's shader translation.
  • Accumulate the time during which queued jobs coexist with one or more translation waiters.
  • Separately accumulate the time during which every pipeline worker is waiting on a shared translation while jobs remain queued.
  • Record peak active jobs, queued jobs and dependency waiters.
  • Report the measurements when the queue drains and when the final dependency waiter leaves while work is still queued.
  • Keep the instrumentation behind the Windows diagnostics feature; normal builds and scheduling behaviour are unchanged.
  • Add deterministic unit tests for overlapping intervals and separate backlog periods.

Scope and limitations

This PR does not introduce a dependency-aware scheduler or claim a frame-time improvement.

A non-empty queue does not by itself prove that every queued pipeline is independently runnable. These measurements are intended to establish whether the suspected worker starvation is occurring in real workloads.

Verification

  • Based directly on upstream main at ffe310e.
  • Two deterministic unit tests are included in scheduler_metrics.rs.
  • Not yet run: Windows compilation, the Rust test suite, Clippy and an in-game diagnostics run.
  • No GitHub Actions checks are currently reported for this branch's head commit.

Please treat this as a draft for review of the instrumentation and its measurement semantics.](https://github.com/Marvisak/VIctory/pull/1604)

<!-- greyfinch-sync:Marvisak/VIctory:issue:6589952953 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1604). Originally posted by [ToxicmaggotRP](https://github.com/ToxicmaggotRP) on 2026-11-24T19:42:13Z. --- [## Summary Adds diagnostics-only measurements for pipeline worker occupancy while shader translations are shared through `OnceLock`. This is a measurement step related to #1509. Existing translation-wait timings show that workers can block on another worker's shader initialization, but they do not show whether more pipeline jobs remain queued during those waits. This patch measures that overlap before proposing any scheduling change. ## Changes - Track the number of pipeline worker threads, active jobs and queued jobs. - Count workers currently waiting on another pipeline worker's shader translation. - Accumulate the time during which queued jobs coexist with one or more translation waiters. - Separately accumulate the time during which every pipeline worker is waiting on a shared translation while jobs remain queued. - Record peak active jobs, queued jobs and dependency waiters. - Report the measurements when the queue drains and when the final dependency waiter leaves while work is still queued. - Keep the instrumentation behind the Windows `diagnostics` feature; normal builds and scheduling behaviour are unchanged. - Add deterministic unit tests for overlapping intervals and separate backlog periods. ## Scope and limitations This PR does **not** introduce a dependency-aware scheduler or claim a frame-time improvement. A non-empty queue does not by itself prove that every queued pipeline is independently runnable. These measurements are intended to establish whether the suspected worker starvation is occurring in real workloads. ## Verification - Based directly on upstream `main` at `ffe310e`. - Two deterministic unit tests are included in `scheduler_metrics.rs`. - **Not yet run:** Windows compilation, the Rust test suite, Clippy and an in-game diagnostics run. - No GitHub Actions checks are currently reported for this branch's head commit. Please treat this as a draft for review of the instrumentation and its measurement semantics.](https://github.com/Marvisak/VIctory/pull/1604)
BaggyALPHA commented 2026-11-24 22:01:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by BaggyALPHA on 2026-11-24T21:50:31Z.

Review: COMMENTED


Independent in-game Windows measurement for #1509 on an RTX 3080 12 GiB, driver 621.24. The diagnostics build passed all four scheduler-metrics unit tests. For the title run I used a cold VIctory cache, the Series S profile, and a local stack of this PR with #211 for Series S UI presentation and #1702 for isolated scripted controller input.

The busy rendering phase began around 69 seconds, reached 4,106 draws per frame, and the run ended in device removal about 171 seconds after launch. The last scheduler snapshot showed:

  • Peak queued jobs: 1,216.
  • Peak active workers: 8 of 8.
  • Peak shared-translation waiters: 1.
  • Cumulative time with both queued jobs and a shared-translation waiter: 13.491 ms.
  • Time with all eight workers waiting while jobs were queued: 0 ms.

This is one cold run, with its endpoint set by device removal. The large backlog coincided with very little measured shared-translation waiting. On this trace, timing native pipeline creation and pipeline-library lock contention separately looks more informative than changing scheduling based on queue depth alone.

AI-assisted (Codex). Aggregate results only.

<!-- greyfinch-sync:Marvisak/VIctory:review:6047971424 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1604#pullrequestreview-6047971424). Originally posted by [BaggyALPHA](https://github.com/BaggyALPHA) on 2026-11-24T21:50:31Z. **Review:** COMMENTED --- Independent in-game Windows measurement for #1509 on an RTX 3080 12 GiB, driver 621.24. The diagnostics build passed all four scheduler-metrics unit tests. For the title run I used a cold VIctory cache, the Series S profile, and a local stack of this PR with #211 for Series S UI presentation and #1702 for isolated scripted controller input. The busy rendering phase began around 69 seconds, reached 4,106 draws per frame, and the run ended in device removal about 171 seconds after launch. The last scheduler snapshot showed: - Peak queued jobs: 1,216. - Peak active workers: 8 of 8. - Peak shared-translation waiters: 1. - Cumulative time with both queued jobs and a shared-translation waiter: 13.491 ms. - Time with all eight workers waiting while jobs were queued: 0 ms. This is one cold run, with its endpoint set by device removal. The large backlog coincided with very little measured shared-translation waiting. On this trace, timing native pipeline creation and pipeline-library lock contention separately looks more informative than changing scheduling based on queue depth alone. AI-assisted (Codex). Aggregate results only.
upstream-sync closed this pull request 2026-11-25 00:05:52 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!1603
No description provided.