Repository navigation
xshader: accept uniform loops around compute swizzles for single-wave - #284
Conversation
81d591c to
5dcf365
Compare
|
Thanks for taking on the swizzle-in-loop refusals. I don't think this can merge as it stands: the translated loops can leave threads waiting at the exchange's barriers while other threads have already left. Why The new rule assumes every invocation runs a loop the same number of times when the group has at most 64 threads and the back-edge isn't
Small case (this PR merged onto It translates to: do {
tb_c2 = false;
j3 = j3 | ((exec_lo & 1u) == 0u);
tb_swizzle[tb_lane] = ((exec_lo & 1u) != 0u && !j3) ? v1 : 0u;
GroupMemoryBarrierWithGroupSync();
...
tb_c2 = (true);
} while (tb_c2 && !(j3) && ++tb_guard < 65536u);A thread with its EXEC bit clear leaves after this iteration; the others come back to the barrier without it. A lone On game shaders I took 28 recorded ProjectScarlett requests refused with I haven't run any of this on a GPU, so this comes from reading the emitted HLSL, not from an observed hang. What would make it work
Happy to look again, or to help with the vote if you'd like. |
|
That's true. There's a subtle problem and need you confirmation which direction to go. What changed in response to your commentI tightened the acceptance rule in
Everything else keeps the conservative refusal. That's the "keep refusing" half of your suggestion, implemented without touching the loop emission itself. Shortcomings — what's still wrongThe tightened rule removes the obvious hazards but does not close the loop-exit hole, which I confirmed by tracing the emitted HLSL of an accepted game shader. What still happens:
So the accepted set is smaller than it was, but it is not yet sound. What I need from you
So, it's not really clear which option is the best for now. |
|
Okay, nvm, seems like solution was found. Will get back soon. |
668c90d to
cce9ada
Compare
|
@brcly, now all comments are addressed. Can you re-verify? |
cce9ada to
0877691
Compare
|
I rechecked the latest push (merged with
Suggestion: apply the vote only to the newly accepted single-wave swizzle loops, leave other loops' output unchanged, refuse the inverted conditions (or require all lanes to agree), and check that no shader is lost against This comes from translator output; I haven't run it on a GPU. |
0877691 to
4833731
Compare
|
Okay, this new version resolves few swizzle_loop shaders, 43 -> 40. Other shaders seem to be the same. Ran GPU tests, they passed. |
… groups Signed-off-by: Pavel Kirilin <s3riussan@gmail.com>
Signed-off-by: Pavel Kirilin <s3riussan@gmail.com>
4833731 to
a27ca0a
Compare
|
good work, my tests all pass! |
Summary
The shader translator refused any shared-memory swizzle inside a loop (a "compute swizzle inside a loop" refusal class hitting ~36 recorded ProjectScarlett requests). A single-wave group (32/64 lanes) with a uniform back-edge — SCC, EXEC, or unconditional — makes the exchange run the same number of times for every invocation, so it translates now; divergent VCC loops and multi-wave groups keep the conservative rejection. Added three tests plus a loop fixture. Verified on the 36 affected real requests (all now translate or refuse for other reasons) and the full check --no-gpu suite.
Verified on Lanes
A pull request is not merged until Lanes passes on a GPU. Run:
python tuxbox.py checkpassed on this branchGPU, driver and backend:
Paste the summary printed at the end:
Checks
CI runs the Python unit tests, the shader compiler, DXBC, and XG layout tests, and a Windows typecheck of
tuxbox-d3d12.If this pull request changes evidence JSON, regenerate the results table and the progress map and include both files:
python tuxbox.py status > docs/RESULTS.md python tuxbox.py status --svg docs/progress.svg