Skip to content

perf(shader): let spanned waves run at any host subgroup size where it can be narrower than 32 - #8004

Open
ThatsLeo wants to merge 2 commits into
boykopovar:mainfrom
ThatsLeo:feat/shader-spanned-any-subgroup
Open

ThatsLeo wants to merge 2 commits into
boykopovar:mainfrom
ThatsLeo:feat/shader-spanned-any-subgroup

Conversation

@ThatsLeo

Copy link
Copy Markdown
Contributor

What

#7922 spans a single-wave wave64 compute program over full 32-lane host subgroups, pinned with a required subgroup size of 32. On Intel that pin forces SIMD32, where every 32-bit value takes twice the registers of SIMD16.

Stray's (PPSA02101) dominant compute program 0x2011300000 is about 80% of the GPU time of a frame once it spans. ANV reports it as 81,332 instructions with 1,095 spills, 6,959 fills and 420 live registers at the peak.

On a device whose compute subgroups can be narrower than 32 lanes (minSubgroupSize < 32), a spanned wave now leaves the width to the driver:

  • Lane numbering. The lane is LocalInvocationIndex, which is the guest lane because a spanned module declares a 64×1×1 workgroup. It was SubgroupId * 32 + SubgroupLocalInvocationId.
  • Shuffles. A shuffle within a 32-lane half (EmitSubgroupShuffleInHalf) goes through the wave_exchange slots that full-wave shuffles already use. The barriers it adds are covered by perf(shader): span single-wave wave64 compute by default after a uniformity check #7922's uniformity check. Ballots, full-wave shuffles and the LDS lock loop were already independent of the host subgroup width.
  • Pipeline. SpirvEmitInfo::anySubgroupSize gives the artifact a host subgroup size of 0, so computeSubgroupSize requests no size and the pipeline is created with REQUIRE_FULL_SUBGROUPS | ALLOW_VARYING_SUBGROUP_SIZE. A 64-lane workgroup is a multiple of every maxSubgroupSize. Compute pipeline captures accept that pair of flags without a required size, and replay checks computeFullSubgroups for it.
  • Target. VulkanDevice sets the new SpirvTarget::spannedAnySubgroup only where spanning is on and minSubgroupSize < 32. NVIDIA (32 only) and AMD (32 or 64) keep the pinned 32-lane layout, where the in-half shuffle stays a subgroup shuffle. The flag is part of the cache key and of the serialized request, as version 38.

Tested

Intel Arc (Meteor Lake), Mesa 26.2.4 ANV, Fedora 44, Linux 7.2.10, GCC 16.2.1, Release.

GPU busy per present (ms) frame p50 (ms)
#7922 + #7811 179.0 / 176.8 / 175.7 (mean 177.2) 344.4 / 347.1 / 346.7 (mean 346.1)
#7922 + this PR + #7811 99.8 / 103.9 / 107.5 (mean 103.8) 284.7 / 275.8 / 282.7 (mean 281.1)

That is −41% GPU time and −19% frame time. Against main + #7811 in #7922's runs (303.4 ms GPU, 449.3 ms p50), the two PRs together are −66% and −37%.

trace_digest.py, first capture of each:

#7922:   frames 20:30 from present 20: 30 presents, frame p50 344.4 / p90 362.8 / p99 365.6 / max 365.6 ms, GPU busy 179.0 ms per present
this PR: frames 20:30 from present 20: 30 presents, frame p50 284.7 / p90 293.6 / p99 301.3 / max 301.3 ms, GPU busy 99.8 ms per present

aps5-summary.jsonl lines, #7922 + #7811:

