GPU: skip pipeline demand for empty compute dispatches #2556
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!2556
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2556"
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?
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 15:40 UTC · original
andrewpozdnakov7-jpg:codex1/empty-compute-dispatch→main· +38 −0 · 2 files · 3 commits · openA compute dispatch with a zero group count on any axis has no shader work. Through both
DispatchandDispatchX, VIctory still requested the pending pipeline and could wait for it or count the command as dropped. Skip the empty grid before pipeline lookup. D3D12 dispatch argumentsThe same synthetic pipeline-demand test fails on
da82e444ec46a162ca779c82d4cf191a69182971and passes on1fe443d75b3a41b64c50ff95b583c323024ae131. Zero X, Y and Z leave the pipeline unused with the patch. A nonempty control still requests it.Windows/WARP GPU suite passed with 199 passed and 1 ignored under both D3D12 debug flag settings. Strict GPU Clippy passed with default and all features, and the asset policy passed. AI-assisted.
GitHub CI passed the GPU crate tests. The shader test
heap_direct_texture_reads_mark_their_heap_indexfailed at the same WARP assertion on both the PR and the unmodified base. Base CI · PR CIPlease preserve Git authorship if cherry-picking. If this is folded into another commit, please include the trailer below.
Co-authored-by: andrewpozdnakov7-jpg [email protected]
Coordination claim
67e8ae1401' into codex1/2556-current-ci 7101dc4de9@Marvisak on GitHub · 2026-11-25 18:38 UTC · original · edited 2026-11-26 00:24 UTC
Automated triage for the maintainers.
Merge candidate. Re-reviewed after the rebase (
301b753, merges cleanly into currentmain).State::dispatch(crates/victory-gpu/src/draw.rs) now returns before the pipeline lookup when any group count is zero. Such a dispatch launches no work (see the D3D12 dispatch-argument documentation linked in the PR), so it no longer waits for a pending pipeline or counts as dropped. The skipped steps (bind, the diagnostics probes) only prepare for work that would not run, and the next dispatch binds again. The new test inpipeline/make.rschecks that zero X, Y and Z leave a pending pipeline unrequested and that a 1x1x1 dispatch still requests it. CI:checkpassing.Generated by Claude Code
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 22:32 UTC · original
I resolved the conflict with #1320 in 301b753. Both tests are retained.
With the same WARP fixture on
f3578e3, the pipeline is marked as requested after the first zero-sized dispatch. With this update it stays unrequested through zero X, Y and Z, then a1×1×1dispatch requests it. The upstream skip-queue test passes as well. The serial GPU suite passed 244 tests and ignored one in each D3D12 debug setting. Both strict Clippy modes and asset policy passed.Please retain the Git author on cherry-pick or rebase. If you fold the fix or test into another commit, please add this trailer.
Co-authored-by: andrewpozdnakov7-jpg [email protected]
@fuzeofficlal on GitHub · 2026-11-26 00:35 UTC · original
Code review and hardware + WARP verification at head
301b75364cadmerged cleanly ontomain(63bcca43c6a0):State::dispatchwhenx == 0 || y == 0 || z == 0runs beforepipeline::host_pipeline,self.bind(list, p, true),list.note_op, diagnostic probes, andDROPPED/DISPATCHEDcounters. Skipping empty compute dispatches leavesStatedirty flags andlist_boundcache coherent without stalling on on-demand shader translation or issuing unnecessary barriers/copies.VICTORY_D3D12_DEBUG=1, Rust 1.98.1):cargo xtask policy:191 files okcargo clippy --locked -p victory-gpu --tests -- -D warnings(default +--features diagnostics): 0 warnings--features diagnostics,VICTORY_D3D12_DEBUG=1,draw::tests list::tests pipeline::): 51/51 passed (includingzero_group_dispatches_do_not_request_a_pipeline)--features diagnostics,VICTORY_D3D12_DEBUG=1,draw::tests list::tests pipeline::): 51/51 passedLooks clean and ready to merge.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.