GPU, Shaders: spread compute dispatches past 65,535 groups in x across z (fixes #2256) #2310

Open
Xvania7 wants to merge 3 commits from upstream-pr/2312 into main
Xvania7 commented 2026-11-25 10:22:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Xvania7 on 2026-11-25T10:22:51Z.


Summary

Fixes #2256 (indirect clamp and direct Dispatch cutting compute dispatches with more than 65,535 groups in x).

  1. Shader side (victory-shader):
    • Adds DISPATCH_SLOT user-data constants (
      ow, sked_x) and a compute prologue (cs_spread_prologue) emitted after self.inputs() (so entry-block inputs dominate the body block).
    • When
      ow != 0, remaps GroupId(0) to x + z * row, GroupId(2) to , and returns early before the shader body if eff_x >= asked_x (covering side-effect-only shaders that do not read TGID).
  2. GPU side (victory-gpu):
    • Direct Dispatch: spreads x > 65,535 && z == 1 into ceil(x / rows) x y x rows (
      ows = ceil(x / 65,535)) and passes [row, asked_x] via DISPATCH_SLOT user data.
    • Indirect ExecuteIndirect(DISPATCH): indirect::bound_spread writes 20-byte [row, asked_x, gx, gy, gz] records into a list-kept UAV buffer (zeroing g_out when over budget), and draw::execute_indirect runs them through a cached root-constant + dispatch command signature (host_spread_signature).

Tests

  • Added indirect::tests::spread_records_split_large_x_and_keep_small_unspread (verified on RTX 5060: 115,200 x 1 x 1 -> [57600, 115200, 57600, 1, 2], 65,537 x 1 x 1 -> [32769, 65537, 32769, 1, 2], 100 x 2 x 1 -> [0, 100, 100, 2, 1]).
  • cargo test -p victory-shader --lib emit::lower::tests:: — 21 passed, 0 failed
  • cargo test -p victory-gpu --lib -- --test-threads=1 indirect::tests:: — 6 passed, 0 failed
  • cargo test -p victory-gpu --lib -- --test-threads=1 list::tests:: — 4 passed, 0 failed
  • cargo clippy -p victory-gpu -p victory-shader --all-targets -- -D warnings — 0 warnings
  • cargo xtask policy — 182 files ok
<!-- greyfinch-sync:Marvisak/VIctory:issue:5489453978 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312). Originally posted by [Xvania7](https://github.com/Xvania7) on 2026-11-25T10:22:51Z. --- ## Summary Fixes #2256 (indirect clamp and direct Dispatch cutting compute dispatches with more than 65,535 groups in x). 1. **Shader side (`victory-shader`):** - Adds `DISPATCH_SLOT` user-data constants ( ow, sked_x) and a compute prologue (cs_spread_prologue) emitted after self.inputs() (so entry-block inputs dominate the body block). - When ow != 0, remaps GroupId(0) to x + z * row, GroupId(2) to , and returns early before the shader body if eff_x >= asked_x (covering side-effect-only shaders that do not read TGID). 2. **GPU side (`victory-gpu`):** - **Direct `Dispatch`:** spreads x > 65,535 && z == 1 into ceil(x / rows) x y x rows ( ows = ceil(x / 65,535)) and passes [row, asked_x] via DISPATCH_SLOT user data. - **Indirect `ExecuteIndirect(DISPATCH)`:** `indirect::bound_spread` writes 20-byte [row, asked_x, gx, gy, gz] records into a list-kept UAV buffer (zeroing g_out when over budget), and `draw::execute_indirect` runs them through a cached root-constant + dispatch command signature (host_spread_signature). ## Tests - Added `indirect::tests::spread_records_split_large_x_and_keep_small_unspread` (verified on RTX 5060: 115,200 x 1 x 1 -> [57600, 115200, 57600, 1, 2], 65,537 x 1 x 1 -> [32769, 65537, 32769, 1, 2], 100 x 2 x 1 -> [0, 100, 100, 2, 1]). - `cargo test -p victory-shader --lib emit::lower::tests::` — 21 passed, 0 failed - `cargo test -p victory-gpu --lib -- --test-threads=1 indirect::tests::` — 6 passed, 0 failed - `cargo test -p victory-gpu --lib -- --test-threads=1 list::tests::` — 4 passed, 0 failed - `cargo clippy -p victory-gpu -p victory-shader --all-targets -- -D warnings` — 0 warnings - `cargo xtask policy` — 182 files ok
catminou4 commented 2026-11-25 10:53:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T10:53:56Z.

Review: APPROVED


Tested locally: merged into main 940d32f69b, cargo test -p victory-shader --locked on macOS arm64 — 144 passed, 0 failed, 2 ignored (Windows-gated hardware execution tests not run here). Approving the shader side — compute dispatches spread past 65,535 groups. victory-gpu side is Windows-only; static review only there.

<!-- greyfinch-sync:Marvisak/VIctory:review:6056241116 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#pullrequestreview-6056241116). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T10:53:56Z. **Review:** APPROVED --- Tested locally: merged into main 940d32f69b, `cargo test -p victory-shader --locked` on macOS arm64 — 144 passed, 0 failed, 2 ignored (Windows-gated hardware execution tests not run here). Approving the shader side — compute dispatches spread past 65,535 groups. victory-gpu side is Windows-only; static review only there.
DesertGamer commented 2026-11-25 11:05:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DesertGamer on 2026-11-25T10:25:53Z.


Not a request to change how this issue works, just a note for people who want a running build to try pull requests together, and for authors whose PRs may already be in it.

VIctory V2 is an integration fork: it merges community pull requests, keeps each author in the history, and runs cargo test --workspace plus one run of the title before each push. On our machine it reaches the first cutscene. It is not playable yet and it is not the official project or endorsed by its author. Three tests are red, listed in the issues there.

What would help us:

  • a test report from your GPU: one comment per machine in hardware reports (there is a form);
  • three small tasks labelled help wanted (one, two, three), two of them look like stale tests.

If you want your PR exercised together with others in a running build, tell us its number.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7159685234 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7159685234). Originally posted by [DesertGamer](https://github.com/DesertGamer) on 2026-11-25T10:25:53Z. --- Not a request to change how this issue works, just a note for people who want a running build to try pull requests together, and for authors whose PRs may already be in it. [VIctory V2](https://github.com/DesertGamer/VIctory-V2) is an integration fork: it merges community pull requests, keeps each author in the history, and runs `cargo test --workspace` plus one run of the title before each push. On our machine it reaches the first cutscene. It is not playable yet and it is not the official project or endorsed by its author. Three tests are red, listed in the issues there. What would help us: - a test report from your GPU: one comment per machine in [hardware reports](https://github.com/DesertGamer/VIctory-V2/issues/4) (there is a form); - three small tasks labelled `help wanted` ([one](https://github.com/DesertGamer/VIctory-V2/issues/16), [two](https://github.com/DesertGamer/VIctory-V2/issues/17), [three](https://github.com/DesertGamer/VIctory-V2/issues/18)), two of them look like stale tests. If you want your PR exercised together with others in a running build, tell us its number.
upipibi commented 2026-11-25 15:02:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T15:02:30Z.


For comparison, a parallel design: xcl-dev/xcl#1428 folds x > 65,535 into Y (when y == 1) for direct dispatches and ExecuteIndirect, and clamps every other shape. It adds GPU tests that each console group runs once and none past its count, on the HLSL path, the direct translator in wave32, wave64 and split wave64, and the per-lane form. This PR's Z spread covers x > 65,535 with y > 1, which #1428 clamps. Neither covers x > 65,535 with z > 1 here or y > 1 there. shadps4-emu/shadPS4#5479 reshapes indirect dispatches on the GPU up to UINT32_MAX and keeps the direct and indirect variants apart in its pipeline cache key. That might be a case worth testing here too: the same pipeline used directly and then indirectly. Read from the PR texts only.

Added 2026-11-28, for the choice between this PR and #3086 (read from the reports, not run): every in-game measurement of the pass so far is an ExecuteIndirect dispatch with y = z = 1. neonbyte1 (below) saw CS_FinalGather ask for 74,192 to 83,008 groups in x through ExecuteIndirect, and zed6000 (below) saw one indirect dispatch a frame ask for about 74,000 to 103,000. #3086 changes only direct dispatches and leaves indirect ones at 65,535, so on its own it would not fix the measured blocky tiles. The shape it adds over this PR, x > 65,535 with z > 1, has not been seen in a title (#3086's own note). The same split shows up in trustno1-coder/VIctory-NVIDIA#662, a port of #3086, which says that indirect dispatches there stay capped.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7166210075 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7166210075). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T15:02:30Z. --- For comparison, a parallel design: xcl-dev/xcl#1428 folds x > 65,535 into **Y** (when y == 1) for direct dispatches and `ExecuteIndirect`, and clamps every other shape. It adds GPU tests that each console group runs once and none past its count, on the HLSL path, the direct translator in wave32, wave64 and split wave64, and the per-lane form. This PR's Z spread covers x > 65,535 with y > 1, which #1428 clamps. Neither covers x > 65,535 with z > 1 here or y > 1 there. shadps4-emu/shadPS4#5479 reshapes indirect dispatches on the GPU up to UINT32_MAX and keeps the direct and indirect variants apart in its pipeline cache key. That might be a case worth testing here too: the same pipeline used directly and then indirectly. Read from the PR texts only. **Added 2026-11-28, for the choice between this PR and #3086** (read from the reports, not run): every in-game measurement of the pass so far is an `ExecuteIndirect` dispatch with y = z = 1. neonbyte1 (below) saw `CS_FinalGather` ask for 74,192 to 83,008 groups in x through `ExecuteIndirect`, and zed6000 (below) saw one indirect dispatch a frame ask for about 74,000 to 103,000. #3086 changes only direct dispatches and leaves indirect ones at 65,535, so on its own it would not fix the measured blocky tiles. The shape it adds over this PR, x > 65,535 with z > 1, has not been seen in a title (#3086's own note). The same split shows up in trustno1-coder/VIctory-NVIDIA#662, a port of #3086, which says that indirect dispatches there stay capped. AI-assisted (Claude Code).
r4tedx commented 2026-11-25 15:04:24 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-25T14:44:50Z.


We were about to add a limit check for direct dispatches and found this PR already covers the main case (x > 65,535 with z == 1). Two notes, from reading the code only; I didn't run anything.

  1. The host spreads even where the shader has no remap. In draw.rs, spread_groups runs for every direct dispatch, whatever the program. But the translator emits cs_spread_prologue only when the entry block isn't a loop header (!self.counters.contains_key(&order[0]) in lower.rs). For a compute program whose first block is a loop header, x > 65,535 is dispatched as (row, y, rows) with no remap:

    • groups row..x never run;
    • groups 0..row run rows times, with z ≠ 0.

    That's wrong output rather than the old cut-off. Two ways to avoid it: spread only when the bound program declares DISPATCH_SLOT in its user data, or emit the prologue for loop-headed entries too, e.g. in a block placed before the loop.

  2. Some oversized dispatches still reach Dispatch unchanged: y > 65,535, z > 65,535, and x > 65,535 when z > 1. A once-only warning, or a clamp with a count, would make those cases visible and defined.

The title was not used in these tests.

AI-assisted

<!-- greyfinch-sync:Marvisak/VIctory:comment:7165750658 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7165750658). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-25T14:44:50Z. --- We were about to add a limit check for direct dispatches and found this PR already covers the main case (x > 65,535 with z == 1). Two notes, from reading the code only; I didn't run anything. 1. **The host spreads even where the shader has no remap.** In `draw.rs`, `spread_groups` runs for every direct dispatch, whatever the program. But the translator emits `cs_spread_prologue` only when the entry block isn't a loop header (`!self.counters.contains_key(&order[0])` in `lower.rs`). For a compute program whose first block is a loop header, x > 65,535 is dispatched as `(row, y, rows)` with no remap: - groups `row..x` never run; - groups `0..row` run `rows` times, with z ≠ 0. That's wrong output rather than the old cut-off. Two ways to avoid it: spread only when the bound program declares `DISPATCH_SLOT` in its user data, or emit the prologue for loop-headed entries too, e.g. in a block placed before the loop. 2. **Some oversized dispatches still reach `Dispatch` unchanged:** y > 65,535, z > 65,535, and x > 65,535 when z > 1. A once-only warning, or a clamp with a count, would make those cases visible and defined. The title was not used in these tests. AI-assisted
Xvania7 commented 2026-11-25 15:04:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Xvania7 on 2026-11-25T14:53:06Z.


