perf(shader): choose the wave64 compute layout per program #4339
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4339"
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 karanvora2599 on 2026-10-12T07:01:23Z.
What
On a host with 32-wide subgroups (NVIDIA, and Intel with a required subgroup size of 32), a wave64 compute program now runs one guest lane per invocation when an analysis of its IR shows that no result depends on the other half of the wave. Every other wave64 program keeps two lanes per invocation, as before. Results are unchanged. This is the per-program layout proposed in #2013.
Background. On such a host, every wave64 compute program ran two guest lanes per invocation (
laneCount == 2).Title data says this is most of the shader work:
APS5_SINGLE_LANE=all, which ignores the rules below, the title's 58 largest compute shaders go from 36.4M to 17.1M SPIR-V words.How. The analysis (
Wave64OneLaneRejection,SpirvAnalysis.cpp) runs incompileVariantafter the front-end passes. A program keeps two lanes if any of these holds:It reads other lanes or the wave mask:
v_permlane*,ds_swizzle,ds_[b]permute,ds_append/ds_consume, orv_readlane;v_readfirstlaneof a lane-varying value;Ballotwhose result is used for more than each lane's own bit.A ballot is allowed when each lane reads its words only through a select on its own half (
LaneId < 32picks word 0, otherwise word 1), passing through AND/OR/XOR/NOT and phis on the way, and ends in(word >> (LaneId & 31)) & 1. That's how exec masks saved in SGPRs are read back, so ordinarys_and_saveexec/s_or_b64 execcontrol flow stays allowed. These keep two lanes:A wave-mask branch guards something wave-wide. The branch is
execz,execnz,vcczorvccnz, which the host evaluates per subgroup. Its region is the selection up to its merge, or the loop body. The region must not:It writes LDS in a workgroup of more than one wave.
WaveLdsScopecan only order a wave's own LDS accesses with a workgroup barrier when the workgroup is one wave.It indexes a bindless table and the device lacks non-uniform indexing. The table slot is no longer uniform over the workgroup once a wave spans two subgroups.
Mesh programs stay at two lanes for now.
For a program that qualifies, the module is emitted with the one-lane input info (
hostSubgroupSize64), so itsLocalSizeis the full workgroup.result.hostSubgroupSizekeeps the target's 32, the valuemainreports. So the driver requires 32-wide subgroups for it on every device, including ones whose subgroups can be 64 wide. Translation needs no second pass: the only layout-dependent IR is the partial-wave exec maskLocalInvocationIndex < threads, which is always true at one lane.The choice depends only on the program and the target, so the cache keys are unchanged. At one lane per invocation:
LocalInvocationIndex & 63;v_readfirstlanetakes its source lane within the host subgroup.Debug aids:
APS5_WAVE64_LAYOUT_LOG=1prints one line per program with the decision and, for a rejection, the opcode that caused it.APS5_TWO_LANE=1keeps every program at two lanes.APS5_SINGLE_LANEstill forces one lane.Before / after on an RTX 4060 Laptop (Ada, driver 591.86), measured on the same synthetic wave64 program compiled both ways in one process. Each lane keeps N values live through a chain of multiply-adds (
v_mac_f32).Registers and code, with 8,192 multiply-adds per lane:
The one-lane layout didn't spill at any size.
Compile time, with 65,536 multiply-adds per lane, which is close to the size of the shaders in Raghav's data:
Run time was within noise in this test, which is limited by memory traffic. One lane was 5% faster at 160 live values, where the two-lane version spills. The two-lane recompile of the 160-value program used 24 GB of RAM before I stopped it.
Tested
Windows 11, MinGW-w64 GCC 15.2.0, Release,
mainatd592d54e. RTX 4060 Laptop (driver 591.86), Intel UHD Graphics (Raptor Lake, driver 101.6790), lavapipe from Mesa 25.2.8 (the version CI installs; Windows build,GALLIUM_OVERRIDE_CPU_CAPS=avx).agc_shader_wave64_layout(CPU) checks the decision for seven programs:v_readfirstlaneof a lane value → two lanes;execzregion whose scalar result is used after it → two lanes;agc_shader_wave64_layoutalso builds three IR programs directly. A ballot word read through the lane's half select qualifies for one lane. The low or the high word read by every lane keeps two lanes; those two are the cases @Scramblrrrr reported.agc_shader_wave64_layoutalso checks that every artifact asks for the target's subgroup size. A one-lane artifact that reported 64 is what failed on RADV, which @blawesom found.agc_shader_memory's descriptor-Phi check now reads how many lanes an invocation holds from the module'sLocalSize, and expects one sample per edge and per lane, instead of assuming two lanes. Its wave64 program qualifies for one lane.agc_driver_*,agc_shader_*,agc_spirv_*,vector_*,agc_masked_select,agc_validate_program,agc_denormal*,agc_float16_*; 350 tests), withAPS5_WAVE64_LAYOUT_LOGon. The BDA tests that hang on driver 591.86 until #3291 lands are left out.RTX 4060: all pass. Of the wave64 compute compiles in the suite:
v_readfirstlaneof a lane-varying value;v_readlane,ds_swizzleorv_permlane16;Many of the rejections are tests that exercise those operations on purpose.
Intel UHD: all pass or skip for missing features except
agc_driver_ds_swizzleandagc_driver_f32_dot2_rounding(noFloat64), which fail the same way without this change.lavapipe 25.2.8: all pass or skip for missing features except two intermittent segfaults:
agc_driver_depth_fast_clear_submit, which also happens onmain, andagc_driver_stencil_ref_export, a graphics test that passed 4 of 5 runs on its own. Its subgroups are 8 wide, so the choice doesn't apply, and the one-lane emission changes are limited to 32-wide hosts.main760ffa683. The test list incore/libs/prx/libSceAgcDriver/CMakeLists.txtand the includes ofSpirvAnalysis.cppconflicted. Sinced9e47d1e9,mainmarks table-indexed images withImageResource::table(NoTableotherwise) instead ofindirectRoot, and samplers can come from tables too, so rule 4 now checks image and sampler tables. On this head:agc_shader_wave64_layoutandagc_shader_memory.agc_driver_ds_swizzleand five image-table tests (agc_driver_bindless_images,agc_driver_image_sint8,agc_driver_image_table,agc_driver_image_table_cache_bounds,agc_driver_image_table_reuse), which fail the same way onmaine858dbd78.agc_driver_preparation_scope_settlefailed once under the suite's load and passes 3 of 3 on its own.APS5_TWO_LANE=1(main's layout):agc_driver_depth_fast_clear_submit,agc_driver_depth_storage_dispatchandagc_driver_sample_mask_depth_stencil.buffer load store wave64: lane 32 load_ubyte is 0x0f7b8468, expected 0x00000099, andbuffer integer atomics wave64: lane 32 buffer_atomic_swap returned is 0x00007fff, expected 0xd14e11a6.Why results don't change. At one lane per invocation, a guest wave spans two host subgroups. Each subgroup computes scalar values and wave-mask branch decisions from its own 32 lanes. The rules exclude exactly the ways a result could depend on the other half:
Limits.
agc_driver_tessellation, also segfaults onmain. With RADV's default 64-wide target nothing changes. A 32-wide target there, as in the tests' wave64 split runs, now gets a required subgroup size of 32.LocalInvocationIndexvalues into each subgroup.APS5_SINGLE_LANEand the lane-id code already assume this; NVIDIA and Intel do it with the required subgroup size of 32, which the driver now also requests where subgroups can be 64 wide.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 Scramblrrrr on 2026-10-12T07:35:03Z.
I found a false admission in the draft's LaneLocalBallot / OwnLaneBit check while evaluating it for 007 on Windows. Synthetic IR reproduction (no title code):
github.com/Scramblrrrr/AnyPS5@8e0d9ef85a. This is an intentionally failing regression test, not a proposed production patch. It carries your 89d6bfdac with author retained, adapted to our 007 cross-test base; the image guard uses that base's image.table != NoTable. The ballot analysis itself is unchanged.Original seven layout checks pass, then BOTH added checks fail with "cross-half ballot word 0/1 admitted: one lane per invocation" (exit 1). Each graph is Ballot(predicate) -> CompositeExtract(fixed word) -> ShiftRightLogical(mask, LaneId & 31) -> AND 1. The shift is accepted as an own-lane bit, but the fixed word can belong to the OTHER wave half:
The direct admission test is verified on Windows GCC 15.2. I have not yet run a GPU output counterexample; the output difference above follows from EmitWaveBallot's word placement. It looks like acceptance needs to establish that word selection corresponds to the invocation's half, not just that the shift uses LaneId & 31. I am holding off on staging this optimization for 007. Happy to cross-test a corrected head. AI-assisted: Codex.
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-12T13:27:10Z.
Rebase handoff + one pre-existing finding — rebased onto current
main, authorship unchanged.One conflict in
Recompiler.cpp, resolved by merging both sides: this PR's per-program wave64 layout (emitInputInfo) now also feeds main's newer registration-module fallback path (bothEmitcalls useemitInputInfo).The finding — independent of the rebase: this PR fails 6 tests deterministically on Linux/RADV, and the failure exists on the original branch at its own base too, so it is not rebase-induced:
Negative control: all 6 pass at this branch's merge base (
2ccbd376) on the same machine — the regression is introduced by the branch's changes on this setup. All six are wave64 compute tests, consistent with this PR's subject (the wave64 layout choice) — on this device (RADV, 64-lane subgroups) the one-lane compute layout appears to break buffer/LDS addressing. Everything else passes (947/953).Verified: builds,
tools/check_conventions.pypasses, full suite 947/953 with only these six failing.To pick it up:
Head is
e83e23ae1. If the layout choice is meant to be device-dependent, the subgroup-size condition may need a look for 64-lane devices.Imported from boykopovar/AnyPS5. Originally posted by karanvora2599 on 2026-10-12T13:38:16Z.
Thanks @Scramblrrrr, you're right. The check accepted the own-lane shift without checking that the word came from the lane's own half.
Fixed in 32bf1e9ee: the analysis now tracks which ballot word each value carries. A value is the low word, the high word, the lane's own half (
Select(LaneId < 32, low, high)), or mixed. A bit extraction is allowed only from an own-half word, and combining the low and high words keeps two lanes.Your two cases are now IR-level checks in
agc_shader_wave64_layout: the fixed low word and the fixed high word read by every lane both keep two lanes. Next to them, the half-selected read still qualifies.The translator itself always selects the word by half, so the shader suite still passes on the RTX 4060 (342 of 342). Three more test programs now keep two lanes, so it's 178 one-lane compiles instead of 181. A cross-test of the new head would be welcome.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T00:19:21Z.
The numbers are still for a synthetic
v_mac_f32chain. With the decision log on a title's shaders (the Demon's Souls set from #2013 would do), how many compute programs take one lane, and what does pipeline creation take before and after (#218)?475fca615 keeps the artifact at 32-lane subgroups, which should clear the six "wave64 split" failures blawesom saw on RADV; a re-run there would confirm it.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T05:21:15Z.
Needs a rebase: the test list in
core/libs/prx/libSceAgcDriver/CMakeLists.txtconflicts with the tests merged today.Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-13T06:43:20Z.
Rebase handoff (v2, for the CMake test-list rebase @oneandonlydean requested) — rebased onto current
main, authorship unchanged.The conflict was exactly the one you named: the `CMakeLists.txt` test list vs today's merges. The resolution keeps main's current list with this PR's
agc_shader_wave64_layout_testsinserted. Head isfc0ab8f18, branchblawesom:rebase/4339-v2.Also verified on this head, on Linux/RADV (CachyOS, kernel 7.2.9, GCC 16.2.1, Release, RX 9070 XT):
agc_driver_tessellation, which segfaults on currentmainitself (tracked to0b7de0e73/ #4727, reported there); not caused by this PRTo pick it up:
Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-13T09:56:24Z.
@oneandonlydean @karanvora2599 I ran the decision log over Ghost of Yōtei's compute shaders on an RTX 3080 Laptop (driver 610.62). Short version: on Yōtei it barely moves anything. Of the 83 programs behind the biggest pipelines we capture (every compute pipeline over 500k SPIR-V words, 461 requests), 8 take one lane, and those 8 are one 8x8 shader loaded at eight addresses, so it's really one pipeline. All the giants that cost us 80 to 470 s each in NVIDIA's compiler keep two lanes. Total SPIR-V for the set drops 0.6% (661.97M to 658.02M words). With
APS5_SINGLE_LANE=allit drops 45.5%.Where a program does flip, the result matches your synthetic numbers. That shader goes from 1,004,821 to 512,074 words, and a cold pipeline create drops from about 12.3 s to 4.6 s. Two-lane modules come out byte-identical, so their create time doesn't change: 0x8000196500 took 88.5 s before and 95.7 s after with the same SPIR-V, which is just run-to-run spread.
mainon an older 1,800-request Yōtei set: one-lane programsThe giants are rejected because they really work across the wave, so relaxing one rule wouldn't help. To see this I added a local diagnostic that lists every blocker in a program, not only the first. Most giants have all of these: ballot words used as counts (
BitCount32, thev_mbcntpattern, 64-bit masks), waterfall loops (FindILsb32of a ballot word intoReadLane,ReadFirstLaneof a phi), and DPP/v_permlane16reductions. In 55 of the 75 rejected programs, ballot,ReadLaneand non-uniformReadFirstLaneall appear. Your waterfall idea would help most if it also covered the ballot counts and the reductions per wave.Only 8 programs are held back by rule 2 alone. Four of them could be worth a look: 0x8000261500, 0x8000289300, 0x8000284e00 and 0x800028d800, at 1.24 to 1.46M words. They run one-wave workgroups (64 threads) with no LDS, and the only reason is "a scalar
Phiused after" a wave-mask region (3 to 6 regions each). Forced to one lane, they come out at 53% of the size. I haven't checked whether the two halves can actually disagree on those phis, so the rule may well be right.Upstream
maincan't compile most of these requests on its own: 370 of 461 stop at a lane-selected descriptor waterfall that our game branch handles locally. So the 461 were measured with #4339 cherry-picked onto our game branch.mainitself (blawesom's fc0ab8f18 againstea2bbefb) was measured on the 91 giants it does compile and on an older, broader set of Yōtei compute requests, using #3717'sagc_compute_pipeline_replayfor create times. The pattern matches: small programs mostly qualify and large ones mostly don't. spirv-val passes on every one-lane module. I haven't run the game with it.Would the requests help you? I can attach the four rule-2-only programs, or the whole set (they're our request layout, plus a small converter to
main's v19).Details
Builds. PR head 475fca6157. For
mainnumbers I used blawesom's rebase fc0ab8f184 (same patch apart from the CMake test list) against its baseea2bbefb2b. For Yōtei's giants: our game branch c7de5a63b6 against c7de5a63b6 + 475fca6157. The cherry-pick needed two adjustments: the game branch doesn't havemain's registration-module fallback yet, and its bindless test isimage.table != NoTable(noindirectRootthere). Windows 11, GCC 15.2.0 Release,ANYPS5_ENABLE_SPIRV_TOOLS=OFFas in the game. RTX 3080 Laptop 16 GB, driver 610.62. Recompiles useANYPS5_NO_SHADER_CACHE=1andAPS5_WAVE64_LAYOUT_LOG=1. The game set also used the game run's switches (APS5_COLD_SPIRV=1 APS5_COLD_SPIRV_FILE=1 APS5_CACHE_SPIRV_BACKING=1 APS5_UNNORM_WRAP_GUARD=1).Requests.
main, which gives 502 distinct modules in 362 programs.main: our layout v20/v21 → v19 (appendregistrationModules,registrationWordLimit,vertexSubgroups; the fields we differ in are graphics-only). Set B's v16 requests got thefloatModebyte added.main(bothea2bbefband the PR), set A gives 91 of 461 recompiles. 363 stop withGetImageResource dword 0 is not a valid runtime valueat aReadLane(FindILsb32(Ballot))descriptor index, and 7 (five 0x800014e300, two 0x8000173b00) crash the replay.Decisions, set A on the game branch (program counts; requests and modules in brackets):
BallotReadFirstLaneDppMoveU32PhiWords over distinct modules: 175,703,817 → 171,761,841 (−2.2%); the 8 one-lane modules go 8,038,568 → 4,096,592 (−49%). No program hits rule 3 first or rule 4. Workgroups of 512/1024 threads with LDS writes exist in 5 programs, but other rules catch them first.
Every blocker per program (local diagnostic
APS5_WAVE64_CENSUS, decision unchanged), number of the 83 programs containing it:ReadFirstLaneof a select 61, of a phi 56;ReadLane58;DppMoveU32/DppUpdateU3252,Permlane16U3249;ISub3248 andULessThan3248 (mbcnt),CompositeConstructU6446,BitCount3241,FindILsb3239;Phiused after 38, scalarBitwiseAnd32used after 35, LDS inside 29;DataAppend9.Combinations: 55 programs have ballot +
ReadLane+ReadFirstLane(most of them also DPP and a mask region), 8 have only mask-region blockers, 1 only DPP (0x8000253100), and 8 are clean. One more thing I noticed but didn't chase: in the giants, the ballot-word tracking marks tens of thousands of values as derived from a ballot. In 0x8000196500, 32,709 values count as "low and high words combined" and about 8,800 feedBitCastF32U32. It doesn't change any decision here.Rule-2-only programs (largest variant; single lane =
APS5_SINGLE_LANE=all, measurement only):Phiused after, 6 regionsSet B on
main(programs, largest variant): 156 one lane, 131 atBallot, 31 atReadFirstLane, 17 at DPP, 8 atPermlane16U32, 2 atReadLane, 12 wave-mask region, 5 wave32. By size: under 100k words 132 of 196 qualify, 100k–500k 21 of 142, over 500k 3 of 24. Words over distinct modules 135,037,944 → 130,453,566 (−3.4%), one-lane subset −43%. Set A's 91 recompiles onmain: 8 one lane (the same 5d00 shader), 39 programs two lanes.Pipeline creation. Every run was cold, one at a time, with nothing else heavy on the machine: a fresh empty
VkPipelineCacheand an empty NVIDIA store (__GL_SHADER_DISK_CACHE_PATHpointing to a new directory). Peak RAM is the process's peak private bytes.agc_shader_replay --pipeline-only, our local tool, which recompiles the request and creates the pipeline through the dispatch path'screateComputePipeline. 0x7ff60e7f5d00 (8x8, 1,796 code words): before 13.5 / 12.3 s; PR withAPS5_TWO_LANE=112.3 / 12.1 s; PR 4.6 / 4.6 s. Peak 787 → 524 MiB, NVIDIA store 1.02 → 0.55 MB. 0x8000196500 (1,833,316 words, two lanes in both): 88.5 s before, 95.7 s after, about 3.06 GB peak.main: #3717'sagc_compute_pipeline_replayon a capture built from the replayed module. The layout was reflected from the module, since dispatch builds it from guest memory; flagsDISPATCH_BASE, required subgroup size 32, 128-byte push range. One run each:Correctness.
spirv-val --target-env vulkan1.3 --scalar-block-layout(SPIRV-Tools v2025.1) passes on every one-lane module: 8 from set A on the game branch, 8 from set A onmainand 421 from set B. Every two-lane module is byte-identical before and after (453 in set A, 955 in set B). Nothing ran on the GPU beyond pipeline creation.Imported from boykopovar/AnyPS5. Originally posted by karanvora2599 on 2026-10-13T21:55:09Z.
@Celegans12, thank you. That answers @oneandonlydean's question better than a synthetic chain could. What it shows about this PR:
main, 156 of 362 Yōtei programs take one lane, most of them under 100k words, and SPIR-V for the set drops 3.4%. Where a program switches, a cold pipeline create is 2.5 to 3 times faster.Yes, please attach the four rule-2-only programs (0x8000261500, 0x8000289300, 0x8000284e00, 0x800028d800).
For the giants, the ballot counts, cross-half
ReadLane/ReadFirstLaneand DPP reductions would have to go between the two halves through shared memory with a barrier. A barrier needs uniform control flow, and waterfall loops don't have it, so I don't see a cheap way to move them to one lane. For those, compiling outside the GPU lock (#4897) matters more than the layout.@blawesom, thanks for the rebase and for rerunning the six split tests on RADV. That confirms 475fca615: one-lane artifacts now keep the target's 32-lane subgroup size, so the driver asks for 32-wide subgroups on every device.
mainhas moved sincefc0ab8f18and the test list conflicts again (agc_formatted_buffer_byte_stores_testsandagc_ir_reclaim_testswere added), so I'll rebase onto currentmainand rerun the suite before pushing.Imported from boykopovar/AnyPS5. Originally posted by karanvora2599 on 2026-10-15T02:08:13Z.
Rebased onto
main760ffa683(e6515bc8c). The test list inCMakeLists.txtconflicted again, this time withagc_vertex_input_tests, and so did the includes at the top ofSpirvAnalysis.cppafter #6015; nothing else changed. The description now has the suite run on the previous rebase, @blawesom's RADV run and @Celegans12's Yōtei numbers. I'll rerun the wave64 tests on this head and post the result here.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T02:35:16Z.
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.
core/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvEmitter.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvEmitter.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvSubgroup.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/Recompiler.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/Recompiler.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/Recompiler.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvEmitter.cppcore/shader/recompiler/Recompiler.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvEmitter.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvSubgroup.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/Recompiler.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvEmitter.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Recompiler.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/SpirvBackend/src/SpirvEmitter.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvEmitter.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/Recompiler.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/Recompiler.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/SpirvBackend/src/SpirvEmitter.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvSubgroup.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/Recompiler.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvEmitter.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvAnalysis.hppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvAnalysis.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/Recompiler.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/Recompiler.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/Recompiler.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvEmitter.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Recompiler.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvEmitter.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/Recompiler.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/Recompiler.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvAnalysis.hppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvAnalysis.cppcore/shader/recompiler/SpirvBackend/src/SpirvEmitter.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvSubgroup.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtImported from boykopovar/AnyPS5. Originally posted by karanvora2599 on 2026-10-15T04:28:45Z.
Correction to my rebase note above: e6515bc8c didn't build. Since
d9e47d1e9,mainmarks table-indexed images withImageResource::tableinstead ofindirectRoot, and the merge was textually clean, so I missed it. Fixed inad94d980e: rule 4 now checkstable != NoTablefor images and also for samplers, which can come from tables since that change. On this head, the suite passes on the RTX 4060 (443 of 443); the Intel UHD and lavapipe results are in the description, and their failures also happen onmain.Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-16T16:42:25Z.
Rebase handoff + the build break resolved — I rebased the current head onto
main143f13055and it now applies and builds clean, so thee6515bc8cbreakage you hit was against the older target: withd9e47d1e9'sImageResource::tablemarking now inmainalongside your headad94d980e, the table-indexed image paths line up again.Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV):tools/check_conventions.py --base origin/mainpassesmainregression (agc_driver_tessellationsegfault, #4727), not this PRTo pick it up:
Head is
f29c521a9(your commit, authorship unchanged).Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-16T17:02:46Z.
Preparing a current-main Windows/RTX5070Ti cross-test for 007 (PPSA11386, discussion#5714). Your current
ad94d980eapplies cleanly to our shared-table integration at local98e8a22e0: https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-wave64-current . Source/conventions checked; explicitly not built/native-tested/title-tested yet because a separate shared-table title measurement is running. I will retain the analysis decision, use APS5_TWO_LANE for a control, and report aggregate accepted/rejected counts and exact heads rather than force APS5_SINGLE_LANE.Why this is relevant: our previous title run's two largest compute modules are about3.95–3.97M SPIR-V words with only2functions; a bounded queue0 sample during a stall was150/150 PCs in NVIDIA's compiler. Current menu baseline is0.63056FPS and roughly108ms GPU work per present, so both compile cost and eventual GPU cost matter. We do not know whether those two programs qualify for one lane; the large-program rejections reported for Yotei are noted. RTX5070Ti reports no f32 flush-to-zero support, so #6503 is not a shortcut here. No performance claim or duplicate implementation. Title code and raw captures stay local. AI-assisted: Codex.
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-16T17:20:47Z.
Windows/RTX5070Ti617.42 native gate is green on integrationd8547a54e06e7d7fafecb7f3223f01cd09896277:22/22 selected CPU/native Vulkan controls PASS11.65s, no skips, including your wave64 layout fixture, shader memory/disk cache, buffer load/store and integer atomics, readlane/readfirstlane, ds_swizzle/ds_permute/permlane16, LDS read/write+integer atomics, wave uniform/wave32, masked select, and shared image-table checks. The16 relevant controls also PASS5.74s with APS5_TWO_LANE=1 (decision fixture excluded from that control because it asserts automatic choices). Conventions clean; matched patched driver/Agc/VideoOut built and staged.
007 is now booting that exact integration with APS5_WAVE64_LAYOUT_LOG=1, all other budgets/guards unchanged from the preceding1.10491FPS menu result at517d. Early logs do show programs admitted and refused for the expected cross-lane/LDS reasons. Counts and title outcome still pending; this is not yet a title speedup claim. AI-assisted: Codex; private title data not attached.
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-16T17:34:44Z.
007 outcome for d8547a54e (your
ad94d980eon the shared-table integration): correctly rendered title and offline menu, no terminal error observed. No-input menu85presents/79.706s =1.06642FPS, frames963–1048,17:31:22.768–17:32:42.474UTC. Preceding517d without #4339 measured1.10491FPS in76.929s, same budgets/guards/drawcache1024 and menu. These short samples of an animated background establish no clear improvement or regression; no FPS win claimed, and this was not a repeated alternating A/B experiment. Native22/22 plus16/16 two-lane controls remain green.The two largest modules remain3,973,914 and3,945,865words, both explicitly refused by the analysis at ReadFirstLane. The retained private captures have LocalSize32x1x1 and2functions each, no f64-typed results. Pipeline creation in this run hit existing driver-cache entries (33/38ms for those two), so their fast creation is NOT attributed to #4339. Many smaller programs qualify: one intermediate parse had at least428 distinct address/decision pairs admitted and336 refused, but the census is incomplete and concurrent stderr can split lines. No title code or raw requests attached.
Owned stop after the sample, peak sampled private27.02GiB/minfree3.93GiB, same2GiBfree/28GiBprivate guards, no guard termination. Branch preserved for cross-tests. I am leaving #4339 out of the next 007 level-loading stack since it adds no demonstrated benefit for this menu and the largest programs stay two-lane. This is not a recommendation against it for other titles. AI-assisted: Codex.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-16T23:29:32Z.
#5405 is merged now, and main runs single-wave wave64 compute programs at one lane per invocation on 32-lane hosts (
spannedWaves,SpannedLane(), withSpannedWaveUnsupportedas the fallback). This PR solves the same layout problem differently, choosing per program from the IR analysis inSpirvAnalysis.cpp, so the rebase isn't mechanical: it conflicts inRecompiler.cpp, the emitter state and helpers, and the subgroup lane id, and the two mechanisms would have to become one. Does the per-program choice still add something on top of #5405, for example programs #5405 sends to the fallback? If it does, could you rebase it ontospannedWavesas that analysis deciding which programs may span? If not, I'd close this in favour of #5405.Imported from boykopovar/AnyPS5. Originally posted by karanvora2599 on 2026-10-18T00:58:04Z.
Thanks @oneandonlydean. With #5405 merged,
mainalready runs single-wave wave64 programs at one lane per invocation, and that was the layout problem this PR was for.What this PR would add on top is choosing per program from the IR analysis, for programs #5405 sends to
SpannedWaveUnsupported. I don't have a title showing such programs matter. @Celegans12's Yōtei run found 8 one-lane programs among the 83 behind the biggest pipelines, all the same shader. I'll close this in favour of #5405 and reopen it as a rebase ontospannedWavesif a title shows programs left on the fallback that the analysis could span.Thanks @Scramblrrrr, @blawesom and @Celegans12 for the testing, the rebase handoffs and the Yōtei decision log.
Pull request closed