Repository navigation
fix(shader): give the frontend's call analysis the dispatch's wave size - #7816
adriadam10 merged 1 commit into
Conversation
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
About the overlap with #6679: it shares only the neighbouring condition in |
|
AMD and Intel Windows data: with this PR's test changes, three Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built,
AI-assisted: yes (Claude Code) |
|
Thanks for testing this on AMD and Intel Windows. That covers the hardware and OS my description listed as not tested, and the three failures without the change match the ones I saw. |
|
First AMD-on-Linux (RADV) run of this PR. Merged onto AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3, Release. Full suite ( Comparing the JUnit output with This checks correctness only; I did not measure performance. GPUs tested: AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 / kernel 7.0.0-38 AI-assisted: yes |
AcquireFrontend built the frontend's SwappcInfo with a wave size of 0, while the driver's LinkUserDataCallees passes the dispatch's wave size. A wave64 v_cmp_e64 that reuses a call's link pair after the return, followed by a v_cndmask_b32_e64 that reads it, was refused as escaping the call/return model. The frontend now receives the dispatch's wave size, and a frontend built for one wave size is not reused for another.
f976e22 to
9863f8b
Compare
|
Checked the wave size wiring against |
What
AcquireFrontendbuilds the frontend'sSwappcInfowith a wave size of0u, while the driver'sLinkUserDataCalleespassesrequest.context.waveSize(ShaderRegistry.cpp). The call analysis uses that value in three places:writesScalarandoverwritesScalar(how many SGPRs a VOPC or VOP3 mask write covers) andreadsScalarDword(how many av_cndmaskmask read covers). With 0, a mask write is counted as one SGPR and a mask read as two. In wave64, av_cmp_e64that reuses a call's link pair after the return, followed by av_cndmask_b32_e64that reads it, is then refused as escaping the call/return model, because the second link SGPR still looks like it holds the return address.AcquireFrontendnow passesrequest.context.waveSize.PreparedControlFlow::Matchescompares the wave size, since the analysis depends on it. A frontend built for one wave size is not reused for another.ShaderMemory.cpptreated the wave size as translation-only state that must not change the frontend identity. They now expect a different wave size to miss (the case reported on #6191).verifyFrontendWaveSizeCalls: a call whose link pairs[14:15]is overwritten by av_cmp_eq_u32_e64and then read by av_cndmask_b32_e64, acquired as wave32 and wave64.Marvel's Wolverine (PPSA03671), the refusal this fixes (Linux,
mainc4c2b3a with #7395 and local patches, this change reverted):Header of that request (
agc_shader_replay): 816 code words, 16 user data, 2 memory regions, wave64; compute threads 64x1x1, partial groups 36x1x1.Tested
BUILD_TESTING=ON, onmain408455b. The test is a CPU test, no GPU is involved.agc_shader_memory_tests --frontend-pair, run directly:APS5_NO_PERF_FRONTEND_PAIR=1;verifyFrontendWaveSizeCallsrun first: fails withscalar call link register s[14] written at program counter 0x00000000 escapes the constant-offset call/return model (used at program counter 0x0000000c), the same refusal as the title's.^agcsuite; AMD and Intel hardware; Windows.Checklist
main(408455b); no other open PR implements the same functions (fix(shader): link a table call whose descriptor load sits before its loop #7413 changes the call analysis and its tests inGraphBuilder, not this wiring)NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file (none added).mdfiles or images added to the repository