fix(agc): name the V# fields when a vertex fetch exceeds its descriptor record count #9604
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9604"
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 ebarr24 on 2026-10-22T04:04:25Z.
What
A vertex fetch past NUM_RECORDS threw only 'vertex fetch exceeds descriptor record count', which does not say which V# fields decided the RDNA 2 range check. The message now appends OOB_SELECT, stride, NUM_RECORDS and whether the index is the vertex or the instance index, with the index. The behaviour is unchanged; it is still a throw. Kena PPSA01746 stops on this in the bring-up of #4073, and the values show what the next step must implement.
Tested
Windows 11, MinGW-w64 GCC 15.2, Release build with tests.
agc_driver_graphicspasses with this change; the new test fails onmain.Validation layer (vulkan-sdk-1.4.363.0), on
main11f976b27cand on this change, withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_ADD_LAYER_PATHset to the layer,ANYPS5_NO_SHADER_CACHE=1andANYPS5_REQUIRE_VULKAN=1:ctest -V -R "agc_driver_graphics". Neither log containswas not found but was requested by env var VK_INSTANCE_LAYERS; the change adds noVUID-errors (0 with the change, 0 onmain).ctest -V log, main
ctest -V log, this change
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)mainand this change, no new VUIDs🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by fogydes on 2026-10-22T08:49:12Z.
Reviewed; verified this is behavior-preserving and the message is honest. The throw condition is exactly the old one (
Require(recordsUnchecked || index < records, ...)⇔if (!recordsUnchecked && index >= records) Require(false, ...)), the string is only built on the failure path so the per-fetch hot path pays nothing extra, and the interleavedRequire(stride != 0 || required <= ZeroStride_AVAILABLEBytes ...)chain below is untouched so the next rejection keeps its own message.I checked the exact-string assertions against the test fixtures rather than trusting them:
fields = {0x1000, 32u << 16u, 3, ...}decodes to stride 32 / NUM_RECORDS 3,0x2004dfacu >> 28 & 3= OOB_SELECT 2, and the effective fetch index (maxIndex + instances - 1 + firstInstance= 3 + 1 - 1 = 3) gives "vertex index 3" — matches. The zero-stride case's{0x1000, 0, 8, ...}+ instance bit gives stride 0 / records 8 / select 1 / index 8 with fetchIndex 1 → "instance index 8" — matches. SinceexpectFailurematches by substring (.find(reason) != npos), the pre-existing "record count" assertions stay valid even though the message got longer, so the layered old/new pattern is a compatible way to tighten the assertion.One note: the run legs (
windows,linux,register-context) had not executed at review time, so the new exact literals only get their first real exercise when they run — they should, given the decode above, but that's the check to watch on the next green run.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T09:30:38Z.
Review: CHANGES_REQUESTED
The change is behavior-preserving: the record-count throw condition is unchanged, the diagnostic is constructed only on the failure path, and subsequent zero-stride/address-range checks remain in their prior order. The exact expected strings match the fixture field decoding. Exact-head conventions and
git diff --checkpass; hosted conventions, eligibility, intake, labels, and progress report pass. Product Linux/Windows jobs are skipped, so those checks did not independently run the test here.Before approval, please attach or link the paired
ctest -Vvalidation-layer logs required for AGC changes and state explicitly that neither run containswas not found but was requested by env var VK_INSTANCE_LAYERSand that the PR introduces no newVUID-errors versus main. The checklist currently asserts this, but the test section only says the focused test passes and does not provide the required validation-layer/no-cache invocation or the log evidence.The reported Kena rate changes from 14.0 fps on main to 13.6 fps on this change. Since this is a performance comparison, please add the two valid same-machine/scene summary lines and attach the traces using the repository Performance report format, or remove the unsupported fps comparison if it is incidental and not a claimed performance result. Include the exact title bring-up discussion link (currently
#4073) and keep its PR list current as required by the contribution rules.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T13:18:35Z.
Review: DISMISSED
I refreshed exact head
ecc035657c814259a1d47dd7f500ebb410094b34against current main3ca07d086d5f44fbe3c00370e7f03953ab46ca1b:git diff --checkand conventions pass, and the current-main merge tree is clean. The diagnostic is still failure-path-only and preserves the existing throw condition; the exact-string test expectations were independently checked against the fixture fields. Hosted conventions/eligibility/labels/report pass, but Linux/Windows product jobs are skipped. I did not run the GPU test locally.The existing review evidence requests remain unresolved: please attach the paired
ctest -Vvalidation-layer logs for main and this head, including the exact invocation and confirmation that neither run has theVK_INSTANCE_LAYERSwarning or new VUIDs. The Tested section also compares Kena at 14.0 and 13.6 fps. Since the change is diagnostic-only, remove that incidental performance comparison unless you intend to report a performance result; if retained as a result, include same-scene summary lines and traces using the repository performance-report format.The PR base is
dce41a89478876a8e3ea9c346b1dac00bb31c8cd, behind current main. Please update to current main and refresh the convention/test evidence on the resulting head. This is a request for the current-main and review-evidence requirements only; it is unrelated to the obsolete intake hold.Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-02T22:27:05Z.
Review: APPROVED
Reads right. The throw condition in
VertexBufferReadSize(core/libs/prx/libSceAgcDriver/Graphics/include/VertexInput.hpp) is unchanged:!recordsUnchecked && index >= records. Only the message gains OOB_SELECT, stride, NUM_RECORDS and which index (vertex or instance) was used, and the two new rows cover both index kinds.Tested on Windows 11, WinLibs GCC 15.2.0, with this head merged onto current
main:agc_driver_graphicspasses, nothing skipped. Withmain'sVertexInput.hppit fails on the new exact-message rows (unexpected failure: AGC graphics: vertex fetch exceeds descriptor record count).MarcZX10's open requests (paired validation-layer logs, dropping the incidental fps comparison, refreshing on current
main) are separate from this; I didn't run with the validation layer.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T22:48:08Z.
Review: APPROVED
Reviewed — approved
The change only makes the record-count error message more detailed. The throw condition is the same as before,
agc_driver_graphicspasses on the merged tree, and the two new rows fail whenmain'sVertexInput.hppis put back.What I ran
Head
56ea15a2382a5a765fbae268b22ad252c19e1305, merged with--no-ffontomain9090972b7e91fd266819cbd77a8b058e177b5682(merged tree07381e7aff668e7789b037733d6139f9c3be2f11). Debian 13 VM, GCC 14.2.0, Release, Vulkan through lavapipe (Mesa 26.1.6).Results
git diff --checkcheck_conventions.pymainVUID-agc_driver_graphicson the merged treeagc_driver_graphicswithmain'sVertexInput.hppgit status --porcelainemptyThe test executable takes about 35–36 s on this loaded VM. The PR adds only two
expectFailurerows, which is a negligible share of that time. A longGraphics.cppsuite that took this long before the PR would explain it, but I did not time it onmainhere: withmain's header the run stops early, at the first failing row (3.3 s).Negative control
I restored only
core/libs/prx/libSceAgcDriver/Graphics/include/VertexInput.hppfrommainand rebuilttests/agc_driver_graphics_tests. The test then failed:output
I then restored the merged file, rebuilt, and the test passed again. The worktree is back to the merged tree.
Findings
Blocking
None.
Non-blocking
None.
Notes from the code review:
core/libs/prx/libSceAgcDriver/Graphics/include/VertexInput.hpp:318-320:!recordsUnchecked && index >= recordsis the exact negation of the oldRequirecondition. The string is only built on the failure path, and the zero-stride and address-range checks after it are unchanged. The expected strings match the fixture decoding, as fogydes already worked out; I add only the run evidence.NUM_RECORDS == 0. That gap is out of scope here: the path still throws, so the "unimplemented paths throw" rule holds.Not verified
agc_driver_graphicsonmainon this machine, so I cannot confirm that the ~35 s runtime predates this PR. Given how small the change is, it most likely does.