Indirect dispatches: NVIDIA cards run the title's wide tile lists too #1273

Closed
Anorak-314 wants to merge 5 commits from upstream-pr/1273 into main
Anorak-314 commented 2026-11-28 16:48:58 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Anorak-314 on 2026-11-28T16:48:58Z.


What was wrong

indirect::widest lets an indirect dispatch run more than 65,535 groups in x on AMD cards only. On every other card the title's two tile-list programs (2dc364df5d3278b8 and 940c2635dc1312f4, one group per 8x4 tile) are cut to 65,535 groups each:

  • 2560x1440 scene (Quality): 115,200 tiles, 67,440 + 47,760 in a captured frame. The first list loses its last 1,905 tiles, the lowest of the picture (already noted in the comment on widest). On an RTX card this shows as blocky patches on arms and hands low in the frame.
  • 3840x2160 scene (DLAA, or any full-size scene): 259,200 tiles. At most 131,070 of them run, so about half of the picture's tiles are never written. They keep an earlier frame's light in the history that the temporal resolve (34fb51b8a0312e82) reads. On screen: bright horizontal streaks and blocky patches across faces and hands while anything moves, and stale light after a camera cut.

How it was found

Dumps of every render target of the same cutscene moment at Quality and at DLAA, compared pass by pass. The G-buffer is clean in both. The first lit target already has the streaks at DLAA. The resolve's history input, which those two programs write, is clean but for a few blocks at Quality and full of stale blocks from earlier camera views at DLAA.

Ruled out on the way, each with a run of screenshots: the title's motion blur, the motion vector scale given to DLSS (x1.5 and x0.667), DLSS preset K against M, a scene at 0.99 of the output, the temporal scene scale left at 2/3, leaving out the depth reprojection (11bbed94ee7a3243), and #932. The frame's and the resolve's constant buffers scale exactly between the two modes.

The change

  • widest runs wide on NVIDIA cards (vendor 0x10de) as it does on AMD's. VICTORY_INDIRECT_WIDE=0 still turns it off.
  • VICTORY_INDIRECT_WIDE=force runs wide on any card, for trying it elsewhere.
  • card_runs_wide_indirect_dispatches now runs on NVIDIA cards too.

65,535 is the most D3D12 names for a dispatch, so this stays outside what the API promises, as it already does on AMD.

Testing

