fix(shader): add the ordered count of a first active lane in the upper wave64 half #6258
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6258"
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 boykopovar/AnyPS5. Originally posted by erm14254 on 2026-10-15T08:11:26Z.
What
ds_ordered_countis emitted as a device-scope atomic add of one active lane's value. The amount was read with a 32-wide shuffle atfirst & 31, so when the first active lane of a wave64 wave sits in the upper half, the lower half's lane was added instead. The amount now comes from the wave64Shufflehelper, which reads the first active lane in either half.Tests:
agc_driver_gds_append_consumegains ordered runs whose first active lane is in the upper half, with M0 set, and checks that inactive lanes stay untouched and that waves see sorted bases;agc_wave_control_decoderecompiles the ordered code for 32-wide hosts;agc_driver_pm4covers the ordered-append modifiers on indirect dispatches (0x49accepted,0x51refused).Tested
Windows 11 (10.0.22631), RTX PRO 6000 Blackwell, NVIDIA 597.16:
agc_driver_pm4,agc_wave_control_decodeandagc_driver_gds_append_consumepass. Linux, lavapipe:agc_driver_pm4andagc_wave_control_decodepass, the GDS test skips without a device. Code Violet (PPSA26528) gets past its first ordered-append dispatch with this and reaches its title screen together with the other pull requests listed in its bring-up thread.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by erm14254 on 2026-10-15T13:11:52Z.
Manual overlap review for the list above, against each pull request's current diff:
SpirvMemoryInstructions.cpp: #4423, #4424, #4520, #4521, #4522, #4523, #4566, #4599, #4718, #4740, #4749, #4760, #4813, #5021.LoadSubwordInBoundsandConstructU32Composite.AppendConsume: the result shuffle (EmitSubgroupShuffletoEmitLaneShuffle).This PR changes the ordered amount read earlier in
AppendConsume, separated from that hunk by unchanged lines, so the two merge in either order. No overlap, noDepends on.Imported from boykopovar/AnyPS5. Originally posted by erm14254 on 2026-10-16T17:34:40Z.
Manual overlap review for #6901: its changes to these four files are line endings only. Its copies of
Pm4.cpp,WaveControlDecode.cpp,GdsAppendConsume.cppandSpirvMemoryInstructions.cppare identical to its merge base once the carriage returns it adds are stripped; it converts every file in the repository the same way (+515,598 −513,181). No overlap, noDepends on.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T18:52:27Z.
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.
main)core/libs/prx/libSceAgcDriver/tests/WaveControlDecode.cppL106core/libs/prx/libSceAgcDriver/tests/execution/GdsAppendConsume.cppL29-30, L52-53, L206, L208Some 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.
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvMemoryInstructions.cppcore/libs/prx/libSceAgcDriver/tests/Pm4.cppcore/libs/prx/libSceAgcDriver/tests/Pm4.cppcore/libs/prx/libSceAgcDriver/tests/Pm4.cppcore/libs/prx/libSceAgcDriver/tests/Pm4.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvMemoryInstructions.cppImported from boykopovar/AnyPS5. Originally posted by erm14254 on 2026-10-16T19:23:53Z.
Manual overlap review for #5021: in
SpirvMemoryInstructions.cppit now carries the same single hunk as #3891 in the first review above, the result shuffle at the end ofAppendConsume(EmitSubgroupShuffletoEmitLaneShuffle), identical line for line. A three-way merge of that file with this PR is clean and keeps both changes. No overlap, noDepends on.Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-17T13:10:10Z.
Intel and AMD Windows data: this fixes the upper-half case on an Intel UHD 770. On an RX 9070 XT the case passes with and without it.
Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built,
ANYPS5_NO_SHADER_CACHE=1, serial CTest. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, withVkCacheemptied first. "Without" means this PR's test files onmainc9e6c45de, with none of its other changes.411ce81a6merged intomainca82d7d88:agc_driver_gds_append_consume,agc_wave_control_decodeand the 13agc_driver_pm4*tests, ×3agc_driver_gds_append_consume, ×3wave64 64 threads, 40 active ds_ordered_count with M0 7 from lane 40 of each wave: GDS counter 0 is 1011, expected 1043The RX 9070 XT runs 64-wide subgroups (the UHD 770 runs 32-wide), and there the new case passes without the fix too. So the UHD 770 is the device here that exercises the fixed path.
Full CTest (
--parallel 4) onmainc9e6c45dewith seven open GPU PRs merged (#6258, #6657, #6324, #6246, #6174, #6360, #6598): UHD 770 1381 of 1389, RX 9070 XT 1383 of 1389.mainalone passes 1378 of 1385 and 1381 of 1385. The merge adds only two failures:agc_buffer_pool(#6174, both GPUs) andagc_driver_indirect_dispatch_limit(#6360, RX 9070 XT).AI-assisted: yes (Claude Code)