feat(agc): serve lane-keyed, pointer and runtime image-table columns #10193
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10193"
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 Celegans12 on 2026-10-23T12:38:57Z.
What
Stacked on #9508, which retains #7642 and both dependency authors' original commits. Please review the device-image-table changes and the merge resolution.
With
APS5_KEEP_UNEXPECTED_DEVICE_IMAGES=1, keep keys missed by the CPU pre-pass on the device image path. Resolve recorded misses so later dispatches can use pointer, indirect and GPU-derived runtime T# columns. Present settlement follows the existing GPU-path policy; heap availability follows the parent's extension-revision policy. Sampler support remains in #13928/#13929.Merge current #9508 and main, preserving main's interpolation and feature-digest cache keys alongside device-table selection. Request format 57 records that selection for replay, accepts supported formats through 52 and 55, and rejects unsupported 50, 53, 54 and 56. Shader-cache format 75 separates the combined layout from the earlier formats. The reported title-scale cache growth remains unresolved.
The combined-stack scan reports 66 shared-line or export overlaps, including dependent #13928/#13929 and the request/cache-format branches; 142 conflicting branches could not be compared. Reconcile formats and shared changes as those PRs land.
Tested
Based on
main096c45570fand #9508. Windows 11 / MinGW-w64 GCC 15.2.0, Release with-DBUILD_TESTING=ONand SPIR-V Tools: 23 selected serializer, shader-cache, image-table, heap-slot and device-path tests passed three times on NVIDIA RTX 3080 Laptop / 610.62 with validation 1.4.363; no VUIDs or skips. The serializer test failed before recording the device-table flag and passed after the fix; it also checks version-55 compatibility and reserved-version rejection.Ubuntu 24.04 WSL / Mesa 25.2.8 llvmpipe / LLVM 20.1.2, validation 1.4.363: nine cases passed three times, including the shader-cache and column tests; 14 heap-dependent cases skipped. No VUIDs were reported. Asynchronous userfaultfd write protection and native descriptor-heap coverage were unavailable.
Not tested: full suite, native Linux heap, current titles/FPS, persistent-cache growth, production windowed presentation or the external old-layer failure. A contributor measured an earlier head on a local title stack with additional experiments; that does not validate this head or settle cache growth.
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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T12:45:11Z.
Review: CHANGES_REQUESTED
Reviewed the three-commit delta after #7642 head
594b34659a97084c2d8fe5cb29896f1f216b4cf6, as requested. The new pointer/indirect shader tests and the lane/pointer device-path tests cover useful portions, but the Tested section does not identify successful results on this PR head: it gives the 12/12 NVIDIA/lavapipe counts for #7642, then says the new tests fail on that base. The hosted checks on this head are only conventions/intake/labels; runtime jobs are skipped by policy. Please report exact-head results for the new tests, with the focused AGC validation-layer settings and no missing-layer/VUID output. In particular,agc_shader_device_runtime_address_columnsverifies compilation/planning only; please add or provide a device-path regression proving a runtime-address T# is recorded as a miss, resolved at Present, and serves the correct texel in the following batch withAPS5_KEEP_UNEXPECTED_DEVICE_IMAGES. The stack depends on #7642, whose current PR head is not mergeable with main, so refresh the stack and rerun its focused tests once that base is rebased before merge.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-28T14:42:32Z.
Review: CHANGES_REQUESTED
Reviewed the four commits after #7642 (295a49f641..7880ded9da).
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp:3741-3742: drop the twoexpectFailure(... "GetImageResource dword 0 is not a valid runtime value" ...)checks for the run-time-address T# with the switch off, as @oneandonlydean asked on 2026-10-27. They assert that an unsupported shape throws and break as soon as it is supported; the device-column cases can stay.APS5_KEEP_UNEXPECTED_DEVICE_IMAGES=1: the shader disk cache went from 23 to 65 GB in 155 s. Every program is persisted twice (gpuResolvedImages=1, then the fallback with 0) and vertex modules are 6-9 MB each. Anything kept alive needs a stated bound and peak size before/after: please persist the eligibility verdict with the plan entry (or decide it before the first compile) so the discarded variant is not stored, and say how big the cache is for the same scene afterwards.main) and #9508. Once they land, rebase the four commits and make sure the3rdparty/Vulkan-Headerspointer in the combined diff comes only from a PR meant to change it.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-29T17:17:03Z.
Review: CHANGES_REQUESTED
Still blocked, nothing new on the head since the last review (7880ded9da). Open points:
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp:3741-3742: drop the twoexpectFailure(... "GetImageResource dword 0 is not a valid runtime value" ...)checks for the run-time-address T# with the switch off, as @oneandonlydean asked. They assert that an unsupported shape throws and break as soon as it is supported; the device-column cases can stay.APS5_KEEP_UNEXPECTED_DEVICE_IMAGES=1is unanswered: the shader disk cache went from 23 to 65 GB in 155 s because every program is persisted twice (gpuResolvedImages=1, then the fallback with 0), with 6-9 MB vertex modules. This needs a design change on your side: persist the eligibility verdict with the plan entry (or decide it before the first compile) so the discarded variant is not stored, and state the cache size for the same scene before/after.main) and #9508. After they land, rebase the four commits and make sure the3rdparty/Vulkan-Headerspointer in the combined diff comes only from a PR meant to change it.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T13:14:58Z.
Review: CHANGES_REQUESTED
Re-checked — new head, changes requested
The new head updates the descriptor-heap revision gate, but the previously measured shader-cache growth remains unresolved and the current source still creates distinct ordinary and GPU-resolved shader variants.
What I ran
Reviewed head
8403a9b05c85c4fe6f276e816ab9cb1220e13746against PR base60bdb061356db736928eee431cd8bd4c9ba68036; the stack check reports #10193 clean when applied alone to currentmaincd087bd12c258cf6dbb82e203bafd20d9fe2596c, while dependency #7642 conflicts with currentmain. Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0. I did not build or run GPU tests locally.Results
main, so the stack is not ready to land. I am not requesting a rebase before its dependency is resolved.8403a9bUnedited local precheck output
git diff --checkproduced no output. The precheck confirmed both head and PR base were unchanged at completion.Findings
Blocking
A contributor measured the shader cache growing from 23 GB to 65 GB in 155 seconds on earlier head
414f92ab8cwithAPS5_GPU_HEAP=1,APS5_GPU_PATH=1, andAPS5_KEEP_UNEXPECTED_DEVICE_IMAGES=1. The author later said that the ordinary and heap variants were still both prepared and persisted, and that the scene had not been rerun or the growth fixed. On the current head,ShaderRegistry.cppstill prepares a normal entry and then an entry withgpuResolvedImages=true;CacheKey.hppincludes that flag, giving the two variants distinct cache identities. The current additions settle unexpected-key batches, but I found no cache-size bound or eviction that addresses the reported growth. Please prevent or bound persistence of discarded/duplicate variants, then rerun the same scene on the updated head and report cache growth and peak size. The older measurement is not presented as a measurement of this head.Non-blocking
The new pointer/runtime-address tests and unexpected-batch settling cover additional behavior. The reported test runs disable the shader cache, so they do not resolve the blocking cache-growth finding.
Sources
gpuResolvedImages.Not verified
I did not rerun Ghost of Yōtei, measure cache growth on head
8403a9b, build, or independently run the focused GPU tests. I did not verify other GPUs or console behavior. The reported 23-to-65 GB result is from an older head; the current-head magnitude is unmeasured.To get this to a good state
Prevent or bound duplicate/discarded variant persistence and report the same-scene cache measurement on the updated head. I will rerun the relevant checks and reassess that exact head.
Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T21:07:41Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The merged tree builds and the tests the change reaches pass. Reverting the PR's planner change makes its new shader tests fail, as it should. One problem blocks: the
agc_driver_presentation_pass_gpu_heapvariant this stack registers failstools/check_skips.pyon lavapipe, the stepmain's Linux CI job runs after ctest.What I ran
Head
d2ec292f746d038b713f0b39a74d653322a1a6b4merged intomain9090972b7e91fd266819cbd77a8b058e177b5682with--no-ff, giving merged tree602d26c5e88754cb806633947d3b9d83fea8fc18. The machine is Debian 13 (a VM with 32 vCPU, Xeon Gold 6136) with GCC 14.2.0 and lavapipe (Mesa 26.1.6, LLVM 19). It has no GPU and noVK_EXT_descriptor_heap.Results
git diff --checkcheck_conventions.pylibsmain.check_skips.pyagc_driver_presentation_pass_gpu_heapis a new unexpected skip.guest_net_ctlis also flagged, but it skips onmaintoo.VUID-lines compared withmain_gpu_path,_unexpected,_pointer,_runtime_address,_table_heapand_gpu_heapcase, because lavapipe lacksVK_EXT_descriptor_heap.FormatVersiongoes from 51 onmainto 75. Requests are written at version 57; versions 53, 54 and 56 are rejected and 55 stays readable.request_serializerpasses.3rdparty/Vulkan-Headerspointer2fa2034→5d94bb4) comes only from #9508's1be42301d4, which needsVK_EXT_descriptor_heap. This answers the earlier question about where the pointer comes from.check_skips.py
agc_driver_presentation_pass_gpu_heap output (tail)
Negative control
The PR's production change from main is too intertwined with the stacked #7642 and #9508 code to restore whole files. I reverted only this PR's own planner hunks in
core/shader/recompiler/Optimization/src/ResourceTracker.cpp:PlanRuntimeAddressColumncall site at line 1977;if (!column.sampler && !column.address && !column.indirect && column.pointerHops.empty()).Then I rebuilt
agc_shader_memory_tests.agc_shader_device_pointer_columnsfailed:the pointer column of a GPU-mode stage is not read through the device image table.agc_shader_device_runtime_address_columnsfailed:GetImageResource dword 0 is not a valid runtime value; ....I restored the file from the merged tree and rebuilt. Both tests pass again, and
git status --porcelainis empty.agc_driver_device_image_tableincludes the PR's newSettlesUnexpectedBatchescase, and it passes here. The driver-level_unexpected,_pointerand_runtime_addresscases skip on this machine, so I could not run a control for them.Findings
Blocking
agc_driver_presentation_pass_gpu_heapfailscheck_skips.pyon lavapipe: tests/PresentationPass.cpp#L793 and #L830-L834._gpu_heapvariant (from #9508 in this stack) first runs the non-heap suites, which printpresentation source in host memory: skipped, the device offers no host memory type for the image. It then exits 77 for the missing descriptor heap.check_skips.pyneeds everyskipped,line of a skipped test to matchDEVICE_LIMITATION. "the device offers no ..." does not match, so the test counts as an unexpected skip and the script exits 1.main's Linux job (build.yml), also on lavapipe withoutVK_EXT_descriptor_heap. Merging as is should turn that step red. Onmainonly the plainagc_driver_presentation_passexists, and it passes, so nothing is flagged there.skipped, the device has no host memory type for the image.GpuHeapEnabled()branch, checkSkipWithoutDescriptorHeap()before running the non-heap suites, so the variant prints only the heap reason.Non-blocking
APS5_KEEP_UNEXPECTED_DEVICE_IMAGES: docs/dev/debt/libSceAgcDriver.md#L366.VulkanDevice::SettleDeviceImageMissesalso makes each present wait for the GPU, which removes the overlap between frames.ENVIRONMENT.mddescribes this, but the debt file is where the console difference belongs. Please add a sentence there.APS5_GPU_PATH: ResourceTracker.cpp#L2053 changes this forAPS5_GPU_PATHwithout the keep switch, not only for the opt-in mode.KeepsUnexpectedPrograms(), or say in the description that the plain GPU-path behaviour changes.Depends online lists only #9508: the description, commit44164d4438and the 2026-11-01 commits say this branch carries two parent PRs. Please list #7642 onDepends ontoo, unless it has merged.Not verified
VK_EXT_descriptor_heap. Every_gpu_heap,_gpu_path,_unexpected,_pointer,_runtime_addressand_table_heapcase skips on lavapipe here, so this run did not reach the PR's runtime paths: the miss settle at present and the runtime-address column served from the table. The validation comparison does not cover them either.SettleDeviceImageMisseskeeps the lock orderGuestMemory::GpuMutex→ table mutex everywhere. I read only the call sites the PR adds, and those follow it.To get this to a good state
agc_driver_presentation_pass_gpu_heapskip with reasonscheck_skips.pyaccepts, by rewording line 793 or checking the heap first. Then confirmpython3 tools/check_skips.py build/ctest.xmlpasses on lavapipe.APS5_KEEP_UNEXPECTED_DEVICE_IMAGES: zero reads and the present-time wait.Depends onwith every open parent PR.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T09:03:35Z.
Review: COMMENTED
Reviewed — comments
The PR combines broad descriptor heap, device image table, shader serialization, and merge-resolution changes; the prepared diff is too large to verify comprehensively in this review.
What I ran
d2ec292f746d038b713f0b39a74d653322a1a6b4.Results
Findings
Blocking
None verified from the inspected excerpt.
Non-blocking
Not verified
files.jsonwas not accessible through the available review reader; the manifest shows many changed files, including excluded files that were not inspected.To get this to a good state
Nothing is required for this comment. Optional: complete targeted review of the remaining changed files and validate the unresolved scenarios described above.
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.