GPU: indirect dispatches past 65,535 groups in x run the rest in a second execution #834

Open
github-bot wants to merge 1 commit from github-bot/gh-834 into main AGit
Owner

@⁠SantannaCarlos on GitHub · 2026-11-25 09:52 UTC · original
SantannaCarlos:fx/dispatch-split → main · +368 −11 · 5 files · 1 commits · open

Problem

A D3D12 dispatch runs at most 65,535 thread groups in each dimension, while the console's go further in x. The README lists it under "Known and counted, not fixed yet": the clamp cuts an indirect compute record that asks for more to 65,535 in x, and the groups past it never run.

In the prologue on an RTX 4070 it is always one program, 2dc364df5d3278b8 (named with a local counter of the cut executions):

  • It runs once per frame as a one-record ExecuteIndirect.
  • It asks for 85,000 to 115,200 groups in x, with y = z = 1, so 22 to 43 % of its groups never ran.
  • It writes five 2560x1440 UAVs (R8_UINT, two R11G11B10_FLOAT, two R32_UINT) and a 1280x720 R16_UINT: a lighting pass over classified tiles.
  • The tiles past the cut keep what an earlier shot left there. That matches the square blocks in the lower right of #310, which VICTORY_SHADER_OPT=0 shows too.

Change

  • Clamp (indirect.rs). Behind bit 3 of the flags word, which was free, the clamp writes a second record after each dispatch record, stride * records bytes on in the scratch buffer.
    • That record holds the groups past 65,535 in x (up to 65,535 more; 0 where the record asked for fewer), with the record's own y and z.
    • The list budget charges both parts, and the 2^20 groups a dispatch may run hold for the two together.
    • With the bit clear, the shader writes what it wrote before. In the clamp source only the dispatch branch's cost line and the store of the dispatch record change, and no budget word but word 0 is used.
  • Translator. A host-computed user-data dword, USER_GROUP_BASE (RootType::Other(0x104)), is added to SV_GroupID.x in programs that read their group id in x. Other programs come out unchanged. The translator emits no SV_DispatchThreadID; the console code builds global ids from the group-id register, so the base reaches those too.
  • Host (draw.rs). For an indirect dispatch whose program has the dword, the clamp runs with bound_split. After the usual ExecuteIndirect, the host sets the dword to 65,535, runs the second records with the same command signature, max and count buffer, then sets the dword back to 0. Direct dispatches and every other path see 0.
  • VICTORY_DISPATCH_SPLIT=0 turns the split off.

The second execution runs exactly the groups past 65,535, so there are no surplus groups to stop.

shortcut: only programs that read their group id in x are split. A second execution for every indirect dispatch would double the indirect compute commands of a frame, so the others are still cut, which matters for one that takes its work from a counter. The one program seen asking for more in the prologue reads it.

Not covered:

  • Records past 131,070 groups in x are still cut there. A 15-minute run from another save, on an earlier main, asked for more than 131,070 in its first three minutes in the world (168,816 to 1,151,648, up to 19 records a frame), then settled at about 80,000. Which program asks for those is not known yet.
  • Mesh dispatches, direct dispatches over 65,535 in x, and y or z over 65,535 are unchanged.
  • Marvisak/VIctory#2256 reports the same cut and spreads the groups over z instead (group = x + z * row, with an early return past the end). That covers any size and direct dispatches, and needs a command signature with two constants per pipeline; this change stays at 131,070 in x and indirect dispatches, with the command signature it had. #2256 also reports the first room getting much darker once all groups run. That did not happen here: see the luma column below. The two runs that kept the blocks are the lightest of their pairs, because the stale tiles are lighter than the shaded room.
  • #823 makes 2cc4c197ee29e291 (the reflection tiling program) run on 32-lane hosts and reports a band of blocks gone in the same shot. That program is refused in all seven runs below, with and without the split, so the difference in them is the split's. The two may each account for part of the blocks.

Tested

  • New tests:
    • indirect::tests::warp_split_runs_every_group_of_a_wide_dispatch_once (WARP): one record goes through the clamp and both executions, and a shader counts each group in a UAV.
      • Asked for x = 1, 65,535, 65,536, 89,968, 131,070 and 200,000, and for 70,000x2x3: each group runs once up to 131,070 in x, with y and z as asked, and the budget charges them all.
      • 70,000x16x1 runs neither part, since the whole dispatch exceeds 2^20 groups.
      • Unsplit, groups from 65,535 on stay at 0.
    • emit::tests::the_group_id_in_x_starts_at_the_host_base: a hand-written program that stores its group-id register is translated, validated and run with three groups. It reads 0, 1, 2 with the dword at 0, and 65,535, 65,536, 65,537 with it at 65,535.
  • cargo clippy --workspace --all-targets -- -D warnings, with and without --all-features: only what 9376fd6 already fails on (draw.rs sort_unstable_by_key, indirect.rs Rig::depth_written, and without the features placed_filler_twins).
  • cargo test -p victory-shader: 216 passed on the card. Under WARP 4 fail (ds_min_max_f32_order..., v_permlane16_and_x16..., whole_wave_f64_sum..., a_lane_mask_joined_with_a_number...), the same way as on 9376fd6.
  • cargo test -p victory-gpu --lib (WARP): all pass but depth_bounds_pipeline_loads_and_filters_draws, which fails on 9376fd6 under WARP too.
  • cargo xtask policy.
  • A trial merge with #793, which edits the same clamp source in other lines, has no conflict; the merged tree builds and its indirect tests pass.
  • In the title: RTX 4070, default mode, the cell save, 8-minute runs with a warm cache, each in a fresh process.
