Stride-zero OOB_SELECT=2 formatted SSBO reads truncate the Y/Z components #14439
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 lgqdaxia on 2026-11-01T13:30:05Z.
What happens
A nonempty, stride-zero
RGB32_FLOATbuffer withOOB_SELECT=2is bound with onlyNumRecordsbytes. A formatted shader load through theGuestBuffersSSBO path can consequently read X correctly while returning zero for Y and Z. This is separate from native vertex attributes.The asset-free reproducer uses one compute invocation and a 10-DWORD guest shader. It checks that the exact input descriptor reaches a storage-buffer binding, with no native vertex attributes or BDA pagetable. The input contains
{1.25f, -2.5f, 19.0f}; onlyNumRecordschanges between the two cases.Title, test or build step
Asset-free
agc_driver_buffer_format_oob2_stride_zeroCTest, usingBufferFormatOob2StrideZero.cpp. No game assets are used.AnyPS5 commit
Executed main:
ba627802e2210187d417deb64c8f2fed8e33011f. Production sources were unchanged; only the new fixture and its CMake fragment were added. Later candidate/rebase results are distinguished under What was checked.System
Windows 11 Pro 10.0.26200 x86-64; WinLibs GCC 15.2.0 UCRT; Release/Ninja,
BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=OFF.NVIDIA GeForce RTX 3080 Laptop GPU, driver 610.74. Vulkan execution used
ANYPS5_REQUIRE_VULKAN=1, disabled shader caching, and actually loadedVK_LAYER_KHRONOS_validation.Steps to reproduce
The fixture source and CMake fragment are public synthetic test code, with no game data.
In a separate checkout at the executed main commit, copy only those two files from the candidate, leaving all production sources on main:
Configure with the normal project compiler and dependencies, adding these settings:
With the Khronos validation layer installed and discoverable, run in PowerShell:
Log
For this nonempty OOB2 descriptor, reducing the record count to 1 should not turn the other components into zero. The input descriptor's word 3 is
0x2004a3ac(format 74,OOB_SELECT=2); stride is zero.The fixture source is byte-identical for the main/candidate comparison (SHA-256
ef1d411bca6f1dedfb1d6572b70b505e86638f6340bc795d470b62a4df1d1f05). The executables were rebuilt against their matching production ABI.Root cause and candidate scope
ShaderBufferResource::GetSize()yields one byte for this descriptor. That value becomes the SSBO binding range even though this OOB mode does not use a positive record count as a byte bound. The shader's formatted load therefore encounters a host-side bound that is too short.The relevant semantics are described in the AMD RDNA2 ISA reference, section 8.1/Table 35. Related work in #8299/#8519 addresses native vertex fetch; this reproducer explicitly uses SSBOs. I have not measured this instruction on console hardware.
The candidate expands only a statically proven base formatted read of a full unpacked 32-bit element, and only for a currently nonempty, linear, stride-zero OOB2 descriptor. Dynamic/unproved addresses, packed/typed/raw accesses, writes and atomics are excluded. This is a bounded subset of the remaining unbounded-buffer problem, recorded in the AGC debt file.
What was checked
On the executed main, only the new regression failed; four existing GPU control CTests passed. The candidate on the same base passed all five. Reverting only the driver's range expansion brought back exactly the Y/Z failure, with the four controls still passing. All three GPU runs had zero skipped tests and no reported VUIDs, with the requested validation layer loaded.
The candidate also passed five CPU CTests covering compiler proof exclusions and descriptor-presence changes, shader disk-cache round trips, resource keys, initial binding, draw/dispatch buffer moves, alias checks, queued read ranges and the forced-written override. After rebasing to main
f1a7b02028ae50adaf6c5aaaef892a51841b25bf, final head5fb8b2c27eafaaf4a430618b1c89b4a52a2acaf1was rebuilt and passed the same five GPU and five CPU CTests, with zero skips and no reported VUIDs. The real configured-build registration audit passed for 1690 executables; conventions and diff checks passed.These are focused component tests. Linux/macOS, other GPUs, hosted CI, the full product/full test suite and game behavior were not tested. No title fix or performance improvement is claimed. Independent fixes are welcome; adopting this candidate is optional.
14 November follow-up: The complete replacement is now PR #19852, covering both the original static case and zero offsets loaded through runtime SRT fields, with the matching KeyMiss fixture correction. The same asset-free GPU fixture fails both cases on main
860c2a432293and passes on454a7f5896e9, with the validation layer loaded, intact guards and zero skips or VUIDs. Game bring-up #19851 records the two-frame backpack result and its gameplay-integration prerequisites.AI-assisted: yes