{"commit":"128b8c1f83c0","dirty":false,"env":{"APS5_PLAYGO_UNLISTED_CHUNKS":"absent","APS5_TRACE_FRAMES":"20:30"},"gpu":"Intel(R) Arc(tm) Graphics (MTL)","driver":"Intel open-source Mesa driver Mesa 26.2.4","os":"Linux 7.2.10-200.fc44.x86_64","resolution":"3840x2160","window":{"spec":"frames 20:30","first_present":20,"ms":10402.197},"presents":30,"frame_ms":{"p50":344.354,"p90":362.838,"p99":365.594,"max":365.594},"gpu_busy_ms_per_present":178.992,"worker_busy_pct":{"queue worker 0x0":95.230,"queue worker 0x20":96.701},"top_phases_ms_per_frame":{"Driver.Packet":662.800,"Driver.Packet.memory_wait":311.063,"Driver.Packet.device_lock":196.200,"Graphics.Draw":118.353,"Graphics.Draw.draw_and_resource_release":117.932,"Recorder.Submit":110.774,"Driver.Packet.dispatch":72.540,"Driver.Dispatch":66.705},"trace_dropped":false,"trace":"aps5-trace-128b8c1f83c0-1108566.json.gz"}
{"commit":"128b8c1f83c0","dirty":false,"env":{"APS5_PLAYGO_UNLISTED_CHUNKS":"absent","APS5_TRACE_FRAMES":"20:30"},"gpu":"Intel(R) Arc(tm) Graphics (MTL)","driver":"Intel open-source Mesa driver Mesa 26.2.4","os":"Linux 7.2.10-200.fc44.x86_64","resolution":"3840x2160","window":{"spec":"frames 20:30","first_present":20,"ms":10438.627},"presents":30,"frame_ms":{"p50":347.138,"p90":357.715,"p99":395.051,"max":395.051},"gpu_busy_ms_per_present":176.764,"worker_busy_pct":{"queue worker 0x0":95.368,"queue worker 0x20":97.001},"top_phases_ms_per_frame":{"Driver.Packet":665.606,"Driver.Packet.memory_wait":310.399,"Driver.Packet.device_lock":200.406,"Graphics.Draw":120.733,"Graphics.Draw.draw_and_resource_release":120.266,"Recorder.Submit":110.327,"Driver.Packet.dispatch":74.144,"Driver.Dispatch":69.392},"trace_dropped":false,"trace":"aps5-trace-128b8c1f83c0-1111466.json.gz"}
{"commit":"128b8c1f83c0","dirty":false,"env":{"APS5_PLAYGO_UNLISTED_CHUNKS":"absent","APS5_TRACE_FRAMES":"20:30"},"gpu":"Intel(R) Arc(tm) Graphics (MTL)","driver":"Intel open-source Mesa driver Mesa 26.2.4","os":"Linux 7.2.10-200.fc44.x86_64","resolution":"3840x2160","window":{"spec":"frames 20:30","first_present":20,"ms":10396.704},"presents":30,"frame_ms":{"p50":346.716,"p90":358.377,"p99":366.846,"max":366.846},"gpu_busy_ms_per_present":175.747,"worker_busy_pct":{"queue worker 0x0":95.259,"queue worker 0x20":96.709},"top_phases_ms_per_frame":{"Driver.Packet":662.152,"Driver.Packet.memory_wait":304.406,"Driver.Packet.device_lock":200.733,"Graphics.Draw":117.667,"Graphics.Draw.draw_and_resource_release":117.215,"Recorder.Submit":112.674,"Driver.Packet.dispatch":78.631,"Driver.Dispatch":74.962},"trace_dropped":false,"trace":"aps5-trace-128b8c1f83c0-1113851.json.gz"}

#7922 + this PR + #7811:

