perf(graphics): retain vertex descriptor decode plans #1313
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1313"
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 TibixDev on 2026-10-07T23:17:12Z.
What
Retain immutable vertex semantic/read plans in the current draw decode. Read live attribute and buffer tables on each use, coalescing only adjacent referenced words. Preserve original semantic ordering, duplicate semantics, format overrides and exact guest-read coverage.
Rebuilt directly on main
d146ec1b6, dropping #1311 and the old draw-plan stack. Preserve current raw-header handling, the short user-data header ABI, static preparation, and merged-stage hidden user words.Tested
Fedora 44, GCC 16.2.1, Release:
No new isolated in-game performance result or Windows test. Full Linux/Windows PR CI requires the collaborator-dispatched workflow.
Checklist
Verified title integration
Verified runtime smoke test: a freshly NID-patched #1313 library (
c1eaeb47f2a8cb515aa7a8b818012322a2702928d309c38a5877f55c8f91f6bd) differs from main and containsVertexStagePlan;/procconfirms that the game loaded it. With the identical experimental NGS dependency andAPS5_VERIFY_DRAW_RECIPE=1, a 120-second Skyrim run reached the PRESS ANY BUTTON screen. The log reports 3,064 decode comparisons with zero differences and no unexpected exception. It ended at the imposed timeout (124). This is a correctness smoke test, not a title-performance or full-gameplay result.Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-08T07:12:03Z.
Rebased on
c081eb90. Updated #1311 after #1134 merged. Non-indexed mesh draws retain the upstream null index descriptor; retained plans and their invalidation coverage remain intact.Fedora 44 Release:
agc_vertex_stage_tests,agc_driver_draw_plan_tests,agc_driver_tests,agc_driver_graphics_tests,agc_driver_pm4_testsbuild; the targeted tests and contribution checks pass. Windows CI is pending.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T11:39:05Z.
Review: CHANGES_REQUESTED
Thanks for the work here. As it stands this can't land:
mainin 10 files (DrawCache.hpp/.cpp,DrawCacheStatistics.cpp,DrawCapture.cpp,DrawDecode.cpp,Draw.cpp,Driver.hpp,ShaderInputState.hpp/.cpp,CMakeLists.txt), mostly because of #639:compileDrawStageis nowmaterializeDrawStage, built from invocations prepared at registration.main(comment on #1311, 2026-10-09). This PR has to follow once the base is redone.main. Please re-measure with this PR alone on top of currentmain.Once the base is rebased, please rebase this one on top of it, rerun
agc_vertex_stage_tests/agc_driver_draw_plan_testsand post the before/after for the vertex-plan commit only.Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-12T04:50:40Z.
Rebuilt this on main
d146ec1b6in726ad7632, without #1311 or its old draw-plan API. The retained plan now belongs to the existing draw decode. It preserves the current short-header ABI, raw shaders, static prepared invocations and hidden user words for merged stages.Vertex-stage, PM4, graphics and prepared-graphics tests pass; graphics runs with RADV core/synchronization validation. Added static-ABI/no-read and hidden-user-word coverage to the existing mutation, guard-page, ownership and concurrent-reader cases.
Isolated CPU measurements compare main's exact decoder with the retained plan and with rebuilding a plan on every call. Six alternating runs/mode, live table changes, read tracking and matching checksums: for 1/4/16/32 semantics, main 0.152/0.465/1.812/3.162 µs, retained 0.113/0.121/0.149/0.195 µs, cold 0.149/0.197/0.277/0.346 µs. The single-semantic cold case is inconclusive. These are component results, not a title FPS claim.
The seven-file branch is ready for another code review; title benefit and full platform CI remain separate outstanding validation. AI-assisted update.
Verified runtime smoke test: a freshly NID-patched #1313 library (
c1eaeb47f2a8cb515aa7a8b818012322a2702928d309c38a5877f55c8f91f6bd) differs from main and containsVertexStagePlan;/procconfirms that the game loaded it. With the identical experimental NGS dependency andAPS5_VERIFY_DRAW_RECIPE=1, a 120-second Skyrim run reached the PRESS ANY BUTTON screen. The log reports 3,064 decode comparisons with zero differences and no unexpected exception. It ended at the imposed timeout (124). This is a correctness smoke test, not a title-performance or full-gameplay result.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T09:08:10Z.
Review: APPROVED
Rebased on current
main(one adjacent-line conflict inDraw.cppwith thepaClVsOutCntlline, kept both). Checked on the rebased tree: build and the libSceAgcDriver/libSceAgc ctest scope pass, includingagc_vertex_stage. The new test does not compile without the change, and swapping the buffer index inVertexStagePlan::Readmakes it fail ("changed descriptor or root was not read"). The only failing test here,agc_driver_tessellation, crashes inside RADV's pipeline link on this host and does so on unrelated PRs too. Merging once the full Build is green.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T10:41:43Z.
Review: CHANGES_REQUESTED
The full Build (windows job) fails on this head:
agc_vertex_stageexits with0xc0000135(DLL not found) because the test linkslibcbut its ctest entry does not putlibc's directory onPATH. Please add, inside theif(BUILD_TESTING)block ofagc_vertex_stage_testsincore/libs/prx/libSceAgcDriver/CMakeLists.txt, the same thing the neighbouring tests do:mainalso moved:Draw.cppnow conflicts on thepaClVsOutCntlline (keepvertexInputs->Read(...)and main's| graphics.layerExports). Please rebase and push; the rest of the diff looked fine on review (new test fails without the change).Imported from boykopovar/AnyPS5. Originally posted by gunerky on 2026-10-13T20:46:46Z.
Additional Windows integration and boundary-test evidence for PR head
bff970af554a1e928d476e55f217562c36262702, combined locally with main0aa4cb1c2f2f8936f3985f905697b0070f1f7305. No commit or branch history was rewritten.The single
Draw.cppconflict was resolved retaining bothprogram.vertexInputs->Read(...)and main's| graphics.layerExports. I applied the requested Windows CTest PATH property and extended the existing Linux-onlyguardBoundary()fixture to Windows withVirtualAlloc,VirtualProtect(PAGE_NOACCESS)andVirtualFree. This tests a descriptor at the last 16 bytes and an attribute at the last 4 bytes of a readable page, followed by an inaccessible page.Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0, Python 3.12.14, Ninja Release,
BUILD_TESTING=ON, Windows-default SPIRV-Tools OFF, offscreen VideoOut. Graphics tests ran on NVIDIA GeForce RTX 3060, WMI driver 32.0.16.1742.libs: passed. The runtime libraries were built afresh; the guard probe recordslibc.prxandlibSceAgcDriver.prxloaded from this new build directory.agc_vertex_stageCTest: 3/3, test times 0.16, 0.03, 0.03 seconds; its 30-second timeout is unchanged.Full CTest used
--parallel 4 --timeout 120, preserving the existing per-test timeouts. The first integration at maindacd78525e537a779682032c0ace7f7af120af05passed 1091/1098 with seven skips. After incorporating the unrelated NGS2/PosixForWebKit main updates, one full run passed 1091/1099 with seven skips and failedsavedata_memory_metadata:std::filesystem::remove_allreported Access denied on its temporary cleanup directory and the process aborted (0xc0000409). That test then passed three serial retries. Full-suite recheck without source changes: 1092/1099 passed, 7 skipped, 0 failed. The failed run is preserved; the cleanup cause is not established or fixed here. The test's imports and changed-file scope show no AGC runtime/code dependency.The follow-up delta is only the CTest environment property and Windows test-platform branch; the retained-plan implementation remains the PR author's work. The GitHub branch still requires the author's rebase/update. Linux/macOS, PS5 and games: not tested. No title-performance claim is made. AI-assisted: yes, local integration, test-platform adaptation and validation assisted by Codex.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T06:23:45Z.
Closing for now: adriadam10's review from 10-13 (Windows PATH fix, the Draw.cpp rebase) is unanswered, it conflicts with main and the last full build is red on Windows. Reopen with those addressed and before/after numbers from a title scene if you pick it up again.
Pull request closed