@r4tedx Great catches on both points. Addressed in a3e7d3a:

  1. Host-side check for DISPATCH_SLOT before spreading:
    In draw.rs direct dispatch, we now verify that the bound compute pipeline's translated user data declares victory_shader::emit::DISPATCH_SLOT (mirroring the check already present in the indirect dispatch path). If the shader doesn't declare the remapping constant slot (such as when cs_spread_prologue was not emitted), the host leaves (x, y, z) untouched and does not remap groups.

  2. Oversized dispatch diagnostics:
    Added a once! diagnostic warning when dispatch dimensions exceed D3D12's 65,535 group limit (gx > 65_535 || gy > 65_535 || gz > 65_535), logging the dimensions and whether spreading was applied (spread: bool), making unsupported dimensions immediately visible.

CI check and xtask policy are clean.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7165966090 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7165966090). Originally posted by [Xvania7](https://github.com/Xvania7) on 2026-11-25T14:53:06Z. --- @r4tedx Great catches on both points. Addressed in `a3e7d3a`: 1. **Host-side check for `DISPATCH_SLOT` before spreading:** In `draw.rs` direct dispatch, we now verify that the bound compute pipeline's translated user data declares `victory_shader::emit::DISPATCH_SLOT` (mirroring the check already present in the indirect dispatch path). If the shader doesn't declare the remapping constant slot (such as when `cs_spread_prologue` was not emitted), the host leaves `(x, y, z)` untouched and does not remap groups. 2. **Oversized dispatch diagnostics:** Added a `once!` diagnostic warning when dispatch dimensions exceed D3D12's 65,535 group limit (`gx > 65_535 || gy > 65_535 || gz > 65_535`), logging the dimensions and whether spreading was applied (`spread: bool`), making unsupported dimensions immediately visible. CI check and xtask policy are clean.
r4tedx commented 2026-11-25 15:04:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-25T14:55:47Z.


Thanks, re-read a3e7d3a. Both points are covered:

  • The direct path now spreads only when the bound program's translated user data declares DISPATCH_SLOT; otherwise (x, y, z) stays as asked. The indirect path's check also requires u.dword == 0. It behaves the same in practice, since both of the remap's dwords are always declared together.
  • Group counts still over 65,535 after spreading now log once, with the dimensions and whether the dispatch was spread.

Two small optional suggestions:

  • A unit test of the decision would pin it down cheaply. spread_groups is pure, so a test can take a can_spread flag and check:
    • x = 65,536, z = 1 spreads;
    • z = 2 doesn't;
    • can_spread == false leaves (x, y, z) unchanged.
  • The warning fires once per process. A count in the periodic stats would show how often those dispatches happen, if that's useful.

This is from reading the code only; I didn't build or run it. The title was not used in these tests.

AI-assisted

<!-- greyfinch-sync:Marvisak/VIctory:comment:7166035962 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7166035962). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-25T14:55:47Z. --- Thanks, re-read `a3e7d3a`. Both points are covered: - The direct path now spreads only when the bound program's translated user data declares `DISPATCH_SLOT`; otherwise `(x, y, z)` stays as asked. The indirect path's check also requires `u.dword == 0`. It behaves the same in practice, since both of the remap's dwords are always declared together. - Group counts still over 65,535 after spreading now log once, with the dimensions and whether the dispatch was spread. Two small optional suggestions: - A unit test of the decision would pin it down cheaply. `spread_groups` is pure, so a test can take a `can_spread` flag and check: - x = 65,536, z = 1 spreads; - z = 2 doesn't; - `can_spread == false` leaves `(x, y, z)` unchanged. - The warning fires once per process. A count in the periodic stats would show how often those dispatches happen, if that's useful. This is from reading the code only; I didn't build or run it. The title was not used in these tests. AI-assisted
Xvania7 commented 2026-11-25 15:04:35 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Xvania7 on 2026-11-25T15:03:54Z.


@r4tedx @upipibi Pushed d045b19 adding the unit test draw::tests::compute_dispatch_group_spreading_decision pinning the decision logic (x = 65,536 with z = 1 spreads to 2 rows of 32,768 in x across z; z = 2 multi-dimensional dispatches stay unspread; x <= 65,535 stays unspread).

@upipibi Great comparative analysis with xcl#1428 and shadPS4#5479. A few key architectural differences that make the Z-spread approach particularly clean here:

  1. Preserving 2D dispatches (y > 1):
    Folding X into Y only works when y == 1. In title workloads (such as wide G-buffer/tiled compute passes), dispatches are frequently 2D (width_tiles, height_tiles, 1) where width_tiles > 65,535 and height_tiles > 1. Spreading across Z keeps Y completely independent and unmodified (gx = row, gy = y, gz = rows), correctly covering wide 2D grids without clamping.

  2. Unified Pipeline Cache Key (No Direct vs Indirect Splitting):
    Unlike shadPS4's split cache keys, in Victory both direct and indirect dispatches use the exact same HostPipeline and root signature:

    • In direct dispatch, State::dispatch injects [row, asked_x] into root constants via DISPATCH_SLOT.
    • In indirect dispatch, bound_spread writes [row, asked_x, row, y, rows] into the indirect arguments buffer, and host_spread_signature extracts row and asked_x into the exact same root constant indices before dispatching gx, gy, gz.
      Because the shader's cs_spread_prologue reads row and asked_x from root constants regardless of how the command list was recorded, a single compiled compute PSO seamlessly services both direct and indirect calls without cache duplication or recompilation overhead.

CI check and unit tests pass cleanly.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7166246421 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7166246421). Originally posted by [Xvania7](https://github.com/Xvania7) on 2026-11-25T15:03:54Z. --- @r4tedx @upipibi Pushed `d045b19` adding the unit test `draw::tests::compute_dispatch_group_spreading_decision` pinning the decision logic (x = 65,536 with z = 1 spreads to 2 rows of 32,768 in x across z; z = 2 multi-dimensional dispatches stay unspread; x <= 65,535 stays unspread). @upipibi Great comparative analysis with `xcl#1428` and `shadPS4#5479`. A few key architectural differences that make the Z-spread approach particularly clean here: 1. **Preserving 2D dispatches (`y > 1`):** Folding X into Y only works when `y == 1`. In title workloads (such as wide G-buffer/tiled compute passes), dispatches are frequently 2D `(width_tiles, height_tiles, 1)` where `width_tiles > 65,535` and `height_tiles > 1`. Spreading across Z keeps Y completely independent and unmodified (`gx = row`, `gy = y`, `gz = rows`), correctly covering wide 2D grids without clamping. 2. **Unified Pipeline Cache Key (No Direct vs Indirect Splitting):** Unlike shadPS4's split cache keys, in Victory both direct and indirect dispatches use the **exact same** `HostPipeline` and root signature: - In direct dispatch, `State::dispatch` injects `[row, asked_x]` into root constants via `DISPATCH_SLOT`. - In indirect dispatch, `bound_spread` writes `[row, asked_x, row, y, rows]` into the indirect arguments buffer, and `host_spread_signature` extracts `row` and `asked_x` into the exact same root constant indices before dispatching `gx, gy, gz`. Because the shader's `cs_spread_prologue` reads `row` and `asked_x` from root constants regardless of how the command list was recorded, a single compiled compute PSO seamlessly services both direct and indirect calls without cache duplication or recompilation overhead. CI check and unit tests pass cleanly.
r4tedx commented 2026-11-25 16:09:06 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-25T15:07:38Z.


Checked d045b19 and the same-pipeline point against the code:

  • compute_dispatch_group_spreading_decision covers spread_groups: x = 65,536 with z = 1 spreads to (32,768, 1, 2); z = 2 isn't spread; x ≤ 65,535 isn't spread.
  • The indirect path's host_spread_signature is built on the same root signature (p.root). Its CONSTANT argument writes 2 dwords into the stage's user-data root parameter, at the index of the DISPATCH_SLOT dword-0 entry. Those are the same two words the direct path fills at bind. So the shader reads (row, asked_x) from the same place either way, and a pipeline used directly and then indirectly sees what each command set.

One optional gap: the can_spread gate itself, which returns (0, x, x, y, z) when the program has no DISPATCH_SLOT, sits inline in State::dispatch, so the test doesn't reach it. Moving the gate into spread_groups would let the same test cover it.

This is from reading the code only. The title was not used in these tests.

AI-assisted

<!-- greyfinch-sync:Marvisak/VIctory:comment:7166344579 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7166344579). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-25T15:07:38Z. --- Checked `d045b19` and the same-pipeline point against the code: - `compute_dispatch_group_spreading_decision` covers `spread_groups`: x = 65,536 with z = 1 spreads to (32,768, 1, 2); z = 2 isn't spread; x ≤ 65,535 isn't spread. - The indirect path's `host_spread_signature` is built on the same root signature (`p.root`). Its `CONSTANT` argument writes 2 dwords into the stage's user-data root parameter, at the index of the `DISPATCH_SLOT` dword-0 entry. Those are the same two words the direct path fills at bind. So the shader reads (row, asked_x) from the same place either way, and a pipeline used directly and then indirectly sees what each command set. One optional gap: the `can_spread` gate itself, which returns `(0, x, x, y, z)` when the program has no `DISPATCH_SLOT`, sits inline in `State::dispatch`, so the test doesn't reach it. Moving the gate into `spread_groups` would let the same test cover it. This is from reading the code only. The title was not used in these tests. AI-assisted
Xvania7 commented 2026-11-25 16:09:06 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Xvania7 on 2026-11-25T15:11:12Z.