Run Split ms/frame (median) GPU ms (median) Second executions Blocks in the lower right, +200..+700 Mean luma, +200..+1100
1 off 259.2 94.6 none 63 of 63 frames 38.3
2 off 267.5 98.5 none 0 of 63 (a few stray blocks at the window's lower edge, +232 to +248) 33.5
3 on 248.7 97.5 1,235,000 of 5,700,036 dispatches 0 of 63 33.5
4 off 252.0 94.0 none 0 of 63 35.9
5 on 246.3 98.7 1,190,000 of 5,484,258 0 of 63 33.3
6 off 255.7 93.1 none 63 of 63 49.9
7 on 270.4 104.2 1,175,000 of 5,423,471 0 of 63 47.7
  • Blocks: square blocks of stale content in the lower right of the cell-window shot, with a blue stepped patch at the right edge. A frame counts when more than 100 of its 8x8 tiles there differ by more than 40 on average from the same frame of the nearest split run. They stay for the whole shot in 2 of the 4 runs without the split and in none of the 3 with it; whether they show without it depends on what an earlier shot left in those tiles. Offsets count from the first world frame.
  • Cost: frame time is within run-to-run noise (median of the medians 257.5 ms off, 248.7 ms on). The card's time rises by about 5 ms a frame (mean of the medians 95.0 ms off, 100.1 ms on), since the groups past 65,535 now run.
  • Pipelines: every run refuses the same eight known ones. Run 7 also reached 6b82bc7d22016cb5 and refused it with E_INVALIDARG; earlier runs on trees without this change refuse it the same way.

The README line under "Known and counted, not fixed yet" can say "up to 131,070 groups in x run" once this is in.

**@⁠SantannaCarlos** on GitHub · 2026-11-25 09:52 UTC · [original](https://github.com/fxceless/victory-fork/pull/834) `SantannaCarlos:fx/dispatch-split` → `main` · +368 −11 · 5 files · 1 commits · open ## Problem A D3D12 dispatch runs at most 65,535 thread groups in each dimension, while the console's go further in x. The README lists it under "Known and counted, not fixed yet": the clamp cuts an indirect compute record that asks for more to 65,535 in x, and the groups past it never run. In the prologue on an RTX 4070 it is always one program, `2dc364df5d3278b8` (named with a local counter of the cut executions): - It runs once per frame as a one-record `ExecuteIndirect`. - It asks for 85,000 to 115,200 groups in x, with y = z = 1, so 22 to 43 % of its groups never ran. - It writes five 2560x1440 UAVs (R8_UINT, two R11G11B10_FLOAT, two R32_UINT) and a 1280x720 R16_UINT: a lighting pass over classified tiles. - The tiles past the cut keep what an earlier shot left there. That matches the square blocks in the lower right of #310, which `VICTORY_SHADER_OPT=0` shows too. ## Change - **Clamp (`indirect.rs`).** Behind bit 3 of the flags word, which was free, the clamp writes a second record after each dispatch record, `stride * records` bytes on in the scratch buffer. - That record holds the groups past 65,535 in x (up to 65,535 more; 0 where the record asked for fewer), with the record's own y and z. - The list budget charges both parts, and the 2^20 groups a dispatch may run hold for the two together. - With the bit clear, the shader writes what it wrote before. In the clamp source only the dispatch branch's cost line and the store of the dispatch record change, and no budget word but word 0 is used. - **Translator.** A host-computed user-data dword, `USER_GROUP_BASE` (`RootType::Other(0x104)`), is added to `SV_GroupID.x` in programs that read their group id in x. Other programs come out unchanged. The translator emits no `SV_DispatchThreadID`; the console code builds global ids from the group-id register, so the base reaches those too. - **Host (`draw.rs`).** For an indirect dispatch whose program has the dword, the clamp runs with `bound_split`. After the usual `ExecuteIndirect`, the host sets the dword to 65,535, runs the second records with the same command signature, `max` and count buffer, then sets the dword back to 0. Direct dispatches and every other path see 0. - `VICTORY_DISPATCH_SPLIT=0` turns the split off. The second execution runs exactly the groups past 65,535, so there are no surplus groups to stop. shortcut: only programs that read their group id in x are split. A second execution for every indirect dispatch would double the indirect compute commands of a frame, so the others are still cut, which matters for one that takes its work from a counter. The one program seen asking for more in the prologue reads it. Not covered: - Records past 131,070 groups in x are still cut there. A 15-minute run from another save, on an earlier main, asked for more than 131,070 in its first three minutes in the world (168,816 to 1,151,648, up to 19 records a frame), then settled at about 80,000. Which program asks for those is not known yet. - Mesh dispatches, direct dispatches over 65,535 in x, and y or z over 65,535 are unchanged. ## Related - Marvisak/VIctory#2256 reports the same cut and spreads the groups over z instead (group = x + z * row, with an early return past the end). That covers any size and direct dispatches, and needs a command signature with two constants per pipeline; this change stays at 131,070 in x and indirect dispatches, with the command signature it had. #2256 also reports the first room getting much darker once all groups run. That did not happen here: see the luma column below. The two runs that kept the blocks are the lightest of their pairs, because the stale tiles are lighter than the shaded room. - #823 makes `2cc4c197ee29e291` (the reflection tiling program) run on 32-lane hosts and reports a band of blocks gone in the same shot. That program is refused in all seven runs below, with and without the split, so the difference in them is the split's. The two may each account for part of the blocks. ## Tested - New tests: - `indirect::tests::warp_split_runs_every_group_of_a_wide_dispatch_once` (WARP): one record goes through the clamp and both executions, and a shader counts each group in a UAV. - Asked for x = 1, 65,535, 65,536, 89,968, 131,070 and 200,000, and for 70,000x2x3: each group runs once up to 131,070 in x, with y and z as asked, and the budget charges them all. - 70,000x16x1 runs neither part, since the whole dispatch exceeds 2^20 groups. - Unsplit, groups from 65,535 on stay at 0. - `emit::tests::the_group_id_in_x_starts_at_the_host_base`: a hand-written program that stores its group-id register is translated, validated and run with three groups. It reads 0, 1, 2 with the dword at 0, and 65,535, 65,536, 65,537 with it at 65,535. - `cargo clippy --workspace --all-targets -- -D warnings`, with and without `--all-features`: only what `9376fd6` already fails on (`draw.rs` `sort_unstable_by_key`, `indirect.rs` `Rig::depth_written`, and without the features `placed_filler_twins`). - `cargo test -p victory-shader`: 216 passed on the card. Under WARP 4 fail (`ds_min_max_f32_order...`, `v_permlane16_and_x16...`, `whole_wave_f64_sum...`, `a_lane_mask_joined_with_a_number...`), the same way as on `9376fd6`. - `cargo test -p victory-gpu --lib` (WARP): all pass but `depth_bounds_pipeline_loads_and_filters_draws`, which fails on `9376fd6` under WARP too. - `cargo xtask policy`. - A trial merge with #793, which edits the same clamp source in other lines, has no conflict; the merged tree builds and its `indirect` tests pass. - In the title: RTX 4070, default mode, the cell save, 8-minute runs with a warm cache, each in a fresh process. | Run | Split | ms/frame (median) | GPU ms (median) | Second executions | Blocks in the lower right, +200..+700 | Mean luma, +200..+1100 | |---|---|---:|---:|---|---|---:| | 1 | off | 259.2 | 94.6 | none | **63 of 63 frames** | 38.3 | | 2 | off | 267.5 | 98.5 | none | 0 of 63 (a few stray blocks at the window's lower edge, +232 to +248) | 33.5 | | 3 | on | 248.7 | 97.5 | 1,235,000 of 5,700,036 dispatches | 0 of 63 | 33.5 | | 4 | off | 252.0 | 94.0 | none | 0 of 63 | 35.9 | | 5 | on | 246.3 | 98.7 | 1,190,000 of 5,484,258 | 0 of 63 | 33.3 | | 6 | off | 255.7 | 93.1 | none | **63 of 63** | 49.9 | | 7 | on | 270.4 | 104.2 | 1,175,000 of 5,423,471 | 0 of 63 | 47.7 | - Blocks: square blocks of stale content in the lower right of the cell-window shot, with a blue stepped patch at the right edge. A frame counts when more than 100 of its 8x8 tiles there differ by more than 40 on average from the same frame of the nearest split run. They stay for the whole shot in 2 of the 4 runs without the split and in none of the 3 with it; whether they show without it depends on what an earlier shot left in those tiles. Offsets count from the first world frame. - Cost: frame time is within run-to-run noise (median of the medians 257.5 ms off, 248.7 ms on). The card's time rises by about 5 ms a frame (mean of the medians 95.0 ms off, 100.1 ms on), since the groups past 65,535 now run. - Pipelines: every run refuses the same eight known ones. Run 7 also reached `6b82bc7d22016cb5` and refused it with `E_INVALIDARG`; earlier runs on trees without this change refuse it the same way. The README line under "Known and counted, not fixed yet" can say "up to 131,070 groups in x run" once this is in.
A dispatch runs at most 65,535 thread groups in each dimension; the
console's go further in x. One lighting pass of the prologue asks for
85,000 to 115,200 groups in a one-record indirect dispatch every frame,
and the clamp cut it to 65,535, so a fifth to two fifths of its tiles kept
what an earlier frame left there, which matches the square blocks in the
lower right of #310.

The clamp now writes, behind a free flag bit, a second record per
dispatch record with the groups past 65,535 in x (up to 65,535 more), y
and z as asked, and charges both to the list's budget; the 2^20 groups a
dispatch may run hold for the two together. The host runs those second
records as a second execution with a new user-data dword at 65,535, which
the translated program adds to its group id in x. Only programs that read
the group id in x get the dword and the second execution;
VICTORY_DISPATCH_SPLIT=0 turns it off.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:52:08 +00:00
Author
Owner

@⁠SantannaCarlos on GitHub · 2026-11-25 10:17 UTC · original

On the requests past 131,070 listed under "Not covered": they come from pipeline warm-up, not from real work. Two 10-minute runs from that save, with this change and the counter:

  • Warm pipeline library: none past 131,070 (largest 114,320). The only program cut is 2dc364df5d3278b8, always one record, y = z = 1.
  • Empty pipeline library, translations warm (the condition of the earlier run): 58 of 477 frame lines ask for more than 131,070, up to 16,345,224, all between 37 s and 2 min 34 s into the world, while 1,100 to 2,200 draws a frame are dropped for want of a pipeline. Seven programs ask for them, each one record with y = z = 1, and all read their group id in x. Once the drops fall to about 350 a frame, those requests stop and only 2dc364df5d3278b8 is left, at 66,000 to 71,000.

So the counts are built while passes that make or clear them have no pipeline yet. No record seen asks for y or z over 1, and every program seen cut reads its group id in x.

**@⁠SantannaCarlos** on GitHub · 2026-11-25 10:17 UTC · [original](https://github.com/fxceless/victory-fork/pull/834#issuecomment-7159497871) On the requests past 131,070 listed under "Not covered": they come from pipeline warm-up, not from real work. Two 10-minute runs from that save, with this change and the counter: - Warm pipeline library: none past 131,070 (largest 114,320). The only program cut is `2dc364df5d3278b8`, always one record, y = z = 1. - Empty pipeline library, translations warm (the condition of the earlier run): 58 of 477 frame lines ask for more than 131,070, up to 16,345,224, all between 37 s and 2 min 34 s into the world, while 1,100 to 2,200 draws a frame are dropped for want of a pipeline. Seven programs ask for them, each one record with y = z = 1, and all read their group id in x. Once the drops fall to about 350 a frame, those requests stop and only `2dc364df5d3278b8` is left, at 66,000 to 71,000. So the counts are built while passes that make or clear them have no pipeline yet. No record seen asks for y or z over 1, and every program seen cut reads its group id in x.
Author
Owner

@⁠SantannaCarlos on GitHub · 2026-11-25 10:23 UTC · original

Heads-up for merging: #646 also adds a host-computed user-data code at RootType::Other(0x104) (USER_DISPATCH_THREADS), the same value as USER_GROUP_BASE here, so the two conflict in emit/shader.rs, emit/mod.rs and draw.rs. Whichever goes in second takes 0x105 and joins the imports and the host_word cases. The logic does not overlap: #646 limits direct DispatchX dispatches with thread dimensions, and this one only splits indirect records. I can rebase this branch onto either order.

**@⁠SantannaCarlos** on GitHub · 2026-11-25 10:23 UTC · [original](https://github.com/fxceless/victory-fork/pull/834#issuecomment-7159638874) Heads-up for merging: #646 also adds a host-computed user-data code at `RootType::Other(0x104)` (`USER_DISPATCH_THREADS`), the same value as `USER_GROUP_BASE` here, so the two conflict in `emit/shader.rs`, `emit/mod.rs` and `draw.rs`. Whichever goes in second takes `0x105` and joins the imports and the `host_word` cases. The logic does not overlap: #646 limits direct `DispatchX` dispatches with thread dimensions, and this one only splits indirect records. I can rebase this branch onto either order.
Author
Owner

@⁠HLVM04 on GitHub · 2026-11-25 10:31 UTC · original

A/B on an RTX 5070 Ti (wave32, NVIDIA 616.64), Series S profile. Tree: 9376fd6 + #798, #783, #799, #780 (with VICTORY_INDIRECT_KEEP=1 VICTORY_INDIRECT_WINDOW=1), #770 and #827, then this PR on top. One run each, about 4.5 minutes, frame lines after the first 60 s:

p50 ms mean ms
without this PR 149 223
with this PR 152 197
  • The frame cost is within run-to-run noise here too, as in your table. Max frame with it was 644 ms.
  • The log no longer reports dispatches cut to 65,535.
  • No device loss.

I didn't compare pictures for the lower-right blocks in this pair, so this only covers cost and stability on a second card and profile.

**@⁠HLVM04** on GitHub · 2026-11-25 10:31 UTC · [original](https://github.com/fxceless/victory-fork/pull/834#issuecomment-7159810523) A/B on an RTX 5070 Ti (wave32, NVIDIA 616.64), Series S profile. Tree: `9376fd6` + #798, #783, #799, #780 (with `VICTORY_INDIRECT_KEEP=1 VICTORY_INDIRECT_WINDOW=1`), #770 and #827, then this PR on top. One run each, about 4.5 minutes, frame lines after the first 60 s: | | p50 ms | mean ms | |---|---:|---:| | without this PR | 149 | 223 | | with this PR | 152 | 197 | - The frame cost is within run-to-run noise here too, as in your table. Max frame with it was 644 ms. - The log no longer reports dispatches cut to 65,535. - No device loss. I didn't compare pictures for the lower-right blocks in this pair, so this only covers cost and stability on a second card and profile.
Author
Owner

@⁠Rezwo on GitHub · 2026-11-25 10:37 UTC · original

Turing hardware test result on unchanged PR head 4b44212d6ba571092793f44e77dc8cf60297f427.

Windows, NVIDIA GeForce RTX 2080 Ti, Windows driver version 32.0.16.2101. No game files or in-game run.

I ran the existing split-dispatch fixture in an instrumented test harness. The local change only selects hardware versus WARP, asserts the adapter type/name, replaces the fixture's silent initialization skip with an expect, and logs the cases. Production split code and the readback assertions were unchanged.

Command:
cargo test --locked -p victory-gpu --lib indirect::tests::warp_split_runs_every_group_of_a_wide_dispatch_once -- --exact --nocapture

Both runs passed (1 test each, exit 0):

  • Microsoft Basic Render Driver, software=true.
  • NVIDIA GeForce RTX 2080 Ti, software=false.

All eight split cases ran: 1x1x1, 65535x1x1, 65536x1x1, 89968x1x1, 131070x1x1, 200000x1x1, 70000x2x3 and 70000x16x1. The unsplit negative control passed too. The fixture checks per-group hits, the 131070 x cap and the budget rejection for the oversized case; this is not a claim that all 200000 groups run.

The untouched baseline fixture also passed, but the adapter-logged runs above are the evidence that the instrumented fixture actually executed on each adapter. Rollback verification was not completed because the local tool rejected that command.

This supports the synthetic split logic on Turing; no conclusions about in-game visual changes or frame rate. AI-assisted (OpenAI Codex); tests executed locally.

**@⁠Rezwo** on GitHub · 2026-11-25 10:37 UTC · [original](https://github.com/fxceless/victory-fork/pull/834#issuecomment-7159953506) Turing hardware test result on unchanged PR head 4b44212d6ba571092793f44e77dc8cf60297f427. Windows, NVIDIA GeForce RTX 2080 Ti, Windows driver version 32.0.16.2101. No game files or in-game run. I ran the existing split-dispatch fixture in an instrumented test harness. The local change only selects hardware versus WARP, asserts the adapter type/name, replaces the fixture's silent initialization skip with an expect, and logs the cases. Production split code and the readback assertions were unchanged. Command: cargo test --locked -p victory-gpu --lib indirect::tests::warp_split_runs_every_group_of_a_wide_dispatch_once -- --exact --nocapture Both runs passed (1 test each, exit 0): - Microsoft Basic Render Driver, software=true. - NVIDIA GeForce RTX 2080 Ti, software=false. All eight split cases ran: 1x1x1, 65535x1x1, 65536x1x1, 89968x1x1, 131070x1x1, 200000x1x1, 70000x2x3 and 70000x16x1. The unsplit negative control passed too. The fixture checks per-group hits, the 131070 x cap and the budget rejection for the oversized case; this is not a claim that all 200000 groups run. The untouched baseline fixture also passed, but the adapter-logged runs above are the evidence that the instrumented fixture actually executed on each adapter. Rollback verification was not completed because the local tool rejected that command. This supports the synthetic split logic on Turing; no conclusions about in-game visual changes or frame rate. AI-assisted (OpenAI Codex); tests executed locally.
Author
Owner

@⁠VibeClauding on GitHub · 2026-11-25 10:55 UTC · original

Heads-up for merging this together with #220 (cheaper indirect draws, open): the two combine without a textual conflict in the clamp shader, but the result is wrong.

  • Since #220, asked in INDIRECT_CLAMP is a single uint that only mesh records set; it's 0 for dispatches. This PR's split reads asked.x in the dispatch branch (uint rest = ... ? min(asked.x - 65535u, 65535u) : 0u).
  • In the merged tree, asked.x is a swizzle of that scalar, so it's 0. 0 - 65535 wraps around, so every full-width dispatch (g.x == 65535) gets a second record of 65,535 extra groups and is charged twice.
  • warp_split_runs_every_group_of_a_wide_dispatch_once catches it: asked [65535, 1, 1]: budget, 8,388,480 against 4,194,240.
  • Fix: read the record's own x there, as the second record's store further down already does: min(src_args.Load(src_at) - 65535u, 65535u).
  • Two more spots in the same merge:
    • record_clamp_with has to take the scratch buffer's state, (dst, before), as #220's record_clamp_as does, and bound_split should track it like clamp_into: list.indirect_state before, list.indirect_readable after.
    • The test's done_on is gone after #220. A plain INDIRECT_ARGUMENT -> COMMON transition replaces it.
  • With those three changes, all 15 indirect tests pass on 8dd30ab + #220 + this PR (+ #646 #648 #670 #705 #346).

AI-assisted (Claude Code).

**@⁠VibeClauding** on GitHub · 2026-11-25 10:55 UTC · [original](https://github.com/fxceless/victory-fork/pull/834#issuecomment-7160351236) Heads-up for merging this together with #220 (cheaper indirect draws, open): the two combine without a textual conflict in the clamp shader, but the result is wrong. - Since #220, `asked` in `INDIRECT_CLAMP` is a single `uint` that only mesh records set; it's 0 for dispatches. This PR's split reads `asked.x` in the dispatch branch (`uint rest = ... ? min(asked.x - 65535u, 65535u) : 0u`). - In the merged tree, `asked.x` is a swizzle of that scalar, so it's 0. `0 - 65535` wraps around, so every full-width dispatch (`g.x == 65535`) gets a second record of 65,535 extra groups and is charged twice. - `warp_split_runs_every_group_of_a_wide_dispatch_once` catches it: `asked [65535, 1, 1]: budget`, 8,388,480 against 4,194,240. - **Fix:** read the record's own x there, as the second record's store further down already does: `min(src_args.Load(src_at) - 65535u, 65535u)`. - **Two more spots in the same merge:** - `record_clamp_with` has to take the scratch buffer's state, `(dst, before)`, as #220's `record_clamp_as` does, and `bound_split` should track it like `clamp_into`: `list.indirect_state` before, `list.indirect_readable` after. - The test's `done_on` is gone after #220. A plain `INDIRECT_ARGUMENT -> COMMON` transition replaces it. - With those three changes, all 15 `indirect` tests pass on 8dd30ab + #220 + this PR (+ #646 #648 #670 #705 #346). AI-assisted (Claude Code).
Author
Owner

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

Rebased onto f85101b, which conflicted in draw.rs and changed the clamp under this branch:

  • The clamp now takes the scratch buffer's state, so record_clamp_with takes (dst, before) like record_clamp_as, and bound_split goes through clamp_into, so the list knows the scratch is readable afterwards.
  • The dispatch branch of the clamp no longer keeps what the record asked for, so the second part's count is read from the record (src_args.Load(src_at)), as the store already did.
  • done_on is gone from the tests; the split test drops it like the others.

Checked on the rebased tree, WARP: the indirect tests pass, including the split one (14 of 14); cargo test -p victory-gpu --all-features --lib -- --test-threads=1 passes but depth_bounds_pipeline_loads_and_filters_draws, as on f85101b; clippy with and without --all-features reports only what f85101b already reports. Run in parallel on WARP, warp_budget_saturates_without_wraparound_and_preserves_draw_fields fails now and then on f85101b too (2 of 3 runs there, 1 of 3 here).

**@⁠SantannaCarlos** on GitHub · 2026-11-25 11:03 UTC · [original](https://github.com/fxceless/victory-fork/pull/834#issuecomment-7160519725) Rebased onto `f85101b`, which conflicted in `draw.rs` and changed the clamp under this branch: - The clamp now takes the scratch buffer's state, so `record_clamp_with` takes `(dst, before)` like `record_clamp_as`, and `bound_split` goes through `clamp_into`, so the list knows the scratch is readable afterwards. - The dispatch branch of the clamp no longer keeps what the record asked for, so the second part's count is read from the record (`src_args.Load(src_at)`), as the store already did. - `done_on` is gone from the tests; the split test drops it like the others. Checked on the rebased tree, WARP: the `indirect` tests pass, including the split one (14 of 14); `cargo test -p victory-gpu --all-features --lib -- --test-threads=1` passes but `depth_bounds_pipeline_loads_and_filters_draws`, as on `f85101b`; clippy with and without `--all-features` reports only what `f85101b` already reports. Run in parallel on WARP, `warp_budget_saturates_without_wraparound_and_preserves_draw_fields` fails now and then on `f85101b` too (2 of 3 runs there, 1 of 3 here).
Author
Owner

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

@⁠VibeClauding thanks, the same three came up in the rebase onto f85101b (which has #220): 0135c41 reads the record's own x, takes (dst, before) and goes through clamp_into, and drops done_on. The split test catches the first one, as you say.

**@⁠SantannaCarlos** on GitHub · 2026-11-25 11:14 UTC · [original](https://github.com/fxceless/victory-fork/pull/834#issuecomment-7160792637) @⁠VibeClauding thanks, the same three came up in the rebase onto `f85101b` (which has #220): `0135c41` reads the record's own x, takes `(dst, before)` and goes through `clamp_into`, and drops `done_on`. The split test catches the first one, as you say.
Author
Owner

@⁠NuraadGit on GitHub · 2026-11-25 11:22 UTC · original

A heads-up for when this is rebased over f85101b (we merged both into a lab stack on an RTX 2080 and hit it).

f85101b rewrites the clamp shader's dispatch branch (} else if (active && kind == 2) {) as uint3 g = min(src_args.Load3(src_at), ...) and adds an outer uint asked = 0; for the mesh diagnostics. Git merges this PR's branch into it without a conflict, but the branch's uint3 asked = src_args.Load3(src_at); is gone. So

uint rest = ((has_count & 4u) != 0 && g.x == 65535u) ? min(asked.x - 65535u, 65535u) : 0u;

now reads the outer scalar asked (0): 0 - 65535 wraps, and every dispatch record with exactly 65,535 groups in x gets a second record of 65,535 more groups. The PR's own warp_split_runs_every_group_of_a_wide_dispatch_once catches it: for [65535, 1, 1] the budget is 8,388,480 instead of 4,194,240. Reading the record again in that branch fixes it (uint3 want = src_args.Load3(src_at);, with want.x in rest).

Two more things that need adapting on rebase: f85101b passes (dst, state) to record_clamp_as and drops done_on, so record_clamp_with, bound_split and the split test need the same state handling (list.indirect_state(&dst) before, list.indirect_readable(&dst) after).

Separately, on f85101b itself: warp_budget_saturates_without_wraparound_and_preserves_draw_fields asks 2^24 indices for its first draw, which is now >= MOST_DRAW (2^23), so that draw runs empty and the test's "the first two real draws fit the budget" assertion fails.

**@⁠NuraadGit** on GitHub · 2026-11-25 11:22 UTC · [original](https://github.com/fxceless/victory-fork/pull/834#issuecomment-7160967508) A heads-up for when this is rebased over f85101b (we merged both into a lab stack on an RTX 2080 and hit it). f85101b rewrites the clamp shader's dispatch branch (`} else if (active && kind == 2) {`) as `uint3 g = min(src_args.Load3(src_at), ...)` and adds an outer `uint asked = 0;` for the mesh diagnostics. Git merges this PR's branch into it without a conflict, but the branch's `uint3 asked = src_args.Load3(src_at);` is gone. So ```hlsl uint rest = ((has_count & 4u) != 0 && g.x == 65535u) ? min(asked.x - 65535u, 65535u) : 0u; ``` now reads the outer scalar `asked` (0): `0 - 65535` wraps, and every dispatch record with exactly 65,535 groups in x gets a second record of 65,535 more groups. The PR's own `warp_split_runs_every_group_of_a_wide_dispatch_once` catches it: for `[65535, 1, 1]` the budget is 8,388,480 instead of 4,194,240. Reading the record again in that branch fixes it (`uint3 want = src_args.Load3(src_at);`, with `want.x` in `rest`). Two more things that need adapting on rebase: f85101b passes `(dst, state)` to `record_clamp_as` and drops `done_on`, so `record_clamp_with`, `bound_split` and the split test need the same state handling (`list.indirect_state(&dst)` before, `list.indirect_readable(&dst)` after). Separately, on f85101b itself: `warp_budget_saturates_without_wraparound_and_preserves_draw_fields` asks 2^24 indices for its first draw, which is now >= `MOST_DRAW` (2^23), so that draw runs empty and the test's "the first two real draws fit the budget" assertion fails.
Author
Owner

@⁠iGoldenNinja on GitHub · 2026-11-25 10:22 UTC · original · edited 2026-11-25 12:13 UTC

Independent RTX 5080 16 GB check, driver 617.14, Windows 11 Pro 25H2 (26200.9974). I applied 4b44212d6ba571092793f44e77dc8cf60297f427 to PR 823 aaf658a. The strict split fixture passed on both RTX 5080 and WARP, including the 89,968-group readback, the 131,070 cap, y/z coverage and the dispatch budget rejection. The translated group-ID fixture also validated and returned the expected groups with bases 0 and 65,535 on the 5080.

On the identical executable and cache seed, both settings reached controllable prison and bound 2dc364df5d3278b8 plus all four PR 823 compute programs. In the sampled, visually matched courtyard frames the lower-right mosaic was absent in both settings. The matched room frames after retreat were similarly dark (mean encoded luma 20.78 off, 20.60 on). One 90-second replay per setting measured 3.04 FPS / 599.79 ms P99 off and 2.93 FPS / 611.48 ms P99 on. The off run spent longer in the preceding transition. Local title telemetry verified pipeline binds, with submitted group dimensions still unmeasured. Pinned report

Follow-up on the rebase 0135c41. I added a fence-completed GPU readback of the requested and clamped records for 2dc364df5d3278b8. On the RTX 5080 (617.14, Windows 11 Pro 25H2 build 26200.9974), all 46 split-off samples asked for more than 65,535 groups in X and were clipped. The largest omission was 31,313 groups. Splitting covered all 48 sampled requests in full, with Y and Z equal to one throughout. Both replays reached controllable prison.

In a third launch I toggled only this shader's split while holding the camera at the prison window. The client dimensions stayed at 1735 × 911. In the initial off phase the first record carried 65,535 of 74,400–74,808 requested groups and the bottom band was visible. With splitting enabled, the second record carried the remaining 10,185–10,393 groups and most of the band cleared. Disabling again clipped the records immediately, and the band stayed mostly clear in the sampled view. That persistence is consistent with previously written tiles retaining their updated values. Stepped character edges remained. Diagnostic code and pinned report

**@⁠iGoldenNinja** on GitHub · 2026-11-25 10:22 UTC · [original](https://github.com/fxceless/victory-fork/pull/834#issuecomment-7159604239) · edited 2026-11-25 12:13 UTC Independent RTX 5080 16 GB check, driver 617.14, Windows 11 Pro 25H2 (26200.9974). I applied `4b44212d6ba571092793f44e77dc8cf60297f427` to PR 823 `aaf658a`. The strict split fixture passed on both RTX 5080 and WARP, including the 89,968-group readback, the 131,070 cap, y/z coverage and the dispatch budget rejection. The translated group-ID fixture also validated and returned the expected groups with bases 0 and 65,535 on the 5080. On the identical executable and cache seed, both settings reached controllable prison and bound `2dc364df5d3278b8` plus all four PR 823 compute programs. In the sampled, visually matched courtyard frames the lower-right mosaic was absent in both settings. The matched room frames after retreat were similarly dark (mean encoded luma 20.78 off, 20.60 on). One 90-second replay per setting measured **3.04 FPS / 599.79 ms P99 off** and **2.93 FPS / 611.48 ms P99 on**. The off run spent longer in the preceding transition. Local title telemetry verified pipeline binds, with submitted group dimensions still unmeasured. [Pinned report](https://github.com/iGoldenNinja/victory-fork/blob/643982139f76a5b828ef1a2c5a8d2f7af86d6bbc/docs/nvidia-pr834-5080.md) **Follow-up on the rebase `0135c41`.** I added a fence-completed GPU readback of the requested and clamped records for `2dc364df5d3278b8`. On the RTX 5080 (617.14, Windows 11 Pro 25H2 build 26200.9974), all 46 split-off samples asked for more than 65,535 groups in X and were clipped. The largest omission was 31,313 groups. Splitting covered all 48 sampled requests in full, with Y and Z equal to one throughout. Both replays reached controllable prison. In a third launch I toggled only this shader's split while holding the camera at the prison window. The client dimensions stayed at 1735 × 911. In the initial off phase the first record carried 65,535 of 74,400–74,808 requested groups and the bottom band was visible. With splitting enabled, the second record carried the remaining 10,185–10,393 groups and most of the band cleared. Disabling again clipped the records immediately, and the band stayed mostly clear in the sampled view. That persistence is consistent with previously written tiles retaining their updated values. Stepped character edges remained. [Diagnostic code and pinned report](https://github.com/iGoldenNinja/victory-fork/blob/0ad7ea4550ee778c5e8de44fbcc64325c29672f4/docs/nvidia-pr834-live-dispatch-5080.md)
Author
Owner

@⁠SantannaCarlos on GitHub · 2026-11-25 12:14 UTC · original

For whoever weighs this: myokex already split dispatches the same way in myokex/victory-amd on the 24th ("Shaders: compute programs add the number of the first group" and "GPU: ... dispatches in parts", 892d259 and 4436f8f there), and it was carried into ZSlayerHQ/victory-world-runtime and vitutu1/victory-perf. I found it only after opening this; it never came here as a pull request, and main took myokex's view guard but not this part.

Same idea and even the same names (USER_GROUP_BASE at 0x104, bound_split), from the conventions next to them. Differences, from reading the diffs:

  • That one also splits direct dispatches over 65,535 in x; this one only indirect records.
  • Its indirect split takes records with y and z of 1, single records only (no count buffer); this one keeps y and z as asked and works with a count buffer.
  • This one has the WARP split test, the translator test and the in-game A/B above.

Take whichever fits better, or the direct-dispatch part of that one on top of this. If you prefer that one, I'll close this; the measurements here apply to both.

**@⁠SantannaCarlos** on GitHub · 2026-11-25 12:14 UTC · [original](https://github.com/fxceless/victory-fork/pull/834#issuecomment-7162114774) For whoever weighs this: myokex already split dispatches the same way in myokex/victory-amd on the 24th ("Shaders: compute programs add the number of the first group" and "GPU: ... dispatches in parts", 892d259 and 4436f8f there), and it was carried into ZSlayerHQ/victory-world-runtime and vitutu1/victory-perf. I found it only after opening this; it never came here as a pull request, and main took myokex's view guard but not this part. Same idea and even the same names (`USER_GROUP_BASE` at 0x104, `bound_split`), from the conventions next to them. Differences, from reading the diffs: - That one also splits direct dispatches over 65,535 in x; this one only indirect records. - Its indirect split takes records with y and z of 1, single records only (no count buffer); this one keeps y and z as asked and works with a count buffer. - This one has the WARP split test, the translator test and the in-game A/B above. Take whichever fits better, or the direct-dispatch part of that one on top of this. If you prefer that one, I'll close this; the measurements here apply to both.
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-25 12:23 UTC · original · edited 2026-11-25 12:51 UTC

Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head 0135c41 into main f85101b in a throwaway tree (no conflict). cargo clippy --workspace --all-targets --locked -- -D warnings fails with the errors main itself has on this machine (placed_filler_twins, depth_written, a sort, and manual implementation of .is_multiple_of() at victory-gpu/src/shadow.rs:2675; PR #841 fixes the first three), also with --all-features; this PR adds none. (Correction: my first version of this report said that the is_multiple_of one was extra here. It is in main too: my first baseline run of main did not list it, and a run with --keep-going on a clean main does.) cargo test --workspace --locked: run 1: stopped at indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields (the one that fails on main itself most runs here (PR #849 and #847 fix its assertion)); run 2: 567 passed, 0 failed, 12 ignored (main alone: 555 passed, 0 failed, 11 ignored). The title was not run, so this says nothing about in-game effect. No game data.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-25 12:23 UTC · [original](https://github.com/fxceless/victory-fork/pull/834#issuecomment-7162313086) · edited 2026-11-25 12:51 UTC Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head `0135c41` into `main` `f85101b` in a throwaway tree (no conflict). `cargo clippy --workspace --all-targets --locked -- -D warnings` fails with the errors `main` itself has on this machine (`placed_filler_twins`, `depth_written`, a sort, and `manual implementation of .is_multiple_of()` at `victory-gpu/src/shadow.rs:2675`; PR #841 fixes the first three), also with `--all-features`; this PR adds none. (Correction: my first version of this report said that the `is_multiple_of` one was extra here. It is in `main` too: my first baseline run of `main` did not list it, and a run with `--keep-going` on a clean `main` does.) `cargo test --workspace --locked`: run 1: stopped at `indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields` (the one that fails on `main` itself most runs here (PR #849 and #847 fix its assertion)); run 2: 567 passed, 0 failed, 12 ignored (`main` alone: 555 passed, 0 failed, 11 ignored). The title was not run, so this says nothing about in-game effect. No game data. AI-assisted (Claude Code); no game data.
Author
Owner

@⁠SantannaCarlos on GitHub · 2026-11-25 14:41 UTC · original

Follow-up on "Not covered" (requests past 131,070 groups in x). Setup: RTX 4070, 10-minute runs, this branch plus the cut counter.

  • With the learned pipeline list kept (pipelines/early-pipelines.txt), shader translations cold and the pipeline library deleted, as after an update: no request passes 131,070 groups on either save. The largest were 111,120 on the cell save and 112,136 on the other one, and only the lighting pass is cut, as before.
  • The large requests (up to 16,345,224 groups, from seven programs, all one record, y = z = 1) showed only once: with the pipelines folder empty, on one save, in the first ~2.5 minutes in the world, while 1,100 to 2,200 draws a frame waited for their pipelines. They stopped once the pipelines were made.
  • In the update case on the cell save, VICTORY_DISPATCH_SPLIT=0 made no difference to the warm-up: 6 frames over 1 s in the first minute against 8 with the split, worst 2.3 s against 2.2 s.
**@⁠SantannaCarlos** on GitHub · 2026-11-25 14:41 UTC · [original](https://github.com/fxceless/victory-fork/pull/834#issuecomment-7165670691) Follow-up on "Not covered" (requests past 131,070 groups in x). Setup: RTX 4070, 10-minute runs, this branch plus the cut counter. - With the learned pipeline list kept (`pipelines/early-pipelines.txt`), shader translations cold and the pipeline library deleted, as after an update: no request passes 131,070 groups on either save. The largest were 111,120 on the cell save and 112,136 on the other one, and only the lighting pass is cut, as before. - The large requests (up to 16,345,224 groups, from seven programs, all one record, y = z = 1) showed only once: with the `pipelines` folder empty, on one save, in the first ~2.5 minutes in the world, while 1,100 to 2,200 draws a frame waited for their pipelines. They stopped once the pipelines were made. - In the update case on the cell save, `VICTORY_DISPATCH_SPLIT=0` made no difference to the warm-up: 6 frames over 1 s in the first minute against 8 with the split, worst 2.3 s against 2.2 s.
Author
Owner

@⁠xunbreakablex on GitHub · 2026-11-25 15:20 UTC · original

Second RTX 4070 data point for the cut (AI-assisted, Claude; run on my machine): RTX 4070 (undervolted, 100 W limit), Ryzen 5 5600 at 3.95 GHz (6 cores), Windows 11, driver 621.01, Series X profile. This branch (edf762e on a253706) plus a diagnostics-only frame-log counter of records over 65,535 groups in x.

  • 2dc364df5d3278b8 is over the limit here too, in 278 frame-log lines of one run: 1-2 records per frame asking for 99,920-105,672 groups in x (e.g. frame 2220: "2 of 3 records over, the most asked 99920"; 2223: 105,672), all of them run with the split. With VICTORY_SPLIT=0-style cutting (my second arm) the counter shows 92,152 and 90,872 requested and 65,535 run, i.e. about a third of the groups of that pass skipped every frame on default main.
  • One observation, not a result: in the run with the split on, I did not see the black stair-stepped blocks on the character's shoulder at the cell window that I see in most default runs; in a later run without the split they were back. That run was on a cold translation cache and the blocks also come and go between runs, so I am repeating it with a warm cache before saying more.
**@⁠xunbreakablex** on GitHub · 2026-11-25 15:20 UTC · [original](https://github.com/fxceless/victory-fork/pull/834#issuecomment-7166678644) Second RTX 4070 data point for the cut (AI-assisted, Claude; run on my machine): RTX 4070 (undervolted, 100 W limit), Ryzen 5 5600 at 3.95 GHz (6 cores), Windows 11, driver 621.01, Series X profile. This branch (`edf762e` on `a253706`) plus a diagnostics-only frame-log counter of records over 65,535 groups in x. - `2dc364df5d3278b8` is over the limit here too, in 278 frame-log lines of one run: 1-2 records per frame asking for 99,920-105,672 groups in x (e.g. frame 2220: "2 of 3 records over, the most asked 99920"; 2223: 105,672), all of them run with the split. With `VICTORY_SPLIT=0`-style cutting (my second arm) the counter shows 92,152 and 90,872 requested and 65,535 run, i.e. about a third of the groups of that pass skipped every frame on default `main`. - One observation, not a result: in the run with the split on, I did not see the black stair-stepped blocks on the character's shoulder at the cell window that I see in most default runs; in a later run without the split they were back. That run was on a cold translation cache and the blocks also come and go between runs, so I am repeating it with a warm cache before saying more.
Author
Owner

@⁠SpaghettiMaster545 on GitHub · 2026-11-25 15:37 UTC · original

More data on the same pass, from our tree (RTX 5070 Ti, NVIDIA 621.40, Windows 11). indirect_diffuse_lighting:CS_FinalGather_0 asks for 73,000 to 77,500 groups in x (y = z = 1) in the opening cutscene, about once a frame. Its last tiles are the blocky tiles along the bottom edge of the picture. We split such records into pieces of at most 65,535 groups, each with its own group base, and the tiles are gone. So whatever runs the groups past 65,535 fixes it; I am not opening a second PR for this.

One trap we hit, in case a later version reads the count on the CPU: when the list is recorded, the record's title memory can still hold a value the title has not written yet. We read 4,294,903,655 once. We treat a count over 2^20 as not a count, and clamp it as before.

**@⁠SpaghettiMaster545** on GitHub · 2026-11-25 15:37 UTC · [original](https://github.com/fxceless/victory-fork/pull/834#issuecomment-7167131385) More data on the same pass, from our tree (RTX 5070 Ti, NVIDIA 621.40, Windows 11). `indirect_diffuse_lighting:CS_FinalGather_0` asks for 73,000 to 77,500 groups in x (y = z = 1) in the opening cutscene, about once a frame. Its last tiles are the blocky tiles along the bottom edge of the picture. We split such records into pieces of at most 65,535 groups, each with its own group base, and the tiles are gone. So whatever runs the groups past 65,535 fixes it; I am not opening a second PR for this. One trap we hit, in case a later version reads the count on the CPU: when the list is recorded, the record's title memory can still hold a value the title has not written yet. We read 4,294,903,655 once. We treat a count over 2^20 as not a count, and clamp it as before.
Author
Owner

@⁠FrancescoGelosoEterea on GitHub · 2026-11-25 16:12 UTC · original

Tested in game on an RTX 5070 Ti (16 GB, driver 621.24, Windows 11): this fixes the blocky "old picture" artifacts we had in the world.

Before: from a save past the prologue (a balcony over a garden and the sea), screen-aligned blocks on walls, the wooden floor, a glass railing and the sea showed pieces of an earlier view, for example trees and parked cars from where the camera had looked before. The blocks stayed put while the camera moved. A target dump of one such frame showed them already in the lit scene, before TAA.

Ruled out first, each in its own run with the artifacts unchanged:

  • VICTORY_QUEUE2 off
  • VICTORY_TEXTURE_GUARD=0
  • VICTORY_LEVELS_ON_DEMAND off
  • VICTORY_WAVE_PAIRS=0 (#854's paired form)
  • VICTORY_INDIRECT_WINDOW off

With this PR merged onto main a253706 (+ #854 and two local patches; the merge was clean), the artifacts are gone in the same scene:

  • 4.1–4.3 fps, about 6,600 draws a frame;
  • no device loss and no new warning in the log.

One thing worth knowing: the change to the translation invalidates the shader cache, so the first launch rebuilt about 2,600 pipelines. That was roughly 10 minutes of a mostly black picture, with missing colours and meshes. On the next launch, with the cache warm, everything was normal.

**@⁠FrancescoGelosoEterea** on GitHub · 2026-11-25 16:12 UTC · [original](https://github.com/fxceless/victory-fork/pull/834#issuecomment-7167687907) Tested in game on an RTX 5070 Ti (16 GB, driver 621.24, Windows 11): this fixes the blocky "old picture" artifacts we had in the world. **Before:** from a save past the prologue (a balcony over a garden and the sea), screen-aligned blocks on walls, the wooden floor, a glass railing and the sea showed pieces of an earlier view, for example trees and parked cars from where the camera had looked before. The blocks stayed put while the camera moved. A target dump of one such frame showed them already in the lit scene, before TAA. **Ruled out first**, each in its own run with the artifacts unchanged: - `VICTORY_QUEUE2` off - `VICTORY_TEXTURE_GUARD=0` - `VICTORY_LEVELS_ON_DEMAND` off - `VICTORY_WAVE_PAIRS=0` (#854's paired form) - `VICTORY_INDIRECT_WINDOW` off **With this PR** merged onto main a253706 (+ #854 and two local patches; the merge was clean), the artifacts are gone in the same scene: - 4.1–4.3 fps, about 6,600 draws a frame; - no device loss and no new warning in the log. One thing worth knowing: the change to the translation invalidates the shader cache, so the first launch rebuilt about 2,600 pipelines. That was roughly 10 minutes of a mostly black picture, with missing colours and meshes. On the next launch, with the cache warm, everything was normal.
Author
Owner

@⁠SantannaCarlos on GitHub · 2026-11-25 16:55 UTC · original

Rebased onto 465b94f. That commit takes bit 2 of the clamp's flags word for gathered records ((has_count & 4u)), the bit this branch used for the split, so the split moves to bit 3 (8u); without that, every split dispatch would have been read as gathered. The description says bit 3 now. The draw.rs conflict was only the new gather path next to the split's lines; dispatches are never gathered.

Checked on the rebased tree (WARP): all 16 indirect tests pass, including 465b94f's gather tests and the split one; cargo test -p victory-gpu --all-features --lib -- --test-threads=1 passes but depth_bounds_pipeline_loads_and_filters_draws; victory-shader 216 passed; the diagnostics build compiles; clippy reports only what 465b94f itself reports.

**@⁠SantannaCarlos** on GitHub · 2026-11-25 16:55 UTC · [original](https://github.com/fxceless/victory-fork/pull/834#issuecomment-7168739776) Rebased onto `465b94f`. That commit takes bit 2 of the clamp's flags word for gathered records (`(has_count & 4u)`), the bit this branch used for the split, so the split moves to bit 3 (`8u`); without that, every split dispatch would have been read as gathered. The description says bit 3 now. The `draw.rs` conflict was only the new gather path next to the split's lines; dispatches are never gathered. Checked on the rebased tree (WARP): all 16 `indirect` tests pass, including `465b94f`'s gather tests and the split one; `cargo test -p victory-gpu --all-features --lib -- --test-threads=1` passes but `depth_bounds_pipeline_loads_and_filters_draws`; `victory-shader` 216 passed; the diagnostics build compiles; clippy reports only what `465b94f` itself reports.
Author
Owner

@⁠tippythetaidum on GitHub · 2026-11-25 17:09 UTC · original

Tested in the title on an RTX 5080 16 GB (driver 621.14, Windows 11, Series X profile): the blocks along the bottom edge of the prison shots are gone.

Build: diagnostics build of main 3973179 + #24 + #927 + #823 + #606 + #956 + #1002 + #907, with this PR's earlier head 0135c41 on top. That's the commit before today's rebase; I haven't run b9ab1ee. It merged without conflict. The one change needed was a field in this PR's own test (half_views, from #927's HostShader). With it, the_group_id_in_x_starts_at_the_host_base and warp_split_runs_every_group_of_a_wide_dispatch_once pass on the card.

The records: a local log of the dispatch records as the title wrote them showed 2dc364df5d3278b8 asking for 75,128 to 98,512 groups in x in our frames, the same range as above.

Picture, the same shots in runs of the same tree without and with the PR, warm caches:

  • The cell window shot (world frame +192): blocks of old picture along the bottom left and bottom right before, a clean edge with the PR.
  • The cell door (+672): blocks in the bottom right corner before, none with the PR.

Stability: no errors and no device loss in two 10-minute runs. The refused compute pipelines are the three that #823 leaves.

AI-assisted (Claude Code, Claude Opus 5.5). Counts and descriptions only, nothing from the game attached.

**@⁠tippythetaidum** on GitHub · 2026-11-25 17:09 UTC · [original](https://github.com/fxceless/victory-fork/pull/834#issuecomment-7169101480) Tested in the title on an RTX 5080 16 GB (driver 621.14, Windows 11, Series X profile): the blocks along the bottom edge of the prison shots are gone. **Build:** diagnostics build of `main` `3973179` + #24 + #927 + #823 + #606 + #956 + #1002 + #907, with this PR's earlier head `0135c41` on top. That's the commit before today's rebase; I haven't run `b9ab1ee`. It merged without conflict. The one change needed was a field in this PR's own test (`half_views`, from #927's `HostShader`). With it, `the_group_id_in_x_starts_at_the_host_base` and `warp_split_runs_every_group_of_a_wide_dispatch_once` pass on the card. **The records:** a local log of the dispatch records as the title wrote them showed `2dc364df5d3278b8` asking for 75,128 to 98,512 groups in x in our frames, the same range as above. **Picture,** the same shots in runs of the same tree without and with the PR, warm caches: - The cell window shot (world frame +192): blocks of old picture along the bottom left and bottom right before, a clean edge with the PR. - The cell door (+672): blocks in the bottom right corner before, none with the PR. **Stability:** no errors and no device loss in two 10-minute runs. The refused compute pipelines are the three that #823 leaves. AI-assisted (Claude Code, Claude Opus 5.5). Counts and descriptions only, nothing from the game attached.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/draw.rs
  • crates/victory-gpu/src/indirect.rs
  • crates/victory-shader/src/emit/mod.rs
  • crates/victory-shader/src/emit/shader.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/834/head:github-bot/gh-834'
git switch 'github-bot/gh-834'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-834'
git switch 'github-bot/gh-834'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-834'
git switch 'github-bot/gh-834'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-834'
git switch 'main'
git merge --squash 'github-bot/gh-834'
git switch 'main'
git merge --ff-only 'github-bot/gh-834'
git switch 'main'
git merge 'github-bot/gh-834'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.