GPU: the indirect argument clamp cuts dispatches of more than 65,535 groups in x (spread over z instead) #2256

Open
opened 2026-11-26 05:00:00 +00:00 by github-bot · 11 comments
Owner

@⁠Coderlord on GitHub · 2026-11-25 09:01 UTC · original

What happens. The indirect argument clamp (crates/victory-gpu/src/indirect.rs) bounds every dimension of a dispatch record to 65,535 (min(asked, 65535)), because D3D12 runs at most 65,535 groups per dimension. The console runs far more, and the title's own compute passes ask for more. Counted in the clamp on a fork, records ask for:

  • up to 115,200 groups in x in the opening cutscene (one group per 32 pixels of the 2560x1440 render);
  • 74,000 to 81,500 in the first gameplay scene, 0.2 to 0.8 such records a frame.

The groups past 65,535 never run.

Evidence (RTX 5080, same build, only spreading toggled, runs at the same moment):

  • Cut, as now: the first gameplay frames show a band of raw, unfiltered reflection tiles along the bottom of the picture, and blocky tiles at a screen edge in a cutscene shot. Both come and go from frame to frame, as these records do.
  • Every group run (the fix below): the band and the tiles are gone. But the whole first room also turns much darker. The walls and the player's clothes go nearly black, while the window and the outside stay as before.

Because the darkening is global, not only in the rows the cut dropped, I suspect a value reduced over the whole pass that the cut never let finish (an exposure, or a step that only the last group to finish runs). I haven't confirmed whether the dark room is the title's intended look or a later pass reading that value wrong, so on the fork the fix is behind a switch for now.

The fix (tested on a fork). D3D12 has no base group for a dispatch, so the translated program has to help. It is built on fxceless's branch, which has host-computed user-data dwords:

  1. The translated program. A compute program that reads its group id (the TGID SGPRs) asks the host for two more user-data dwords: the groups of one row (0 means not spread) and the groups asked for in x. When the row is not 0, the program:

    • takes its console group as x + z * row in x and 0 in z;
    • returns before the console code when that is at or past the asked count. That is the last row's surplus; the whole group is alike, so this happens before any barrier.

    One pitfall here: branch out of the entry block only after the program's inputs are loaded. Some input code (thread ids numbered by console lane) makes a value in the current block and uses it in the entry block. Done before the inputs, this made 936 of the title's programs fail in the bitcode writer ("forward reference outside a phi").

  2. The clamp, for such a pipeline. It writes each dispatch record as [row, asked x, gx, gy, gz] (20 bytes). A record of more than 65,535 groups in x and 1 in z goes out as ceil(x / rows) by y by rows, where rows = ceil(x / 65535). So fewer than rows groups are surplus.

  3. The command signature. Those pipelines' indirect dispatches use a command signature of two D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT arguments and the dispatch. The constants go into the user-data root constants at those two dwords' places. The signature is created with the pipeline's root signature, once per pipeline. (The next draw or dispatch sets all user data again, so the values the signature leaves behind don't matter.)

  4. Direct dispatches. A direct Dispatch with more than 65,535 groups in x is spread the same way on the CPU.

Checks.

  • A translated program that stores its group id at that dword, run as 5 groups unspread, 100,000 in two rows, and 131,071 in three rows. On the card and WARP, every group stores once and the surplus groups store nothing. The same with cross-lane code, on the card only.
  • The clamp's spread records run through the command signature on WARP: every group asked for runs once.
  • All the title's programs translated with the change: the same outcomes as without it, and every emitted program passes the DXIL validator.
  • On the card, the frame takes about 10 ms more with every group run: the work the cut dropped.

No existing issue or pull request seems to cover the cut. #956 adds command signatures with root constants for the title's own multi-argument signatures, which may share code with this.

RTX 5080 (driver 621.24), Windows 11.

Found, written and tested with Claude Code.

