Repository navigation
GPU: scale indirect Wave64 dispatches in list-owned arguments - #11
Conversation
|
Thanks for this. I reviewed it, built it, and ran it on an RTX 5070, a Radeon iGPU and WARP. Short version: the scaling is correct, but I am not merging it into What holds up The scaling in the clamp shader (clamp x to 65535, multiply only when
Why not as is
Two things that are not this PR's fault but came out of the review: Marvisak#242's unwritten-arguments path reads the title's buffer through a root SRV, which leaves it in a read state for the rest of the list (a later UAV writer in the same list would be formally invalid; results were correct on all three adapters here, and the debug layer is not installed on this machine, so I could neither confirm nor rule that out). And on the Radeon iGPU a multi-record indirect dispatch ran only its first record in every case tried, with or without this PR's code; I will look at that separately. What I suggest The base has moved: All tests here were synthetic. The title was not used in these tests. AI-assisted (Claude Code). |
b3c2052 to
bccc358
Compare
|
Thanks for the review. Updated in
AI-assisted implementation and testing. |
|
Thank you for reworking it so quickly; The fault (RTX 5070, driver 616.92). A probe that only calls budget.InterlockedAdd(0, 0, used);
[allow_uav_condition]
while (true) { ... budget.InterlockedCompareExchange(0, used, used + cost, observed);
if (observed == used) break; used = observed; }Every active record contends on one word and one thread wins per round. Your tests never put more than 3 records in a pass. To be clear about where this comes from: my own What checked out
What I would change, besides the loop
Smaller: one expected value depends on record 3 winning the budget race against record 4; a test registers a stack array as the title buffer; the test pipeline helper polls for 10 s. If you rework the budget step, please do not test large record counts in a loop on your own card: one run, and check the System log for All tests synthetic. The title was not used in these tests. AI-assisted (Claude Code). |
bccc358 to
2ab8b25
Compare
|
@r4tedx Updated to
Locked workspace tests had 387 passes, zero failures and six ignored. Both CI Clippy commands passed. Rustfmt found existing differences with no new hunks. The single RTX stress run recorded five rewrites in one list, including 6,000 active records. Two fit the budget, scratch grew once, and the System log showed zero new AI. |
|
@r4tedx One edge case I spotted after posting the update. If an ordinary compute pipeline isn’t ready, AI. |
|
Third round, at The many-record case now runs on the RTX 5070. One run, through The earlier findings
Both CI clippy commands are clean; What is left before I merge it
Two notes, not requests: each k > 1 indirect dispatch now costs at least three dispatches and four UAV barriers, and the 2^20 cap now counts host groups (2^20 / k console groups). Both are fine by me; the second deserves a line in the doc. With those in, I will merge it into All runs synthetic. The title was not used in these tests. AI-assisted (Claude Code). |
2ab8b25 to
37b4070
Compare
|
@r4tedx Updated in one commit,
The probe passed on WARP and in one RTX 2080 SUPER run. The Windows System log had zero new AI. |
|
Merged into Final check at
Not covered by anything here: the D3D12 debug layer is not installed on this machine, so resource states are verified by reading only; and no test has a title count larger than the max. Neither holds the merge. This is now the indirect path of the multi-wave form on the branch, which a title report on Marvisak#439 says the cascade-shadow passes need (343 of 343 of them go through All runs synthetic. The title was not used in these tests. AI-assisted (Claude Code). |
e234090 bounded the split dispatch's compare-exchange loop at 1,024 retries. A 6,000-record stress test (added here) showed what that costs: on a Radeon iGPU (64-lane waves) only 2,771 of 6,000 small records were accepted with the budget almost untouched, because every lane of a wave expects the same value and only one wins each round. It never reached the RTX 5070. The pass now uses the scheme fork PR #11 measured with 6,000 records on an RTX 5070, a Radeon iGPU and WARP: word 0 keeps counting threads for the legacy clamp; a second word, in groups, takes one InterlockedAdd per record with a refund on refusal. Records cost at most 2^20 groups and batches are at most 63 groups, so the word stays below 2^32 with every refund pending. A first phase seeds it from word 0 and a last one writes the accepted groups back. Test: `split_dispatch_charges_thousands_of_records_exactly` (ignored by default, a GPU stress) runs 6,000 records through the pass and checks each output and the budget. For it, diagnostics builds take `VICTORY_D3D12_ADAPTER` (a substring of the adapter's description) to put the host device on another GPU, and say on stderr which device the WARP or named path chose. Untested at commit time: waiting for the machine's test queue (WARP, then the Radeon, then the RTX 5070). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rebased on the rebuilt
shader/wave-per-groupat7ae51da, which includes the current Marvisak#439 head. This adapts r4tedx’s831cdb3andfc57738fromtesters/indirect-wave-dispatchand removes the Marvisak#242 dependency.Compute indirect dispatches write packed records and the effective count into a list-owned buffer. The source and count stay available to later GPU writers. X scaling is overflow-safe, and the group cap and list budget account for scaled host work.
Verification
State::execute_indirectregression checks two counted dispatches, each with the original 384 lane values. Both passed on an RTX 2080 SUPER (621.01, Wave32). Forcingwaves = 1at the call site failed at lane 192 (expected 104, got 0).VICTORY_ADAPTERandVICTORY_WARPand selects native Wave64 on a compatible adapter. WARP passed the k=1 and k=2 GPU-written argument regressions and the scaled-limit and budget checks. Its four-lane device skipped the translated fixture. Native Wave64 hardware and in-game execution remain unverified.AI-assisted implementation and testing.