metal: an indirect dispatch or mesh dispatch of more than 2^22 groups runs nothing (#79) #383
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/383"
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?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T15:33:43Z.
Refs #79. Tarraga's claim there covers splitting submissions into pieces; this is a different cause.
What stops world runs here. On an M5 Pro 48 GB, Series S, headless, main
905e7aad, all 5 of 5 runs stopped between +110 and +190 s.kIOGPUCommandBufferCallbackErrorTimeoutis a wait. The kernel logs(IOGPUFamily) Cmd queue … sleep port_name … value: v timed out!5 s after the stall, andvis the value ourencodeWaitForEventwaits for (the queue's order event, or a piece event withVICTORY_PASSES_PER_BUFFER). The failed command buffer is the one behind a command buffer that never ends.What never ends. An ExecuteIndirect dispatch whose record the GPU read as [510, 1182027346, 1314076063] (compute
0af6bb55602abf70).eee76bf6265f33bbstores [0, 1, 1] into 25 dispatch records, but it is dropped: "a cross-lane operation between host waves in divergent code".Change. Every indirect dispatch and indirect mesh dispatch goes through the Metal gate. A record of more than 2^22 groups in all runs nothing, and the first cases are logged. The limit is on the product of the counts, not 65,535 per dimension: other ports report the title asking for more than that in x on larger targets (not measured here).
Runs with the limit: 5 of 6 had no GPU error (170–300 s). One stopped at +126 s with every dispatch count sane; mesh dispatches weren't gated in that run, and its cause isn't found yet.
VICTORY_PASSES_PER_BUFFER=1doesn't protect against a pass that never ends (3 runs).Traces, behind existing switches:
VICTORY_TRACE_GPU_FAILS: pieces, the record at encode time, and the counts the GPU read;VICTORY_TRACE_DISPATCH_FLAGS: the first three indirect dispatches of each pipeline;VICTORY_TRACE_RECORD_WRITERS=<hashes>: dispatch records.Tests:
an_indirect_dispatch_past_the_most_groups_runs_nothingand victory-gpuan_indirect_mesh_dispatch_past_the_most_groups_draws_nothing. Both fail without the change.buffer_atomic_cmpswap, which had none. They pass before and after.Checks: victory-hle, victory, victory-gpu, xtask and victory-metal tests pass (arm64). Windows clippy is clean with
-D warnings, andcargo xtask policypasses (385 files).Also measured: each command buffer that attaches the heaps' residency sets costs about 0.35 s of kernel time (the
slowlines underVICTORY_TRACE_GPU_FAILS). That's about the world's 1.3 fps.Not in this PR: the Windows D3D12 host has no such limit. The real fix for those passes is translating
eee76bf6265f33bb.@LakshanSivakumar, this is ours, so it needs your approval and merge.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T16:15:10Z.
The guard (
f2b476da) is on main as part of4cf84c83, merged with the maintainer's push. After merging main, this branch has no remaining difference, so I'm closing it. Thanks!Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T16:15:37Z.
Merged in
4cf84c83(your commitf2b476dais on main; the later head only merges main in, so nothing else is left). Tests, Windows clippy, policy and a release build passed, and a 170 s headless game run of that tree entered the world and kept presenting to the end with 0 GPU errors. Closing since it is fully on main. Thanks.Pull request closed