{"commit":"3c286f2aaa91","dirty":false,"env":{"APS5_PLAYGO_UNLISTED_CHUNKS":"absent","APS5_TRACE_FRAMES":"20:30"},"gpu":"Intel(R) Arc(tm) Graphics (MTL)","driver":"Intel open-source Mesa driver Mesa 26.2.4","os":"Linux 7.2.10-200.fc44.x86_64","resolution":"3840x2160","window":{"spec":"frames 20:30","first_present":20,"ms":8502.341},"presents":30,"frame_ms":{"p50":284.666,"p90":293.569,"p99":301.329,"max":301.329},"gpu_busy_ms_per_present":99.842,"worker_busy_pct":{"queue worker 0x0":95.453,"queue worker 0x20":96.606},"top_phases_ms_per_frame":{"Driver.Packet":541.345,"Driver.Packet.memory_wait":242.369,"Driver.Packet.device_lock":172.983,"Graphics.Draw":109.737,"Graphics.Draw.draw_and_resource_release":109.328,"Recorder.Submit":86.761,"Driver.Packet.dispatch":77.395,"Driver.Dispatch":59.959},"trace_dropped":false,"trace":"aps5-trace-3c286f2aaa91-1110129.json.gz"}
{"commit":"3c286f2aaa91","dirty":false,"env":{"APS5_PLAYGO_UNLISTED_CHUNKS":"absent","APS5_TRACE_FRAMES":"20:30"},"gpu":"Intel(R) Arc(tm) Graphics (MTL)","driver":"Intel open-source Mesa driver Mesa 26.2.4","os":"Linux 7.2.10-200.fc44.x86_64","resolution":"3840x2160","window":{"spec":"frames 20:30","first_present":20,"ms":8295.347},"presents":30,"frame_ms":{"p50":275.827,"p90":287.420,"p99":298.300,"max":298.300},"gpu_busy_ms_per_present":103.936,"worker_busy_pct":{"queue worker 0x0":95.021,"queue worker 0x20":96.792},"top_phases_ms_per_frame":{"Driver.Packet":526.752,"Driver.Packet.memory_wait":230.941,"Driver.Packet.device_lock":175.752,"Graphics.Draw":109.682,"Graphics.Draw.draw_and_resource_release":109.304,"Recorder.Submit":84.958,"Driver.Packet.dispatch":77.214,"Driver.Dispatch":56.640},"trace_dropped":false,"trace":"aps5-trace-3c286f2aaa91-1112745.json.gz"}
{"commit":"3c286f2aaa91","dirty":false,"env":{"APS5_PLAYGO_UNLISTED_CHUNKS":"absent","APS5_TRACE_FRAMES":"20:30"},"gpu":"Intel(R) Arc(tm) Graphics (MTL)","driver":"Intel open-source Mesa driver Mesa 26.2.4","os":"Linux 7.2.10-200.fc44.x86_64","resolution":"3840x2160","window":{"spec":"frames 20:30","first_present":20,"ms":8485.135},"presents":30,"frame_ms":{"p50":282.685,"p90":298.537,"p99":299.527,"max":299.527},"gpu_busy_ms_per_present":107.481,"worker_busy_pct":{"queue worker 0x0":94.914,"queue worker 0x20":97.470},"top_phases_ms_per_frame":{"Driver.Packet":540.337,"Driver.Packet.memory_wait":237.203,"Driver.Packet.device_lock":173.253,"Graphics.Draw":109.525,"Graphics.Draw.draw_and_resource_release":109.133,"Recorder.Submit":88.988,"Driver.Packet.dispatch":82.072,"Driver.Dispatch":62.017},"trace_dropped":false,"trace":"aps5-trace-3c286f2aaa91-1115056.json.gz"}

Traces, digests and summaries: ThatsLeo:evidence/spanned-any-subgroup.

Not tested:

  • Devices other than the Arc. On NVIDIA and AMD the flag stays off by the rule above, so their modules are unchanged; a run there would confirm it.
  • Other Intel GPUs and other titles.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: perf(shader): span single-wave wave64 compute by default after a uniformity check #7922
  • Fixes: none
  • Unblocks: none
  • GPUs tested: Intel Arc (Meteor Lake), Mesa 26.2.4 ANV, Linux; lavapipe (Mesa 26.2.4), Linux
  • AI-assisted: yes

