GPU: DispatchMesh with no groups in a dimension runs nothing, and its group counts are not multiplied #2300
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2300
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2300/head"
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?
@denkencar-sketch on GitHub · 2026-11-25 10:05 UTC · original
denkencar-sketch:fix/list-004→main· +16 −1 · 1 files · 1 commits · closed without mergingSummary
DispatchMeshmultiplied its group counts, which overflowedu32for large counts, and a zero y or z still dispatched x groups. A dispatch with no groups in a dimension now runs nothing and the counts are not multiplied.Testing
Test
mesh_dispatches_with_overflowing_or_zero_groups_do_nothingfails onmain(overflow abort) and passes with this change.cargo test --workspace --lockedpasses apart from known flakes:modules::dstorage::tests::a_page_list_filled_after_its_request_startsfails now and then onmaintoo, and so does a parallel-run flake invictory-gpu's lib tests (watch::anddescriptor::host::tests, 2 of 40 runs on pristinemain).Not covered by an assertion: the zero-group early return (
(16,0,1)and(0,1,1)also pass onmain). Not tried: a run in the game.AI-assisted.
@Marvisak on GitHub · 2026-11-25 15:20 UTC · original
Automated triage for the maintainers.
Merge candidate (worth a look). In
crates/victory-gpu/src/list.rs,state::dispatch_meshused to warn only wheny * z != 1and then always calledState::dispatch_mesh(list, x), which recordsDispatchMesh(x, 1, 1), so a title call with y or z set to 0 still ran x groups. D3D12 documents that a 0 in any dimension dispatches nothing, and this PR now returns early in that case; it also drops they * zproduct, which aborts in a checked build when it overflows. I checked that the early return comes before any host state is touched, thatcount_drawstill counts the call, and thatDispatchMeshXis unaffected.Small note: the new test only catches the overflow abort; as the description says, the zero-group calls also pass on
main, so the early return itself is not tested. CI: passing.Generated by Claude Code
@Marvisak on GitHub · 2026-11-25 22:08 UTC · original
Automated triage for the maintainers, second look (a review against current
main, with builds and tests where they could change the verdict).Closing as a duplicate of #2014, which makes the same change to the same function and tests the zero-dimension cases as well as the overflow. The change itself is right.
If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.
Pull request closed