Fix pipeline wait accounting and diagnose wave-size limits (RTX 5060 gameplay verified) #16

Open
Castyan wants to merge 6 commits from upstream-pr/16 into main
Castyan commented 2026-11-25 18:29:56 +00:00 (Migrated from github.com)

Imported from DexNom/VIctory. Originally posted by Castyan on 2026-11-25T18:29:56Z.


## Changes

  • Detect the D3D12 adapter's maximum wave width in victory translate --pipelines so the offline translator uses the detected width by default. Explicit overrides still work.
  • Read the fixed wave size from the emitted DXIL and report an unsupported width before asking D3D12 to build the compute pipeline.
  • Log the selected adapter and PCI IDs in the runtime, and document the RTX 5060 results.

Validation

On RTX 5060 (driver 32.0.16.2124), the Windows SDK validator passed all 18 targeted compute shaders. Twelve comparison pipelines were created. The six pipelines that returned 0x80070057 before the change now report shader requires wave64, host supports at most wave32. The release diagnostics build, focused PSV regression test, and asset policy check passed.

The six compute shaders still need a wave32 lowering that preserves shared-memory ordering. The breakpoint at the end of the recorded session and the scene's performance remain open.

<!-- greyfinch-sync:DexNom/VIctory:issue:5496921411 --> Imported from [DexNom/VIctory](https://github.com/DexNom/VIctory/pull/16). Originally posted by [Castyan](https://github.com/Castyan) on 2026-11-25T18:29:56Z. --- ## Changes - Detect the D3D12 adapter's maximum wave width in `victory translate --pipelines` so the offline translator uses the detected width by default. Explicit overrides still work. - Read the fixed wave size from the emitted DXIL and report an unsupported width before asking D3D12 to build the compute pipeline. - Log the selected adapter and PCI IDs in the runtime, and document the RTX 5060 results. ## Validation On RTX 5060 (driver 32.0.16.2124), the Windows SDK validator passed all 18 targeted compute shaders. Twelve comparison pipelines were created. The six pipelines that returned `0x80070057` before the change now report `shader requires wave64, host supports at most wave32`. The release diagnostics build, focused PSV regression test, and asset policy check passed. The six compute shaders still need a wave32 lowering that preserves shared-memory ordering. The breakpoint at the end of the recorded session and the scene's performance remain open.
molodayamama commented 2026-11-25 18:53:59 +00:00 (Migrated from github.com)

Imported from DexNom/VIctory. Originally posted by molodayamama on 2026-11-25T18:53:59Z.


Verified on NVIDIA GeForce RTX 4060 8 GB (Ada, wave32) / AMD Ryzen 5 5600 / Windows 10 22H2 (19045.5794) / Rust 1.98.1 (x86_64-pc-windows-msvc):

  • Clean merge with current main (2e01ab4)
  • cargo test --locked -p xtask: 4 passed, 0 failed (196 files ok)
  • cargo clippy --workspace --all-targets --locked -- -D warnings (default & --all-features): 0 warnings
  • Hardware D3D12 tests on RTX 4060 (with Agility SDK 1.614.1 via #12 for Windows 10 SM 6.6; no game files):
    • emit::container::tests::fixed_wave_size_requires_matching_lanes_in_complete_runtime_info: passed
    • emit::wave64_tests: 7 passed, 0 failed
    • cargo test --locked -p victory-gpu --lib: 188 passed, 0 failed
<!-- greyfinch-sync:DexNom/VIctory:comment:7171554003 --> Imported from [DexNom/VIctory](https://github.com/DexNom/VIctory/pull/16#issuecomment-7171554003). Originally posted by [molodayamama](https://github.com/molodayamama) on 2026-11-25T18:53:59Z. --- Verified on **NVIDIA GeForce RTX 4060 8 GB (Ada, wave32)** / AMD Ryzen 5 5600 / Windows 10 22H2 (`19045.5794`) / Rust `1.98.1` (`x86_64-pc-windows-msvc`): - Clean merge with current `main` (`2e01ab4`) - `cargo test --locked -p xtask`: **4 passed, 0 failed** (`196 files ok`) - `cargo clippy --workspace --all-targets --locked -- -D warnings` (default & `--all-features`): **0 warnings** - Hardware D3D12 tests on RTX 4060 (with Agility SDK `1.614.1` via #12 for Windows 10 SM 6.6; no game files): - `emit::container::tests::fixed_wave_size_requires_matching_lanes_in_complete_runtime_info`: **passed** - `emit::wave64_tests`: **7 passed, 0 failed** - `cargo test --locked -p victory-gpu --lib`: **188 passed, 0 failed**
Castyan commented 2026-11-25 19:23:03 +00:00 (Migrated from github.com)

Imported from DexNom/VIctory. Originally posted by Castyan on 2026-11-25T19:23:03Z.


Thanks @molodayamama for the independent RTX 4060 validation. I also tested the exact PR commit (1ae3b85, release with diagnostics) in game on an RTX 5060, driver 32.0.16.2124, with the Series X profile and experimental RT off. This run used copied save data and a separate, effectively cold pipeline cache. Both upload switches were set before launch.

  • The startup log identified the RTX 5060 (10de:2d05) and reported host wave lanes min=32 max=32.
  • During intro loading, the new runtime check reported required=64 max=32 for 02384a60fda6f2d0, 369cbe906ea72764, and 2da4beb386509b77. The game kept rendering after all three refusals.
  • The title later exited with 0xc0000005 during intro prestreaming, about 2 min 21 s after launch. It attempted a null write at image offset +0x23cf683, with the next two image-relative stack entries at +0x2215c35 and +0x2215eca. These match an earlier run on 2e01ab4. There was no DXGI device removal in this run.

This confirms the adapter and wave-size diagnostics in game. The wave32 lowering and the recurring title crash remain open. The cold-cache run does not establish a performance change or a causal link between the skipped compute dispatches and the crash.

<!-- greyfinch-sync:DexNom/VIctory:comment:7172217681 --> Imported from [DexNom/VIctory](https://github.com/DexNom/VIctory/pull/16#issuecomment-7172217681). Originally posted by [Castyan](https://github.com/Castyan) on 2026-11-25T19:23:03Z. --- Thanks @molodayamama for the independent RTX 4060 validation. I also tested the exact PR commit (`1ae3b85`, release with diagnostics) in game on an RTX 5060, driver `32.0.16.2124`, with the Series X profile and experimental RT off. This run used copied save data and a separate, effectively cold pipeline cache. Both upload switches were set before launch. - The startup log identified the RTX 5060 (`10de:2d05`) and reported `host wave lanes min=32 max=32`. - During intro loading, the new runtime check reported `required=64 max=32` for `02384a60fda6f2d0`, `369cbe906ea72764`, and `2da4beb386509b77`. The game kept rendering after all three refusals. - The title later exited with `0xc0000005` during intro prestreaming, about 2 min 21 s after launch. It attempted a null write at image offset `+0x23cf683`, with the next two image-relative stack entries at `+0x2215c35` and `+0x2215eca`. These match an earlier run on `2e01ab4`. There was no DXGI device removal in this run. This confirms the adapter and wave-size diagnostics in game. The wave32 lowering and the recurring title crash remain open. The cold-cache run does not establish a performance change or a causal link between the skipped compute dispatches and the crash.
Castyan commented 2026-11-25 19:53:32 +00:00 (Migrated from github.com)

Imported from DexNom/VIctory. Originally posted by Castyan on 2026-11-25T19:53:32Z.


Final RTX 5060 integration update for commit e7c90ca. The build combining #1, #7, #9, #12, and #16 reached the introduction and crashed about 13 min 18 s after launch, during intro prestreaming (frame 1260).

  • The unhandled breakpoint was 0x80000003 at +0x63966f. The next four title-image stack offsets match the earlier run on 2e01ab4.
  • The log reported all six known wave64 pipeline refusals and no DXGI device removal. The earlier 0xc0000005 null write did not recur in this run.

The breakpoint trigger remains unverified. This combined run cannot isolate the effect of any single PR.

<!-- greyfinch-sync:DexNom/VIctory:comment:7172905828 --> Imported from [DexNom/VIctory](https://github.com/DexNom/VIctory/pull/16#issuecomment-7172905828). Originally posted by [Castyan](https://github.com/Castyan) on 2026-11-25T19:53:32Z. --- Final RTX 5060 integration update for commit `e7c90ca`. The build combining #1, #7, #9, #12, and #16 reached the introduction and crashed about **13 min 18 s** after launch, during intro prestreaming (frame 1260). - The unhandled breakpoint was `0x80000003` at `+0x63966f`. The next four title-image stack offsets match the earlier run on `2e01ab4`. - The log reported all six known wave64 pipeline refusals and no DXGI device removal. The earlier `0xc0000005` null write did not recur in this run. The breakpoint trigger remains unverified. This combined run cannot isolate the effect of any single PR.
Castyan commented 2026-11-25 20:15:49 +00:00 (Migrated from github.com)

Imported from DexNom/VIctory. Originally posted by Castyan on 2026-11-25T20:15:49Z.


RTX 5060 retest: reached interactive gameplay

Tested on Windows 11 build 26300.9974, NVIDIA driver 32.0.16.2124, Series X profile, system D3D12, and release with diagnostics. Both runs used copied saves, VICTORY_LOG=info, VICTORY_FILL_WORKERS=4, and VICTORY_PARALLEL_PRELUDES=1, with experimental RT and GPU detiling off. The integration included #1 (a902405), #7 (3ac8713), #9 (83e78b9), #12 (999fd75), and #16.

Run Pipeline library at startup / base wait Result
Reference integration 98c516d 172.6 MB / 12,000 ms 0x80000003 at +0x5149aec after 6m48s, intro prestreaming at frame 1944, INSTANCE_LIST=45000/45000.
Corrected integration 00b26e5, including 6b5a888 208.8 MB / 500 ms Reached interactive gameplay. The movement and camera prompts were visible at 10m44s. The tester deliberately closed the window at 10m53s and the runtime exited with code 0 after the suspend timeout.

For samples with at least 500 draws, the median was 2,768.4 ms/frame for the reference (36 samples) and 570.9 ms/frame for the corrected run (89 samples). The last three samples in the corrected run were 249–290 ms/frame at about 5,000 draws. The cache sizes and base waits differed, so the numbers describe the two tested configurations. The corrected run ended before the breakpoint that ended the older trace run at 13m18s, and this is one successful gameplay session.

Change and verification

  • 6b5a888 charges the loading allowance once per frame. Sequential waits share one base allowance, overlapping waits count once in shared-window mode, and an outstanding wait is still counted when the next frame starts. This follows the accounting issue reported in the discussion of #7. The focused suite passed 10/10 on #16 alone and 12/12 with the integration, including #7's Present ceiling and the new regressions.
  • The two runs added wave64 hashes 6b82bc7d22016cb5 and 926c46bab3b86bd6 to the six already recorded. An offline check validated all nine DXIL containers, and the control created its pipeline. The eight wave64 pipelines remain outside the RTX 5060's 32..=32 range.
  • The reference showed the same full pool and breakpoint family as the upstream pool report. The corrected run logged no title exception or DXGI device removal before deliberate closure. The source of pool exhaustion remains unverified.

Recorded results and settings

<!-- greyfinch-sync:DexNom/VIctory:comment:7173412644 --> Imported from [DexNom/VIctory](https://github.com/DexNom/VIctory/pull/16#issuecomment-7173412644). Originally posted by [Castyan](https://github.com/Castyan) on 2026-11-25T20:15:49Z. --- ## RTX 5060 retest: reached interactive gameplay Tested on Windows 11 build 26300.9974, NVIDIA driver 32.0.16.2124, Series X profile, system D3D12, and release with diagnostics. Both runs used copied saves, `VICTORY_LOG=info`, `VICTORY_FILL_WORKERS=4`, and `VICTORY_PARALLEL_PRELUDES=1`, with experimental RT and GPU detiling off. The integration included #1 (`a902405`), #7 (`3ac8713`), #9 (`83e78b9`), #12 (`999fd75`), and #16. | Run | Pipeline library at startup / base wait | Result | | --- | --- | --- | | Reference integration `98c516d` | 172.6 MB / 12,000 ms | `0x80000003` at `+0x5149aec` after 6m48s, intro prestreaming at frame 1944, `INSTANCE_LIST=45000/45000`. | | Corrected integration `00b26e5`, including `6b5a888` | 208.8 MB / 500 ms | Reached interactive gameplay. The movement and camera prompts were visible at 10m44s. The tester deliberately closed the window at 10m53s and the runtime exited with code `0` after the suspend timeout. | For samples with at least 500 draws, the median was 2,768.4 ms/frame for the reference (36 samples) and 570.9 ms/frame for the corrected run (89 samples). The last three samples in the corrected run were 249–290 ms/frame at about 5,000 draws. The cache sizes and base waits differed, so the numbers describe the two tested configurations. The corrected run ended before the breakpoint that ended the older trace run at 13m18s, and this is one successful gameplay session. ### Change and verification - `6b5a888` charges the loading allowance once per frame. Sequential waits share one base allowance, overlapping waits count once in shared-window mode, and an outstanding wait is still counted when the next frame starts. This follows the accounting issue reported in [the discussion of #7](https://github.com/DexNom/VIctory/pull/7#issuecomment-7171115239). The focused suite passed **10/10** on #16 alone and **12/12** with the integration, including #7's Present ceiling and the new regressions. - The two runs added wave64 hashes `6b82bc7d22016cb5` and `926c46bab3b86bd6` to the six already recorded. An offline check validated all nine DXIL containers, and the control created its pipeline. The eight wave64 pipelines remain outside the RTX 5060's `32..=32` range. - The reference showed the same full pool and breakpoint family as [the upstream pool report](https://github.com/Marvisak/VIctory/issues/698). The corrected run logged no title exception or DXGI device removal before deliberate closure. The source of pool exhaustion remains unverified. [Recorded results and settings](https://github.com/Castyan/VIctory/blob/6da1f12/docs/nvidia-rtx5060.md)
andrewDoing commented 2026-11-27 00:14:53 +00:00 (Migrated from github.com)

Imported from DexNom/VIctory. Originally posted by andrewDoing on 2026-11-27T00:14:53Z.


I checked the new wait accounting at 6da1f12 with the actual FrameWait, WaitBudgets, and frame_budget logic and synthetic Instants. With a 100 ms base and a 1-second cumulative allowance, frame 1 waits the full second. If frame 2 requests at t=1001 ms after that wait ends, it receives 100 ms and cumulative extra is 900 ms. If it requests at t=999 ms while the first wait is still open, it receives another full second; after both complete, cumulative extra is 1.8 seconds despite only 1 ms of overlap. The result held for all three sharing modes.

The old wait is eventually charged in end(), as the discussion notes, but budget() considers past_base when admitting the later frame and cannot account for an open wait's already elapsed excess. This is distinct from #19's completed charge being lost on rollover. I have not established whether this behavior was introduced versus the parent, or measured its gameplay frequency.

Verification was AI-assisted with GPT-6.2 Astra.

<!-- greyfinch-sync:DexNom/VIctory:comment:7206300179 --> Imported from [DexNom/VIctory](https://github.com/DexNom/VIctory/pull/16#issuecomment-7206300179). Originally posted by [andrewDoing](https://github.com/andrewDoing) on 2026-11-27T00:14:53Z. --- I checked the new wait accounting at `6da1f12` with the actual `FrameWait`, `WaitBudgets`, and `frame_budget` logic and synthetic `Instant`s. With a 100 ms base and a 1-second cumulative allowance, frame 1 waits the full second. If frame 2 requests at t=1001 ms after that wait ends, it receives 100 ms and cumulative extra is 900 ms. If it requests at t=999 ms while the first wait is still open, it receives another full second; after both complete, cumulative extra is 1.8 seconds despite only 1 ms of overlap. The result held for all three sharing modes. The old wait is eventually charged in `end()`, as the discussion notes, but `budget()` considers `past_base` when admitting the later frame and cannot account for an open wait's already elapsed excess. This is distinct from #19's completed charge being lost on rollover. I have not established whether this behavior was introduced versus the parent, or measured its gameplay frequency. Verification was AI-assisted with GPT-6.2 Astra.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/16:upstream-pr/16'
git switch 'upstream-pr/16'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/16'
git switch 'upstream-pr/16'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/16'
git switch 'upstream-pr/16'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/16'
git switch 'main'
git merge --squash 'upstream-pr/16'
git switch 'main'
git merge --ff-only 'upstream-pr/16'
git switch 'main'
git merge 'upstream-pr/16'
git push origin 'main'
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
DexNom/VIctory!16
No description provided.