Indirect compute records past the host's group limit run in pieces too (on top of #976); the group base goes to the group id only #1219

Open
Steenax6 wants to merge 2 commits from upstream-pr/1222 into main
Steenax6 commented 2026-11-26 00:30:24 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Steenax6 on 2026-11-26T00:30:24Z.


What

#976 (MoscaLosca, open) runs direct dispatches of more than 65,535 thread groups in pieces. This adds the indirect case, which is the one we hit, and one correction to the translated program.

In the first room a band along the bottom of the picture held stale blocks, old tiles of earlier frames, in the scene target and in several history targets (it looks like HUD garbage; it is not HUD). A compute pass of the title's indirect lighting is run by an indirect record that asks for about 74,816 thread groups in x. A host dispatch runs 65,535, and the argument clamp cut the record there, so the last tiles of the list, the bottom of the screen, were never written. About 1.2 such records a frame.

Commits

  1. #976 as it is, cherry-picked onto 4aa6e8c with MoscaLosca as author (two conflicts, both "keep both sides"). This branch is stacked on it; if #976 is merged first this commit drops out.
  2. Ours:
    • For a program that reads its group id, the argument clamp writes each indirect compute record VICTORY_GROUP_PIECES times (2 by default, at most 16), piece p holding clamp(x - p * 65535, 0, 65535) groups, and the execution is recorded once a piece with that piece's group base (USER_GROUP_BASE). No count is read back. All pieces of a record charge the list's budget as one.
    • The translated program adds the base to its group id only. In #976 it is added to the thread id in the group as well (both go through the same helper), so a program reading its thread id in the group reads it too large by the base in every piece after the first.
    • Still cut, and counted on the frame line: a record of a program that reads no group id, a record asking for more than all its pieces run, and everything with VICTORY_GROUP_SPLIT=0.
    • On this base only the clamp where the record runs needs it: a dispatch record is never served from a window and never gathered (VICTORY_INDIRECT_GATHER=1), so the gather pass gets one piece and is otherwise unchanged.

Measured (in our tree, Steenax6/VIctory-NVID ac7664d, RTX 4070 Ti)

The largest count asked for is 74,816; the records over the limit run whole and the band is gone. No cost in frame time (88.7 ms with two pieces, 87.6 with one).

What I can and cannot say for this tree

  • Compiled and linted on 4aa6e8c: both clippy runs of the CI give exactly the warnings main gives, none new. cargo test --workspace --locked: victory-shader passes with the extended group-base test, and a new WARP test runs a record of 70,000 groups in two pieces and in one. Failing and not from this change: xtask repository_passes_policy (two files under diagnostics/ on main are over the size limit) and one of two WARP tests in watch.rs / inplace.rs, a different one in each run.
  • Not run with the title on this base. Our tree clamps hoisted in the list prelude as well; that machinery is not brought along, so the code here is the same idea written against this tree's clamp, not a copy of what was measured.
  • The translator changes, so every shader is translated again on the next start.

🤖 Generated with Claude Code

<!-- greyfinch-sync:fxceless/victory-fork:issue:6616698028 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1222). Originally posted by [Steenax6](https://github.com/Steenax6) on 2026-11-26T00:30:24Z. --- ## What #976 (MoscaLosca, open) runs **direct** dispatches of more than 65,535 thread groups in pieces. This adds the **indirect** case, which is the one we hit, and one correction to the translated program. In the first room a band along the bottom of the picture held stale blocks, old tiles of earlier frames, in the scene target and in several history targets (it looks like HUD garbage; it is not HUD). A compute pass of the title's indirect lighting is run by an indirect record that asks for about 74,816 thread groups in x. A host dispatch runs 65,535, and the argument clamp cut the record there, so the last tiles of the list, the bottom of the screen, were never written. About 1.2 such records a frame. ## Commits 1. **#976 as it is**, cherry-picked onto 4aa6e8c with MoscaLosca as author (two conflicts, both "keep both sides"). This branch is stacked on it; if #976 is merged first this commit drops out. 2. **Ours:** - For a program that reads its group id, the argument clamp writes each indirect compute record `VICTORY_GROUP_PIECES` times (2 by default, at most 16), piece p holding `clamp(x - p * 65535, 0, 65535)` groups, and the execution is recorded once a piece with that piece's group base (`USER_GROUP_BASE`). No count is read back. All pieces of a record charge the list's budget as one. - The translated program adds the base to its **group id only**. In #976 it is added to the thread id in the group as well (both go through the same helper), so a program reading its thread id in the group reads it too large by the base in every piece after the first. - Still cut, and counted on the frame line: a record of a program that reads no group id, a record asking for more than all its pieces run, and everything with `VICTORY_GROUP_SPLIT=0`. - On this base only the clamp where the record runs needs it: a dispatch record is never served from a window and never gathered (`VICTORY_INDIRECT_GATHER=1`), so the gather pass gets one piece and is otherwise unchanged. ## Measured (in our tree, Steenax6/VIctory-NVID [ac7664d](https://github.com/Steenax6/VIctory-NVID/commit/ac7664d), RTX 4070 Ti) The largest count asked for is 74,816; the records over the limit run whole and the band is gone. No cost in frame time (88.7 ms with two pieces, 87.6 with one). ## What I can and cannot say for this tree - Compiled and linted on 4aa6e8c: both clippy runs of the CI give exactly the warnings `main` gives, none new. `cargo test --workspace --locked`: `victory-shader` passes with the extended group-base test, and a new WARP test runs a record of 70,000 groups in two pieces and in one. Failing and not from this change: `xtask` `repository_passes_policy` (two files under `diagnostics/` on `main` are over the size limit) and one of two WARP tests in `watch.rs` / `inplace.rs`, a different one in each run. - **Not run with the title on this base.** Our tree clamps hoisted in the list prelude as well; that machinery is not brought along, so the code here is the same idea written against this tree's clamp, not a copy of what was measured. - The translator changes, so every shader is translated again on the next start. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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/1222:upstream-pr/1222'
git switch 'upstream-pr/1222'

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/1222'
git switch 'upstream-pr/1222'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1222'
git switch 'upstream-pr/1222'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1222'
git switch 'main'
git merge --squash 'upstream-pr/1222'
git switch 'main'
git merge --ff-only 'upstream-pr/1222'
git switch 'main'
git merge 'upstream-pr/1222'
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
fxceless/victory-fork!1219
No description provided.