Repository navigation
fix(shader): use GPU addresses for oversized scalar buffers - #24025
Conversation
|
AMD / Linux results for this PR, on RADV (Mesa 26.2.6) with Khronos validation layer 1.4.363, for head
In all nine logs the loader inserts
Not tested: Teardown, AMD on Windows, lavapipe. AI-assisted: yes (runs scripted with an AI assistant, on the hardware above) |
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
GPU test run: ✅ no new failures or validation errors on Windows / NVIDIABasis: built and ran · this PR's head Checked
Findings: none from this run; this is a GPU run, not a code review. AI-assisted test run (Claude Code) · head |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The scalar descriptor selection change and its included tests were reviewed at head 02ca7dad10471cec0628b4cb7a7d34c9e41784c3; I found no verified blocking defect, but did not run checks independently.
What I ran
No commands or tests were run. The prepared diff and included source files were inspected using the review reader.
Results
| Check | Result | Note |
|---|---|---|
| Diff and changed source review | passed | All five changed files were read |
| Tests and prechecks | not run | Only author-reported results were available |
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not run tests, prechecks, builds, or GPU checks. The author reports those checks passed, but I did not independently verify them. The review bundle listed five changed files under reviewed, and I read all five: core/libs/prx/libSceAgcDriver/tests/OversizedScalarBuffer.cpp, core/libs/prx/libSceAgcDriver/tests/cmake/agc_oversized_scalar_buffer_tests.cmake, core/libs/prx/libSceAgcDriver/tests/execution/ScalarBufferRuntimeWord3.cpp, core/shader/recompiler/Optimization/src/ResourceTracker.cpp, and docs/dev/debt/changes/oversized-scalar-buffer.md. No changed files were excluded.
To get this to a good state
Nothing is required.
GPU test run: passes on AMD RDNA4 with no
|
| Test | main | head run 1 | head run 2 | head run 3 |
|---|---|---|---|---|
agc_driver_buffer_descriptor_runtime |
Passed 0.32 s | Passed 0.33 s | Passed 0.31 s | Passed 0.32 s |
agc_driver_gcn_scalar_buffer_base |
Passed 0.97 s | Passed 0.23 s | Passed 0.22 s | Passed 0.23 s |
agc_driver_oversized_descriptor_sets |
Passed 0.18 s | Passed 0.12 s | Passed 0.12 s | Passed 0.12 s |
agc_driver_runtime_buffer_spans |
Passed 0.43 s | Passed 0.40 s | Passed 0.37 s | Passed 0.40 s |
agc_driver_scalar_buffer_runtime_word3 |
Passed 0.29 s | Passed 0.27 s | Passed 0.23 s | Passed 0.27 s |
agc_oversized_scalar_buffer |
not on main (negative control above) |
Passed 0.05 s | Passed 0.01 s | Passed 0.01 s |
- Every test that opens an
AgcDriver::VulkanDeviceselected the R9700 (subgroup=64). agc_driver_oversized_descriptor_setsloads the layer but logs no device selection.agc_oversized_scalar_bufferis a CPU-side IR test.- The
mainrun was the first run after its rebuild, so its times include a cold start. This is not a speed claim.
Validation:
Insert instance layer "VK_LAYER_KHRONOS_validation"appears 5 times in themainlog and in each head log, once per test that loads Vulkan.was not found but was requested by env var VK_INSTANCE_LAYERSappears in no log.VUID-lines: 0 onmain, and 0, 0 and 0 on the three head runs. The negative-control and mutation logs also have none.
Host:
- GPU: AMD Radeon AI PRO R9700 (gfx1201, 1002:7551), driver 32.0.31044.16, Vulkan 1.4.349
- Validation layer: Khronos 1.4.363 (LunarG SDK)
- CPU and OS: Ryzen 9 9950X3D, Windows 11 Pro 26300
- Build: WinLibs GCC 15.2, Release
- Commits: main
16d82b47e7, head02ca7dad10, merged onto main as20a5d5bd08
AI-assisted: yes
What
Scalar buffer descriptors whose stride times record count is provably greater than
UINT32_MAXcannot fit a single Vulkan storage-buffer descriptor. Teardown (PPSA15246, 01.070.100) reaches this with stride 16 and0xffffffffrecords: the declared extent is0xffffffff0bytes, and the current storage-buffer path throwsshader buffer exceeds descriptor range limit.Use the existing GPU descriptor/address path for these scalar accesses. A bounded analysis of known set bits proves a minimum descriptor extent; uncertain sizes and vector accesses keep the existing path. This changes resource selection, not the scalar load's address or bounds-check implementation. No title IDs, host vendors, or platform-specific conditions are added.
Add an IR regression covering oversized, boundary, small, unknown-stride and vector descriptors. Extend the scalar-buffer GPU readback test with a shader that constructs a 64 GiB descriptor and checks actual scalar reads.
Overlap:
tools/pr_overlap.py --names knownSetBits TakeGpuDescriptorfound no matching additions. The branch check reported stale branches that conflict with its base; their shared resource-tracker changes were inspected manually and no functional prerequisite or duplicate oversized-scalar routing was identified. The initial text conflict with #20248 was removed by placing this scalar-only decision before descriptor materialization;git merge-treeconfirms a clean merge with its headdd7df7d730. This does not depend on its opt-in buffer tables. Older shared-file PRs examined: #6280, #6488, #7085, #7395, #7642, #7684, #8939, #9457, #9633, #9749, #9790, #9852, #9969, #10193, #13928, #13929, #14032, #14944, #16472, #16812, #16814, #21745, #21763, #22424, #22583 and #23242.Scope: this removes one buffer-descriptor stop, not every large-memory failure. With the normal host-import budget, the Teardown experiment instead reached a large staging allocation failure. With the process-local
APS5_HOST_IMPORT_MIB=14000setting it passed the original stop and reached an unsupported PM4 type-0 packet at DWORD 15. The budget is a test setting, not a new default or a requirement suitable for every host. No full-gameplay or performance claim is made.Tested
Windows 10.0 build 26300, AMD Ryzen 9 7900X, NVIDIA GeForce RTX 4070, NVIDIA 610.88, WinLibs GCC 15.2.0 r7, Release. Khronos validation layer 1.4.368, newer than the pinned Vulkan headers (1.4.335).
Focused tests on upstream
2b718a22feand this change, on the same GPU, withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layer, andVK_LAYER_PATHpointing to the portable Khronos layer:The scalar-buffer GPU readback test passes on both versions. The new IR regression fails on the original selection logic and passes with this change. Both GPU logs confirm insertion of
VK_LAYER_KHRONOS_validation; neither contains a missing-layer warning or aVUID-error. The small GPU fixture can already be clipped to its registered allocation on main; it validates the new path's readback, rather than reproducing Teardown's large registered allocation.python tools/check_conventions.py --base origin/main,python tools/debt_fold.py --check, andgit diff --checkpass.Title evidence was captured on base
e1ab104e0aplus this resource-selection change, before rebasing to current main. Teardown's import audit found 887 unique imports, zero absent imports and zero throwing stubs. Advancing past the Cross prompt reproduced the original descriptor-range refusal with shader caches disabled. The narrowed change plus the host-import setting reached the later PM4 rejection. No copyrighted game files, shaders, or raw title logs are included. AMD, Intel, Linux, and complete gameplay are not tested.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)