Repository navigation
Conversation
…reductions logged Two world runs on an RTX 5070 hung (device removed) in the same indirect dispatch of a loop-free culling program whose arguments another pass writes (meshlet culling; DRED stops at it). The clamp let a dispatch of 2^20 groups through, and the list budget counted every group as 64 threads. - A dispatch now runs at most 2^16 groups (mesh dispatches likewise). - The budget counts each program's own threads per group (numthreads, or a mesh program's lanes), read from its native program once. - Each record the clamp reduces is written to the list's budget buffer (up to 31 a run); before the list's next submission the host logs them at info, "indirect arguments clamped", with the program's hash, the kind and the arguments read and left (the first three per program and kind, then every hundredth, at most 300 lines). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 626b328) (cherry picked from commit bface5a)
…un folded The console runs more than 65,535 groups along x; the host does not, and the indirect clamp cut such dispatches to 65,535 (in the world on an RTX 5070: the indirect diffuse lighting's final gather asks for about 115,000, so 43% of it never ran). Such a dispatch (y and z of 1) now runs folded: rows of 65,535 groups along z, and a second dispatch for the rest. A compute shader that reads its group id reads a fold root constant (b1 in the user-data space, one dword; every compute root signature has it, 0 unless folded): non-zero, it is the first group the dispatch runs plus one, the group is that plus x plus z rows, and z reads 0 (`GROUP_FOLD_ROW`). - Direct dispatches fold on the CPU (two Dispatch calls with the constant). - Indirect ones (one uncounted record) fold in the argument clamp: it writes the count and the records (constant, then x, y, z) to a region of the list's fold buffer, executed with a command signature of the constant and a dispatch. Up to 2^22 groups fold; the budget still bounds the work. - The test host's compute root signatures have the constant too (set to 0 unless a dispatch's roots set it). Test: emit::fold_tests on the RTX 5070 and WARP (groups as given, a folded remainder from group 100, and two rows: groups 0, 1, 65535, 65536). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 365802a)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two commits, on fork main f0df6a5.
1. Indirect argument clamp.
World runs 17 and 18 on the RTX 5070 hung, both times in the same indirect dispatch: a loop-free meshlet-culling program whose arguments another pass writes. The old clamp let 2^20 groups through, and the budget counted every group as 64 threads.
numthreads, or a mesh group's lanes.indirect arguments clamped, with the shader, kind, read and left values. The first three per program and kind are logged, then every hundredth, at most 300 lines.2. Folded dispatches.
GROUP_FOLD_ROW): rows of 65,535 groups along z, then a second dispatch for the rest. No padding groups.b1in the user-data space, one dword. Every compute root signature has it; it is 0 unless the dispatch is folded.Dispatchcalls with the constant.[root constant, dispatch].Tests
Windows 11, RTX 5070, AMD CPU.
emit::fold_tests::folded_dispatches_number_groups_as_the_consolepasses on the RTX 5070 and on WARP. Cases:fxc(cs_5_1).cargo clippy --workspace --all-targets -- -D warnings: clean.-p victory-gpu -p victory-shader --all-features: clean.cargo test --workspace --no-fail-fast -- --test-threads=1: 712 passed, 7 failed. The same 7 fail on fork main itself on this RTX 5070, and none is new: 2 victory-gpu heap tests that assume heaps of HEAP_VIEWS (NVIDIA caps at 10^6), 2 PSV0 container checks, 2 stride tests and 1 gather test.Not tested
ExecuteIndirectin the tests. The next world run is that test. The "indirect arguments clamped" lines for the final gather should stop.AI-assisted (Claude Code).
🤖 Generated with Claude Code