Repository navigation
Dispatches past the host's group limit run in pieces, each told where its groups start - #976
MoscaLosca wants to merge 1 commit into
Conversation
… its groups start The title asks some passes for more thread groups in x than the host runs in one dispatch (65,535), and the groups after it were lost, or the count itself went to the driver, which has no duty to survive it: - Dispatch, DispatchX and DispatchMesh are run as pieces of at most 65,535 groups, and the translated program adds the piece's first group to its group id (SV_DispatchThreadID and 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, an Other root kind after USER_VIEW_BIAS), bound at 0 by every bind and set again before each piece from the second on. VICTORY_GROUP_SPLIT=0 turns it off. - A dispatch past the limit whose program reads no group id is clamped to 65,535 with a note (its ids cannot move), where before the whole count went to the driver. - A group count that arrives in GPU memory (the indirect light pass's compute record of about 77,500 groups, run 200) is still clamped, now counted as well: the clamp notes the largest group count its compute records asked for (budget words 12 and 16, beside the mesh notes at 4 and 8), and the frame line reports it, so the next run measures what the cut-off costs. Built and unit-tested (the program that reads its group id is checked to read the base with the split on and not with it off); not yet seen in a run of the title.
|
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, 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. |
|
I reproduced a local-ID regression on Restricting the addition to DXIL 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. |
What
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.