@github-actions github-actions Bot added the perf Performance change label Oct 19, 2026
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 1395 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 2434 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4040 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4072 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/Recompiler.cpp
PR 4472 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4847 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4891 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 5021 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvSubgroup.cpp
docs/dev/debt/shader.md
PR 5315 core/shader/recompiler/SpirvBackend/src/SpirvSpecialization.cpp
PR 5371 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/debt/shader.md
PR 5426 docs/dev/debt/shader.md
PR 5431 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 5441 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5499 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5500 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/shader.md
PR 5609 core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 5656 core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 5799 docs/dev/debt/shader.md
PR 5925 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/CMakeLists.txt
core/shader/recompiler/Recompiler.hpp
PR 5941 docs/dev/debt/shader.md
PR 6009 docs/dev/debt/shader.md
PR 6010 docs/dev/debt/shader.md
PR 6011 docs/dev/debt/shader.md
PR 6146 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6177 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitter.hpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/Recompiler.hpp
PR 6202 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6235 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
docs/dev/debt/shader.md
PR 6249 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6262 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6280 docs/dev/debt/shader.md
PR 6290 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvSubgroup.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6412 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/shader.md
PR 6416 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
PR 6436 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6488 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
docs/dev/debt/shader.md
PR 6539 core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 6604 docs/dev/debt/shader.md
PR 6611 core/shader/recompiler/Recompiler.cpp
PR 6612 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CMakeLists.txt
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
docs/dev/debt/shader.md
PR 6615 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6636 docs/dev/ENVIRONMENT.md
PR 6639 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 6645 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 6655 docs/dev/ENVIRONMENT.md
PR 6658 docs/dev/ENVIRONMENT.md
PR 6679 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
docs/dev/debt/shader.md
PR 6683 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 6718 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6751 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
PR 6782 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6785 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 6788 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6801 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 6804 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6820 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6858 core/shader/recompiler/Recompiler.cpp
PR 6879 core/shader/recompiler/CMakeLists.txt
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 6887 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6924 core/shader/recompiler/Recompiler.cpp
docs/dev/ENVIRONMENT.md
docs/dev/debt/shader.md
PR 6946 core/shader/recompiler/CMakeLists.txt
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/ENVIRONMENT.md
PR 6947 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CMakeLists.txt
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitter.hpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
docs/dev/ENVIRONMENT.md
PR 6948 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 6951 docs/dev/ENVIRONMENT.md
PR 6959 core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/shader.md
PR 6960 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6965 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6970 core/shader/recompiler/Recompiler.hpp
PR 6973 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6977 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/CMakeLists.txt
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
docs/dev/debt/shader.md
PR 6987 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6989 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6995 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7002 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7080 docs/dev/ENVIRONMENT.md
PR 7085 docs/dev/debt/shader.md
PR 7154 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7201 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/CMakeLists.txt
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
PR 7223 core/shader/recompiler/Recompiler.cpp
docs/dev/debt/shader.md
PR 7233 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7275 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7292 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7307 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 7332 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CMakeLists.txt
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitter.hpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvSubgroup.cpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
docs/dev/ENVIRONMENT.md
docs/dev/debt/shader.md
PR 7340 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 7369 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7371 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7392 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
docs/dev/debt/shader.md
PR 7395 core/shader/recompiler/Recompiler.cpp
docs/dev/debt/shader.md
PR 7411 docs/dev/ENVIRONMENT.md
PR 7417 docs/dev/ENVIRONMENT.md
PR 7426 core/shader/recompiler/Recompiler.hpp
docs/dev/debt/shader.md
PR 7427 docs/dev/ENVIRONMENT.md
PR 7431 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 7449 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7457 docs/dev/ENVIRONMENT.md
PR 7464 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 7474 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7480 docs/dev/ENVIRONMENT.md
PR 7484 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitter.hpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
docs/dev/ENVIRONMENT.md
docs/dev/debt/shader.md
PR 7522 core/shader/recompiler/Recompiler.cpp
PR 7560 core/shader/recompiler/CMakeLists.txt
core/shader/recompiler/Recompiler.cpp
PR 7603 core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
PR 7604 docs/dev/ENVIRONMENT.md
PR 7610 core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
PR 7618 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7622 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/CMakeLists.txt
PR 7642 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CMakeLists.txt
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitter.hpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
docs/dev/ENVIRONMENT.md
PR 7643 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 7647 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7683 docs/dev/ENVIRONMENT.md
PR 7684 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/debt/shader.md
PR 7689 core/shader/recompiler/Recompiler.hpp
PR 7694 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 7705 docs/dev/ENVIRONMENT.md
PR 7747 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
PR 7759 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 7803 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/debt/shader.md
PR 7816 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
PR 7817 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
PR 7827 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7829 docs/dev/debt/shader.md
PR 7831 core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
PR 7869 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7870 docs/dev/ENVIRONMENT.md
PR 7880 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 7882 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 7888 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitter.hpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
docs/dev/debt/shader.md
PR 7891 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 7920 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 7930 docs/dev/ENVIRONMENT.md
PR 7933 core/shader/recompiler/CMakeLists.txt
PR 7942 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/debt/shader.md
PR 7945 docs/dev/debt/shader.md
PR 7954 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7965 docs/dev/debt/shader.md
PR 8014 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 8047 docs/dev/ENVIRONMENT.md
PR 8055 docs/dev/debt/shader.md
PR 8066 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 8075 docs/dev/ENVIRONMENT.md
PR 8077 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/ENVIRONMENT.md
docs/dev/debt/shader.md
PR 8083 docs/dev/debt/shader.md
PR 8104 docs/dev/ENVIRONMENT.md
PR 8105 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 8115 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 8134 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitter.hpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
docs/dev/debt/shader.md
PR 8144 docs/dev/debt/shader.md
PR 8145 core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 8160 docs/dev/ENVIRONMENT.md
PR 8161 docs/dev/ENVIRONMENT.md
PR 8180 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 8206 docs/dev/ENVIRONMENT.md
PR 8212 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 8221 docs/dev/ENVIRONMENT.md

@ThatsLeo
ThatsLeo force-pushed the feat/shader-spanned-any-subgroup branch from 3b26f10 to 2276a44 Compare October 19, 2026 17:37
…ormity check

A spanned module is checked for barriers inside control flow that a per-invocation
value decides, and falls back to two lanes per invocation when it has one, so the
spanned layout no longer needs APS5_SPANNED_WAVE; APS5_NO_SPANNED_WAVE turns it off.
…t can be narrower than 32

