Dispatches past the host's group limit run in pieces, each told where its groups start #976
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!976
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-976"
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?
@MoscaLosca on GitHub · 2026-11-25 14:30 UTC · original
dispatch-group-split→main· +263 −36 · 8 files · 1 commits · closed without mergingWhat
A dispatch that asks for more thread groups in
xthan the host runs in onedispatch (65,535) used to lose its tail, or hand the whole count to the driver.
Now:
Dispatch,DispatchXandDispatchMeshrun as pieces of at most 65,535groups. The translated program adds the piece's first group to its group id
(
SV_DispatchThreadIDand the mesh stage's group are built from the same op,so all of them move with it). The dword is one the host computes
(
USER_GROUP_BASE, anOtherroot kind afterUSER_VIEW_BIAS): bound to 0by every
bind, set again before each piece from the second on.65,535 with a note, instead of the whole count going to the driver.
77,500 groups in
x) is not fixed: its count arrives in GPU memory, andsplitting it would need the host to read each record's count, or a per-record
group base the argument buffer does not carry. The clamp now counts these too
(budget words 12 and 16, beside the mesh notes at 4 and 8), and the frame
line reports the largest group count asked for, so the next run measures what
the cut-off costs and whether the indirect split is worth building.
VICTORY_GROUP_SPLIT=0restores the old behavior.Status
with the split on and not with it off (
victory-shader, 172 passed;victory-formats25).blake3/pure, also withdiagnostics).translator sources (build.rs), so nothing to clear by hand.
a dispatch asks for more groups in x than the host runs: it runs in pieces(the fix working, with the number of pieces),... and its program reads no group id(an over-limit dispatch notrecoverable), and the frame line's
indirect compute dispatches: the largest group count asked for ....README and
docs/fork-ray-tracing.mdupdated, including the honest status.@SantannaCarlos on GitHub · 2026-11-25 14:33 UTC · original
This and #834 are two halves of the same mechanism: #834 runs the indirect compute records past 65,535 groups in x as a second execution, this one splits direct and mesh dispatches. Both add a host-set dword,
USER_GROUP_BASEat0x104, to the group id in x where a program reads it, and both leave it at 0 everywhere else.So if both go in, they should keep one constant and one lowering: resolving the conflict by keeping both lowering blocks would add the base twice. With one lowering, the host side of each is unchanged (this one sets the dword per piece of a direct or mesh dispatch, #834 sets it around the second indirect execution). I can rebase #834 onto this one if it lands first.
@avt0m4t48 on GitHub · 2026-11-25 14:59 UTC · original
I reproduced a local-ID regression on
23affc7.compute_idaddsUSER_GROUP_BASEto the X component of bothgroupIdandthreadIdInGroup. The synthetic shader writes both values to fixed output offsets. WARP returns the expected[0, 0]at base 0. At base 65,535 it returns[65535, 65535]instead of[0, 65535]. Derived indices and local groupshared indexing can then use a shifted local ID.Restricting the addition to DXIL
groupIdfixes both readbacks. A shader that only reads its local ID also stops gaining group-base metadata. The fixture sets the piece base directly and exercises shader lowering and GPU readback. The host's command loop was checked separately in source, including piece boundaries, root indices, and the following zero-base bind. I did not run a retail dispatch.The README's coverage sentence should also reflect the host fallback. The current host truncates an oversized dispatch when the shader lacks group-base metadata. A shader that reads no group X can still need every group to run, for example to contribute to an atomic counter.
WARP reproduction · Corrected Windows suite · Small candidate patch
AI-assisted using Codex.
Pull request closed