fix(agc): resolve reuse-enabled indirect mesh draws on the CPU #23811
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23811"
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 JJenkx on 2026-11-19T17:46:31Z.
What
With
APS5_MESH_REUSE=1, a single indexed indirect mesh draw without offset SGPR locations could be classified for GPU-side arguments, then fail withindirect mesh draws do not support reuse grouping.Route reuse-enabled mesh indirect draws through the existing CPU argument-resolution path before building each draw's group table. Synchronized record reads, record limits, offsets and per-record drawing stay in use. Ordinary eligible indirect mesh draws retain the GPU path, including current main's non-indexed single-record path.
This stacks on #20518 at
22d46b1f2832. The current child51f90821421dmerges upstream93d64f2d1e75intod509bcbf6745. The request reader accepts upstream split-state format 64, historical mesh format 65, and compiler-options format 66 from #24721. It writes mesh format 67. Merge order is #24721, #20518, then this PR.Add eight distinct-record pixel checks (both, left only, right only, neither; inline and pipelined), fixed public format-64 capture fixtures and required-tail truncation checks. Keep all parent serializer tests. The routing matrix checks that reuse/multi-record cases use CPU resolution while eligible ordinary single-record cases keep the GPU path.
Tested
Current head
51f90821421d, Linux: The registered request-serializer and shader-memory CPU suites both passed. All 15 selected Vulkan fixtures passed on RX 6650 XT/RADV with Khronos validation 1.4.363, zero skips and zero validation diagnostics (FIFO ticket13694).The selection includes both poisoned-offset cases, the device-query routing matrix, and all eight multi-record readbacks across inline and pipelined modes.
Earlier Linux qualification
Fresh Linux qualification of final head
a3aaf428e70f1209762a30d288b98fc09c0cff36against pure maine1e7d4b96b48fc03c7d189510b37d56a17070ff8, on Arch Linux 7.3.5, GCC 16.2.1, AMD RX 6650 XT / RADV Mesa 26.3.1, validation layer 1.4.363 (headers 335).request_serializersuiteThe final child has 12 GPU execution/readback cases, one device-query-only routing case and one CPU case. Both full SDK/relinker builds and five fixture targets were built through the Linux resource gate. Actual raw and patched driver source labels match each tested head; all 835 frozen bank files per arm stayed unchanged. Fresh resolved CMake test commands/environments are retained. Each hardware case confirms the physical RADV device and validation-layer insertion with
ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationandVK_LOADER_DEBUG=layer; no missing-layer warning or device loss was recorded. Completectest -Vlogs provide the per-case audit because JUnit truncates passed-test stdout.The retained first refreshed run found an outdated assertion for ordinary non-indexed single-record draws. Main
fc6660ec98b5intentionally enabled that GPU path. Only that expected result was updated, then the final SDK/fixtures were rebuilt with matchinga3aaf428source labels and all 14 child cases rerun successfully.Fresh logs, JUnit, commands, source proofs and frozen-bank manifests, SHA-256
7092f9e590b32cf2580682708cdb93aa9f6bbbf7bd07087e7b020db49b20fbde; release download and all 49 payload hashes verified. Conventions pass against the pinned main; a separate merge-tree check is clean against main4f69a6052e29. This is Linux fixture qualification; current-head Windows testing remains outstanding.The original parent-control refusal and pixel negative controls remain historical. The synthetic CPU cross-reader witness documents why the conflicting experimental parent format-64 captures cannot safely be guessed from tail length.
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
APS5_MESH_REUSE; grouping respects configured vertex and primitive limits. Draws using primitive restart are excluded, and eligible indirect draws resolve their arguments on the CPU.APS5_MESH_REUSE, including its default behavior and eligibility conditions.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T10:52:54Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
e1f013999582ee88d7353127145658dac6ee1ac9using the prepared diff andrepo_read.py. No tests or build commands were run.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Reviewed changed-line context in
IndirectDraw.cpp,Draw.cpp,InstructionTranslator.cpp,MeshReuseGroups.hpp, andMeshReuseGroups.cpp; also inspected targeted context inExecution/src/Driver/Draw/Draw.cppandShaderMemory.cpp.Not verified
This was not a complete file-by-file review. Several changed files listed as included in the manifest were not read, and
ShaderMemory.cppwas excluded from the review folder and only a targeted range was read through the reader. No tests or build were run. The test and GPU results in the description are author-reported.To get this to a good state
Nothing is required. Optional: complete the review of the unread changed files and run the relevant checks on this head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T23:15:54Z.
Review: COMMENTED
Reviewed — comments
Changes are required before merge: the indirect reuse routing and per-record CPU argument resolution need further verification.
What I ran
The prepared diff is for head
0f49e39b8b1448b12b2faab4f592e18db46c9974. I did not run commands or tests;repo_read.pywas unavailable as a shell command, so I used the provided reader tools. I readdescription.md,commits.md,manifest.json,diff.patch, and the changed source ranges inIndirectDraw.cpp,Draw.cpp, andInstructionTranslator.cpp.Results
Negative control
Not run; no tests were run.
Findings
Blocking
None verified.
Non-blocking
IndirectDraw.cpp:34) and rejects non-null indirect arguments inplanDraw(Draw.cpp:1896). I did not inspect the CPU per-record caller to determine whether it clears or transformsargsbefore planning. Please verify that path, including multi-record indirect draws, against the stated behavior.Not verified
I did not read the remaining changed files or all changed hunks. The manifest lists 30 changed files; the review folder excludes
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppbecause it is too large. The cited author test results were not independently run. No conclusions are made about unread code.To get this to a good state
Nothing is required for a merge-blocking defect. Please verify the CPU indirect per-record path for reuse-enabled mesh draws; this is optional feedback pending further review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T13:14:40Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected change routes reuse-enabled indirect mesh draws through CPU argument resolution, but the full changed-file set was not reviewed, so a formal approval is not justified.
What I ran
Read the prepared description, commit list, manifest, and diff at head
a3aaf428e70f1209762a30d288b98fc09c0cff36. Read selected source ranges inDraw.cpp,SpirvModuleEmitter.cpp, andRequestSerializer.cpp. No commands or tests were run.Results
Findings
Blocking
None verified in the inspected code.
Non-blocking
None.
Not verified
The full text of changed files was not read, including the excluded
ShaderMemory.cppand other files not examined beyond their diff hunks. The author-reported Linux qualification and attached evidence were not independently verified; Windows testing is also unconfirmed.files.jsonwas unavailable through the review reader, so its reviewed/excluded inventory could not be checked directly.To get this to a good state
Nothing is required. Optional: complete review of the remaining changed files and independently verify the reported test evidence before issuing a formal decision.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T17:43:01Z.
Review: COMMENTED
Actionable comments posted: 3
b8a4702d-c252-43ff-9e73-907679d58a9dReviewing files that changed from the base of the PR and between
1bc92752d2andfaa25b2e0e.core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawLookup.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/IndirectDraw.cppcore/libs/prx/libSceAgcDriver/Graphics/include/MeshReuseGroups.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Mesh.cppcore/libs/prx/libSceAgcDriver/tests/MeshReuseGroups.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_draw_offset_indices_tests.cmakecore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_mesh_draw_relocation_tests.cmakecore/libs/prx/libSceAgcDriver/tests/cmake/agc_mesh_reuse_groups_tests.cmakecore/libs/prx/libSceAgcDriver/tests/execution/DrawOffsetIndices.cppcore/libs/prx/libSceAgcDriver/tests/execution/MeshDrawRelocation.cppcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/ControlFlow/src/RequestSerializer.cppcore/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrOpcode.hppcore/shader/recompiler/IntermediateRepresentation/src/IrOpcode.cppcore/shader/recompiler/Optimization/include/Optimization/ShaderStageInputInfo.hppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterInstructions.hppcore/shader/recompiler/SpirvBackend/src/SpirvFlowEmitter.cppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/shader/recompiler/Translation/src/InstructionTranslator.cppcore/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cppcore/shader/recompiler/tests/RequestSerializerTests.cppdocs/dev/ENVIRONMENT.mddocs/dev/debt/changes/fix-agc-mesh-reuse-indirect-routing.mddocs/dev/debt/changes/request-replay-options.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T17:45:40Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
faa25b2e0e08aa674e1382e7f4b94d5c6ff1cbd6. I inspected the prepared diff, changed code, and relevant callers throughrepo_read.py; I did not run commands or tests.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I read the core grouping implementation, indirect routing, shader translation and SPIR-V emission, serializer changes, and grouping tests. I did not read every changed file: full
ShaderMemory.cppwas excluded from the review folder as too large, and the remaining changed files—including portions of the serializer and shader changes, test fixtures, and documentation—were not fully inspected. I did not run the reported Linux checks, Windows tests, builds, or a merge-preview check. Those outcomes are author-reported in the PR description, not verified here.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T19:09:56Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change based on the inspected source; the author-reported Linux qualification passed, but I did not run checks.
What I ran
Reviewed head
5ae9e462d19ea118f72b3646495093c9a4b07136. No build or tests were run. Readdescription.md,commits.md,manifest.json, anddiff.patch, plus targeted repository source throughrepo_read.py.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwas excluded from the review bundle because it was too large; I read targeted ranges around its changed lines. The full current-head Windows behavior and the reported Linux test runs were not independently verified. All other changed files listed in the manifest were included, but I did not read every included file in full.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T19:29:58Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing in the inspected code establishes a blocking defect; approval is not justified because several changed files were not read and no checks were run in this review.
What I ran
No commands or tests were run. I inspected the prepared diff and selected changed source ranges using the pinned reader.
Results
Findings
Blocking
None identified in the inspected ranges.
Non-blocking
None.
Not verified
The changed production routing, grouping and serialization paths were sampled, but the review is incomplete. The manifest says all changed files were included; only
DrawLookup.cpp,DrawRegisterKey.cpp,IndirectDraw.cpp,MeshReuseGroups.hpp,Draw.cpp, selected sections ofRequestSerializer.cpp,InstructionTranslator.cpp, andMeshDrawRelocation.cppwere read. Other changed files and code outside the inspected ranges were not verified. The reported Linux test results are author-supplied and were not run here. Windows behavior remains unverified per the description.To get this to a good state
Complete review of the remaining changed files and relevant callers, then run the applicable checks on this head before deciding whether approval is justified.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T22:30:25Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed changes show no verified blocking defect; the full
ShaderMemory.cppsource was unavailable in the review folder, and current-head Windows behavior was not verified.What I ran
Reviewed head
51f90821421d3d9b4757f0910b4dbc4894b6c9f8. Read the prepared diff and manifest, relevant runtime source ranges throughrepo_read.py, and changed-file text available underfiles/. No tests or build commands were run; qualification results below are reported by the author.Results
Findings
Blocking
None.
Non-blocking
Sources
Behavior was checked against the prepared diff and source at the reviewed head. The author-reported Linux test results were not independently run.
Not verified
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpptext; its changed hunks were present in the diff, but the full file was excluded by size.To get this to a good state
Nothing is required. The optional point above is for additional platform coverage.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-30T22:36:58Z.
Review: COMMENTED
Architecture findings (2)
Advisory architecture findings (2)
c3bba031-1250-45f8-bffb-8af36ee179a5Reviewing files that changed from the base of the PR and between
d509bcbf67and51f9082142.core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/IndirectDraw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/execution/DrawOffsetIndices.cppcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/shader/recompiler/Translation/src/ShaderInputInfoBuilder.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 coderabbitai[bot] on 2026-12-03T00:47:58Z.
Review: COMMENTED
Actionable comments
1700217f-fb5c-4c53-9a27-4071e8bd9709Reviewing files that changed from the base of the PR and between
51f9082142anda40c8c2b30.core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppLimit details: You’ve used all 10 included reviews currently available.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T00:51:42Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected excerpts show the reuse routing and group-table reads align, but the review is incomplete, so a formal approval is not justified.
What I ran
Reviewed head
a40c8c2b30111662e891a91561fcd3f1d9fc618fusing the prepared diff and targetedrepo_read.pysource ranges. I ran no builds or tests. The reader returned source excerpts, but its audit-log append failed in the read-only workspace.Results
Findings
Blocking
None in the inspected excerpts.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwas excluded from the review folder due to size; changed excerpts were inspected throughrepo_read.py.reviewedinfiles.jsonwere considered through the prepared diff; targeted source reads focused on draw routing, shader group-table access, serialization, and configuration. This was not a full-file audit of every changed path.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T01:12:55Z.
Review: COMMENTED
Reviewed — no blocking findings
I found no concrete blocking defect in the changed code; the author’s reported test results do not cover the exact reviewed head.
What I ran
Reviewed head
c876381b1dd7f4f7eba98064bbb42b98e0778ddeagainst basemain; no merged-preview check or tests were run. I inspected the prepared diff and changed-line source excerpts withrepo_read.pyin the read-only review environment; no compiler or build tool was used.Results
Negative control
Not run by the reviewer.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
The author reports Linux GPU and CPU checks on head
51f90821421dand earlier qualification ona3aaf428e70f; neither is the reviewed head. Current-head execution, including the outstanding Windows checks, was not verified. The two oversized files excluded fromfiles/(Graphics.cppandShaderMemory.cpp) were inspected for their changed hunks throughrepo_read.py; their full text and unchanged context were not read.To get this to a good state
Nothing is required. Optional: refresh the test report on
c876381b1dd7f4f7eba98064bbb42b98e0778dde, including Windows validation.Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T21:57:00Z.
Review: COMMENTED
The current routing sends reuse-enabled records through synchronized CPU resolution and keeps the ordinary GPU route. There is a wire-format conflict with #23818. Its serializer writes version 65 with a different mesh record. I compiled both exact serializers and confirmed this branch rejects that request as truncated, although each reads its own output. Please coordinate the history with #23818 before both land, and also coordinate the new version 67 with #23553. The paired mesh and serializer fixtures are queued.
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.