fix(agc): resolve unbounded indirect vertex inputs before copying #19620
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19620"
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-13T16:21:52Z.
What
Live strided OOB_SELECT 2 and 3 inputs can fetch past the descriptor's record index. An indirect draw must resolve the actual vertex and instance ranges before sizing the copy. Otherwise, the copy can omit guest values that the shader uses.
Reuse the current main
VertexFetchNeedsResolvedIndexcheck andVertexRangefallback for these live strided inputs. The resolved draw uses the real fetch range. Main's complete-stride Vulkan binding capacity, isolated copies, and select 0 and 1 behavior from #26706 stay in place. In particular the empty strided select-1 safeguard still resolves indices before sizing input.Measurements on gfx1036 and gfx1031 show that select 2 checks whether NUM_RECORDS is zero and select 3 checks the typed fetch's byte width without counting the index. The measured select-1 index bound differs from the resolved strided select-1 behavior that #26706 implements and tests. The debt entry records that discrepancy. Gfx1013 remains unverified. gfx1036 measurements, gfx1031 measurements.
Head
570e51a5449036e0c3eeeae5c2c84d816238ae90merges main6a1b7a1920ee5a8024c63f845998e50fad55d297into the publishedf295632315f5ab9ec2aee741b2c973bf54178b13, preserving both parents and prerequisite authorship. Relative to main, the production delta is inVertexInput.hppandDraw.cpp. The duplicate classifier and profiling reason are superseded by the shared main route. #9915 remains the declared dependency.Tested
December 1 focused Release builds on Arch Linux 7.3.5, GCC 16.2.1, AMD Radeon RX 6650 XT and RADV Mesa 26.3.1.
6a1b7a1920ee570e51a54490The common CTest registrations match after normalizing build paths. The suite includes main's select-1 draw-offset tests, recorded-stage groups, index-behind-writer and the shared pending producer. The old index-behind-writer fixture expected the optimization for select 2. The updated fixture verifies that select 0 still takes it and live selects 2 and 3 resolve the GPU-written indices, with exact shader outputs compared against the copied path. The initial checkout's fast-path counter failure and the updated check are in the archive. Candidate-only tests cover the device routing matrix, direct readbacks, a low-level unresolved draw followed by the resolved readback, and full driver submits with normal/copied producers, count filtering, instances and indices.
The tests require physical Vulkan, bypass the shader cache, and use the Khronos validation layer 1.4.363 with loader diagnostics. Fixture and linked-library hashes were verified through execution. The host could not run two optional guest-arena checks in the CPU/mock graphics profile test. With identical candidate fixtures linked against the frozen main provider, the routing matrix and both direct select-2/3 readbacks fail at their expected old-policy checks. All three pass with the candidate provider.
Source patch, build commands, verbose CTest and JUnit, and validation evidence, SHA-256
0d764d7aba4fe6908b3b7be75ffac8e736e103738e69819f4248cd547c8f6fab, 111 payload hashes verified after download.Previous paired Linux qualification at
f295632315f5and earlier three-arm controls remain pinned to those earlier heads. NVIDIA RTX 4090 and limited Apple M1 results are also historical.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 MarcZX10 on 2026-11-19T14:06:34Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the focused source review supports the fix, though I did not read every changed file or run checks.
What I ran
Reviewed head
a16428cddb130fe89e3cb34ff0255e7a904b390eusing the prepared diff andrepo_read.pyat the pinned head. No build or tests were run.Results
Findings
Blocking
None identified in the inspected code.
Non-blocking
None.
Not verified
The complete text of
core/libs/prx/libSceAgcDriver/tests/Graphics.cppwas excluded as too large and was not read. The manifest identifies 17 changed files; I read the prepared diff and inspected the core changed implementation and portions of test changes, but did not read every changed file in full. The reported Linux, NVIDIA, and Apple test results were not independently verified. Windows and physical-console behavior were not tested.To get this to a good state
Nothing is required. Optional: run the changed tests on Windows and review the excluded
Graphics.cpptest context before relying on this as a complete all-files approval.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T07:08:51Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected production changes address the described indirect vertex range gap; this review is incomplete because some changed files were not read in full.
What I ran
Inspected the prepared diff and targeted source ranges at head
5abacecd8040dd561289882dccf9fe8d00485a6ausingrepo_read.py. No build or tests were run; test results in the PR description are author-reported.Results
Negative control
Not run; no tests were run during this review.
Findings
Blocking
None in the code inspected.
Non-blocking
None.
Sources
Reviewed the prepared diff and these repository files:
IndirectDraw.cpp,VertexInput.hpp,Draw.cpp,Draw.hpp, the changedGraphics.cpphunk,IndirectVertexRange.cpp,StridedIndirectVertexFetch.cpp,DrawRecaptureOnChange.cpp,IndirectProducerGate.hpp,agc_driver_draw_recapture_on_change_tests.cmake, andindirect-unbounded-vertex-range.md.Not verified
The full contents of
Graphics.cppwere not read; only its changed hunk was inspected. Other changed files were not read in this pass, includingVertexInput.cpp,StridedVertexFetch.cmake,IndirectArgumentsPendingProducer.cpp, and portions of the test and build changes.Graphics.cppwas excluded from the review folder because it was too large. No independent build, test run, Windows test, or physical console behavior was verified.To get this to a good state
Nothing is required. Optional: complete review of the unread changed files before making a formal approval decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T09:31:02Z.
Review: COMMENTED
Reviewed — no blocking findings
The changed code routes indirect draws with live, strided OOB_SELECT 2/3 inputs through CPU record resolution before vertex inputs are prepared; I found no concrete defect in the inspected changes.
What I ran
Reviewed head
fb4dcb463b78136d51582c84f8078edec037612cusingrepo_read.pyfor the prepared diff and targeted source ranges. I did not run builds or tests.Results
Negative control
Not run; no build or test execution was available in this review.
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not independently reproduce the contributor-reported builds, CTest runs, or GPU results. The full text of
Graphics.cppwas not read; its changed lines were inspected. The added lines inGraphics.cpptests were read through the repository reader because that file was not included in the review folder. The remaining changed files were checked at their changed lines; unrelated portions of large files were not read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T13:42:01Z.
Review: APPROVED
Reviewed — looks good
The reviewed change at
22aef893254ea76b8d257d9d48e8f6b12746535aroutes indirect draws with unbounded strided selects through CPU record resolution; the inspected classification and copy-sizing code support the stated fix.What I ran
No build or tests were run in this review. I read the prepared diff and inspected changed code and targeted context using the
repo_read.pyreader at the pinned head.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build and tests were not run. The full text for
core/libs/prx/libSceAgcDriver/tests/Graphics.cppwas excluded from the review folder; its changed lines were read through the reader. No other changed file was excluded. Hardware and console behavior were not independently verified.To get this to a good state
Nothing is required.
Files read
Read all changed files listed in
review/manifest.json, including the changed lines ofcore/libs/prx/libSceAgcDriver/tests/Graphics.cppthroughrepo_read.py. Also read targeted callers and context incore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp. No changed file was left unread.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T22:11:58Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed change routes indirect draws with live strided OOB_SELECT 2 or 3 inputs through CPU record resolution; I found no verified blocking defect in the inspected code.
What I ran
f295632315f5ab9ec2aee741b2c973bf54178b13usingrepo_read.pyto inspect the prepared diff and targeted source ranges.Results
Findings
Blocking
None verified.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/tests/Graphics.cppwas excluded from the review folder because it was too large. Its changed lines were visible in the diff, but I did not read the full file at the pinned head.description.md,commits.md,manifest.json, anddiff.patch. Repository source read at head:IndirectDraw.cpp,VertexInput.hpp, andDraw.cpp.files.jsonwas unavailable; the file listing showedGraphics.cppas excluded.To get this to a good state
Nothing is required. Optional: independently run the author-reported focused checks on the reviewed head.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-01T20:25:55Z.
Review: COMMENTED
🏛️ Architecture findings (2)
Advisory architecture findings (2)
💬 Code review
eb3281b9-8649-47b2-80c9-2f1738eae88cReviewing files that changed from the base of the PR and between
6a1b7a1920and570e51a544.core/libs/prx/libSceAgcDriver/Graphics/include/VertexInput.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/IndirectProducerGate.hppcore/libs/prx/libSceAgcDriver/tests/VertexInput.cppcore/libs/prx/libSceAgcDriver/tests/cmake/StridedVertexFetch.cmakecore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_draw_recapture_on_change_tests.cmakecore/libs/prx/libSceAgcDriver/tests/execution/DrawRecaptureOnChange.cppcore/libs/prx/libSceAgcDriver/tests/execution/IndexBehindWriterVertexAttributes.cppcore/libs/prx/libSceAgcDriver/tests/execution/IndirectArgumentsPendingProducer.cppcore/libs/prx/libSceAgcDriver/tests/execution/IndirectVertexRange.cppcore/libs/prx/libSceAgcDriver/tests/execution/StridedIndirectVertexFetch.cppdocs/dev/debt/changes/indirect-unbounded-vertex-range.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-12-02T01:22:10Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected changes route live strided OOB_SELECT 2 and 3 inputs through resolved indirect ranges; I found no concrete blocking defect in the code reviewed.
What I ran
Reviewed head
570e51a5449036e0c3eeeae5c2c84d816238ae90. I ran no tests or builds. The description reports author-run Release CTests and Vulkan validation; those results were not independently verified.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
The full changed-file set was not read end to end, and the tests were not run. I inspected the changed core logic and selected test hunks. The
Graphics.cppfull text was not included in the review folder; its changed hunk was read withrepo_read.py. Other changed files not inspected in full:DrawRecaptureOnChange.cpp,IndirectArgumentsPendingProducer.cpp,IndexBehindWriterVertexAttributes.cpp,StridedIndirectVertexFetch.cpp,IndirectVertexRange.cpp,IndirectProducerGate.hpp,VertexInput.cpp, both changed CMake files, and the debt note. The manifest marksGraphics.cppas too large for the review folder;files.jsonlists no excluded paths.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:29:21Z.
Review: COMMENTED
The trial merge onto
c1601e56d5was clean. I checked that live strided select 2 and 3 inputs go through resolved indices before the copy is sized, and that empty select 1 still takes the existing safety path. Please retain the execution case where the indirect index exceeds the descriptor record count and the producer must settle before the CPU reads the arguments. These address distinct range and ordering failures. Paired 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.