Split wide indirect dispatches on 32-lane GPUs #10
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!10
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-10"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@gomeaw on GitHub · 2026-11-25 23:18 UTC · original
gomeaw:fix/portable-wide-dispatch→main· +445 −18 · 7 files · 5 commits · draftWhat this addresses
On NVIDIA, this fork clamps indirect compute dispatches at 65,535 groups in X. Larger dispatches can miss the last lighting tiles and leave stale pixels. Related fxceless/victory-fork#834 includes world reports of this artifact on RTX cards. This adapts Carlos Sant'Anna's patch to this fork and preserves its commit attribution.
Change
With
VICTORY_DISPATCH_SPLIT=1on a 32-lane host, a single indirect compute record without a count buffer can run up to 131,070 groups in X. The two executions share the original budget. Only shaders that read the X group ID receive the extra root dword. The host sets it before the second execution and clears it afterward. The opt-in path bypasses the batch clamp for eligible calls so the tail executes next to the first part.Verification
WARP ran the translated shader at group bases 0 and 65,535. The indirect fixture checked each group once across eight cases, including an 89,968-group workload, the upper cap, Y/Z coverage, and budget rejection. With splitting disabled, the fixture stops at 65,535. Windows validation
The native lowering test also checks that a 64-lane host gets no new group-base constant.
The replay regression verifies that skipping clamps copies both argument records. Replay clamp batching keeps lists with split dispatches in their recorded form.
The translator and pipeline cache keys now include the effective dispatch split setting. The regression test distinguishes on and off for wave32 and verifies a stable key for wave64. Thanks to sawetco for reproducing the collision and verifying the key strategy on an RTX 5070. Hardware cache investigation Windows regression check
For gameplay validation, compare the same checkpoint with and without splitting on a 32-lane GPU. The effect on frame time is unmeasured on this fork.
scripts\play.ps1can pass the switch through-More @{VICTORY_DISPATCH_SPLIT='1'}.AI-assisted with Codex. The tests use synthetic shaders and buffers.
@sawetco on GitHub · 2026-11-25 23:31 UTC · original · edited 2026-11-25 23:59 UTC
I found a shader-cache collision while testing
d78024bon an RTX 5070, driver 621.24. It can mask the result of the proposed gameplay A/B if both runs reuse a cache.For one compute shader, these are the first 12 hex digits of the SHA-256 of its cached translation:
VICTORY_DISPATCH_SPLIT=022b1d00c958bVICTORY_DISPATCH_SPLIT=104b0f3aa1ca022b1d00c958bBoth fresh translations used the same cache filename. You can also see the missing discriminator without game data: on this card
victory warm --limit 0 --jobs 1in two new processes printed the same fingerprint (82b4540fbd80e731) with the switch set to 0 and 1.I tested a fix in
crates/victory-shader/src/emit/lower.rs: extendhost_settings()to[u32; 5]and appendu32::from(split_group_base()). The shared cache then held two entries, and the enabled translation matched a fresh enabled cache byte for byte. The pipeline fingerprints also separated. A regression test using the existing host-wave overrides confirms that toggling changes the key on wave32 and preserves it on wave64. The existing group-base test still passed on WARP.Until the key includes this setting, separate cache directories for off and on give a valid comparison. This check covers cache selection. In-game lighting is a separate measurement. AI-assisted test and report.
Retest on the published fix. I built an unmodified
b390945and repeated the same shared-cache test on the RTX 5070. The cache held one entry after off and two after switching on. Repeating on kept both entries, and the enabled entry matched a fresh enabled cache byte for byte.warm --limit 0now reports distinct fingerprints (a426f76508304e04off,c87a34a9996fa279on).In-game A/B. The gameplay executable was
d78024bwith the locally tested cache-key change and an input-only hook. Both runs used Series X, the published Safe settings, a copy of the same Jason house save, and their own 1,352 pretranslated shaders from identical inputs. Both started with an empty host pipeline library. For 30 seconds at the same porch railing, before any movement input, I measured host presents and sampled the composed window approximately every five seconds.With splitting on, the channel behind Jason showed a blue-gray water surface and reflections in the sampled views. With splitting off the same area was pale and looked exposed down to the bed. A faint wireframe around the head was still visible in one enabled sample. One run per setting, with pipelines still warming. This is an outdoor visual observation, and does not establish the cause of the water difference or an interior-lighting fix.
@MoonYueya on GitHub · 2026-11-26 05:28 UTC · original
Tested on an RTX 3080 10 GB, driver 32.0.16.1742, Ryzen 7 7700, 31.1 GB RAM, Windows 11 26300, merged into MoonYueya/VIctory-Kira
a3de053on top ofe2a28ectogether with the other open NVIDIA PRs (#47 #48 #24 #23 #78 #42 #66 #18 #10 #4 #58 #17).cargo test --workspace --locked --no-fail-fast -- --test-threads=1: 931 passed, 0 failed, 45 ignored after this PR was merged (never below the count before it; the branch started at 923).VICTORY_DISPATCH_SPLITis off by default, so the runs below do not exercise it.What this does not show: the PR was not run in the game on its own, so this is unit tests plus a combined run, not an in-game verification of this PR by itself; nothing here is about picture quality.
AI-assisted.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.