On a device whose compute subgroups can be narrower than 32 lanes, a spanned wave numbers
its lanes by LocalInvocationIndex and shuffles within a half through workgroup memory, so
its pipeline asks for full subgroups of any size and the driver picks the width.
@github-actions github-actions Bot added build shader core/shader docs agc libSceAgc* needs rebase Conflicts with main, rebase needed labels Oct 19, 2026
@wachi35676

Copy link
Copy Markdown
Contributor

Runs on NVIDIA and AMD (the "Not tested" list), plus two problems that block a merge onto current main.

1. Serialization version 38 is already taken on main. dd41527ce (feat(shader): emulate smooth barycentrics on the mesh path, merged after this PR's base 7a015c094) moved RequestSerializer to version 38 and reads a mesh barycentric flag under version >= 38u. This PR also bumps 37 to 38. git merge-tree origin/main 2276a44aa merges RequestSerializer.cpp without a conflict, and the result reads both fields under version 38:

803:    if (version >= 38u && reader.ReadBool()) {                                    // main, mesh barycentrics
868:    if (version < 1u || version > 38u) throw ...
913:    if (version >= 38u) result.request.target.spannedAnySubgroup = reader.ReadBool();  // this PR

A version-38 request that current main writes has no trailing spannedAnySubgroup byte, so this reader would read past its end. I read this from the merged code and didn't run it. The next free version avoids it. (Disclosure: my own open #7410 currently takes 39 for its wave-shared VGPR fields, so whichever lands second moves up one.) RequestSerializerTests.cpp conflicts in the same places, around InsertMeshBarycentricFlag. SpirvSpecialization.cpp from #7922 conflicts with main's WordArena change.

2. spanned_uniformity_tests doesn't link with MinGW. This comes from #7922 and is carried here. At #7922's head 753bb56e3, a Windows MinGW GCC 15.2 Release build stops at:

ld.exe: ...SpannedUniformityTests.cpp.obj:(.data+0x0): undefined reference to `__gxx_personality_v0'
ld.exe: ...SpirvSpannedUniformity.cpp.obj:(.data+0x0): undefined reference to `__gxx_personality_v0'

The neighbouring spirv_validator_exit_tests in the same function adds if(MINGW) target_link_libraries(... PRIVATE libc) and the PATH prepend. With those 5 lines added locally for spanned_uniformity_tests, everything links. The runs below use that local fix.

3. Runs. Windows 11 26300, MinGW GCC 15.2 Release, on the PR's own base: #7922 head 753bb56e3 against this PR head 2276a44aa (#7922 + this PR). GPUs: RTX 5070 Ti (NVIDIA 617.42) and Ryzen 5 9600X Radeon iGPU (ANYPS5_GPU=AMD, 32.0.21042.62), both with ANYPS5_REQUIRE_VULKAN=1. Test set: ctest -R "agc|shader|spirv|recomp|spanned|request_serializer", 814 tests.

build NVIDIA failures AMD failures
#7922 address_passes, pass_input_hazard layered_volume_vertex_no_gpl, draw_cache_reuse_off, stencil_replay_no_gpl
#7922 + this PR pass_input_hazard the same 3
#7922 + this PR, any-subgroup path forced (below) pass_input_hazard the same 3 + agc_trimmed_import

All of these also fail on current main on this machine. spanned_uniformity, request_serializer, agc_compute_pipeline_capture, agc_shader_memory and agc_driver_lds_mask_waterfall pass on both GPUs. Both devices log single-wave wave64 compute spans full subgroups: 1, of any size: 0, so as the PR says, NVIDIA (32 only) and this AMD driver (minSubgroupSize 32) keep the pinned layout.

Forced path. Neither GPU reaches the new code by itself, and lavapipe doesn't either: its computeWave32 is false, so spanning is off there. To run the LocalInvocationIndex lane numbering, the wave_exchange in-half shuffle and the REQUIRE_FULL_SUBGROUPS | ALLOW_VARYING_SUBGROUP_SIZE pipelines on these GPUs, I made a local probe build (not for merge) that also sets spannedAnySubgroup when RVM_FORCE_ANY_SUBGROUP is set. The logs show of any size: 1 on both GPUs. Run with ANYPS5_NO_SHADER_CACHE=1, the same 814 tests have no new failures on either GPU. agc_trimmed_import fails on AMD on main as well. I didn't record which width the AMD driver picked under ALLOW_VARYING_SUBGROUP_SIZE.

Not measured: frame time or GPU time. The perf claim is Intel-only, and NVIDIA and AMD modules don't change by the rule above.

AI-assisted: yes (Claude Code); results above were run on this machine.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build docs needs rebase Conflicts with main, rebase needed perf Performance change shader core/shader

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants