GPU: prioritize pipeline work requested by draws #546

Closed
github-bot wants to merge 1 commit from gh-pr/546/head into gh-pr/546/base
Owner

@⁠melon0918 on GitHub · 2026-11-24 04:43 UTC · original
melon0918:fix/prioritize-requested-pipelines → main · +117 −33 · 1 files · 1 commits · closed without merging

Change

Compile pipelines needed by a draw or dispatch ahead of speculative early work. A first request promotes a pipeline that is still in the early queue. Workers claim each pipeline once and preserve FIFO order within each priority. The same frame wait budget applies to the request.

#275 addresses wait accounting and cache saves. This change addresses which pending job a worker takes next.

Verification

  • Windows 10 22H2, RX 7900 XT, and the app-local Agility SDK. The victory-gpu diagnostics suite passed 46 tests with one existing ignored test. The queue regression checks promotion, FIFO order within each priority, and single processing of a promoted entry. The asset policy passed.
  • One paired offline title test on a compatibility integration stack. Both runs used the same diagnostic executable and separate copies of the same starting application cache. A test-only mode reproduced FIFO ordering. These are medians across 21 samples per mode in the first 120 seconds after the first indexed rectangle submission in the opening scene.
Measure FIFO Prioritize requested jobs
Recorded draws per frame 10 1,721
Draws dropped for a missing host pipeline per frame 2,040 1,359
Pipelines still being made 1,532 1,122
Frames per second 1.3 0.9

The reviewed captures show opening credits and 2D imagery. Live 3D rendering remains unverified. The prioritization run recorded substantially more draws at a lower median frame rate and encountered device removal. The queue measurements are evidence of scheduling behavior.

AI-assisted contribution. All test data and captures stayed local.

**@⁠melon0918** on GitHub · 2026-11-24 04:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/546) `melon0918:fix/prioritize-requested-pipelines` → `main` · +117 −33 · 1 files · 1 commits · closed without merging ## Change Compile pipelines needed by a draw or dispatch ahead of speculative early work. A first request promotes a pipeline that is still in the early queue. Workers claim each pipeline once and preserve FIFO order within each priority. The same frame wait budget applies to the request. #275 addresses wait accounting and cache saves. This change addresses which pending job a worker takes next. ## Verification - Windows 10 22H2, RX 7900 XT, and the app-local Agility SDK. The `victory-gpu` diagnostics suite passed 46 tests with one existing ignored test. The queue regression checks promotion, FIFO order within each priority, and single processing of a promoted entry. The asset policy passed. - One paired offline title test on a compatibility integration stack. Both runs used the same diagnostic executable and separate copies of the same starting application cache. A test-only mode reproduced FIFO ordering. These are medians across 21 samples per mode in the first 120 seconds after the first indexed rectangle submission in the opening scene. | Measure | FIFO | Prioritize requested jobs | | --- | ---: | ---: | | Recorded draws per frame | 10 | 1,721 | | Draws dropped for a missing host pipeline per frame | 2,040 | 1,359 | | Pipelines still being made | 1,532 | 1,122 | | Frames per second | 1.3 | 0.9 | The reviewed captures show opening credits and 2D imagery. Live 3D rendering remains unverified. The prioritization run recorded substantially more draws at a lower median frame rate and encountered device removal. The queue measurements are evidence of scheduling behavior. AI-assisted contribution. All test data and captures stayed local.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:07:51 +00:00
github-bot closed this pull request 2026-11-26 04:07:51 +00:00
Author
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-24 11:43 UTC · original

Independent verification & code review on Windows 11 Pro (build 26100) + AMD Radeon RX 9060 XT (RDNA4, driver 32.0.32029.2010, Rust 1.98.1), cleanly merged onto main (ffe310e):

  • cargo xtask policy: PASS (154 files ok)
  • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: PASS
  • cargo clippy -p victory-gpu --all-targets --features diagnostics --locked -- -D warnings: PASS
  • cargo test -p victory-gpu --locked: 51 passed, 0 failed, 1 ignored (including new pipeline::make::tests::draws_promote_early_pipelines_without_claiming_them_twice)

Diff review (crates/victory-gpu/src/pipeline/make.rs): very clean state machine (NOT_QUEUED -> EARLY -> REQUESTED -> MAKING) serialized under QUEUE:

  • Promoting an EARLY entry to REQUESTED pushes it to requested without double-incrementing WAITING, and pop() skips promoted entries left in early (queue_state != EARLY) so no pipeline is ever compiled twice.
  • Workers drop QUEUE before p.make(), and the no-workers fallback (!workers()) builds inline safely without touching WAITING.

AI-assisted; synthetic tests only, no game files.

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 11:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/546#issuecomment-7130465068) Independent verification & code review on Windows 11 Pro (build 26100) + AMD Radeon RX 9060 XT (RDNA4, driver `32.0.32029.2010`, Rust `1.98.1`), cleanly merged onto `main` (`ffe310e`): - `cargo xtask policy`: PASS (`154 files ok`) - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings`: PASS - `cargo clippy -p victory-gpu --all-targets --features diagnostics --locked -- -D warnings`: PASS - `cargo test -p victory-gpu --locked`: **51 passed, 0 failed, 1 ignored** (including new `pipeline::make::tests::draws_promote_early_pipelines_without_claiming_them_twice`) Diff review (`crates/victory-gpu/src/pipeline/make.rs`): very clean state machine (`NOT_QUEUED -> EARLY -> REQUESTED -> MAKING`) serialized under `QUEUE`: - Promoting an `EARLY` entry to `REQUESTED` pushes it to `requested` without double-incrementing `WAITING`, and `pop()` skips promoted entries left in `early` (`queue_state != EARLY`) so no pipeline is ever compiled twice. - Workers drop `QUEUE` before `p.make()`, and the no-workers fallback (`!workers()`) builds inline safely without touching `WAITING`. *AI-assisted; synthetic tests only, no game files.*
Author
Owner

@⁠Mumogg on GitHub · 2026-11-24 17:57 UTC · original · edited 2026-11-24 19:08 UTC

A data point for why this is needed even once library loads run in parallel (#1000), from Linux (RTX 5070 Ti, driver 615.78.08, Wine 11.22 Staging, vkd3d-proton from GE-Proton11-14; r4tedx integration/testers update 9, diagnostics build, warm cache with 1,167 pipelines on the early list).

One caveat first: I could not run this PR's code on that tree. make.rs conflicts with #275, which the testers tree carries (the per-pipeline wait pair and the frame budget), so what I ran is a local change with the same idea: two queues, a pipeline a frame asks for goes to the urgent one even if it is already waiting in the early one, workers drain urgent first. A rebase of this PR over #275 would let testers run the real thing.

Warm start, same cache, at world entry:

draws dropped per frame as "being made" draws run per frame
loads outside the library's lock only 3,610 to 5,406 167 to 511
plus the two-level queue 174 to 226 at entry, 2 to 4 a few minutes later 1,482 to 3,354

With only the lock fixed, the frame's own pipelines still sat behind several hundred early compute pipelines, each a multi-second load here.

(AI-assisted, Claude Code; runs on my machine.)

Edit: the Wine version was 11.22 Staging, not 11.21 (the system had updated before these runs).

**@⁠Mumogg** on GitHub · 2026-11-24 17:57 UTC · [original](https://github.com/Marvisak/VIctory/pull/546#issuecomment-7139946280) · edited 2026-11-24 19:08 UTC A data point for why this is needed even once library loads run in parallel (#1000), from Linux (RTX 5070 Ti, driver 615.78.08, Wine 11.22 Staging, vkd3d-proton from GE-Proton11-14; r4tedx `integration/testers` update 9, diagnostics build, warm cache with 1,167 pipelines on the early list). One caveat first: I could not run this PR's code on that tree. `make.rs` conflicts with #275, which the testers tree carries (the per-pipeline wait pair and the frame budget), so what I ran is a local change with the same idea: two queues, a pipeline a frame asks for goes to the urgent one even if it is already waiting in the early one, workers drain urgent first. A rebase of this PR over #275 would let testers run the real thing. Warm start, same cache, at world entry: | | draws dropped per frame as "being made" | draws run per frame | |---|---|---| | loads outside the library's lock only | 3,610 to 5,406 | 167 to 511 | | plus the two-level queue | 174 to 226 at entry, 2 to 4 a few minutes later | 1,482 to 3,354 | With only the lock fixed, the frame's own pipelines still sat behind several hundred early compute pipelines, each a multi-second load here. (AI-assisted, Claude Code; runs on my machine.) *Edit: the Wine version was 11.22 Staging, not 11.21 (the system had updated before these runs).*
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:24 UTC · original

Automated triage for the maintainers. Closing because this change is already in main, or main has since replaced the code it patches.

Already in main: make.rs has a queue for pipelines draws wait for ahead of the early starts, with promotion of a still-queued early entry and single processing (enqueue, test draws_go_ahead_of_early_starts).

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/546#issuecomment-7148480265) Automated triage for the maintainers. Closing because this change is already in `main`, or `main` has since replaced the code it patches. Already in main: make.rs has a queue for pipelines draws wait for ahead of the early starts, with promotion of a still-queued early entry and single processing (enqueue, test draws_go_ahead_of_early_starts). If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

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!546
No description provided.