@r4tedx Pushed 8eb90cb: moved can_spread into spread_groups(x, y, z, can_spread) and updated compute_dispatch_group_spreading_decision to explicitly test that can_spread == false leaves (x, y, z) unspread ((0, 65_536, 65_536, 1, 1)). Clippy and unit tests pass cleanly.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7166439789 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7166439789). Originally posted by [Xvania7](https://github.com/Xvania7) on 2026-11-25T15:11:12Z. --- @r4tedx Pushed `8eb90cb`: moved `can_spread` into `spread_groups(x, y, z, can_spread)` and updated `compute_dispatch_group_spreading_decision` to explicitly test that `can_spread == false` leaves `(x, y, z)` unspread (`(0, 65_536, 65_536, 1, 1)`). Clippy and unit tests pass cleanly.
r4tedx commented 2026-11-25 16:09:06 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-25T15:12:13Z.


Checked 8eb90cb: the can_spread gate is now inside spread_groups, and the test covers it. can_spread == false with x = 65,536 gives (0, 65_536, 65_536, 1, 1), and the existing cases now pass true. That closes my first point.

My second point, y or z over the limit and x over it with z > 1, was already covered by a3e7d3a. Those dispatches still reach Dispatch as asked, but they now log once with the dimensions, so they're visible rather than silent. That's enough for this PR as far as I'm concerned. Nothing more from me here.

This is from reading the code only. The title was not used in these tests.

AI-assisted

<!-- greyfinch-sync:Marvisak/VIctory:comment:7166466321 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7166466321). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-25T15:12:13Z. --- Checked `8eb90cb`: the `can_spread` gate is now inside `spread_groups`, and the test covers it. `can_spread == false` with x = 65,536 gives `(0, 65_536, 65_536, 1, 1)`, and the existing cases now pass `true`. That closes my first point. My second point, y or z over the limit and x over it with z > 1, was already covered by `a3e7d3a`. Those dispatches still reach `Dispatch` as asked, but they now log once with the dimensions, so they're visible rather than silent. That's enough for this PR as far as I'm concerned. Nothing more from me here. This is from reading the code only. The title was not used in these tests. AI-assisted
Xvania7 commented 2026-11-25 16:09:07 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Xvania7 on 2026-11-25T15:14:10Z.


Thanks @r4tedx for the thorough review, catching the loop-header edge case, and helping pin down the unit tests!

<!-- greyfinch-sync:Marvisak/VIctory:comment:7166516861 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7166516861). Originally posted by [Xvania7](https://github.com/Xvania7) on 2026-11-25T15:14:10Z. --- Thanks @r4tedx for the thorough review, catching the loop-header edge case, and helping pin down the unit tests!
Marvisak commented 2026-11-25 16:09:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:26:23Z.


Automated triage for the maintainers.

Needs work (small). Thanks for the rebase onto 63bcca4; it merges cleanly and CI check passes. The earlier point is addressed. In the clamp shader (indirect.rs, clamped), records that are not spread keep the 65,535 clamp, and spreading needs g.y >= 1 && g.z == 1. spread_records_split_large_x_and_keep_small_unspread adds the z > 1, y = 0 and y > 65,535 cases. The translator side (cs_spread_prologue in lower.rs) puts row and asked at consecutive user-data indices, which is what the 2-constant indirect argument expects.

Still to fix:

  • y in the spread path is not clamped. For a spread record, g = uint3(row, g.y, z) keeps the title's y as is, and row is at least 32,768. With y of 131,072 or more, g.x * g.y wraps in 32 bits, so the GROUPS check can pass and an out-of-limit dispatch reaches ExecuteIndirect. Unwritten records with huge counts have been seen in this very pass (SpaghettiMaster545's comment). Please clamp g.y to 65,535 before the multiply in the spread path (or spread only when g.y <= 65535), and add a record such as 70,000 x 131,072 x 1 to the test.
  • host_spread_signature (draw.rs) caches by the root signature's raw pointer. Nothing keeps that root signature alive, so once it is freed, a new root signature at the same address would get a command signature made for the old one. Either keep the ID3D12RootSignature in the cache entry, so the address can't be reused, or key the cache on something that lives as long as the pipeline.
  • Nit: host_spread_signature has two doc paragraphs saying the same thing.

This overlaps #3086 and #3100, which handle the same 65,535 limit for direct dispatches; the maintainer picks one approach.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7166844427 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7166844427). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T15:26:23Z. --- <!-- victory-triage v1 head=7a1632daa74e8bf2d00c30dfee66c209f30ac180 verdict=needs-work at=2026-11-26T08:20:21Z --> Automated triage for the maintainers. **Needs work (small).** Thanks for the rebase onto `63bcca4`; it merges cleanly and CI `check` passes. The earlier point is addressed. In the clamp shader (`indirect.rs`, `clamped`), records that are not spread keep the 65,535 clamp, and spreading needs `g.y >= 1 && g.z == 1`. `spread_records_split_large_x_and_keep_small_unspread` adds the z > 1, y = 0 and y > 65,535 cases. The translator side (`cs_spread_prologue` in `lower.rs`) puts `row` and `asked` at consecutive user-data indices, which is what the 2-constant indirect argument expects. Still to fix: - **`y` in the spread path is not clamped.** For a spread record, `g = uint3(row, g.y, z)` keeps the title's `y` as is, and `row` is at least 32,768. With `y` of 131,072 or more, `g.x * g.y` wraps in 32 bits, so the `GROUPS` check can pass and an out-of-limit dispatch reaches `ExecuteIndirect`. Unwritten records with huge counts have been seen in this very pass (SpaghettiMaster545's comment). Please clamp `g.y` to 65,535 before the multiply in the spread path (or spread only when `g.y <= 65535`), and add a record such as `70,000 x 131,072 x 1` to the test. - **`host_spread_signature` (`draw.rs`) caches by the root signature's raw pointer.** Nothing keeps that root signature alive, so once it is freed, a new root signature at the same address would get a command signature made for the old one. Either keep the `ID3D12RootSignature` in the cache entry, so the address can't be reused, or key the cache on something that lives as long as the pipeline. - Nit: `host_spread_signature` has two doc paragraphs saying the same thing. This overlaps #3086 and #3100, which handle the same 65,535 limit for direct dispatches; the maintainer picks one approach. --- _Generated by [Claude Code](https://claude.ai/code)_
SpaghettiMaster545 commented 2026-11-25 16:09:18 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by SpaghettiMaster545 on 2026-11-25T15:42:29Z.


More data on the pass this fixes, measured on an 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), about once a frame in the opening cutscene. With the cut to 65,535, its last tiles are the blocky tiles along the bottom edge of the picture. Running the groups past the limit (we split the records into pieces of at most 65,535, each with its own group base) makes them go away.

One trap for the indirect side, if a count is ever read on the CPU when the list is recorded: the record's 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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7167257585 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7167257585). Originally posted by [SpaghettiMaster545](https://github.com/SpaghettiMaster545) on 2026-11-25T15:42:29Z. --- More data on the pass this fixes, measured on an 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), about once a frame in the opening cutscene. With the cut to 65,535, its last tiles are the blocky tiles along the bottom edge of the picture. Running the groups past the limit (we split the records into pieces of at most 65,535, each with its own group base) makes them go away. One trap for the indirect side, if a count is ever read on the CPU when the list is recorded: the record's 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.
Xvania7 commented 2026-11-25 16:09:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Xvania7 on 2026-11-25T15:45:36Z.


Pushed 6bfc9c3 addressing both triage items:

1. Default-Heap Spread Buffer Pooling & Zero Per-Dispatch Allocation Overhead

  • Replaced per-dispatch committed custom-heap (MEMORY_POOL_L0) allocations with a pooled default-heap buffer (Host::spread_default_buffer) created in VRAM with D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS.
  • Cached and reused the buffer per HostList (list.spread_buffer), initialized lazily to max(size, 64 KiB) (spread: Mutex<Option<(ID3D12Resource, u64)>>) and preserved across list resets. This eliminates all per-dispatch committed resource creations and allows the GPU to read indirect arguments directly from high-speed local VRAM with zero PCIe host-memory traffic during ExecuteIndirect.
  • Exported pure spread_groups from victory_shader::emit and shared it across crates to avoid logic duplication.

