Repository navigation
Conversation
…DEX_BUFFER_SIZE A queue that has received neither INDEX_BUFFER_SIZE nor INDEX_ATTRIBUTES_INDIRECT since its last reset has no index limit. Such a draw takes the CPU record path and reads each record's index range as written, refusing a range that overflows or is not readable. An explicit INDEX_BUFFER_SIZE of 0 still throws. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HAtTu2pw6GTkMNwsjBDatU
|
Thank you for your contribution! Authors with no pull requests merged into |
12 tasks done
This was referenced Oct 21, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
An indexed indirect draw (
DRAW_INDEX_INDIRECT0x25,DRAW_INDEX_INDIRECT_MULTI0x38) on a queue that has not receivedINDEX_BUFFER_SIZE(0x13) orINDEX_ATTRIBUTES_INDIRECT(0x91) since its last reset threwINDEX_BUFFER_SIZE has not been set.Marvel's Spider-Man 2 (PPSA08338) never emits either packet. Probing every 0x13 and every suspend-point queue reset over a whole run found none, so no written size is being lost. Per draw it writes
VGT_INDEX_TYPE(uconfig 0x243 = 0x400, 16-bit indices) andINDEX_BASE, then issuesDRAW_INDEX_INDIRECT_MULTI. It stopped about 110–194 s in, on both a 2026-10-13 base (84b0d2f24) and currentmain.The change:
QueueState::indexBufferSizebecomesstd::optional<std::uint32_t>. A size written by 0x13 or by a 0x91 record behaves as before. An explicit 0 still throws, now asINDEX_BUFFER_SIZE is zero.resolveIndirectDrawmarks the drawindexLimitKnown = falseand keeps the base and alignment checks.ClassifyIndirectDrawsends such a draw to the CPU record path (new pathIndexLimitUnknown, profiler name "index limit unknown"). The mesh GPU-side case goes there too, so the GPU path's whole-range check and copy is never reached without a limit.firstIndex/indexCountrange skips the clamp against the declared limit. Instead it must not overflow, and it goes through fix(agc): resolve sparse indirect index ranges per record #6606's per-record readability check. Reads stay bounded bymin(count at countAddress, packet count)records; nothing beyond a record's own range is read.docs/dev/debt/libSceAgcDriver.md. The console's initial INDEX_BUFFER_SIZE, and whether theDRAW_INDEX_2/DRAW_INDEX_OFFSET_2MAX_SIZE sets it, are not measured.The branch is #6606's head (
925f9a84b) merged withmain(0d1c299a9), plus one commit. Until #6606 is merged, the diff also shows its commits.Tested
tests/Pm4.cpp: 0x25 and 0x38 without 0x13 resolve with an unknown limit; an explicit 0x13 of 0 still throws; a written size keeps a known limit.SparseIndirectIndices: three new registrations.agc_driver_sparse_indirect_indices_no_sizesends 0x38 with no 0x13 and matches the reference triangle...._no_size_unreadableand..._no_size_unreadable_recordcheck that an unreadable active record still throws.resolveIndirectDrawmakesagc_driver_pm4and the threeno_sizetests fail. Disabling only theIndexLimitUnknownclassification makes the threeno_sizetests fail.ctest -R ^agc_: 732 of 733 pass, 3 skipped.agc_driver_bda_devicefails identically onmainon this machine (vkWaitForFences graphics: Vulkan result -4).tools/check_conventions.py --base origin/mainandtools/check_test_registration.py buildpass.mainwith fix(agc): run the unwatch hook before an import whose range leaves the write watch whatever the import does #7505 and fix(agc): resolve sparse indirect index ranges per record #6606 plus this change, the INDEX_BUFFER_SIZE abort is gone.GetImageResource dword 0 is not a valid runtime value(a record → pointer → V# → T# chain, Recompiler: a T# reached through two loads after a dynamically indexed read (pointer → pointer → T#, pointer → V# → buffer → T#) stops Ratchet & Clank (PPSA01474) and Guardians of the Galaxy (PPSA01748) #6191).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)🤖 Generated with Claude Code
https://claude.ai/code/session_01HAtTu2pw6GTkMNwsjBDatU