**@⁠Coderlord** on GitHub · 2026-11-25 09:01 UTC · [original](https://github.com/Marvisak/VIctory/issues/2256) **What happens.** The indirect argument clamp (`crates/victory-gpu/src/indirect.rs`) bounds every dimension of a dispatch record to 65,535 (`min(asked, 65535)`), because D3D12 runs at most 65,535 groups per dimension. The console runs far more, and the title's own compute passes ask for more. Counted in the clamp on a fork, records ask for: - up to 115,200 groups in x in the opening cutscene (one group per 32 pixels of the 2560x1440 render); - 74,000 to 81,500 in the first gameplay scene, 0.2 to 0.8 such records a frame. The groups past 65,535 never run. **Evidence (RTX 5080, same build, only spreading toggled, runs at the same moment):** - **Cut, as now:** the first gameplay frames show a band of raw, unfiltered reflection tiles along the bottom of the picture, and blocky tiles at a screen edge in a cutscene shot. Both come and go from frame to frame, as these records do. - **Every group run (the fix below):** the band and the tiles are gone. But the whole first room also turns much darker. The walls and the player's clothes go nearly black, while the window and the outside stay as before. Because the darkening is global, not only in the rows the cut dropped, I suspect a value reduced over the whole pass that the cut never let finish (an exposure, or a step that only the last group to finish runs). I haven't confirmed whether the dark room is the title's intended look or a later pass reading that value wrong, so on the fork the fix is behind a switch for now. **The fix (tested on a fork).** D3D12 has no base group for a dispatch, so the translated program has to help. It is built on fxceless's branch, which has host-computed user-data dwords: 1. **The translated program.** A compute program that reads its group id (the TGID SGPRs) asks the host for two more user-data dwords: the groups of one row (0 means not spread) and the groups asked for in x. When the row is not 0, the program: - takes its console group as `x + z * row` in x and 0 in z; - returns before the console code when that is at or past the asked count. That is the last row's surplus; the whole group is alike, so this happens before any barrier. One pitfall here: branch out of the entry block only after the program's inputs are loaded. Some input code (thread ids numbered by console lane) makes a value in the current block and uses it in the entry block. Done before the inputs, this made 936 of the title's programs fail in the bitcode writer ("forward reference outside a phi"). 2. **The clamp, for such a pipeline.** It writes each dispatch record as `[row, asked x, gx, gy, gz]` (20 bytes). A record of more than 65,535 groups in x and 1 in z goes out as `ceil(x / rows)` by `y` by `rows`, where `rows = ceil(x / 65535)`. So fewer than `rows` groups are surplus. 3. **The command signature.** Those pipelines' indirect dispatches use a command signature of two `D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT` arguments and the dispatch. The constants go into the user-data root constants at those two dwords' places. The signature is created with the pipeline's root signature, once per pipeline. (The next draw or dispatch sets all user data again, so the values the signature leaves behind don't matter.) 4. **Direct dispatches.** A direct `Dispatch` with more than 65,535 groups in x is spread the same way on the CPU. **Checks.** - A translated program that stores its group id at that dword, run as 5 groups unspread, 100,000 in two rows, and 131,071 in three rows. On the card and WARP, every group stores once and the surplus groups store nothing. The same with cross-lane code, on the card only. - The clamp's spread records run through the command signature on WARP: every group asked for runs once. - All the title's programs translated with the change: the same outcomes as without it, and every emitted program passes the DXIL validator. - On the card, the frame takes about 10 ms more with every group run: the work the cut dropped. No existing issue or pull request seems to cover the cut. #956 adds command signatures with root constants for the title's own multi-argument signatures, which may share code with this. RTX 5080 (driver 621.24), Windows 11. Found, written and tested with Claude Code.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:00:00 +00:00
Author
Owner

@⁠Ingenioeren on GitHub · 2026-11-25 09:34 UTC · original

One additional test case for spreading is a shader whose original code never reads its group ID. It can still have a side effect for every group.

On 940d32f, I fed the existing indirect clamp two synthetic records on WARP: (65535, 2, 1) and (65537, 2, 1). The x field read back as 65,535 in both. I then dispatched a native SM 6.6 shader that only increments a UAV counter once per group. The RX 6750 XT and WARP returned identical counts. Current indirect clamp

Dispatch Counter
Clamped (65535, 2, 1) 131,070
Spread (32769, 2, 2), original shader 131,076
Same spread with an early x + z * 32769 >= 65537 guard 131,074, expected

That makes the tail guard a correctness requirement even if the guest shader never consumes TGID. If the first implementation spreads only pipelines that already read TGID, this case can establish the current limit and guard against enabling spreading for side-effect-only pipelines without injecting the guard.

AI-assisted. Two synthetic checks passed. No title or fork patch was run.

**@⁠Ingenioeren** on GitHub · 2026-11-25 09:34 UTC · [original](https://github.com/Marvisak/VIctory/issues/2256#issuecomment-7158516948) One additional test case for spreading is a shader whose original code never reads its group ID. It can still have a side effect for every group. On `940d32f`, I fed the existing indirect clamp two synthetic records on WARP: `(65535, 2, 1)` and `(65537, 2, 1)`. The x field read back as 65,535 in both. I then dispatched a native SM 6.6 shader that only increments a UAV counter once per group. The RX 6750 XT and WARP returned identical counts. [Current indirect clamp](https://github.com/Marvisak/VIctory/blob/940d32f69b22265690a0b5a15d6ded572ba33baf/crates/victory-gpu/src/indirect.rs#L32-L54) | Dispatch | Counter | | --- | ---: | | Clamped `(65535, 2, 1)` | 131,070 | | Spread `(32769, 2, 2)`, original shader | 131,076 | | Same spread with an early `x + z * 32769 >= 65537` guard | **131,074**, expected | That makes the tail guard a correctness requirement even if the guest shader never consumes TGID. If the first implementation spreads only pipelines that already read TGID, this case can establish the current limit and guard against enabling spreading for side-effect-only pipelines without injecting the guard. _AI-assisted. Two synthetic checks passed. No title or fork patch was run._
Author
Owner

@⁠Calvix2k on GitHub · 2026-11-25 09:48 UTC · original

I looked at taking this upstream on main and want to state the shape before writing it, because the fork you built it on has a piece this tree does not.

The spread needs the translated program's help, and on main a compute program reads its group id through dx.op.groupId (the SGPR "TGID" inputs are modelled as that), so there is nothing the host can offset alone. The upstream-sized change is:

  1. lower.rs: for a program that reads groupId, add two host-provided user-data dwords (row width, asked x) and, when the row width is non-zero, compute the console group as x + z * row and return before the console code when it is at or past the ask. The branch has to come after the program's input loads — your note about the 936 "forward reference outside a phi" failures is the constraint here.
  2. host/draw: reserve those two dwords per dispatch, fill them for direct dispatches, and dispatch ceil(x / 65535) rows by re-dispatching with the row constant.
  3. indirect.rs + command signature: the clamp shader rewrites a record to (row, asked, ceil(x/row), y, rows) and those pipelines' indirect dispatch uses a signature with two CONSTANT arguments feeding the same user-data dwords.
  4. Tests: the group-id stores you describe (5 groups, 100,000 in two rows, 131,071 in three; the "never reads its group id" side-effect case from @⁠Ingenioeren), plus the clamp's records through the signature on WARP.

That is a day-scale change in the translator and submission path, and two things make me want a maintainer's yes before starting:

  • the fork uses host-computed user-data dwords; upstream would have to grow that mechanism (or a reserved pair of constants) first;
  • your own measurement has the room going globally darker with every group run. If a pass that the cut silently skipped now completes and darkens the scene, spreading will change how the title looks, and that needs an explanation before it lands — the "every group runs" state is the correct one, so either the pass is reading something we produce wrongly, or the exposure depends on a group that races.

I can start with (1) and (2) behind a switch, which is testable without the command signature and gives the translator work a landing place; is that wanted, or would the maintainers rather keep this on the fork until the darkening is understood?

**@⁠Calvix2k** on GitHub · 2026-11-25 09:48 UTC · [original](https://github.com/Marvisak/VIctory/issues/2256#issuecomment-7158826414) I looked at taking this upstream on `main` and want to state the shape before writing it, because the fork you built it on has a piece this tree does not. The spread needs the translated program's help, and on `main` a compute program reads its group id through `dx.op.groupId` (the SGPR "TGID" inputs are modelled as that), so there is nothing the host can offset alone. The upstream-sized change is: 1. `lower.rs`: for a program that reads `groupId`, add two host-provided user-data dwords (row width, asked x) and, when the row width is non-zero, compute the console group as `x + z * row` and return before the console code when it is at or past the ask. The branch has to come after the program's input loads — your note about the 936 "forward reference outside a phi" failures is the constraint here. 2. `host`/`draw`: reserve those two dwords per dispatch, fill them for direct dispatches, and dispatch `ceil(x / 65535)` rows by re-dispatching with the row constant. 3. `indirect.rs` + command signature: the clamp shader rewrites a record to `(row, asked, ceil(x/row), y, rows)` and those pipelines' indirect dispatch uses a signature with two CONSTANT arguments feeding the same user-data dwords. 4. Tests: the group-id stores you describe (5 groups, 100,000 in two rows, 131,071 in three; the "never reads its group id" side-effect case from @⁠Ingenioeren), plus the clamp's records through the signature on WARP. That is a day-scale change in the translator and submission path, and two things make me want a maintainer's yes before starting: - the fork uses host-computed user-data dwords; upstream would have to grow that mechanism (or a reserved pair of constants) first; - your own measurement has the room going globally darker with every group run. If a pass that the cut silently skipped now completes and darkens the scene, spreading will change how the title looks, and that needs an explanation before it lands — the "every group runs" state is the correct one, so either the pass is reading something we produce wrongly, or the exposure depends on a group that races. I can start with (1) and (2) behind a switch, which is testable without the command signature and gives the translator work a landing place; is that wanted, or would the maintainers rather keep this on the fork until the darkening is understood?
Author
Owner

@⁠SantannaCarlos on GitHub · 2026-11-25 09:53 UTC · original

A data point on the darkening, from fxceless/victory-fork#834, which runs the groups past 65,535 in x of an indirect record as a second execution (a host-set base added to the group id in x, up to 131,070, indirect only) instead of spreading over z.

On an RTX 4070, default mode, from the cell save: the cut program there is 2dc364df5d3278b8, one record a frame of 85,000 to 115,200 groups in x. With all of its groups running, the room did not get darker. Mean luma of the whole picture from +200 to +1100 frames after the first world frame was 33.5, 33.3 and 47.7 in three runs with the split, and 38.3, 33.5, 35.9 and 49.9 in four without it. The two lightest runs without the split are the ones that kept the stale lower-right blocks. So on this card, running that pass in full does not change the exposure. If the room darkens with spreading, the difference is more likely in the spreading path (the other programs it covers, the direct dispatches, or the command signature's constants) than in the pass completing.

The split also has no surplus groups: the second execution asks for exactly the groups past 65,535, so the side-effect case above only applies to the spreading form.

**@⁠SantannaCarlos** on GitHub · 2026-11-25 09:53 UTC · [original](https://github.com/Marvisak/VIctory/issues/2256#issuecomment-7158931167) A data point on the darkening, from fxceless/victory-fork#834, which runs the groups past 65,535 in x of an indirect record as a second execution (a host-set base added to the group id in x, up to 131,070, indirect only) instead of spreading over z. On an RTX 4070, default mode, from the cell save: the cut program there is `2dc364df5d3278b8`, one record a frame of 85,000 to 115,200 groups in x. With all of its groups running, the room did not get darker. Mean luma of the whole picture from +200 to +1100 frames after the first world frame was 33.5, 33.3 and 47.7 in three runs with the split, and 38.3, 33.5, 35.9 and 49.9 in four without it. The two lightest runs without the split are the ones that kept the stale lower-right blocks. So on this card, running that pass in full does not change the exposure. If the room darkens with spreading, the difference is more likely in the spreading path (the other programs it covers, the direct dispatches, or the command signature's constants) than in the pass completing. The split also has no surplus groups: the second execution asks for exactly the groups past 65,535, so the side-effect case above only applies to the spreading form.
Author
Owner

@⁠Coderlord on GitHub · 2026-11-25 09:56 UTC · original

Thanks, all three of these help.

@⁠SantannaCarlos, that settles where to look. On your card the pass runs in full and the room keeps its brightness, so the darkening I saw most likely comes from my spreading path, not from the pass completing. My path differs from fxceless/victory-fork#834 in two ways:

  • Every dispatch, not only wide ones. Every indirect dispatch of a program that reads its group id goes through a command signature with two CONSTANT arguments, not only the wide ones. #834 keeps the plain signature and adds a second execution with a host-set base.
  • Direct dispatches. Mine spreads direct dispatches too.

I'll A/B those on the RTX 5080 (spreading only through a second execution, as in #834) and post what I find.

@⁠Ingenioeren, the fork spreads only pipelines whose program reads its group id: the prologue that guards the surplus is emitted only there. Every other pipeline is still cut, so your side-effect case can't run surplus groups there, though those dispatches also still lose their tail. Your counter test is a good one to add for whichever form lands.

@⁠Calvix2k, #834's form looks like the better shape for main than the one in this issue:

  • one host-set base dword instead of a pair;
  • no surplus groups, so no guard;
  • no constants in the command signature;
  • per the measurement above, no darkening.

Found, written and tested with Claude Code.

**@⁠Coderlord** on GitHub · 2026-11-25 09:56 UTC · [original](https://github.com/Marvisak/VIctory/issues/2256#issuecomment-7159011048) Thanks, all three of these help. @⁠SantannaCarlos, that settles where to look. On your card the pass runs in full and the room keeps its brightness, so the darkening I saw most likely comes from my spreading path, not from the pass completing. My path differs from fxceless/victory-fork#834 in two ways: - **Every dispatch, not only wide ones.** Every indirect dispatch of a program that reads its group id goes through a command signature with two CONSTANT arguments, not only the wide ones. #834 keeps the plain signature and adds a second execution with a host-set base. - **Direct dispatches.** Mine spreads direct dispatches too. I'll A/B those on the RTX 5080 (spreading only through a second execution, as in #834) and post what I find. @⁠Ingenioeren, the fork spreads only pipelines whose program reads its group id: the prologue that guards the surplus is emitted only there. Every other pipeline is still cut, so your side-effect case can't run surplus groups there, though those dispatches also still lose their tail. Your counter test is a good one to add for whichever form lands. @⁠Calvix2k, #834's form looks like the better shape for `main` than the one in this issue: - one host-set base dword instead of a pair; - no surplus groups, so no guard; - no constants in the command signature; - per the measurement above, no darkening. Found, written and tested with Claude Code.
Author
Owner

@⁠Coderlord on GitHub · 2026-11-25 10:32 UTC · original

A follow-up with a measurement. In the RTX 5080 runs below, the darkening comes from the cut groups running, whichever way they run, not from the spreading path.

I took the spread over z out of the fork and cherry-picked fxceless/victory-fork#834 as it is (thanks @⁠SantannaCarlos). Then I ran the same build with and without its split, from a new game into the first gameplay shot (the cell window). The runs were 7 minutes each at 1080p, with the same scripted presses and a warm cache:

Run Cut groups First room Window Bottom edge ms/frame, last quarter (median) Card ms
A run (spread over z, the issue's form) dark: walls and clothes nearly black clear clean 222 97
B cut (spreading off, same build as A) lit clear stale blocks 207 86
C run (#834's second execution) dark, as in A grainy, washed out, fence missing clean 218 96
D cut (#834's build with VICTORY_DISPATCH_SPLIT=0) lit, as in B clear stale blocks 213 91

On this card the room darkens in both forms, and only when the cut groups run. In C the window also turned grainy and the fence disappeared, which A did not show. Your RTX 4070 runs started from the cell save rather than a new game, so the scene's state may differ. That would explain the difference better than the spreading path does.

So the open question is the pass itself, or whatever reads its outputs, on this card. Your description says that pass writes five 2560x1440 views and one 1280x720 view. Next, I'll compare its outputs with and without the split at the same frame to see which one darkens the room. Meanwhile the fork keeps #834's code with the split off by default.

Found, written and tested with Claude Code.

**@⁠Coderlord** on GitHub · 2026-11-25 10:32 UTC · [original](https://github.com/Marvisak/VIctory/issues/2256#issuecomment-7159828121) A follow-up with a measurement. In the RTX 5080 runs below, the darkening comes from the cut groups running, whichever way they run, not from the spreading path. I took the spread over z out of the fork and cherry-picked fxceless/victory-fork#834 as it is (thanks @⁠SantannaCarlos). Then I ran the same build with and without its split, from a new game into the first gameplay shot (the cell window). The runs were 7 minutes each at 1080p, with the same scripted presses and a warm cache: | Run | Cut groups | First room | Window | Bottom edge | ms/frame, last quarter (median) | Card ms | |---|---|---|---|---|---:|---:| | A | run (spread over z, the issue's form) | dark: walls and clothes nearly black | clear | clean | 222 | 97 | | B | cut (spreading off, same build as A) | lit | clear | stale blocks | 207 | 86 | | C | run (#834's second execution) | dark, as in A | grainy, washed out, fence missing | clean | 218 | 96 | | D | cut (#834's build with `VICTORY_DISPATCH_SPLIT=0`) | lit, as in B | clear | stale blocks | 213 | 91 | On this card the room darkens in both forms, and only when the cut groups run. In C the window also turned grainy and the fence disappeared, which A did not show. Your RTX 4070 runs started from the cell save rather than a new game, so the scene's state may differ. That would explain the difference better than the spreading path does. So the open question is the pass itself, or whatever reads its outputs, on this card. Your description says that pass writes five 2560x1440 views and one 1280x720 view. Next, I'll compare its outputs with and without the split at the same frame to see which one darkens the room. Meanwhile the fork keeps #834's code with the split off by default. Found, written and tested with Claude Code.
Author
Owner

@⁠Coderlord on GitHub · 2026-11-25 11:46 UTC · original

A correction to my last comment: the darkening is not caused by running the cut groups.

Two more runs of the same #834 build, at the same frame (frame 2400, about 75 s into the first gameplay shot), with a warm cache:

Run Cut groups First room Bottom edge Mean luma, whole frame (0-255)
E run (VICTORY_DISPATCH_SPLIT=1) lit clean 47.2
F cut lit stale blocks 47.5

A third warm run with the split on (G) saved frames 2200 and 2600: also lit (whole-frame luma 45.2 and 46.4), with a clean bottom edge. Along the bottom-right edge where the blocks show, the luma is 3.3 to 3.4 with the split on and 25.8 with it off.

Run E shows what #834 is for: the blocks are gone and the room looks as it does with the cut. The two dark runs in my table (A and C) were both the first run after a translator change. The driver was still compiling pipelines through the opening cutscene, and draws and dispatches waited or were dropped meanwhile. A warm run with every group running (E) is lit, so the darkening goes with that cold start, not with the split or the spread. Sorry for the noise. Your RTX 4070 numbers fit this.

I'm turning the split on by default in the fork.

Found, written and tested with Claude Code.

**@⁠Coderlord** on GitHub · 2026-11-25 11:46 UTC · [original](https://github.com/Marvisak/VIctory/issues/2256#issuecomment-7161479255) A correction to my last comment: the darkening is not caused by running the cut groups. Two more runs of the same #834 build, at the same frame (frame 2400, about 75 s into the first gameplay shot), with a warm cache: | Run | Cut groups | First room | Bottom edge | Mean luma, whole frame (0-255) | |---|---|---|---|---:| | E | run (`VICTORY_DISPATCH_SPLIT=1`) | lit | clean | 47.2 | | F | cut | lit | stale blocks | 47.5 | A third warm run with the split on (G) saved frames 2200 and 2600: also lit (whole-frame luma 45.2 and 46.4), with a clean bottom edge. Along the bottom-right edge where the blocks show, the luma is 3.3 to 3.4 with the split on and 25.8 with it off. Run E shows what #834 is for: the blocks are gone and the room looks as it does with the cut. The two dark runs in my table (A and C) were both the first run after a translator change. The driver was still compiling pipelines through the opening cutscene, and draws and dispatches waited or were dropped meanwhile. A warm run with every group running (E) is lit, so the darkening goes with that cold start, not with the split or the spread. Sorry for the noise. Your RTX 4070 numbers fit this. I'm turning the split on by default in the fork. Found, written and tested with Claude Code.
Author
Owner

@⁠Xvania7 on GitHub · 2026-11-25 11:49 UTC · original

Opened #2312 ( eat/spread-large-dispatches) addressing this on main: direct dispatches with x > 65,535 && z == 1 and indirect dispatches bound via indirect::bound_spread spread the grid across z (remapping group IDs in the compute shader prologue via a hidden root constant). All CI checks passed and verified against 940d32f.

**@⁠Xvania7** on GitHub · 2026-11-25 11:49 UTC · [original](https://github.com/Marvisak/VIctory/issues/2256#issuecomment-7161548794) Opened #2312 ( eat/spread-large-dispatches) addressing this on main: direct dispatches with x > 65,535 && z == 1 and indirect dispatches bound via indirect::bound_spread spread the grid across z (remapping group IDs in the compute shader prologue via a hidden root constant). All CI checks passed and verified against 940d32f.
Author
Owner

@⁠Coderlord on GitHub · 2026-11-25 12:15 UTC · original

One more data point, so my last comment doesn't overclaim. I ran #834's build with the split on and the pipeline library moved aside, so every pipeline was made during the run as in runs A and C. The room was lit. So a cold pipeline start alone doesn't bring the dark room back.

Tally on the RTX 5080, from a new game:

  • Cut groups: the room was dark in 0 of 4 runs.
  • Every group run: dark in 2 of 5. Both dark runs were the first run after a translator change, with the translation cache filled beforehand by victory translate --warm. The three lit runs came after.

I can't explain it yet. It may be intermittent, but nothing I've measured ties it to the split.

Found, written and tested with Claude Code.

**@⁠Coderlord** on GitHub · 2026-11-25 12:15 UTC · [original](https://github.com/Marvisak/VIctory/issues/2256#issuecomment-7162134651) One more data point, so my last comment doesn't overclaim. I ran #834's build with the split on and the pipeline library moved aside, so every pipeline was made during the run as in runs A and C. The room was lit. So a cold pipeline start alone doesn't bring the dark room back. Tally on the RTX 5080, from a new game: - **Cut groups:** the room was dark in 0 of 4 runs. - **Every group run:** dark in 2 of 5. Both dark runs were the first run after a translator change, with the translation cache filled beforehand by `victory translate --warm`. The three lit runs came after. I can't explain it yet. It may be intermittent, but nothing I've measured ties it to the split. Found, written and tested with Claude Code.
Author
Owner

@⁠iGoldenNinja on GitHub · 2026-11-25 12:18 UTC · original

One same-launch RTX 5080 follow-up on the NVIDIA fork's PR 834 (0135c41), driver 617.14 and Windows 11 Pro 25H2 build 26200.9974. I toggled only the diffuse-lighting dispatch split while the camera stayed at the prison window at 1735 × 911. Most of the band cleared after the second record restored the missing groups. Turning the split off again immediately clipped the GPU arguments, and the cleared region persisted in both sampled frames at that view. This is consistent with earlier writes persisting in the affected tiles. Pinned diagnostic and numbers

Testing and reporting assisted by OpenAI Codex.

**@⁠iGoldenNinja** on GitHub · 2026-11-25 12:18 UTC · [original](https://github.com/Marvisak/VIctory/issues/2256#issuecomment-7162191757) One same-launch RTX 5080 follow-up on the NVIDIA fork's PR 834 (`0135c41`), driver 617.14 and Windows 11 Pro 25H2 build 26200.9974. I toggled only the diffuse-lighting dispatch split while the camera stayed at the prison window at 1735 × 911. Most of the band cleared after the second record restored the missing groups. Turning the split off again immediately clipped the GPU arguments, and the cleared region persisted in both sampled frames at that view. This is consistent with earlier writes persisting in the affected tiles. [Pinned diagnostic and numbers](https://github.com/iGoldenNinja/victory-fork/blob/0ad7ea4550ee778c5e8de44fbcc64325c29672f4/docs/nvidia-pr834-live-dispatch-5080.md#fixed-camera-repeat) Testing and reporting assisted by OpenAI Codex.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 15:52 UTC · original · edited 2026-11-26 00:50 UTC

Automated triage for the maintainers.

Confirmed on main (63bcca4). The indirect argument clamp shader in crates/victory-gpu/src/indirect.rs still does min(args.Load3(at), uint3(65535, 65535, 65535)), so groups past 65,535 in a dimension never run. Main has no base-group or spreading path. Open PR #2312 spreads such dispatches across z with a group-id remap in the compute prologue. It needs a rebase. The thread's later measurements (warm runs) tie the dark room seen in some runs to something other than running the cut groups, so it is not an argument against fixing the cut.

New since the last triage: on an RTX 3080 Ti (driver 621.24), raising only the clamp's x bound let a 67,440-group indirect dispatch run whole, and the blocky band in the prison-cell scene went away. D3D12 documents 65,535 as the limit, so that relies on driver behaviour on one card and is not a portable fix. Spreading (#2312) or a second execution with a host-set base, as discussed above, stays within the limit.

The thread also asks whether a smaller, switch-gated upstream form is wanted; that is a decision for the maintainers.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 15:52 UTC · [original](https://github.com/Marvisak/VIctory/issues/2256#issuecomment-7167396443) · edited 2026-11-26 00:50 UTC <!-- victory-issue-triage v1 verdict=confirmed seen=2026-11-25T23:26:31Z at=2026-11-26T00:54:30Z --> Automated triage for the maintainers. Confirmed on main (`63bcca4`). The indirect argument clamp shader in `crates/victory-gpu/src/indirect.rs` still does `min(args.Load3(at), uint3(65535, 65535, 65535))`, so groups past 65,535 in a dimension never run. Main has no base-group or spreading path. Open PR #2312 spreads such dispatches across z with a group-id remap in the compute prologue. It needs a rebase. The thread's later measurements (warm runs) tie the dark room seen in some runs to something other than running the cut groups, so it is not an argument against fixing the cut. New since the last triage: on an RTX 3080 Ti (driver 621.24), raising only the clamp's x bound let a 67,440-group indirect dispatch run whole, and the blocky band in the prison-cell scene went away. D3D12 documents 65,535 as the limit, so that relies on driver behaviour on one card and is not a portable fix. Spreading (#2312) or a second execution with a host-set base, as discussed above, stays within the limit. The thread also asks whether a smaller, switch-gated upstream form is wanted; that is a decision for the maintainers. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠Machad3x on GitHub · 2026-11-25 23:26 UTC · original

A data point for NVIDIA without spreading: on an RTX 3080 Ti (driver 621.24, Windows 11) an indirect dispatch of 67,440 x 1 x 1 groups runs whole. Raising only the clamp's x bound to 2^20 (the expression follows avatarmanz/VIctory-7900XTX 84eae352, which does this for AMD cards), a test on the card counts every group once, the highest group id 67,439; with the 65,535 clamp it counts 65,535.

In the title: one 7-minute run with that change, Series X mode, the blocky band along the bottom of the window scene in the prison cell was gone in the screenshots (present in the run before, same build otherwise), no device removal. The cell walls were dark in both runs, so this says nothing about the darkening discussed above.

D3D12 documents 65,535 as the limit and does not validate indirect counts, so this is driver behaviour, not a guarantee; one card and driver tested.

Ran with AI assistance (Claude Code).

**@⁠Machad3x** on GitHub · 2026-11-25 23:26 UTC · [original](https://github.com/Marvisak/VIctory/issues/2256#issuecomment-7177564227) A data point for NVIDIA without spreading: on an RTX 3080 Ti (driver 621.24, Windows 11) an indirect dispatch of 67,440 x 1 x 1 groups runs whole. Raising only the clamp's x bound to 2^20 (the expression follows avatarmanz/VIctory-7900XTX 84eae352, which does this for AMD cards), a test on the card counts every group once, the highest group id 67,439; with the 65,535 clamp it counts 65,535. In the title: one 7-minute run with that change, Series X mode, the blocky band along the bottom of the window scene in the prison cell was gone in the screenshots (present in the run before, same build otherwise), no device removal. The cell walls were dark in both runs, so this says nothing about the darkening discussed above. D3D12 documents 65,535 as the limit and does not validate indirect counts, so this is driver behaviour, not a guarantee; one card and driver tested. Ran with AI assistance (Claude Code).
This discussion has been locked. Commenting is limited to contributors.
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#2256
No description provided.