2. Synthetic GPU Unit Test for Translated Remap & Group Bounding

  • Added cs_spread_prologue_remaps_group_ids_and_bounds_groups in crates/victory-shader/src/emit/synthetic_tests.rs.
  • Validates a dispatch of x = 65,537 groups spread across z = 2 rows (32,769 \times 2 = 65,538 groups dispatched):
    • Every console group 0..65,537 maps GroupId(0) cleanly to eff_x = gx + gz * row and writes its ID once into a raw UAV with no gaps and no duplicates.
    • The surplus 65,538th group (gx = 32,768, gz = 1 \implies eff\_x = 65,537 \ge asked) takes the early return branch generated by cs_spread_prologue without writing.
    • Verified with DXIL bytecode validation.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7167296308 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7167296308). Originally posted by [Xvania7](https://github.com/Xvania7) on 2026-11-25T15:45:36Z. --- Pushed `6bfc9c3` addressing both triage items: ### 1. Default-Heap Spread Buffer Pooling & Zero Per-Dispatch Allocation Overhead - Replaced per-dispatch committed custom-heap (`MEMORY_POOL_L0`) allocations with a pooled default-heap buffer (`Host::spread_default_buffer`) created in VRAM with `D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS`. - Cached and reused the buffer per `HostList` (`list.spread_buffer`), initialized lazily to `max(size, 64 KiB)` (`spread: Mutex<Option<(ID3D12Resource, u64)>>`) and preserved across list resets. This eliminates all per-dispatch committed resource creations and allows the GPU to read indirect arguments directly from high-speed local VRAM with zero PCIe host-memory traffic during `ExecuteIndirect`. - Exported pure `spread_groups` from `victory_shader::emit` and shared it across crates to avoid logic duplication. ### 2. Synthetic GPU Unit Test for Translated Remap & Group Bounding - Added `cs_spread_prologue_remaps_group_ids_and_bounds_groups` in `crates/victory-shader/src/emit/synthetic_tests.rs`. - Validates a dispatch of $x = 65,537$ groups spread across $z = 2$ rows ($32,769 \times 2 = 65,538$ groups dispatched): - Every console group $0..65,537$ maps `GroupId(0)` cleanly to `eff_x = gx + gz * row` and writes its ID once into a raw UAV with no gaps and no duplicates. - The surplus 65,538th group ($gx = 32,768, gz = 1 \implies eff\_x = 65,537 \ge asked$) takes the early return branch generated by `cs_spread_prologue` without writing. - Verified with DXIL bytecode validation.
Xvania7 commented 2026-11-25 18:02:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Xvania7 on 2026-11-25T17:49:26Z.


Rebased cleanly onto origin/main (13f91ca), adopting 315cea1's pooled HostList::arguments(...) buffer pattern directly:

  • Host List Argument Buffer Integration: When spreading is active, indirect::bound sizes list.arguments(...) for 20-byte records (stride = 20), clamps and writes [row, asked_x, gx, gy, gz] directly into the list's own argument buffer, transitions it, and executes via host_spread_signature. The title buffer copy remains untouched with no transitions.
  • Unwritten Count Protection: Consistent with @SpaghettiMaster545's note, dispatches exceeding GROUPS = 1 << 20 (or unwritten memory words > 2^20) are treated as invalid counts and zeroed.
  • Test Coverage: All unit tests passing:
    • cs_spread_prologue_remaps_group_ids_and_bounds_groups
    • spread_records_split_large_x_and_keep_small_unspread
    • spread_indirect_signature_matches_root_and_layout
<!-- greyfinch-sync:Marvisak/VIctory:comment:7170049962 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7170049962). Originally posted by [Xvania7](https://github.com/Xvania7) on 2026-11-25T17:49:26Z. --- Rebased cleanly onto `origin/main` (`13f91ca`), adopting `315cea1`'s pooled `HostList::arguments(...)` buffer pattern directly: - **Host List Argument Buffer Integration:** When spreading is active, `indirect::bound` sizes `list.arguments(...)` for 20-byte records (`stride = 20`), clamps and writes `[row, asked_x, gx, gy, gz]` directly into the list's own argument buffer, transitions it, and executes via `host_spread_signature`. The title buffer copy remains untouched with no transitions. - **Unwritten Count Protection:** Consistent with @SpaghettiMaster545's note, dispatches exceeding `GROUPS = 1 << 20` (or unwritten memory words > 2^20) are treated as invalid counts and zeroed. - **Test Coverage:** All unit tests passing: - `cs_spread_prologue_remaps_group_ids_and_bounds_groups` - `spread_records_split_large_x_and_keep_small_unspread` - `spread_indirect_signature_matches_root_and_layout`
andrewpozdnakov7-jpg commented 2026-11-26 08:03:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-26T07:30:29Z.


@Xvania7 I saw your latest rebase in 7a1632d. I also prepared a rebase onto upstream main (63bcca4), preserving your authorship in 87c8c2a. The follow-up commit d5d6673 contains the group-limit fixes and regression tests from the review. Could you take a look at that follow-up for #2312?

On the linked branch, both Dispatch and ExecuteIndirect produced exactly the expected group indices on WARP at 65,535, 65,536, and 65,537 groups. Y = 0 produced no writes, and Z = 2 retained the 65,535 X limit on each layer. The GPU suite passed 249 tests with one ignored. The opening cutscene still needs an in-game check.

Branch · Follow-up commit · Full diff

AI-assisted with Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7185531942 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7185531942). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-26T07:30:29Z. --- @Xvania7 I saw your latest rebase in `7a1632d`. I also prepared a rebase onto upstream `main` (`63bcca4`), preserving your authorship in `87c8c2a`. The follow-up commit `d5d6673` contains the group-limit fixes and regression tests from the review. Could you take a look at that follow-up for #2312? On the linked branch, both `Dispatch` and `ExecuteIndirect` produced exactly the expected group indices on WARP at 65,535, 65,536, and 65,537 groups. `Y = 0` produced no writes, and `Z = 2` retained the 65,535 X limit on each layer. The GPU suite passed 249 tests with one ignored. The opening cutscene still needs an in-game check. [Branch](https://github.com/andrewpozdnakov7-jpg/VIctory/tree/rebase/2312-dispatch-spread) · [Follow-up commit](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/d5d6673806590527fca01e52aa0c260dbd4fd2cb) · [Full diff](https://github.com/andrewpozdnakov7-jpg/VIctory/compare/63bcca4...d5d6673) AI-assisted with Codex.
Xvania7 commented 2026-11-26 09:06:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Xvania7 on 2026-11-26T08:49:19Z.


@andrewpozdnakov7-jpg thanks for the detailed verification across the group boundaries (65,535 / 65,536 / 65,537) on WARP and validating Y = 0 / Z = 2!

Looked through your follow-up commit d5d6673: tightening u.dword == 0 for the user data slot check and ensuring min(requested, 65535) bounds on unspread/multi-layer paths are very clean additions.

I can cherry-pick d5d6673 directly into this branch so everything lands in one clean PR, or we can keep it as a follow-up right after #2312 merges — whichever @Marvisak prefers during triage.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7187061509 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7187061509). Originally posted by [Xvania7](https://github.com/Xvania7) on 2026-11-26T08:49:19Z. --- @andrewpozdnakov7-jpg thanks for the detailed verification across the group boundaries (65,535 / 65,536 / 65,537) on WARP and validating `Y = 0` / `Z = 2`! Looked through your follow-up commit `d5d6673`: tightening `u.dword == 0` for the user data slot check and ensuring `min(requested, 65535)` bounds on unspread/multi-layer paths are very clean additions. I can cherry-pick `d5d6673` directly into this branch so everything lands in one clean PR, or we can keep it as a follow-up right after #2312 merges — whichever @Marvisak prefers during triage.
andrewpozdnakov7-jpg commented 2026-11-26 09:06:15 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-26T08:55:54Z.


@Xvania7 I carried the fixes from d5d6673 onto your current 7a1632d in 2ac161a. This addresses both points in the latest review.

  • Spread Y limit. The indirect clamp bounds Y before multiplying. In the WARP argument readback, 70,000 × 131,072 × 1 already produced zero dispatch dimensions on the PR head and still does after the fix. The adjacent 65,536 × 131,072 × 1 case produced nonzero, out-of-range arguments on the PR head and now produces (0, 0, 0). Both cases are in the regression test, which reads only the sanitizer output.
  • Root signature ownership. Each cache entry now holds an ID3D12RootSignature reference. WARP's command signature itself retained one reference in the uncached control. The patched cache retains one additional reference, and a cache hit reuses the command signature without increasing the root reference count.

The full app-local WARP suite passed 249 tests with one ignored. The synthetic direct and indirect dispatches wrote each expected group once at 65,535, 65,536 and 65,537 groups. The shader unit test also checks the direct Y clamp.

If you cherry-pick the follow-up, please retain its Git author. If you fold it into another commit, please keep Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

AI-assisted. Synthetic tests.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7187197678 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7187197678). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-26T08:55:54Z. --- @Xvania7 I carried the fixes from `d5d6673` onto your current `7a1632d` in [`2ac161a`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/2ac161af61d7828c5e17b1120c11e9f548ca1815). This addresses both points in the latest review. - **Spread Y limit.** The indirect clamp bounds Y before multiplying. In the WARP argument readback, `70,000 × 131,072 × 1` already produced zero dispatch dimensions on the PR head and still does after the fix. The adjacent `65,536 × 131,072 × 1` case produced nonzero, out-of-range arguments on the PR head and now produces `(0, 0, 0)`. Both cases are in the regression test, which reads only the sanitizer output. - **Root signature ownership.** Each cache entry now holds an `ID3D12RootSignature` reference. WARP's command signature itself retained one reference in the uncached control. The patched cache retains one additional reference, and a cache hit reuses the command signature without increasing the root reference count. The full app-local WARP suite passed 249 tests with one ignored. The synthetic direct and indirect dispatches wrote each expected group once at 65,535, 65,536 and 65,537 groups. The shader unit test also checks the direct Y clamp. If you cherry-pick the follow-up, please retain its Git author. If you fold it into another commit, please keep `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`. AI-assisted. Synthetic tests.
neonbyte1 commented 2026-11-26 11:04:01 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by neonbyte1 on 2026-11-26T10:30:09Z.


Tested in game on Linux, and it fixes the scene where I found this bug.

