perf(agc): skip a split table call dispatch while its part pipelines build in the background #28289
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/28289"
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 Remi-Bon on 2026-11-29T19:25:44Z.
Requested by Chef · project thread
What
Depends on #28280 (and so on #28279); this PR holds only the last commit.
With
APS5_ASYNC_DRAW_COMPILE, a dispatch whose compute pipeline of at leastAPS5_ASYNC_COMPUTE_WORDSwords is not built yet is skipped while the pipeline builds on the prebuild pool. A split table call dispatch did not follow that rule: it built the pipeline of every part it served in the dispatch, so a title that grows a call table stalls the queue while tens of parts build.A split table call dispatch is now skipped whole, like any other dispatch, while one of these pipelines builds in the background:
DispatchWriteRangesis empty and bounded). Only the entry part has run at that point, and its writes go to the driver's split state, so the skipped dispatch has no effect the guest can see.A callee part that a later round or slice reaches still builds its pipeline in the dispatch, as before. A dispatch never runs with part of its lanes unserved. A later dispatch of the same shader finds the pipelines built and runs.
docs/dev/ENVIRONMENT.mddescribes the split case underAPS5_ASYNC_DRAW_COMPILE.Tested
Windows 11, MinGW Release build, AMD Radeon RX 9070.
ctest -R "split|table_call|scalar_call|request_serializer|linked_call|swappc|user_data_call|control_flow|graph" -V: 103/103 passed, withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationandVK_LOADER_DEBUG=layer. The loader log shows the validation layer inserted and contains noVUID-.New
agc_driver_split_table_call_driver_asyncruns the driver split test withAPS5_ASYNC_DRAW_COMPILE=1andAPS5_ASYNC_COMPUTE_WORDS=1. It repeats the dispatch until the output changes, checks that at least one dispatch was skipped and left the whole output untouched, then checks every invocation. WithAPS5_PROFILE_DRAW=1it logs two skipped dispatches, then the pipeline ready.In game, Gran Turismo 7 (PPSA01317), cold shader cache, to the Café, with
APS5_SPLIT_TABLE_CALLS=1,APS5_ASYNC_DRAW_COMPILE=1andAPS5_ASYNC_COMPUTE_WORDS=0.mainalone stops before the menu, so the base wasmain+ #24083 + #16935 (measurement conditions, not dependencies) + #28279 + #28280. Two runs each, alternated:Both reach the menu and the Café with no driver failure. The Café's 3D scene is black with and without this PR (a separate issue); the menu overlay keeps updating with this PR.
#26165 adds a bounded wait before the plain path skips a dispatch; this PR does not use it, and the split path can take it the same way once both are in.
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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-29T19:37:00Z.
Review: COMMENTED
Actionable comments posted: 1
338eb89b-bf8d-4f04-906e-3d1e7e795b0aReviewing files that changed from the base of the PR and between
1f27e2abfaand839462b560.core/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Shaders/ShaderRegistry.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppcore/libs/prx/libSceAgcDriver/tests/execution/SplitTableCallDriver.cppcore/libs/prx/libSceAgcDriver/tests/execution/SplitTableCallRun.cppcore/libs/tests/ScalarCall.cppcore/shader/recompiler/ControlFlow/include/ControlFlow/GraphBuilder.hppcore/shader/recompiler/ControlFlow/src/GraphBuilder.cppcore/shader/recompiler/SplitStateAbi.hppcore/shader/recompiler/Translation/src/ControlFlowInstructions.cppdocs/dev/ENVIRONMENT.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-29T19:39:43Z.
Review: APPROVED
Reviewed — looks good
The reviewed change at head
839462b5608b0711c32e992888ab3691b77c3e97has no verified blocking findings; the author reports targeted Windows/Vulkan tests and game runs, which I did not run in this session.What I ran
reviewedin the manifest.Results
Negative control
Not run; no test command was run in this session.
Findings
Blocking
None.
Non-blocking
None.
Sources
The review used the prepared diff and files at the pinned head SHA. No external behavior claims are made.
Not verified
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T11:01:40Z.
Review: COMMENTED
Reviewed — comments
Nothing is required; the points below are optional.
What I ran
Reviewed head
4a53e23c838a4822f65baf429444dda501853203using the pinnedrepo_read.pyreader. No build or tests were run here. I read the description, commits, diff, and all added lines in 13 of the 14 changed files.core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwas excluded from the review folder and was not read.Results
Findings
Blocking
None.
Non-blocking
core/shader/recompiler/SplitStateAbi.hpp:112—DecodevalidatesmarkerSlotonly as a header word and accepts any value, althoughSaveMarkerlater uses it as a split-state buffer index. Since the plans are serialized in recompile requests, consider validating the slot againstTotalSlotsat the point wherevectorCountis known, to reject malformed or stale plans before GPU execution.Not verified
The contents of
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwere excluded as too large for the review folder and were not read. No local build, test run, or hardware behavior was verified. The Windows build, 103 passing tests, validation-layer result, and game measurements are author-reported. The review folder lists all 14 changed files; 13 were read and one was excluded.To get this to a good state
Nothing is required. Consider validating
markerSlotfor decoded plans.Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-30T11:15:17Z.
Review: COMMENTED
Actionable comments posted: 3
Architecture findings (1)
Advisory architecture findings (1)
970d861a-c9c8-49f9-aa7e-ccbe90739c12Reviewing files that changed from the base of the PR and between
839462b560and4a53e23c83.core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/execution/SplitTableCallRun.cppcore/shader/recompiler/ControlFlow/include/ControlFlow/GraphBuilder.hppcore/shader/recompiler/ControlFlow/src/GraphBuilder.cppcore/shader/recompiler/ControlFlow/src/RequestSerializer.cppcore/shader/recompiler/tests/RequestSerializerTests.cppdocs/dev/ENVIRONMENT.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T19:42:35Z.
Review: COMMENTED
--asynccan pass from the guaranteed cold entry/resume/repeat skip alone. It counts every untouched dispatch together, so it would still pass if first-round callee prebuilds were always synchronous. Can the fixture distinguish a skip after entry from a skip before entry? A companion case where the entry writes guest memory could also verify that a missing first-round callee completes synchronously once visible work has begun.Source review at
4a53e23c83. Paired Vulkan execution is pending.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.