Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
AMD check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release, Radeon RX 6700 XT (RDNA 2), AMD driver 26.10.1. Run through the Windows test queue with
AI-assisted: yes. |
|
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.
|
|
Thanks for the RX 6700 XT run. On the fallback: it doesn't need a device without the feature. A device that really lacks the feature (Adreno 650 under Turnip) is being tried next, and I'll post that result here. AI-assisted: yes (Claude Code) |
|
Result on a device that really lacks the feature: Meta Quest 2 (Snapdragon XR2, Adreno 650), Turnip from Mesa 25.0.7, AnyPS5's Linux x86-64 build under box64 0.4.5 in a Debian proot, running the ccleste homebrew. The build is release v0.1.4 (
AI-assisted: yes (Claude Code) |
|
Read through the fallback end to end. On RADV (which exposes the feature) the fallback is only reachable through AI-assisted: yes |
|
RADV validation-layer run of head
AI-assisted: yes |
gabichuuuuu
left a comment
There was a problem hiding this comment.
Ran 22ae5d725d merged on main 302864d on Windows 11 x64 (WinLibs GCC 15.2), on an NVIDIA laptop GPU (Turing, driver 610) and an Intel iGPU (driver 101.70xx), with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (Khronos validation layer 1.4.368), ctest -R '^(agc_driver_bda|agc_bda|agc_host_report_vulkan|agc_shader_device_profile)' -V.
main |
main + the PR's test files only |
change | |
|---|---|---|---|
| NVIDIA | 11/11 | 8/11 | 11/11, twice |
| Intel | 11/11 | 8/11 | 11/11, twice |
- Without the driver and recompiler changes, the PR's tests fail on both GPUs:
agc_driver_bda_device("BDA requires unsupported SPIR-V capability 4448"),agc_host_report_vulkan("the absent 8-bit storage extension is not listed as optional and missing") andagc_shader_device_profile("shader runtime requires enabled storageBuffer8BitAccess"). - Both GPUs here have
storageBuffer8BitAccess, so the device itself never takes the new path.agc_driver_bda_devicestill runs the BDA read and store execution tests on each real device twice, and both runs pass on both GPUs: "BDA store boundary tests passed with 8-bit pointers" and "BDA store boundary tests passed with 32-bit word byte access". - The layer was inserted in every test that opens a Vulkan device (
agc_bda_atomics,agc_driver_bda_device_selection_cpu,agc_host_report_vulkanandagc_shader_device_profileopen none). No log haswas not found but was requested by env var VK_INSTANCE_LAYERS, and no log on either side has aVUID-: the 32-bit word loads compile to SPIR-V the layer accepts. To be sure validation messages reach these logs, the same layer with best practices on printed 28BestPractices-warnings into anagc_driver_recorderlog on each GPU.
Not covered here: a device that really lacks storageBuffer8BitAccess, where VulkanDevice no longer enables the extension or chains byteFeatures; both GPUs here report the feature.
AI-assisted: yes.
|
Thanks @blawesom for the RADV run and @gabichuuuuu for NVIDIA and Intel. The middle column (the PR's tests failing without the driver and recompiler changes) is a useful proof that the tests check the new code. With RADV, NVIDIA, Intel and the Adreno 650, the word-RMW fallback now has clean validation runs on four vendors. AI-assisted: yes (Claude Code) |
|
Hi @ycbuzi, Thanks for this, and the review came back fine. We're putting it on hold rather than merging it for now. The reason is direction, not the code: right now the project is focused on performance and stable Linux and Windows on desktop GPUs, and we've paused work whose purpose is ARM or mobile GPU support (Turnip, Adreno, Quest and phones) until that direction opens up again. Making 8-bit storage optional is a reasonable fallback, but its only use today is those devices, so it waits with the rest of that work. We're leaving the PR open so it can pick up from here when ARM support is back on the list. Nothing is needed from you in the meantime. |
|
@oneandonlydean understood, thanks for explaining. I will leave it open and rebase it when ARM and mobile GPU work opens up again. |
…t-storage Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Ran the description's A/B set on Linux and NVIDIA's proprietary driver with the Khronos validation layer; the Tested section covers Windows only. Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (vendor
The loader picked the RTX 4090 in both logs. On the branch Negative control: the merged tree with No new AI-assisted: yes (Claude Code) |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — changes requested
Changes are required before merge: make the word fallback safe when a mapped BDA range ends inside a 32-bit word.
What I ran
Reviewed head c52bc51945abbb4ed289636d8c78000cf9cc19b2 using repo_read.py to inspect the prepared diff and targeted source context. No commands or tests were run.
Results
| Check | Result | Note |
|---|---|---|
| Diff and targeted source review | passed | BDA access paths and range construction reviewed |
| Tests | not run | Author-reported tests were not rerun |
Findings
Blocking
core/shader/recompiler/SpirvBackend/src/SpirvBdaRead.cpp:68-70,158-162: The fallback rounds the physical byte address down and reads or atomically updates the full containingu32. BDA ranges can be exact-sized copied buffers; the reader-side table construction preservesregion.begin/region.end, and the buffer allocation uses that exact region size. A byte access in the last one to three bytes of a range can therefore make the shader touch bytes beyond the mapped range and Vulkan buffer. The debt note records an alignment assumption, but the range construction inspected here does not enforce dword-sized range boundaries. Ensure fallback accesses are contained within the mapped allocation (for example, by padding and mapping edge words or using a safe edge path), and add coverage for reads and writes at a range tail.
Non-blocking
None.
Not verified
- The full text of
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppwas excluded from the review folder due to size; the relevant changed areas were read throughrepo_read.py. core/libs/prx/libSceAgcDriver/Execution/src/BdaFeatures.cpp,HostReportVulkan.cpp,ShaderDeviceProfile.cpp; testsBdaContracts.cpp,BdaDevice.cpp,BdaShader.cpp,BdaShader.hpp,HostReportVulkan.cpp,ShaderDeviceProfile.cpp;core/shader/recompiler/SpirvBackend/src/SpirvBdaRead.cpp,SpirvMemory/SpirvEmitterHelpers.cpp; anddocs/dev/debt/shader.md,docs/user/USAGE.mdwere read in relevant ranges. Other portions of these files were not read.- Adreno 650 / Turnip behavior and the author-reported GPU test runs were not independently verified.
To get this to a good state
Make the fallback safe at BDA range edges, then rerun the BDA contract and device tests, including byte reads and writes at the final bytes of a mapped range.
ligmaSec
left a comment
There was a problem hiding this comment.
The trial merge onto c1601e56d5 conflicts in SpirvBdaRead.cpp. Please retain logical byte-range validation ahead of the aligned-word fallback and the fixture that checks a byte write leaves neighboring bytes unchanged. The disabled-8-bit-storage profile should also verify capability emission, so a supported GPU does not mask an extension requirement on the fallback path. Move the direct shader debt edit into a fragment on the resolved head.
AI-assisted: yes.
What
Lets the AGC driver run on a Vulkan device without
VK_KHR_8bit_storage/storageBuffer8BitAccess. Turnip exposes the feature only on Adreno 7xx (Mesa 25.0.7 and 25.3.6tu_device.cc), so an Adreno 650 (Quest 2, many phones) stopped at device creation withlacks 2 items AnyPS5 needs: VK_KHR_8bit_storage (extension), storageBuffer8BitAccess (feature).SpirvBdaRead.cpp): when the target lacksStorageBuffer8BitAccess, a byte load reads the aligned 32-bit word that holds the byte and shifts it out, and a byte store is a 32-bit compare-and-swap that replaces only that byte (AtomicUpdate, the same loop the non-BDA path already uses throughbyteBuffers()). Byte loads, anchored 8/16-bit reads and thewrite_bda_bytesfunctions all go through the two new helpers. With the capability present the emitted code is unchanged, except thatStorageBuffer8BitAccessandSPV_KHR_8bit_storageare now declared where a byte pointer is made instead of for every DMA program.ValidateBdaTargetno longer requires the 8-bit capability or extension.QueryBdaByteFeaturesreports the feature instead of throwing;VulkanDeviceenables the extension, chains the feature struct and advertises capability 4448 /SPV_KHR_8bit_storageonly when the device has it.ShaderDeviceProfiletreats the capability like the other optional ones (advertised only if enabled, and thenSPV_KHR_8bit_storagemust be listed). The host report listsVK_KHR_8bit_storageas optional, and USAGE.md drops it from the required list.docs/dev/debt/shader.md, together with the unmeasured speed of the atomic byte stores.Related: #4847 skips adapters without 8-bit storage during selection; after this PR that feature is no longer a reason to skip one.
Overlap: #7392 changes the fault condition at the top of
EmitBdaByte(the lines this PR replaces with oneLoadPhysicalBytecall). The two changes are independent: whichever lands second keeps the other's condition around the single load call, a small rebase.Tested
Windows 11 Home 26200, MinGW g++ 15.2.0,
agc_driver_bda_device,agc_host_report_vulkan,agc_shader_device_profile:agc_driver_bda_devicenow runs every BDA GPU read, span, anchored and store/write boundary case twice: with 8-bit pointers and with the 32-bit word fallback (SetBdaTestBytePointers). Both pass on all three GPUs (BDA store boundary tests passed with 8-bit pointers/... with 32-bit word byte access). The store cases use 2- and 3-byte buffers and check that bytes outside the mapped span are unchanged.BdaContractschecks that byte accesses declare 8-bit storage only on a target that has it, thatValidateBdaTargetaccepts a target without it, and that the CAS byte store is still seen bySpirvStoresThroughAddresses. The fallback store shaders passValidateAndOptimizeSpirv.agc_shader_device_profileprofiles a device without the feature;agc_host_report_vulkanexpects it as optional.maind7240ef vs this branch (6caa788; the two later commits change only docs), Vulkan SDK 1.4.363.0 Khronos layer from a non-elevated process,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ctest -R '^(agc_driver_bda_device|agc_host_report_vulkan|agc_shader_device_profile)$' -V, two runs per GPU per side: 3/3 passed in every run, 0VUID-lines, nowas not found but was requested by env var VK_INSTANCE_LAYERSline. A best-practices control onagc_driver_bda_devicewrote 15 layer log lines on each side, so the layer was loaded.main2e48261 (merge c52bc51; the only conflict wasdocs/dev/debt/shader.md, both sides' entries kept), the A/B was rerun onmain2e48261 vs c52bc51 with the same layer and variables,ctest -R '^agc_(driver_bda_device.*|driver_host_import_failure_handles|host_report_vulkan|shader_device_profile)$' -V, one run per GPU per side on the RTX 4070 SUPER, GTX 1650 SUPER and Radeon iGPU: 5/5 passed in every run, 0VUID-lines on either side, no missing-layer line, and the branch logs show bothBDA store boundary tests passed with 8-bit pointersand... with 32-bit word byte accesson each GPU. A best-practices control wrote 24 layer log lines on each side.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