Setup: RTX 5090 (driver 620.73.04), GE-Proton11-14 Wine with its vkd3d-proton. Base: main with a few unmerged PRs needed on this setup (#2723, #439, #2118, #2703, #2101 and others). This PR merged on top as 0ca6b4c. diag build, the lit prison-yard scene after the opening.

The bug there: indirect_diffuse_lighting:CS_FinalGather (runtime hash 2dc364df5d3278b8) asks for 74,192 to 83,008 groups in x through ExecuteIndirect, depending on the view. With the clamp at 65,535, about 1,000 screen tiles were never gathered, and the bottom rows of the lit picture showed stale tiles from earlier frames.

Bottom-edge blocks: the share of bright blocky pixels in the bottom 4% of the frame.

Build Frames Bottom-edge blocks
base 1500 16.6%
base + this PR (warm run) 1450, 1500, …, 1700 (6 frames) 0% in all

Also: the lit yard looks the same as with the clamp simply lifted (a diagnostic that isn't valid D3D12). There was no device removal, Xid or exception in the runs.

I also reviewed the merge for the bug classes found in my competing #3100:

  • The argument buffer is sized for the spread records.
  • The counted and uncounted ExecuteIndirect paths both pass a matching count.
  • The 2^20 cap and budget are applied.

Two minor things you may want to look at:

  • indirect.rs around lines 68–69: the arithmetic can overflow near u32::MAX (then the group cap is skipped and z becomes 0).
  • synthetic_tests.rs around lines 1113–1119: the test passes when device or pipeline creation fails instead of reporting it.

The merge onto that base had a few conflicts with #2699's root-view offset check and the Wine-compilable clamp from #2969; they were mechanical. indirect tests (9) and the lowering and spread tests pass under Wine on the 5090, and they really dispatch: breaking the spread logic made them fail.

AI-assisted (Claude); measured on my machine, no game data shared.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7189450520 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7189450520). Originally posted by [neonbyte1](https://github.com/neonbyte1) on 2026-11-26T10:30:09Z. --- Tested in game on Linux, and it fixes the scene where I found this bug. **Setup:** RTX 5090 (driver 620.73.04), GE-Proton11-14 Wine with its vkd3d-proton. Base: `main` with a few unmerged PRs needed on this setup (#2723, #439, #2118, #2703, #2101 and others). This PR merged on top as `0ca6b4c`. `diag` build, the lit prison-yard scene after the opening. **The bug there:** `indirect_diffuse_lighting:CS_FinalGather` (runtime hash `2dc364df5d3278b8`) asks for 74,192 to 83,008 groups in x through `ExecuteIndirect`, depending on the view. With the clamp at 65,535, about 1,000 screen tiles were never gathered, and the bottom rows of the lit picture showed stale tiles from earlier frames. **Bottom-edge blocks:** the share of bright blocky pixels in the bottom 4% of the frame. | Build | Frames | Bottom-edge blocks | |---|---|---| | base | 1500 | 16.6% | | base + this PR (warm run) | 1450, 1500, …, 1700 (6 frames) | 0% in all | **Also:** the lit yard looks the same as with the clamp simply lifted (a diagnostic that isn't valid D3D12). There was no device removal, Xid or exception in the runs. I also reviewed the merge for the bug classes found in my competing #3100: - The argument buffer is sized for the spread records. - The counted and uncounted `ExecuteIndirect` paths both pass a matching count. - The 2^20 cap and budget are applied. Two minor things you may want to look at: - `indirect.rs` around lines 68–69: the arithmetic can overflow near `u32::MAX` (then the group cap is skipped and z becomes 0). - `synthetic_tests.rs` around lines 1113–1119: the test passes when device or pipeline creation fails instead of reporting it. The merge onto that base had a few conflicts with #2699's root-view offset check and the Wine-compilable clamp from #2969; they were mechanical. `indirect` tests (9) and the lowering and spread tests pass under Wine on the 5090, and they really dispatch: breaking the spread logic made them fail. _AI-assisted (Claude); measured on my machine, no game data shared._
andrewpozdnakov7-jpg commented 2026-11-26 11:04:06 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-26T10:59:20Z.


@Xvania7 @neonbyte1 I reproduced the near-UINT_MAX case from the Linux report on the exact PR head 7a1632d. The synthetic WARP test reads the clamp output and never dispatches those arguments.

Build Input Output (row, requested x, group x, group y, group z)
PR head 7a1632d (4294967295, 1, 1) (4294967295, 4294967295, 4294967295, 1, 0)
Existing follow-up 2ac161a (4294967295, 1, 1) (0, 4294967295, 0, 0, 0)

The earlier follow-up already rejects that x before doing either ceiling division and caps y before the group count check. I also updated the same fork branch at 38b0f59 so the shader regression reports errors from the requested WARP device or pipeline creation. It uses a single WARP run when VICTORY_WARP=1.

With inbox WARP (SM 6.2), the previous forced test printed two skips and passed. The updated test fails with the actual shader-model error. With app-local Agility 1.620.2 and WARP 1.0.22, it validates DXIL, dispatches the synthetic shader, and verifies all 65,537 group IDs in its readback. Strict shader Clippy and asset policy passed.

Please retain the Git author if cherry-picking or rebasing the fix and test. If folded into another commit, please add the following trailer.

Co-authored-by: andrewpozdnakov7-jpg [email protected]

<!-- greyfinch-sync:Marvisak/VIctory:comment:7190108609 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7190108609). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-26T10:59:20Z. --- @Xvania7 @neonbyte1 I reproduced the near-UINT_MAX case from the Linux report on the exact PR head 7a1632d. The synthetic WARP test reads the clamp output and never dispatches those arguments. | Build | Input | Output (row, requested x, group x, group y, group z) | | --- | --- | --- | | PR head 7a1632d | (4294967295, 1, 1) | (4294967295, 4294967295, 4294967295, 1, 0) | | Existing follow-up 2ac161a | (4294967295, 1, 1) | (0, 4294967295, 0, 0, 0) | The earlier follow-up already rejects that x before doing either ceiling division and caps y before the group count check. I also updated the same fork branch at [38b0f59](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/38b0f59d8960eb1e33df9a93ea0e4bcd662bf5d4) so the shader regression reports errors from the requested WARP device or pipeline creation. It uses a single WARP run when VICTORY_WARP=1. With inbox WARP (SM 6.2), the previous forced test printed two skips and passed. The updated test fails with the actual shader-model error. With app-local Agility 1.620.2 and WARP 1.0.22, it validates DXIL, dispatches the synthetic shader, and verifies all 65,537 group IDs in its readback. Strict shader Clippy and asset policy passed. Please retain the Git author if cherry-picking or rebasing the fix and test. If folded into another commit, please add the following trailer. Co-authored-by: andrewpozdnakov7-jpg <[email protected]>
Xvania7 commented 2026-11-26 16:05:00 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Xvania7 on 2026-11-26T15:02:35Z.


Pulled @andrewpozdnakov7-jpg's follow-up commits 2ac161a and 38b0f59 directly into this branch, preserving authorship:

  • u32::MAX / Group Caps (crates/victory-gpu/src/indirect.rs): Indirect clamp bounds requested dimensions and guards against overflow near u32::MAX.
  • Root Signature Ownership (crates/victory-gpu/src/draw.rs): Cached spread command signatures retain root signature references cleanly.
  • Hardware/WARP Diagnostics (crates/victory-shader/src/emit/synthetic_tests.rs): Synthetic regression tests report pipeline creation diagnostics cleanly.

Huge thanks to @neonbyte1 for the in-game validation on RTX 5090 (Proton / Linux) confirming the fix for indirect_diffuse_lighting:CS_FinalGather (0% corrupted edge tiles).

Local validation clean:

  • cargo test -p victory-shader cs_spread: passed (remaps 65,537 group IDs).
  • cargo test -p victory-gpu spread: passed (records clamping & signature layout).
  • cargo clippy -p victory-shader -p victory-gpu -- -D warnings: 0 warnings.
  • cargo run -p xtask -- policy: 191 files ok.

Pushed to branch head 38b0f59. Ready for maintainer merge.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7195697500 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7195697500). Originally posted by [Xvania7](https://github.com/Xvania7) on 2026-11-26T15:02:35Z. --- Pulled @andrewpozdnakov7-jpg's follow-up commits [`2ac161a`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/2ac161af61d7828c5e17b1120c11e9f548ca1815) and [`38b0f59`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/38b0f59d8960eb1e33df9a93ea0e4bcd662bf5d4) directly into this branch, preserving authorship: - **`u32::MAX` / Group Caps (`crates/victory-gpu/src/indirect.rs`):** Indirect clamp bounds requested dimensions and guards against overflow near `u32::MAX`. - **Root Signature Ownership (`crates/victory-gpu/src/draw.rs`):** Cached spread command signatures retain root signature references cleanly. - **Hardware/WARP Diagnostics (`crates/victory-shader/src/emit/synthetic_tests.rs`):** Synthetic regression tests report pipeline creation diagnostics cleanly. Huge thanks to @neonbyte1 for the in-game validation on RTX 5090 (Proton / Linux) confirming the fix for `indirect_diffuse_lighting:CS_FinalGather` (0% corrupted edge tiles). Local validation clean: - `cargo test -p victory-shader cs_spread`: passed (remaps 65,537 group IDs). - `cargo test -p victory-gpu spread`: passed (records clamping & signature layout). - `cargo clippy -p victory-shader -p victory-gpu -- -D warnings`: 0 warnings. - `cargo run -p xtask -- policy`: 191 files ok. Pushed to branch head `38b0f59`. Ready for maintainer merge.
AIcelos commented 2026-11-26 21:37:16 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by AIcelos on 2026-11-26T21:37:16Z.


Tested on Linux + NVIDIA (Wine) — this stack now boots GTA VI v1.0.2.1 to a running game window.

Setup that works today (merged all open PRs in branch nvidia-wine):

  • Cross-build from Linux: cargo xwin build --profile diag -p victory --features diagnostics --target x86_64-pc-windows-msvc
  • Wine 10 prefix + vkd3d-proton d3d12.dll/d3d12core.dll and DXVK dxgi.dll from GE-Proton 11-14 copied to system32/, WINEDLLOVERRIDES="d3d12,d3d12core,dxgi=n,builtin"
  • Do NOT copy dxil.dll: Wine's built-in (Wine-mono) DXBC builder works; NVIDIA's Windows dxil.dll cannot load under Wine and blocks vkd3d-proton. (The team gist "remove all D3D12/DXGI/DXIL + builtin override" fails on stock wine — wine 10 ships no d3d12.dll of its own.)
  • Fixes in this branch that made it work: versioned dxcompiler_NN.dll fallback (Wine's is unversioned), IDxcContainerBuilder v1→v2→v3 retry, root-signature fallback, VICTORY_CACHE_DIR.

Result on RTX 5090: window appears, swapchain presents (frame 2048+ in 90 s ≈ 20 fps diag build), all 49 ttpf + packs open via dstorage, XUserAddAsync offline user, 52 shaders translated through Wine's dxil→DXBC path. No crash.

The "XCL requires Windows" premise is wrong: the whole layer runs under Wine with vkd3d-proton; only the host tooling assumed Windows.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7203901761 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7203901761). Originally posted by [AIcelos](https://github.com/AIcelos) on 2026-11-26T21:37:16Z. --- **Tested on Linux + NVIDIA (Wine) — this stack now boots GTA VI v1.0.2.1 to a running game window.** Setup that works today (merged all open PRs in branch `nvidia-wine`): - Cross-build from Linux: `cargo xwin build --profile diag -p victory --features diagnostics --target x86_64-pc-windows-msvc` - Wine 10 prefix + vkd3d-proton `d3d12.dll`/`d3d12core.dll` and DXVK `dxgi.dll` from GE-Proton 11-14 copied to `system32/`, `WINEDLLOVERRIDES="d3d12,d3d12core,dxgi=n,builtin"` - **Do NOT copy `dxil.dll`**: Wine's built-in (Wine-mono) DXBC builder works; NVIDIA's Windows `dxil.dll` cannot load under Wine and blocks vkd3d-proton. (The team gist "remove all D3D12/DXGI/DXIL + builtin override" fails on stock wine — wine 10 ships no `d3d12.dll` of its own.) - Fixes in this branch that made it work: versioned `dxcompiler_NN.dll` fallback (Wine's is unversioned), `IDxcContainerBuilder` v1→v2→v3 retry, root-signature fallback, `VICTORY_CACHE_DIR`. Result on RTX 5090: window appears, swapchain presents (frame 2048+ in 90 s ≈ 20 fps diag build), all 49 ttpf + packs open via dstorage, XUserAddAsync offline user, 52 shaders translated through Wine's dxil→DXBC path. No crash. The "XCL requires Windows" premise is wrong: the whole layer runs under Wine with vkd3d-proton; only the *host tooling* assumed Windows.
ColorMeBoom commented 2026-11-27 02:01:57 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ColorMeBoom on 2026-11-27T02:01:57Z.


RDNA1 run (AMD RX 5700 XT, Navi 10, driver 32.0.21045.29003, Windows 11 26200; from the batch in #3410). Head 38b0f59 merged onto main 63bcca4.

Three crosslane_tests fail, before any GPU work:

emit::crosslane_tests::dpp16_inactive_source_and_bound_ctrl_match_rdna2_on_gpu
emit::crosslane_tests::dpp8_and_dpp8fi_inactive_source_match_rdna2_on_gpu
emit::crosslane_tests::ds_swizzle_b32_inactive_source_returns_zero_on_gpu
  crosslane_tests.rs:525  assertion `left == right` failed  left: Constants  right: Table

They pass on main. dispatch_wave32 in crosslane_tests.rs (from #1582) asserts that every user-data entry is a Table, so the new DISPATCH_SLOT constants trip it. The PR already skips that slot in the waterfall_tests helper. The same skip here fixes it:

     for u in &shader.user_data {
+        if u.slot == super::DISPATCH_SLOT {
+            continue;
+        }
         assert_eq!(u.root, RootType::Table);

With that, the full victory-shader --lib suite passes on the RX 5700 XT and WARP: 304 passed, 0 failed, 3 ignored. These tests need a hardware adapter with 32-lane waves, so a WARP-only run skips them.

AI use: Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7207773942 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7207773942). Originally posted by [ColorMeBoom](https://github.com/ColorMeBoom) on 2026-11-27T02:01:57Z. --- **RDNA1 run** (AMD RX 5700 XT, Navi 10, driver 32.0.21045.29003, Windows 11 26200; from the batch in #3410). Head `38b0f59` merged onto main `63bcca4`. Three `crosslane_tests` fail, before any GPU work: ``` emit::crosslane_tests::dpp16_inactive_source_and_bound_ctrl_match_rdna2_on_gpu emit::crosslane_tests::dpp8_and_dpp8fi_inactive_source_match_rdna2_on_gpu emit::crosslane_tests::ds_swizzle_b32_inactive_source_returns_zero_on_gpu crosslane_tests.rs:525 assertion `left == right` failed left: Constants right: Table ``` They pass on main. `dispatch_wave32` in `crosslane_tests.rs` (from #1582) asserts that every user-data entry is a `Table`, so the new `DISPATCH_SLOT` constants trip it. The PR already skips that slot in the `waterfall_tests` helper. The same skip here fixes it: ```diff for u in &shader.user_data { + if u.slot == super::DISPATCH_SLOT { + continue; + } assert_eq!(u.root, RootType::Table); ``` With that, the full `victory-shader --lib` suite passes on the RX 5700 XT and WARP: 304 passed, 0 failed, 3 ignored. These tests need a hardware adapter with 32-lane waves, so a WARP-only run skips them. AI use: Claude Code (Claude Opus 5.5).
andrewpozdnakov7-jpg commented 2026-11-27 06:28:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T06:28:51Z.


Thanks @ColorMeBoom for isolating the three setup assertions on RX 5700 XT and testing the fix. I put your exact fixture change on top of 38b0f59 in e8a8f3c, with your co-author trailer. The user-data setup still asserts that every descriptor entry is a table. The reserved dispatch slot is handled the same way as in the waterfall fixture.

Your RX 5700 XT and WARP run covered all 304 tests with 3 ignored. My local suite matched the five pre-existing failures on the same checkout before this change (299 passed, 3 ignored). The three cross-lane cases need a Wave32 hardware adapter for end-to-end coverage.

@Xvania7 please carry the commit into this PR. If you fold it in, please retain ColorMeBoom's co-author trailer and add:

Co-authored-by: andrewpozdnakov7-jpg [email protected]

AI-assisted with Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7211564927 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7211564927). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T06:28:51Z. --- Thanks @ColorMeBoom for isolating the three setup assertions on RX 5700 XT and testing the fix. I put your exact fixture change on top of `38b0f59` in [e8a8f3c](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/e8a8f3ca9ce639c50f984d8b61c7d2b4637078f2), with your co-author trailer. The user-data setup still asserts that every descriptor entry is a table. The reserved dispatch slot is handled the same way as in the waterfall fixture. Your [RX 5700 XT and WARP run](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7207773942) covered all 304 tests with 3 ignored. My local suite matched the five pre-existing failures on the same checkout before this change (299 passed, 3 ignored). The three cross-lane cases need a Wave32 hardware adapter for end-to-end coverage. @Xvania7 please carry the commit into this PR. If you fold it in, please retain ColorMeBoom's co-author trailer and add: Co-authored-by: andrewpozdnakov7-jpg <[email protected]> AI-assisted with Codex.
zed6000 commented 2026-11-27 12:08:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by zed6000 on 2026-11-27T12:08:55Z.


Tested on an AMD RX 7900 XTX (driver 32.0.32029.2010) with the Series X profile, in the intro cutscene: this fixes the blocky, unlit tiles there.

  • The cause, from counters: one indirect compute dispatch per frame asks for about 74,000 to 103,000 groups in x, with y = z = 1. Without this PR it is cut to 65,535, so the tail of the tile list is never shaded: lighting stopped about 62 % of the way down the screen. With this PR it runs as two z slices (for example 75,640 as 37,820 × 1 × 2). The frame captures show no tile blocks and no unlit band, and the "dispatch dimensions clamped" line is gone from the log.
  • Cost: 419 ms a frame against 430 before (GPU 156.6 against 158.1), which is within noise. Every compute program gets the two extra dwords and the prologue, so all compute pipelines are rebuilt once. The first run after the change is slow while they compile.
  • Tests: merged onto a branch that also carries several other open shader PRs, victory-shader --lib 359 passed and victory-gpu --lib 240 passed. Two of those other PRs' test hosts needed a 4-line test-only change to accept the new user-data dwords; that change isn't needed on main.

Two minor review notes. Neither case occurs in the dispatch measured here.

  1. A compute program whose entry block is a loop header gets no prologue and falls back to the cut. The direct path warns once, but the indirect path is silent.
  2. Counts within about 16 below 2^20 are zeroed by the round-up.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7217895478 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7217895478). Originally posted by [zed6000](https://github.com/zed6000) on 2026-11-27T12:08:55Z. --- Tested on an AMD RX 7900 XTX (driver 32.0.32029.2010) with the Series X profile, in the intro cutscene: this fixes the blocky, unlit tiles there. - **The cause, from counters:** one indirect compute dispatch per frame asks for about 74,000 to 103,000 groups in x, with y = z = 1. Without this PR it is cut to 65,535, so the tail of the tile list is never shaded: lighting stopped about 62 % of the way down the screen. With this PR it runs as two z slices (for example 75,640 as 37,820 × 1 × 2). The frame captures show no tile blocks and no unlit band, and the "dispatch dimensions clamped" line is gone from the log. - **Cost:** 419 ms a frame against 430 before (GPU 156.6 against 158.1), which is within noise. Every compute program gets the two extra dwords and the prologue, so all compute pipelines are rebuilt once. The first run after the change is slow while they compile. - **Tests:** merged onto a branch that also carries several other open shader PRs, `victory-shader --lib` 359 passed and `victory-gpu --lib` 240 passed. Two of those other PRs' test hosts needed a 4-line test-only change to accept the new user-data dwords; that change isn't needed on `main`. Two minor review notes. Neither case occurs in the dispatch measured here. 1. A compute program whose entry block is a loop header gets no prologue and falls back to the cut. The direct path warns once, but the indirect path is silent. 2. Counts within about 16 below 2^20 are zeroed by the round-up.
pablogonz12 commented 2026-11-27 17:06:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pablogonz12 on 2026-11-27T17:06:42Z.


RDNA4 / Linux unit-test report (AMD RX 9070 XT, Mesa RADV 26.3.1-arch3.5, GE-Proton11-14, bundled vkd3d-proton v3.1-83-gcae8353ed-GE-Proton(dirty)+). I tested PR head 38b0f59d8960eb1e33df9a93ea0e4bcd662bf5d4 merged onto main 63bcca43c6a00a758510398fa43096ce7e4f7df0, and main alone, with VICTORY_TEST_ADAPTER=hw.

Windows victory-shader --lib under Wine:

  • Main: 300 passed, 2 failed, 3 ignored.
  • PR: 299 passed, 5 failed, 3 ignored. The three additional failures are the cross-lane tests also reported above. All three pass on main:
    • dpp16_inactive_source_and_bound_ctrl_match_rdna2_on_gpu
    • dpp8_and_dpp8fi_inactive_source_match_rdna2_on_gpu
    • ds_swizzle_b32_inactive_source_returns_zero_on_gpu
crosslane_tests.rs:525:9:
assertion `left == right` failed
  left: Constants
 right: Table

The two failures on both revisions were pops_wait_loop_exits_immediately_for_inactive_lanes (WARP host: "Not implemented.") and stub_pipeline_is_created (digest [00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00] accepted).

On the PR, cs_spread_prologue_remaps_group_ids_and_bounds_groups passed and printed hardware: verified 65537 group IDs; its WARP part was skipped because WARP was unavailable. spread_records_split_large_x_and_keep_small_unspread and spread_indirect_signature_matches_root_and_layout passed.

Windows victory-gpu --lib: the full process exited with code 5 at queue::tests::aliased_present_planes_preserve_the_host_texture_state on both revisions. Excluding that one test, main had 227 passed, 3 failed, 1 ignored; PR had 229 passed, 3 failed, 1 ignored. The same three failed on both:

draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view
assertion `left == right` failed: round 0: one host texture
  left: false
 right: true
pipeline::library::tests::a_rejected_blob_gives_an_empty_library
pipeline::library::tests::pipelines_load_on_many_threads_at_once
an empty library

Native Linux cargo test --lib for both touched crates failed to compile on both revisions: shader tests reference the Windows-gated validator module; GPU tests include unresolved Windows-gated host/memory imports. The Windows test binaries compiled for both.

This is unit-test coverage only; I did not run a game.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7224039124 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7224039124). Originally posted by [pablogonz12](https://github.com/pablogonz12) on 2026-11-27T17:06:42Z. --- **RDNA4 / Linux unit-test report** (AMD RX 9070 XT, Mesa RADV 26.3.1-arch3.5, GE-Proton11-14, bundled vkd3d-proton `v3.1-83-gcae8353ed-GE-Proton(dirty)+`). I tested PR head `38b0f59d8960eb1e33df9a93ea0e4bcd662bf5d4` merged onto main `63bcca43c6a00a758510398fa43096ce7e4f7df0`, and main alone, with `VICTORY_TEST_ADAPTER=hw`. Windows `victory-shader --lib` under Wine: - Main: 300 passed, 2 failed, 3 ignored. - PR: 299 passed, 5 failed, 3 ignored. The three additional failures are the cross-lane tests also reported above. All three pass on main: - `dpp16_inactive_source_and_bound_ctrl_match_rdna2_on_gpu` - `dpp8_and_dpp8fi_inactive_source_match_rdna2_on_gpu` - `ds_swizzle_b32_inactive_source_returns_zero_on_gpu` ```text crosslane_tests.rs:525:9: assertion `left == right` failed left: Constants right: Table ``` The two failures on both revisions were `pops_wait_loop_exits_immediately_for_inactive_lanes` (`WARP host: "Not implemented."`) and `stub_pipeline_is_created` (`digest [00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00] accepted`). On the PR, `cs_spread_prologue_remaps_group_ids_and_bounds_groups` passed and printed `hardware: verified 65537 group IDs`; its WARP part was skipped because WARP was unavailable. `spread_records_split_large_x_and_keep_small_unspread` and `spread_indirect_signature_matches_root_and_layout` passed. Windows `victory-gpu --lib`: the full process exited with code 5 at `queue::tests::aliased_present_planes_preserve_the_host_texture_state` on both revisions. Excluding that one test, main had 227 passed, 3 failed, 1 ignored; PR had 229 passed, 3 failed, 1 ignored. The same three failed on both: ```text draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view assertion `left == right` failed: round 0: one host texture left: false right: true pipeline::library::tests::a_rejected_blob_gives_an_empty_library pipeline::library::tests::pipelines_load_on_many_threads_at_once an empty library ``` Native Linux `cargo test --lib` for both touched crates failed to compile on both revisions: shader tests reference the Windows-gated `validator` module; GPU tests include unresolved Windows-gated `host`/`memory` imports. The Windows test binaries compiled for both. This is unit-test coverage only; I did not run a game.
pablogonz12 commented 2026-11-27 17:09:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pablogonz12 on 2026-11-27T17:09:43Z.


I checked the three RDNA4 failures against the RDNA1 report: they are the same tests and the same Constants versus Table assertion. Head 38b0f59 does not include e8a8f3c.

The cross-lane fixture assumes every user-data entry is a descriptor table. This PR adds DISPATCH_SLOT root constants for the spread row and requested X count. The fixture dispatches one group, so leaving those two constants at zero selects the unspread path; it should still assert Table for the other entries.

I tested andrewpozdnakov7-jpg's exact fixture commit on top of 38b0f59, preserving its authorship and ColorMeBoom's co-author credit. Please feel free to take it into this branch:

Co-authored-by: ColorMeBoom <[email protected]>
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>

RX 9070 XT / RADV 26.3.1, GE-Proton11-14: before, the three cross-lane tests failed at crosslane_tests.rs:525 (left: Constants, right: Table). After, DPP16 passed 18 cases, DPP8/DPP8FI passed 5, and ds_swizzle passed 6; none skipped. The spread shader test also passed, verifying 65,537 group IDs on hardware. WARP was unavailable and skipped. These are unit tests only; I did not run a game.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7224096542 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7224096542). Originally posted by [pablogonz12](https://github.com/pablogonz12) on 2026-11-27T17:09:43Z. --- I checked the three RDNA4 failures against the RDNA1 report: they are the same tests and the same `Constants` versus `Table` assertion. Head `38b0f59` does not include `e8a8f3c`. The cross-lane fixture assumes every user-data entry is a descriptor table. This PR adds `DISPATCH_SLOT` root constants for the spread row and requested X count. The fixture dispatches one group, so leaving those two constants at zero selects the unspread path; it should still assert `Table` for the other entries. I tested [andrewpozdnakov7-jpg's exact fixture commit](https://github.com/pablogonz12/VIctory/commit/e8a8f3ca9ce639c50f984d8b61c7d2b4637078f2) on top of `38b0f59`, preserving its authorship and ColorMeBoom's co-author credit. Please feel free to take it into this branch: ```text Co-authored-by: ColorMeBoom <30307984+[email protected]> Co-authored-by: andrewpozdnakov7-jpg <[email protected]> ``` RX 9070 XT / RADV 26.3.1, GE-Proton11-14: before, the three cross-lane tests failed at `crosslane_tests.rs:525` (`left: Constants`, `right: Table`). After, DPP16 passed 18 cases, DPP8/DPP8FI passed 5, and ds_swizzle passed 6; none skipped. The spread shader test also passed, verifying 65,537 group IDs on hardware. WARP was unavailable and skipped. These are unit tests only; I did not run a game.
ColorMeBoom commented 2026-11-27 17:09:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ColorMeBoom on 2026-11-27T17:09:46Z.


@pablogonz12 those three crosslane_tests failures (crosslane_tests.rs:525, left: Constants, right: Table) come from the test fixture, not the change. This PR adds a dispatch-constants entry to user_data, and dispatch_wave32 asserts that every entry is a table. @andrewpozdnakov7-jpg's e8a8f3c on top of 38b0f59 skips DISPATCH_SLOT there; it's a 3-line, test-only change. With it, all three passed on the RX 5700 XT earlier, so they should pass on your RX 9070 XT too.

AI use: Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7224097511 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7224097511). Originally posted by [ColorMeBoom](https://github.com/ColorMeBoom) on 2026-11-27T17:09:46Z. --- @pablogonz12 those three `crosslane_tests` failures (`crosslane_tests.rs:525`, `left: Constants, right: Table`) come from the test fixture, not the change. This PR adds a dispatch-constants entry to `user_data`, and `dispatch_wave32` asserts that every entry is a table. @andrewpozdnakov7-jpg's [`e8a8f3c`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/e8a8f3ca9ce639c50f984d8b61c7d2b4637078f2) on top of `38b0f59` skips `DISPATCH_SLOT` there; it's a 3-line, test-only change. With it, all three passed on the RX 5700 XT earlier, so they should pass on your RX 9070 XT too. AI use: Claude Code (Claude Opus 5.5).
andrewpozdnakov7-jpg commented 2026-11-27 17:15:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T17:15:25Z.


The RX 9070 XT retest confirms that e8a8f3c fixes the same three fixture assertions seen on RX 5700 XT. I kept that exact commit and moved the binding checks ahead of adapter selection in 0d8f049. The fixture now checks for constants at the reserved dispatch slot and tables at the descriptor slots on Windows runners without a Wave32 device. RX 9070 XT retest · Combined head 0d8f049

  • With the slot check temporarily omitted, all three tests reproduced the Constants versus Table assertion before selecting a device.
  • The combined head passed the setup checks for 29 cases. The Wave32 readbacks were skipped on this Windows host. The RX 9070 XT report covers those readbacks on e8a8f3c.
  • The separate spread test verified all 65,537 group IDs with app-local Agility 1.620.2 and WARP 1.0.22. Both loaded modules were verified. Strict shader Clippy passed with default and all features, and the asset policy passed.

The next step is for Xvania7 to pick up the two commits. Please retain the original Git author and ColorMeBoom's co-author credit on cherry-pick or rebase. If folding the changes into another commit, please include both trailers.

Co-authored-by: ColorMeBoom <[email protected]>

Co-authored-by: andrewpozdnakov7-jpg <[email protected]>

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7224203617 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7224203617). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T17:15:25Z. --- The RX 9070 XT retest confirms that `e8a8f3c` fixes the same three fixture assertions seen on RX 5700 XT. I kept that exact commit and moved the binding checks ahead of adapter selection in `0d8f049`. The fixture now checks for constants at the reserved dispatch slot and tables at the descriptor slots on Windows runners without a Wave32 device. [RX 9070 XT retest](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7224096542) · [Combined head `0d8f049`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/0d8f04940d66871d429461a41f65eb3c73f96057) - With the slot check temporarily omitted, all three tests reproduced the `Constants` versus `Table` assertion before selecting a device. - The combined head passed the setup checks for 29 cases. The Wave32 readbacks were skipped on this Windows host. The RX 9070 XT report covers those readbacks on `e8a8f3c`. - The separate spread test verified all 65,537 group IDs with app-local Agility 1.620.2 and WARP 1.0.22. Both loaded modules were verified. Strict shader Clippy passed with default and all features, and the asset policy passed. The next step is for Xvania7 to pick up the two commits. Please retain the original Git author and ColorMeBoom's co-author credit on cherry-pick or rebase. If folding the changes into another commit, please include both trailers. `Co-authored-by: ColorMeBoom <30307984+[email protected]>` `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` AI-assisted with OpenAI Codex.
Coderlord commented 2026-11-28 16:17:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Coderlord on 2026-11-28T16:17:29Z.


A performance data point for the indirect path, from a fork that carries this change (RTX 5080, driver 621.40, Windows 11 build 26300, diagnostics build).

With every indirect dispatch of a program that declares DISPATCH_SLOT going through the spread command signature (the CONSTANT argument writing the two words, then the dispatch), about 960 indirect dispatches a frame took that signature in the first gameplay area, while about one record a frame asked for more than 65,535 groups in x. On this card that signature is the expensive part. In one run, with only that path switched every 20 seconds (same build, same scene), the frame was 67.4 ms with the spread signature for every record against 53.0 ms with the lean form below (14.8 against 18.9 fps): about 15 microseconds of the card's time per ExecuteIndirect with root constants.

The lean form is fxceless/victory-fork#1352 (by grosterr). The clamp writes each record that fits within 65,535 groups for the plain dispatch signature (the program's two spread words are 0 from its bind, so it runs unspread), and only a record past 65,535 is written for the spread signature, which runs under a predicate the clamp sets only for such a record (SetPredication on the clamp's output). Every record still runs whole; nothing is clamped to 65,535 either way. On the card that is two ExecuteIndirect calls per dispatch, the second predicated off nearly always, and no root constants on the common path.

So on NVIDIA it may be worth taking that form here, or at least keeping the constants off the path of records that fit.

Found, written and tested with Claude Code.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7242126045 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7242126045). Originally posted by [Coderlord](https://github.com/Coderlord) on 2026-11-28T16:17:29Z. --- A performance data point for the indirect path, from a fork that carries this change (RTX 5080, driver 621.40, Windows 11 build 26300, diagnostics build). With every indirect dispatch of a program that declares `DISPATCH_SLOT` going through the spread command signature (the `CONSTANT` argument writing the two words, then the dispatch), about 960 indirect dispatches a frame took that signature in the first gameplay area, while about one record a frame asked for more than 65,535 groups in x. On this card that signature is the expensive part. In one run, with only that path switched every 20 seconds (same build, same scene), the frame was 67.4 ms with the spread signature for every record against 53.0 ms with the lean form below (14.8 against 18.9 fps): about 15 microseconds of the card's time per `ExecuteIndirect` with root constants. The lean form is fxceless/victory-fork#1352 (by grosterr). The clamp writes each record that fits within 65,535 groups for the plain dispatch signature (the program's two spread words are 0 from its bind, so it runs unspread), and only a record past 65,535 is written for the spread signature, which runs under a predicate the clamp sets only for such a record (`SetPredication` on the clamp's output). Every record still runs whole; nothing is clamped to 65,535 either way. On the card that is two `ExecuteIndirect` calls per dispatch, the second predicated off nearly always, and no root constants on the common path. So on NVIDIA it may be worth taking that form here, or at least keeping the constants off the path of records that fit. Found, written and tested with Claude Code.
andrewpozdnakov7-jpg commented 2026-11-28 16:24:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T16:24:56Z.


Thanks for the RTX 5080 data, @Coderlord. I tested grosterr's fork change at cd10ed9 on WARP 1.0.22 with Agility 1.620.2. Its two existing WARP tests passed, including mixed-record routing and the 100,000-group execution case.

I also ran a synthetic single-record check through the fork's lean path. The shader incremented a separate counter per logical group ID, and I compared the entire readback, including every expected zero.

Requested (X, Y, Z) Readback Spread predicate
(65,535, 1, 1) 65,535 IDs, each exactly once 0
(65,536, 1, 1) 65,536 IDs, each exactly once 1
(65,537, 1, 1) 65,537 IDs, each exactly once 1
(65,537, 0, 1) Zero writes 0
(65,537, 1, 2) 65,535 IDs per Z slice, each exactly once 0

A port for batches with multiple records needs to account for the execution order. The fork submits the plain list before the spread list, so an interleaved batch can issue in a different order from the original argument buffer. The mixed-record test verifies routing. The per-ID test here covers one record per call. D3D12 ExecuteIndirect reference

The RTX 5080 performance figure comes from your report. My local results cover the fork's indirect path on WARP. If porting the lean change, please preserve grosterr's Git author. If reusing my boundary probe, please preserve its Git authorship or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>. AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7242225004 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7242225004). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T16:24:56Z. --- Thanks for the RTX 5080 data, @Coderlord. I tested grosterr's [fork change at `cd10ed9`](https://github.com/fxceless/victory-fork/pull/1352) on WARP 1.0.22 with Agility 1.620.2. Its two existing WARP tests passed, including mixed-record routing and the 100,000-group execution case. I also ran a synthetic single-record check through the fork's lean path. The shader incremented a separate counter per logical group ID, and I compared the entire readback, including every expected zero. | Requested (X, Y, Z) | Readback | Spread predicate | | --- | --- | --- | | (65,535, 1, 1) | 65,535 IDs, each exactly once | 0 | | (65,536, 1, 1) | 65,536 IDs, each exactly once | 1 | | (65,537, 1, 1) | 65,537 IDs, each exactly once | 1 | | (65,537, 0, 1) | Zero writes | 0 | | (65,537, 1, 2) | 65,535 IDs per Z slice, each exactly once | 0 | A port for batches with multiple records needs to account for the execution order. The fork submits the plain list before the spread list, so an interleaved batch can issue in a different order from the original argument buffer. The mixed-record test verifies routing. The per-ID test here covers one record per call. [D3D12 ExecuteIndirect reference](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-executeindirect) The RTX 5080 performance figure comes from your report. My local results cover the fork's indirect path on WARP. If porting the lean change, please preserve grosterr's Git author. If reusing my boundary probe, please preserve its Git authorship or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`. AI-assisted with OpenAI Codex.
neonbyte1 commented 2026-11-28 17:49:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by neonbyte1 on 2026-11-28T17:49:27Z.


A Wine/vkd3d-proton data point for the lean form @Coderlord measured on the 5080. Credit to grosterr (fxceless/victory-fork#1352) for the design and @andrewpozdnakov7-jpg for the boundary probe.

Setup: RTX 5090, Linux, Wine 11.22 + vkd3d-proton (GE-Proton11-14), Series X profile at 2560×1440 with ray tracing on, prison yard. One diagnostics exe with three arms, adjacent 420 s runs after a warm-up, medians of the last 30 frame lines. The base is a tree with clamp windows on (draws already batch their clamps).

Arm Frame (ms) GPU (ms)
spread signature for every indirect dispatch (today) 210.2 / 205.9 63.4 / 62.3
lean (single-record executions: plain DISPATCH + predicated spread ExecuteIndirect) 224.6 / 219.1 74.2 / 73.5
plain signature + indirect dispatches in the shared clamp windows (needs a translation option: the program reads the spread values from the clamped record) 185.7 / 186.5 43.5 / 43.0
  • Under vkd3d-proton the lean form is slower here: +13-14 ms a frame, +11 ms of GPU. Our reading [INFERENCE]: the second, predicated-off ExecuteIndirect per dispatch costs more on this path than the root constants it saves. On native Windows your 5080 showed the opposite, so the result looks driver- or platform-specific. A 4080 on Windows is running the same three arms.
  • The bigger lever on this setup is batching the clamps: ~924 indirect dispatches a frame each paid for their own clamp pass. With those in shared windows plus the plain signature, GPU time falls ~20 ms (−10.5 % frame).
  • Same refusals and dropped draws in all six runs, no crash, same pictures.
  • Order: the lean arm only takes single-record executions, so a multi-record batch keeps its own order, which avoids the interleaving question @andrewpozdnakov7-jpg raised.

Branch with all three arms: https://github.com/neonbyte1/VIctory/tree/wip/perf/indirect-plain (diagnostics build; VICTORY_INDIRECT_PLAIN=1|lean).

AI-assisted (Claude); measured on my machine, no game data shared.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7243314482 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2312#issuecomment-7243314482). Originally posted by [neonbyte1](https://github.com/neonbyte1) on 2026-11-28T17:49:27Z. --- A Wine/vkd3d-proton data point for the lean form @Coderlord measured on the 5080. Credit to grosterr (fxceless/victory-fork#1352) for the design and @andrewpozdnakov7-jpg for the boundary probe. Setup: RTX 5090, Linux, Wine 11.22 + vkd3d-proton (GE-Proton11-14), Series X profile at 2560×1440 with ray tracing on, prison yard. One diagnostics exe with three arms, adjacent 420 s runs after a warm-up, medians of the last 30 frame lines. The base is a tree with clamp windows on (draws already batch their clamps). | Arm | Frame (ms) | GPU (ms) | |---|---|---| | spread signature for every indirect dispatch (today) | 210.2 / 205.9 | 63.4 / 62.3 | | lean (single-record executions: plain `DISPATCH` + predicated spread `ExecuteIndirect`) | 224.6 / 219.1 | 74.2 / 73.5 | | plain signature + indirect dispatches in the shared clamp windows (needs a translation option: the program reads the spread values from the clamped record) | **185.7 / 186.5** | **43.5 / 43.0** | - **Under vkd3d-proton the lean form is slower here: +13-14 ms a frame, +11 ms of GPU.** Our reading [INFERENCE]: the second, predicated-off `ExecuteIndirect` per dispatch costs more on this path than the root constants it saves. On native Windows your 5080 showed the opposite, so the result looks driver- or platform-specific. A 4080 on Windows is running the same three arms. - **The bigger lever on this setup is batching the clamps:** ~924 indirect dispatches a frame each paid for their own clamp pass. With those in shared windows plus the plain signature, GPU time falls ~20 ms (−10.5 % frame). - Same refusals and dropped draws in all six runs, no crash, same pictures. - Order: the lean arm only takes single-record executions, so a multi-record batch keeps its own order, which avoids the interleaving question @andrewpozdnakov7-jpg raised. Branch with all three arms: https://github.com/neonbyte1/VIctory/tree/wip/perf/indirect-plain (diagnostics build; `VICTORY_INDIRECT_PLAIN=1|lean`). _AI-assisted (Claude); measured on my machine, no game data shared._
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.

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

git switch 'main'
git merge --no-ff 'upstream-pr/2312'
git switch 'upstream-pr/2312'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2312'
git switch 'upstream-pr/2312'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2312'
git switch 'main'
git merge --squash 'upstream-pr/2312'
git switch 'main'
git merge --ff-only 'upstream-pr/2312'
git switch 'main'
git merge 'upstream-pr/2312'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!2310
No description provided.