One PC: RTX 5090 (32 GB, driver 621.24), Ryzen 9 9950X3D, Windows 11, Series X profile, 3840x2160 output.

  • card_runs_wide_indirect_dispatches passes on the RTX 5090 (checked that the test ran on vendor 0x10de with WIDEST 2^20, not on the PC's integrated Radeon): every group of 67,440, 115,200 and 2^20 runs once under its own number, one by one and in a batch; 2^20 + 1 runs 65,535.
  • DLAA, this branch with #1274 merged (a full-size scene does not start without it), 12 frames 110 apart through the opening cutscenes (VICTORY_CAPTURE_WORLD): with VICTORY_INDIRECT_WIDE=0, streaks or blocks in 10 of 12, and a face broken up into noise in two of them; with the default, none in 12.
  • Quality, on main with other open pull requests merged, 12 screenshots 2 s apart: with VICTORY_INDIRECT_WIDE=0, blocky patches low in the frame in 3 of 12; with the dispatches wide, none in 12.
  • No driver reset or device removal in any run. Frame rate unchanged (24.8 against 24.9 fps at DLAA, diagnostics build).
  • cargo test --workspace --locked passes (1,126 tests), and so does repository_passes_policy.
  • cargo clippy --workspace --all-targets --locked -- -D warnings stops here on main itself (manual_is_multiple_of in shadow.rs and descriptor.rs, let_and_return in victory-shader); it reports nothing in indirect.rs.

Only this one NVIDIA card was tried. If you would rather keep NVIDIA opt-in until more cards are checked, say so and I will flip the default; force is there either way.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5542453169 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1273). Originally posted by [Anorak-314](https://github.com/Anorak-314) on 2026-11-28T16:48:58Z. --- ## What was wrong `indirect::widest` lets an indirect dispatch run more than 65,535 groups in x on AMD cards only. On every other card the title's two tile-list programs (`2dc364df5d3278b8` and `940c2635dc1312f4`, one group per 8x4 tile) are cut to 65,535 groups each: - **2560x1440 scene** (Quality): 115,200 tiles, 67,440 + 47,760 in a captured frame. The first list loses its last 1,905 tiles, the lowest of the picture (already noted in the comment on `widest`). On an RTX card this shows as blocky patches on arms and hands low in the frame. - **3840x2160 scene** (DLAA, or any full-size scene): 259,200 tiles. At most 131,070 of them run, so about half of the picture's tiles are never written. They keep an earlier frame's light in the history that the temporal resolve (`34fb51b8a0312e82`) reads. On screen: bright horizontal streaks and blocky patches across faces and hands while anything moves, and stale light after a camera cut. ## How it was found Dumps of every render target of the same cutscene moment at Quality and at DLAA, compared pass by pass. The G-buffer is clean in both. The first lit target already has the streaks at DLAA. The resolve's history input, which those two programs write, is clean but for a few blocks at Quality and full of stale blocks from earlier camera views at DLAA. Ruled out on the way, each with a run of screenshots: the title's motion blur, the motion vector scale given to DLSS (x1.5 and x0.667), DLSS preset K against M, a scene at 0.99 of the output, the temporal scene scale left at 2/3, leaving out the depth reprojection (`11bbed94ee7a3243`), and #932. The frame's and the resolve's constant buffers scale exactly between the two modes. ## The change - `widest` runs wide on NVIDIA cards (vendor `0x10de`) as it does on AMD's. `VICTORY_INDIRECT_WIDE=0` still turns it off. - `VICTORY_INDIRECT_WIDE=force` runs wide on any card, for trying it elsewhere. - `card_runs_wide_indirect_dispatches` now runs on NVIDIA cards too. 65,535 is the most D3D12 names for a dispatch, so this stays outside what the API promises, as it already does on AMD. ## Testing One PC: RTX 5090 (32 GB, driver 621.24), Ryzen 9 9950X3D, Windows 11, Series X profile, 3840x2160 output. - `card_runs_wide_indirect_dispatches` passes on the RTX 5090 (checked that the test ran on vendor `0x10de` with `WIDEST` 2^20, not on the PC's integrated Radeon): every group of 67,440, 115,200 and 2^20 runs once under its own number, one by one and in a batch; 2^20 + 1 runs 65,535. - **DLAA**, this branch with #1274 merged (a full-size scene does not start without it), 12 frames 110 apart through the opening cutscenes (`VICTORY_CAPTURE_WORLD`): with `VICTORY_INDIRECT_WIDE=0`, streaks or blocks in 10 of 12, and a face broken up into noise in two of them; with the default, none in 12. - **Quality**, on `main` with other open pull requests merged, 12 screenshots 2 s apart: with `VICTORY_INDIRECT_WIDE=0`, blocky patches low in the frame in 3 of 12; with the dispatches wide, none in 12. - No driver reset or device removal in any run. Frame rate unchanged (24.8 against 24.9 fps at DLAA, diagnostics build). - `cargo test --workspace --locked` passes (1,126 tests), and so does `repository_passes_policy`. - `cargo clippy --workspace --all-targets --locked -- -D warnings` stops here on `main` itself (`manual_is_multiple_of` in `shadow.rs` and `descriptor.rs`, `let_and_return` in `victory-shader`); it reports nothing in `indirect.rs`. Only this one NVIDIA card was tried. If you would rather keep NVIDIA opt-in until more cards are checked, say so and I will flip the default; `force` is there either way. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Anorak-314 commented 2026-11-29 05:28:12 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Anorak-314 on 2026-11-29T05:28:12Z.


Update after more runs on the same card (RTX 5090, driver 621.24, Series X profile).

A caveat I found. With the opt-in structure builder (VICTORY_BVH_BUILDER=1) and the wide bound together, the device stopped answering within a minute of the opening cutscenes in 3 runs of 4 (0x887A0006, after frames of more than a second). With the bound at 65,535 it held 10 to 13 fps at DLSS Quality in 2 runs of 2, and a later 5-minute run had no device loss. Those runs were on a build with #718, #403, #401 and #1161 on top. I have not found which dispatch does it; my guess is one of the builder's that asks for more than 65,535 groups and then runs whole.

What I pushed.

  • b6f3d13: an NVIDIA card keeps the 65,535 bound while VICTORY_BVH_BUILDER=1. VICTORY_INDIRECT_WIDE=force still sets the wide one. Without the builder nothing changes from the first commit, so the native-4K streak fix stands.
  • c9f0c2d: merges 8f03fa2 to resolve the conflict with main (the clamp compiles through crate::hlsl now). cargo test -p victory-gpu indirect: 29 passed.

Not done here. Widening only the two tile-list programs, so that native 4K stays clean with the builder on. That means the picture at native 4K with the builder on has the streaks again on NVIDIA until then.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7251272175 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1273#issuecomment-7251272175). Originally posted by [Anorak-314](https://github.com/Anorak-314) on 2026-11-29T05:28:12Z. --- Update after more runs on the same card (RTX 5090, driver 621.24, Series X profile). **A caveat I found.** With the opt-in structure builder (`VICTORY_BVH_BUILDER=1`) and the wide bound together, the device stopped answering within a minute of the opening cutscenes in 3 runs of 4 (`0x887A0006`, after frames of more than a second). With the bound at 65,535 it held 10 to 13 fps at DLSS Quality in 2 runs of 2, and a later 5-minute run had no device loss. Those runs were on a build with #718, #403, #401 and #1161 on top. I have not found which dispatch does it; my guess is one of the builder's that asks for more than 65,535 groups and then runs whole. **What I pushed.** - b6f3d13: an NVIDIA card keeps the 65,535 bound while `VICTORY_BVH_BUILDER=1`. `VICTORY_INDIRECT_WIDE=force` still sets the wide one. Without the builder nothing changes from the first commit, so the native-4K streak fix stands. - c9f0c2d: merges 8f03fa2 to resolve the conflict with main (the clamp compiles through `crate::hlsl` now). `cargo test -p victory-gpu indirect`: 29 passed. **Not done here.** Widening only the two tile-list programs, so that native 4K stays clean with the builder on. That means the picture at native 4K with the builder on has the streaks again on NVIDIA until then. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Yoshi-233 commented 2026-11-29 07:09:26 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Yoshi-233 on 2026-11-29T07:09:26Z.


The indirect-dispatch counter test also runs on an RTX 4070 Ti SUPER (16 GB, driver 617.42) with the structure builder off. I used the NVIDIA change plus the b6f3d13 builder guard on our local build. The test fixture asserted the physical adapter vendor was 0x10de and printed the UAV counter after queue completion so the hardware test could not silently skip.

Requested X groups Count read back, single clamp Count read back, batched clamp
67,440 67,440 67,440
115,200 115,200 115,200
1,048,576 1,048,576 1,048,576
1,048,577 65,535 65,535

The upstream per-group exactly-once checks and max-group checks passed in all eight cases. This covers card execution at the wider limit. A separate same-scene comparison is needed to attribute lighting changes to it.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7252296756 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1273#issuecomment-7252296756). Originally posted by [Yoshi-233](https://github.com/Yoshi-233) on 2026-11-29T07:09:26Z. --- The indirect-dispatch counter test also runs on an RTX 4070 Ti SUPER (16 GB, driver 617.42) with the structure builder off. I used the NVIDIA change plus the b6f3d13 builder guard on our local build. The test fixture asserted the physical adapter vendor was 0x10de and printed the UAV counter after queue completion so the hardware test could not silently skip. | Requested X groups | Count read back, single clamp | Count read back, batched clamp | | ---: | ---: | ---: | | 67,440 | 67,440 | 67,440 | | 115,200 | 115,200 | 115,200 | | 1,048,576 | 1,048,576 | 1,048,576 | | 1,048,577 | 65,535 | 65,535 | The upstream per-group exactly-once checks and max-group checks passed in all eight cases. This covers card execution at the wider limit. A separate same-scene comparison is needed to attribute lighting changes to it.
trustno1-coder commented 2026-11-29 08:28:12 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-29T08:28:12Z.


Thank you! An earlier version of this pull request was merged into main with its original commits and is part of v2026.11.29.01, where you are credited. GitHub does not show it as merged because new commits were pushed here after that merge. It stays open so those newer commits can be looked at next.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7253124371 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1273#issuecomment-7253124371). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-11-29T08:28:12Z. --- Thank you! An earlier version of this pull request was merged into main with its original commits and is part of [v2026.11.29.01](https://github.com/trustno1-coder/VIctory-NVIDIA/releases/tag/v2026.11.29.01), where you are credited. GitHub does not show it as merged because new commits were pushed here after that merge. It stays open so those newer commits can be looked at next.
Anorak-314 commented 2026-11-30 04:58:02 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Anorak-314 on 2026-11-30T04:58:02Z.


Merged with main at 41adb551, and one correction of mine.

I have taken back the builder guard (b6f3d131). It kept an NVIDIA card at 65,535 groups while VICTORY_BVH_BUILDER=1, after the device was lost in three runs of four with the builder and the wide bound together. Two things since then:

  • The cap does harm with the builder on: at 2560x1440 the first tile list loses its last tiles, and the lowest rows of the picture keep blocks of an earlier frame.
  • On main at 41adb551 the builder and the wide bound ran together in two runs of two with no device loss (RTX 5090, driver 621.40, DLSS Quality, a loaded save in gameplay, five minutes each, 13 to 20 fps). The losses I reported were on a build of 2026-11-28 with #718, #403, #401 and #1161 on top, in the opening cutscenes, and I never found the dispatch that did it. My guess of a builder dispatch asking for more than 65,535 groups was not confirmed.

Not covered: the opening cutscenes themselves on this build, and other NVIDIA cards with the builder on. If anyone sees a device loss with ray tracing on and the wide bound, VICTORY_INDIRECT_WIDE=0 is the cap again; please say so here.

With that the branch is the same as main (no files changed): the original change is in since v2026.11.29.01. Closing. Thanks to @Yoshi-233 for the 4070 Ti SUPER counter test.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7269238054 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1273#issuecomment-7269238054). Originally posted by [Anorak-314](https://github.com/Anorak-314) on 2026-11-30T04:58:02Z. --- Merged with main at 41adb551, and one correction of mine. **I have taken back the builder guard (b6f3d131).** It kept an NVIDIA card at 65,535 groups while `VICTORY_BVH_BUILDER=1`, after the device was lost in three runs of four with the builder and the wide bound together. Two things since then: - The cap does harm with the builder on: at 2560x1440 the first tile list loses its last tiles, and the lowest rows of the picture keep blocks of an earlier frame. - On main at 41adb551 the builder and the wide bound ran together in two runs of two with no device loss (RTX 5090, driver 621.40, DLSS Quality, a loaded save in gameplay, five minutes each, 13 to 20 fps). The losses I reported were on a build of 2026-11-28 with #718, #403, #401 and #1161 on top, in the opening cutscenes, and I never found the dispatch that did it. My guess of a builder dispatch asking for more than 65,535 groups was not confirmed. Not covered: the opening cutscenes themselves on this build, and other NVIDIA cards with the builder on. If anyone sees a device loss with ray tracing on and the wide bound, `VICTORY_INDIRECT_WIDE=0` is the cap again; please say so here. With that the branch is the same as main (no files changed): the original change is in since v2026.11.29.01. Closing. Thanks to @Yoshi-233 for the 4070 Ti SUPER counter test.

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
trustno1-coder/VIctory-NVIDIA!1273
No description provided.