Stray (PPSA02100): a pixel shader reads a 2D image descriptor as a buffer ("buffer descriptor uses an unsupported type") #5879

Open
opened 2026-10-14 14:37:04 +00:00 by p3n1cillin · 14 comments
p3n1cillin commented 2026-10-14 14:37:04 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by p3n1cillin on 2026-10-14T14:37:04Z.


Stray (PPSA02100, Unreal Engine 4) on Windows 11, RTX 5070, MinGW GCC 15, Release, main 066b58fa1, relinked with --windows. It boots, shows its brightness calibration screen, and accepts it. While the first level loads (black screen with the loading icon), it stops:

terminate called after throwing an instance of 'std::runtime_error'
  what():  buffer descriptor uses an unsupported type

A local print at the throw in materializeTables (ResourceMaterializer.cpp) showed:

stage=2 (pixel) buffer 2 of 3
dwords = 20fd8300 c3800000 021bc3bf 91b00f2e
scalar=0 written=0 atomic=0 formatted=0 imageAlias=none, read through vector memory

Word 3's top nibble is 0x9, the TYPE of a 2D image resource (T#), so the slot the pixel shader reads as a buffer holds an image descriptor. A few runs before this one, the same throw also showed up as an apparent hang: the terminating thread sat in ucrtbase!abort under LibcException::DefaultTerminate and the crash report was never written. That happened in 1 of 4 runs.

I haven't found which draw this is or whether the shader takes the buffer path for it. If the read is on a branch that this draw never takes, the hardware never interprets the T# as a V#. Without a capture I can't tell.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5849796013 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5879). Originally posted by [p3n1cillin](https://github.com/p3n1cillin) on 2026-10-14T14:37:04Z. --- Stray (PPSA02100, Unreal Engine 4) on Windows 11, RTX 5070, MinGW GCC 15, Release, `main` `066b58fa1`, relinked with `--windows`. It boots, shows its brightness calibration screen, and accepts it. While the first level loads (black screen with the loading icon), it stops: ``` terminate called after throwing an instance of 'std::runtime_error' what(): buffer descriptor uses an unsupported type ``` A local print at the throw in `materializeTables` (`ResourceMaterializer.cpp`) showed: ``` stage=2 (pixel) buffer 2 of 3 dwords = 20fd8300 c3800000 021bc3bf 91b00f2e scalar=0 written=0 atomic=0 formatted=0 imageAlias=none, read through vector memory ``` Word 3's top nibble is `0x9`, the TYPE of a 2D image resource (T#), so the slot the pixel shader reads as a buffer holds an image descriptor. A few runs before this one, the same throw also showed up as an apparent hang: the terminating thread sat in `ucrtbase!abort` under `LibcException::DefaultTerminate` and the crash report was never written. That happened in 1 of 4 runs. I haven't found which draw this is or whether the shader takes the buffer path for it. If the read is on a branch that this draw never takes, the hardware never interprets the T# as a V#. Without a capture I can't tell. AI-assisted: yes (Claude Code)
YossiYad commented 2026-10-14 14:47:50 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-14T14:47:50Z.


Some context on why this read throws, in case it saves a search: the exact word 3 here, 0x91b00f2e, is already in tests/execution/BufferDescriptorRuntime.cpp. aa2abf801 ("ignore unused descriptor fields for scalar buffer loads", merged 13 Oct) made scalar buffer loads ignore word 3, and that test checks a scalar read with 0x91b00f2e still returns the buffer's data. The same test requires a vector or mixed access with that word to keep throwing buffer descriptor uses an unsupported type, because what the hardware does when a vector buffer instruction gets a descriptor whose TYPE is not a buffer has not been measured (zeros, a read through the address and size fields anyway, or undefined).

So the read here takes the vector path (scalar=0 ... read through vector memory in your print), which is the case that test keeps refusing on purpose. Lifting it would need either that hardware behaviour, or evidence that this draw never reaches the read, as you suggest. The throw happens when the stage's resources are materialized, before anything executes, so an unreached read fails the same way as a reached one.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6171112261 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5879#issuecomment-6171112261). Originally posted by [YossiYad](https://github.com/YossiYad) on 2026-10-14T14:47:50Z. --- Some context on why this read throws, in case it saves a search: the exact word 3 here, `0x91b00f2e`, is already in `tests/execution/BufferDescriptorRuntime.cpp`. `aa2abf801` ("ignore unused descriptor fields for scalar buffer loads", merged 13 Oct) made scalar buffer loads ignore word 3, and that test checks a scalar read with `0x91b00f2e` still returns the buffer's data. The same test requires a vector or mixed access with that word to keep throwing `buffer descriptor uses an unsupported type`, because what the hardware does when a vector buffer instruction gets a descriptor whose TYPE is not a buffer has not been measured (zeros, a read through the address and size fields anyway, or undefined). So the read here takes the vector path (`scalar=0 ... read through vector memory` in your print), which is the case that test keeps refusing on purpose. Lifting it would need either that hardware behaviour, or evidence that this draw never reaches the read, as you suggest. The throw happens when the stage's resources are materialized, before anything executes, so an unreached read fails the same way as a reached one.
p3n1cillin commented 2026-10-14 15:04:18 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by p3n1cillin on 2026-10-14T15:04:18Z.


More detail from later runs, same setup:

  • The buffer slot doesn't always hold the same descriptor. In some runs it's a 3D T#: 20da2600 c3800000 001dc13f a1b00fac, with word 3's nibble 0xA. It is always buffer 2 of 3 in a pixel shader, read by vector memory loads.
  • The next stop is the same pattern on an image slot. With a local, unsubmitted change that binds such a read-only buffer as empty, the next stop is:
    image descriptor is incompatible with the static runtime image interface:
    descriptor format 60 decodes to {class 2, dim 4, ...}; modes: {class 1, dim 3, ...} ...
    T# 20dc6600 c3c00000 001fc00f a1b00fac 0000003f 00700000 006b0000 00208a6b
    
    There, a 3D T# sits in a slot that the shader statically uses as a 2D image.

So Unreal leaves 3D-texture descriptors in buffer and 2D slots of this pixel shader. Either the shader's accesses to those slots aren't behind a branch the capture can evaluate, or the branch is taken. I couldn't find the shader address: the throw is reached through ResourceMaterializer::Materialize, the Release build has no unwind info past that frame, and it doesn't go through DrawCapture's Materialize call. The RDNA2 ISA only says TYPE must be 0 for a V# and doesn't define a buffer read through a T#, so I haven't proposed a fix.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6171445119 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5879#issuecomment-6171445119). Originally posted by [p3n1cillin](https://github.com/p3n1cillin) on 2026-10-14T15:04:18Z. --- More detail from later runs, same setup: - **The buffer slot doesn't always hold the same descriptor.** In some runs it's a 3D T#: `20da2600 c3800000 001dc13f a1b00fac`, with word 3's nibble `0xA`. It is always buffer 2 of 3 in a pixel shader, read by vector memory loads. - **The next stop is the same pattern on an image slot.** With a local, unsubmitted change that binds such a read-only buffer as empty, the next stop is: ``` image descriptor is incompatible with the static runtime image interface: descriptor format 60 decodes to {class 2, dim 4, ...}; modes: {class 1, dim 3, ...} ... T# 20dc6600 c3c00000 001fc00f a1b00fac 0000003f 00700000 006b0000 00208a6b ``` There, a 3D T# sits in a slot that the shader statically uses as a 2D image. So Unreal leaves 3D-texture descriptors in buffer and 2D slots of this pixel shader. Either the shader's accesses to those slots aren't behind a branch the capture can evaluate, or the branch is taken. I couldn't find the shader address: the throw is reached through `ResourceMaterializer::Materialize`, the Release build has no unwind info past that frame, and it doesn't go through `DrawCapture`'s `Materialize` call. The RDNA2 ISA only says `TYPE` must be 0 for a V# and doesn't define a buffer read through a T#, so I haven't proposed a fix.
simonbronk commented 2026-10-14 15:53:55 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-14T15:53:55Z.


I measured what the hardware does with a vector buffer access through a V# whose TYPE (word 3 bits 31:30) isn't 0. That's the case here: 0x91b00f2e and 0xa1b00fac both have TYPE 2. AMD RDNA 2 iGPU (gfx1036), Windows driver 32.0.21036.18, with the HIP runner from #1281 (probes below).

Loads (buffer_load_dword and buffer_load_dwordx2 with offen; buffer_load_format_xyzw and buffer_load_dword with idxen):

  • The control V# (0x31016fac, TYPE 0) reads the data.
  • Changing only TYPE to 1, 2 or 3 makes every load leave its destination VGPRs untouched: they keep a 0xdeadbeef preset. 96 of 96 offset/index rows, num_records 0x1000 and 0x100.
  • The load does not return zero, which is the difference from an out-of-range load.
  • With this issue's two word 3 values and TYPE cleared to 0, all four loads return zero (the FORMAT field there is 0). With their own TYPE 2, the VGPRs stay untouched.

Stores and atomics (buffer_store_dword, buffer_atomic_add ... glc), 64 lanes, read back through the same V# with TYPE 0:

  • TYPE 0: all stores and adds land.
  • TYPE 1, 2, 3: memory is unchanged on every lane, and the atomic's return VGPR keeps its previous value (1).

So on this GPU a vector buffer instruction through a V# with TYPE ≠ 0 does nothing: no memory access, no VGPR write. That matches the ISA's "TYPE must be 0" being enforced as a no-op rather than a fault. Scalar loads ignore word 3 already, as YossiYad noted. PS5's gfx1013 isn't measured.

Onimusha: Way of the Sword (PPSA27836, #5769) hits the same throw: Capcom's RE Engine, after the EULA screen.

probe_buffer_type.py
"""Buffer loads through a V# whose word 3 TYPE field (bits 31:30) is not 0, compared with TYPE 0.

The V# points at a block of distinct words. Word 3 keeps the low 30 bits of a descriptor seen in a
title (DST_SEL, FORMAT, ...) and only TYPE changes. Each row is (byte offset, index, 0, 0).
"""
import struct
import sys
from pathlib import Path

sys.path.insert(0, str(Path(__file__).resolve().parent))
import hw_oracle_win as oracle

ROWS = 128
DATA_OFFSET = ROWS * 16
DATA_BYTES = 8192
STRIDE = 16
RECORDS = 256

OFFSETS = [0, 4, 8, 12, 16, 64, 1020, 4092, 4096, 8188, 8192, 12000]
INDICES = [0, 1, 2, 63, 255, 256, 300, 511]

WORD3_LOW = {
    "control word 3 0x31016fac": 0x31016fac & 0x3fffffff,
    "PPSA02100 word 3 0x91b00f2e": 0x91b00f2e & 0x3fffffff,
    "PPSA02100 word 3 0xa1b00fac": 0xa1b00fac & 0x3fffffff,
}


def body(word3, num_records):
    return f"""
  s_add_u32 s16, s4, {DATA_OFFSET:#x}
  s_addc_u32 s17, s5, 0
  s_and_b32 s17, s17, 0xffff
  s_or_b32 s17, s17, {STRIDE << 16:#x}
  s_mov_b32 s18, {num_records:#x}
  s_mov_b32 s19, {word3:#x}
  v_mov_b32 v10, 0xdeadbeef
  v_mov_b32 v11, 0xdeadbeef
  v_mov_b32 v12, 0xdeadbeef
  v_mov_b32 v13, 0xdeadbeef
  v_mov_b32 v14, 0xdeadbeef
  v_mov_b32 v15, 0xdeadbeef
  v_mov_b32 v16, 0xdeadbeef
  v_mov_b32 v17, 0xdeadbeef
  v_mov_b32 v18, 0xdeadbeef
  buffer_load_dword v10, v4, s[16:19], 0 offen
  buffer_load_dwordx2 v[11:12], v4, s[16:19], 0 offen
  buffer_load_format_xyzw v[14:17], v5, s[16:19], 0 idxen
  buffer_load_dword v18, v5, s[16:19], 0 idxen
  s_waitcnt vmcnt(0)
"""


def data():
    return b"".join(struct.pack("<I", (i * 0x9E3779B1 + 0x5A5A1234) & 0xFFFFFFFF) for i in range(DATA_BYTES // 4))


def main():
    rows = [(o, i, 0, 0) for o in OFFSETS for i in INDICES]
    count = len(rows)
    rows = rows + [(0, 0, 0, 0)] * (ROWS - count)
    print(f"target {oracle.target()}; {count} rows; buffer loads through a V# with TYPE 0, 1, 2, 3")
    for name, low in WORD3_LOW.items():
        for num_records in (RECORDS * STRIDE, RECORDS):
            results = {}
            for type_bits in range(4):
                word3 = low | (type_bits << 30)
                results[type_bits] = [r[0:9] for r in oracle.run(body(word3, num_records), rows, data(), coarse=True)][:count]
            base = results[0]
            for type_bits in (1, 2, 3):
                same = sum(1 for a, b in zip(base, results[type_bits]) if a == b)
                print(f"{name}, num_records {num_records:#x}: TYPE {type_bits} vs TYPE 0: {same}/{count} rows equal")
                shown = 0
                for row, a, b in zip(rows, base, results[type_bits]):
                    if a != b and shown < 3:
                        shown += 1
                        print(f"  offset {row[0]} index {row[1]}: TYPE 0 {' '.join(f'{w:08x}' for w in a)} | TYPE {type_bits} {' '.join(f'{w:08x}' for w in b)}")
            sample = base[1]
            print(f"  TYPE 0 sample row offset {rows[1][0]} index {rows[1][1]}: {' '.join(f'{w:08x}' for w in sample)}")


if __name__ == "__main__":
    main()
probe_buffer_type_store.py
"""Buffer stores and atomics through a V# whose TYPE (word 3 bits 31:30) is not 0.

Each lane stores, then adds, through the V# with the TYPE under test, then reads back the same dword
through the same V# with TYPE 0. Row: (byte offset, value, 0, 0); offsets are distinct per lane.
"""
import struct
import sys
from pathlib import Path

sys.path.insert(0, str(Path(__file__).resolve().parent))
import hw_oracle_win as oracle

ROWS = 64
DATA_OFFSET = ROWS * 16
DATA_BYTES = 4096
WORD3 = 0x31016fac


def body(type_bits):
    word3 = (WORD3 & 0x3fffffff) | (type_bits << 30)
    return f"""
  s_add_u32 s16, s4, {DATA_OFFSET:#x}
  s_addc_u32 s17, s5, 0
  s_and_b32 s17, s17, 0xffff
  s_mov_b32 s18, {DATA_BYTES:#x}
  s_mov_b32 s19, {word3:#x}
  s_mov_b32 s20, s16
  s_mov_b32 s21, s17
  s_mov_b32 s22, {DATA_BYTES:#x}
  s_mov_b32 s23, {WORD3:#x}
  buffer_store_dword v5, v4, s[16:19], 0 offen
  s_waitcnt vmcnt(0)
  buffer_load_dword v10, v4, s[20:23], 0 offen
  s_waitcnt vmcnt(0)
  v_mov_b32 v6, 1
  buffer_atomic_add v6, v4, s[16:19], 0 offen offset:2048 glc
  s_waitcnt vmcnt(0)
  v_mov_b32 v11, v6
  buffer_load_dword v12, v4, s[20:23], 0 offen offset:2048
  s_waitcnt vmcnt(0)
"""


def main():
    rows = [(lane * 4, 0x1000 + lane, 0, 0) for lane in range(ROWS)]
    data = b"".join(struct.pack("<I", 0xC0DE0000 + i) for i in range(DATA_BYTES // 4))
    print(f"target {oracle.target()}; {ROWS} lanes; store, then atomic add 1, through a V# with each TYPE")
    for type_bits in range(4):
        results = oracle.run(body(type_bits), rows, data, coarse=True)
        stored = sum(1 for row, r in zip(rows, results) if r[0] == row[1])
        kept = sum(1 for row, r in zip(rows, results) if r[0] == 0xC0DE0000 + row[0] // 4)
        added = sum(1 for row, r in zip(rows, results) if r[2] == 0xC0DE0000 + (2048 + row[0]) // 4 + 1)
        untouched = sum(1 for row, r in zip(rows, results) if r[2] == 0xC0DE0000 + (2048 + row[0]) // 4)
        returned = sorted({r[1] for r in results})[:3]
        print(f"TYPE {type_bits}: store landed {stored}/{ROWS}, memory kept {kept}/{ROWS}; atomic added {added}/{ROWS}, memory kept {untouched}/{ROWS}; atomic returned {' '.join(f'{w:08x}' for w in returned)}")


if __name__ == "__main__":
    main()
Output
target gfx1036; 96 rows; buffer loads through a V# with TYPE 0, 1, 2, 3
control word 3 0x31016fac, num_records 0x1000: TYPE 1 vs TYPE 0: 0/96 rows equal
  offset 0 index 0: TYPE 0 5a5a1234 5a5a1234 f8918be5 deadbeef 5a5a1234 5a5a1234 5a5a1234 5a5a1234 5a5a1234 | TYPE 1 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
control word 3 0x31016fac, num_records 0x1000: TYPE 2 vs TYPE 0: 0/96 rows equal
  offset 0 index 0: TYPE 0 5a5a1234 5a5a1234 f8918be5 deadbeef 5a5a1234 5a5a1234 5a5a1234 5a5a1234 5a5a1234 | TYPE 2 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
control word 3 0x31016fac, num_records 0x1000: TYPE 3 vs TYPE 0: 0/96 rows equal
  offset 0 index 0: TYPE 0 5a5a1234 5a5a1234 f8918be5 deadbeef 5a5a1234 5a5a1234 5a5a1234 5a5a1234 5a5a1234 | TYPE 3 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
control word 3 0x31016fac, num_records 0x100: TYPE 1 vs TYPE 0: 0/96 rows equal
  offset 0 index 0: TYPE 0 5a5a1234 5a5a1234 f8918be5 deadbeef 5a5a1234 5a5a1234 5a5a1234 5a5a1234 5a5a1234 | TYPE 1 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
control word 3 0x31016fac, num_records 0x100: TYPE 2 vs TYPE 0: 0/96 rows equal
  offset 0 index 0: TYPE 0 5a5a1234 5a5a1234 f8918be5 deadbeef 5a5a1234 5a5a1234 5a5a1234 5a5a1234 5a5a1234 | TYPE 2 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
control word 3 0x31016fac, num_records 0x100: TYPE 3 vs TYPE 0: 0/96 rows equal
  offset 0 index 0: TYPE 0 5a5a1234 5a5a1234 f8918be5 deadbeef 5a5a1234 5a5a1234 5a5a1234 5a5a1234 5a5a1234 | TYPE 3 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
PPSA02100 word 3 0x91b00f2e, num_records 0x1000: TYPE 1 vs TYPE 0: 0/96 rows equal
  offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 1 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
PPSA02100 word 3 0x91b00f2e, num_records 0x1000: TYPE 2 vs TYPE 0: 0/96 rows equal
  offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 2 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
PPSA02100 word 3 0x91b00f2e, num_records 0x1000: TYPE 3 vs TYPE 0: 0/96 rows equal
  offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 3 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
PPSA02100 word 3 0x91b00f2e, num_records 0x100: TYPE 1 vs TYPE 0: 0/96 rows equal
  offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 1 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
PPSA02100 word 3 0x91b00f2e, num_records 0x100: TYPE 2 vs TYPE 0: 0/96 rows equal
  offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 2 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
PPSA02100 word 3 0x91b00f2e, num_records 0x100: TYPE 3 vs TYPE 0: 0/96 rows equal
  offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 3 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
PPSA02100 word 3 0xa1b00fac, num_records 0x1000: TYPE 1 vs TYPE 0: 0/96 rows equal
  offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 1 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
PPSA02100 word 3 0xa1b00fac, num_records 0x1000: TYPE 2 vs TYPE 0: 0/96 rows equal
  offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 2 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
PPSA02100 word 3 0xa1b00fac, num_records 0x1000: TYPE 3 vs TYPE 0: 0/96 rows equal
  offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 3 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
PPSA02100 word 3 0xa1b00fac, num_records 0x100: TYPE 1 vs TYPE 0: 0/96 rows equal
  offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 1 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
PPSA02100 word 3 0xa1b00fac, num_records 0x100: TYPE 2 vs TYPE 0: 0/96 rows equal
  offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 2 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
PPSA02100 word 3 0xa1b00fac, num_records 0x100: TYPE 3 vs TYPE 0: 0/96 rows equal
  offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 3 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
target gfx1036; 64 lanes; store, then atomic add 1, through a V# with each TYPE
TYPE 0: store landed 64/64, memory kept 0/64; atomic added 64/64, memory kept 0/64; atomic returned c0de0200 c0de0201 c0de0202
TYPE 1: store landed 0/64, memory kept 64/64; atomic added 0/64, memory kept 64/64; atomic returned 00000001
TYPE 2: store landed 0/64, memory kept 64/64; atomic added 0/64, memory kept 64/64; atomic returned 00000001
TYPE 3: store landed 0/64, memory kept 64/64; atomic added 0/64, memory kept 64/64; atomic returned 00000001

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6172452746 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5879#issuecomment-6172452746). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-14T15:53:55Z. --- I measured what the hardware does with a vector buffer access through a V# whose `TYPE` (word 3 bits 31:30) isn't 0. That's the case here: `0x91b00f2e` and `0xa1b00fac` both have TYPE 2. AMD RDNA 2 iGPU (gfx1036), Windows driver 32.0.21036.18, with the HIP runner from #1281 (probes below). **Loads** (`buffer_load_dword` and `buffer_load_dwordx2` with `offen`; `buffer_load_format_xyzw` and `buffer_load_dword` with `idxen`): - The control V# (`0x31016fac`, TYPE 0) reads the data. - Changing only TYPE to 1, 2 or 3 makes every load leave its destination VGPRs untouched: they keep a `0xdeadbeef` preset. 96 of 96 offset/index rows, num_records `0x1000` and `0x100`. - The load does not return zero, which is the difference from an out-of-range load. - With this issue's two word 3 values and TYPE cleared to 0, all four loads return zero (the FORMAT field there is 0). With their own TYPE 2, the VGPRs stay untouched. **Stores and atomics** (`buffer_store_dword`, `buffer_atomic_add ... glc`), 64 lanes, read back through the same V# with TYPE 0: - TYPE 0: all stores and adds land. - TYPE 1, 2, 3: memory is unchanged on every lane, and the atomic's return VGPR keeps its previous value (1). So on this GPU a vector buffer instruction through a V# with TYPE ≠ 0 does nothing: no memory access, no VGPR write. That matches the ISA's "TYPE must be 0" being enforced as a no-op rather than a fault. Scalar loads ignore word 3 already, as YossiYad noted. PS5's gfx1013 isn't measured. Onimusha: Way of the Sword (PPSA27836, #5769) hits the same throw: Capcom's RE Engine, after the EULA screen. <details><summary>probe_buffer_type.py</summary> ```python """Buffer loads through a V# whose word 3 TYPE field (bits 31:30) is not 0, compared with TYPE 0. The V# points at a block of distinct words. Word 3 keeps the low 30 bits of a descriptor seen in a title (DST_SEL, FORMAT, ...) and only TYPE changes. Each row is (byte offset, index, 0, 0). """ import struct import sys from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parent)) import hw_oracle_win as oracle ROWS = 128 DATA_OFFSET = ROWS * 16 DATA_BYTES = 8192 STRIDE = 16 RECORDS = 256 OFFSETS = [0, 4, 8, 12, 16, 64, 1020, 4092, 4096, 8188, 8192, 12000] INDICES = [0, 1, 2, 63, 255, 256, 300, 511] WORD3_LOW = { "control word 3 0x31016fac": 0x31016fac & 0x3fffffff, "PPSA02100 word 3 0x91b00f2e": 0x91b00f2e & 0x3fffffff, "PPSA02100 word 3 0xa1b00fac": 0xa1b00fac & 0x3fffffff, } def body(word3, num_records): return f""" s_add_u32 s16, s4, {DATA_OFFSET:#x} s_addc_u32 s17, s5, 0 s_and_b32 s17, s17, 0xffff s_or_b32 s17, s17, {STRIDE << 16:#x} s_mov_b32 s18, {num_records:#x} s_mov_b32 s19, {word3:#x} v_mov_b32 v10, 0xdeadbeef v_mov_b32 v11, 0xdeadbeef v_mov_b32 v12, 0xdeadbeef v_mov_b32 v13, 0xdeadbeef v_mov_b32 v14, 0xdeadbeef v_mov_b32 v15, 0xdeadbeef v_mov_b32 v16, 0xdeadbeef v_mov_b32 v17, 0xdeadbeef v_mov_b32 v18, 0xdeadbeef buffer_load_dword v10, v4, s[16:19], 0 offen buffer_load_dwordx2 v[11:12], v4, s[16:19], 0 offen buffer_load_format_xyzw v[14:17], v5, s[16:19], 0 idxen buffer_load_dword v18, v5, s[16:19], 0 idxen s_waitcnt vmcnt(0) """ def data(): return b"".join(struct.pack("<I", (i * 0x9E3779B1 + 0x5A5A1234) & 0xFFFFFFFF) for i in range(DATA_BYTES // 4)) def main(): rows = [(o, i, 0, 0) for o in OFFSETS for i in INDICES] count = len(rows) rows = rows + [(0, 0, 0, 0)] * (ROWS - count) print(f"target {oracle.target()}; {count} rows; buffer loads through a V# with TYPE 0, 1, 2, 3") for name, low in WORD3_LOW.items(): for num_records in (RECORDS * STRIDE, RECORDS): results = {} for type_bits in range(4): word3 = low | (type_bits << 30) results[type_bits] = [r[0:9] for r in oracle.run(body(word3, num_records), rows, data(), coarse=True)][:count] base = results[0] for type_bits in (1, 2, 3): same = sum(1 for a, b in zip(base, results[type_bits]) if a == b) print(f"{name}, num_records {num_records:#x}: TYPE {type_bits} vs TYPE 0: {same}/{count} rows equal") shown = 0 for row, a, b in zip(rows, base, results[type_bits]): if a != b and shown < 3: shown += 1 print(f" offset {row[0]} index {row[1]}: TYPE 0 {' '.join(f'{w:08x}' for w in a)} | TYPE {type_bits} {' '.join(f'{w:08x}' for w in b)}") sample = base[1] print(f" TYPE 0 sample row offset {rows[1][0]} index {rows[1][1]}: {' '.join(f'{w:08x}' for w in sample)}") if __name__ == "__main__": main() ``` </details> <details><summary>probe_buffer_type_store.py</summary> ```python """Buffer stores and atomics through a V# whose TYPE (word 3 bits 31:30) is not 0. Each lane stores, then adds, through the V# with the TYPE under test, then reads back the same dword through the same V# with TYPE 0. Row: (byte offset, value, 0, 0); offsets are distinct per lane. """ import struct import sys from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parent)) import hw_oracle_win as oracle ROWS = 64 DATA_OFFSET = ROWS * 16 DATA_BYTES = 4096 WORD3 = 0x31016fac def body(type_bits): word3 = (WORD3 & 0x3fffffff) | (type_bits << 30) return f""" s_add_u32 s16, s4, {DATA_OFFSET:#x} s_addc_u32 s17, s5, 0 s_and_b32 s17, s17, 0xffff s_mov_b32 s18, {DATA_BYTES:#x} s_mov_b32 s19, {word3:#x} s_mov_b32 s20, s16 s_mov_b32 s21, s17 s_mov_b32 s22, {DATA_BYTES:#x} s_mov_b32 s23, {WORD3:#x} buffer_store_dword v5, v4, s[16:19], 0 offen s_waitcnt vmcnt(0) buffer_load_dword v10, v4, s[20:23], 0 offen s_waitcnt vmcnt(0) v_mov_b32 v6, 1 buffer_atomic_add v6, v4, s[16:19], 0 offen offset:2048 glc s_waitcnt vmcnt(0) v_mov_b32 v11, v6 buffer_load_dword v12, v4, s[20:23], 0 offen offset:2048 s_waitcnt vmcnt(0) """ def main(): rows = [(lane * 4, 0x1000 + lane, 0, 0) for lane in range(ROWS)] data = b"".join(struct.pack("<I", 0xC0DE0000 + i) for i in range(DATA_BYTES // 4)) print(f"target {oracle.target()}; {ROWS} lanes; store, then atomic add 1, through a V# with each TYPE") for type_bits in range(4): results = oracle.run(body(type_bits), rows, data, coarse=True) stored = sum(1 for row, r in zip(rows, results) if r[0] == row[1]) kept = sum(1 for row, r in zip(rows, results) if r[0] == 0xC0DE0000 + row[0] // 4) added = sum(1 for row, r in zip(rows, results) if r[2] == 0xC0DE0000 + (2048 + row[0]) // 4 + 1) untouched = sum(1 for row, r in zip(rows, results) if r[2] == 0xC0DE0000 + (2048 + row[0]) // 4) returned = sorted({r[1] for r in results})[:3] print(f"TYPE {type_bits}: store landed {stored}/{ROWS}, memory kept {kept}/{ROWS}; atomic added {added}/{ROWS}, memory kept {untouched}/{ROWS}; atomic returned {' '.join(f'{w:08x}' for w in returned)}") if __name__ == "__main__": main() ``` </details> <details><summary>Output</summary> ``` target gfx1036; 96 rows; buffer loads through a V# with TYPE 0, 1, 2, 3 control word 3 0x31016fac, num_records 0x1000: TYPE 1 vs TYPE 0: 0/96 rows equal offset 0 index 0: TYPE 0 5a5a1234 5a5a1234 f8918be5 deadbeef 5a5a1234 5a5a1234 5a5a1234 5a5a1234 5a5a1234 | TYPE 1 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef control word 3 0x31016fac, num_records 0x1000: TYPE 2 vs TYPE 0: 0/96 rows equal offset 0 index 0: TYPE 0 5a5a1234 5a5a1234 f8918be5 deadbeef 5a5a1234 5a5a1234 5a5a1234 5a5a1234 5a5a1234 | TYPE 2 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef control word 3 0x31016fac, num_records 0x1000: TYPE 3 vs TYPE 0: 0/96 rows equal offset 0 index 0: TYPE 0 5a5a1234 5a5a1234 f8918be5 deadbeef 5a5a1234 5a5a1234 5a5a1234 5a5a1234 5a5a1234 | TYPE 3 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef control word 3 0x31016fac, num_records 0x100: TYPE 1 vs TYPE 0: 0/96 rows equal offset 0 index 0: TYPE 0 5a5a1234 5a5a1234 f8918be5 deadbeef 5a5a1234 5a5a1234 5a5a1234 5a5a1234 5a5a1234 | TYPE 1 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef control word 3 0x31016fac, num_records 0x100: TYPE 2 vs TYPE 0: 0/96 rows equal offset 0 index 0: TYPE 0 5a5a1234 5a5a1234 f8918be5 deadbeef 5a5a1234 5a5a1234 5a5a1234 5a5a1234 5a5a1234 | TYPE 2 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef control word 3 0x31016fac, num_records 0x100: TYPE 3 vs TYPE 0: 0/96 rows equal offset 0 index 0: TYPE 0 5a5a1234 5a5a1234 f8918be5 deadbeef 5a5a1234 5a5a1234 5a5a1234 5a5a1234 5a5a1234 | TYPE 3 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef PPSA02100 word 3 0x91b00f2e, num_records 0x1000: TYPE 1 vs TYPE 0: 0/96 rows equal offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 1 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef PPSA02100 word 3 0x91b00f2e, num_records 0x1000: TYPE 2 vs TYPE 0: 0/96 rows equal offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 2 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef PPSA02100 word 3 0x91b00f2e, num_records 0x1000: TYPE 3 vs TYPE 0: 0/96 rows equal offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 3 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef PPSA02100 word 3 0x91b00f2e, num_records 0x100: TYPE 1 vs TYPE 0: 0/96 rows equal offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 1 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef PPSA02100 word 3 0x91b00f2e, num_records 0x100: TYPE 2 vs TYPE 0: 0/96 rows equal offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 2 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef PPSA02100 word 3 0x91b00f2e, num_records 0x100: TYPE 3 vs TYPE 0: 0/96 rows equal offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 3 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef PPSA02100 word 3 0xa1b00fac, num_records 0x1000: TYPE 1 vs TYPE 0: 0/96 rows equal offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 1 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef PPSA02100 word 3 0xa1b00fac, num_records 0x1000: TYPE 2 vs TYPE 0: 0/96 rows equal offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 2 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef PPSA02100 word 3 0xa1b00fac, num_records 0x1000: TYPE 3 vs TYPE 0: 0/96 rows equal offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 3 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef PPSA02100 word 3 0xa1b00fac, num_records 0x100: TYPE 1 vs TYPE 0: 0/96 rows equal offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 1 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef PPSA02100 word 3 0xa1b00fac, num_records 0x100: TYPE 2 vs TYPE 0: 0/96 rows equal offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 2 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef PPSA02100 word 3 0xa1b00fac, num_records 0x100: TYPE 3 vs TYPE 0: 0/96 rows equal offset 0 index 0: TYPE 0 00000000 00000000 00000000 deadbeef 00000000 00000000 00000000 00000000 00000000 | TYPE 3 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef target gfx1036; 64 lanes; store, then atomic add 1, through a V# with each TYPE TYPE 0: store landed 64/64, memory kept 0/64; atomic added 64/64, memory kept 0/64; atomic returned c0de0200 c0de0201 c0de0202 TYPE 1: store landed 0/64, memory kept 64/64; atomic added 0/64, memory kept 64/64; atomic returned 00000001 TYPE 2: store landed 0/64, memory kept 64/64; atomic added 0/64, memory kept 64/64; atomic returned 00000001 TYPE 3: store landed 0/64, memory kept 64/64; atomic added 0/64, memory kept 64/64; atomic returned 00000001 ``` </details> AI-assisted (Claude Code).
YossiYad commented 2026-10-14 17:11:05 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-14T17:11:05Z.


@p3n1cillin on the shader address: the throw is reached from the resource capture, shaderMemory.Capture(invocation) in Driver::materializeDrawStage (the capture materializes the snapshot), which is why the Materialize call there never sees it. #5897 puts shader 0x<address> stage <n>: on failures of both calls, adds the buffer slot and V# words to this message, and with APS5_DUMP_SHADERS=1 dumps the stage's request. A run with it should name the shader and give a .req to replay.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6173963473 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5879#issuecomment-6173963473). Originally posted by [YossiYad](https://github.com/YossiYad) on 2026-10-14T17:11:05Z. --- @p3n1cillin on the shader address: the throw is reached from the resource capture, `shaderMemory.Capture(invocation)` in `Driver::materializeDrawStage` (the capture materializes the snapshot), which is why the `Materialize` call there never sees it. #5897 puts `shader 0x<address> stage <n>:` on failures of both calls, adds the buffer slot and V# words to this message, and with `APS5_DUMP_SHADERS=1` dumps the stage's request. A run with it should name the shader and give a `.req` to replay.
nikowolf123 commented 2026-10-14 17:13:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by nikowolf123 on 2026-10-14T17:13:17Z.


@p3n1cillin, before anything is built on the TYPE ≠ 0 result @simonbronk measured above, it's worth checking whether this draw should run its pixel stage at all. Could you run current main with #5631 by @moong15 (head 75083acb3) applied? It skips the pixel stage for draws in the state described below. In its matched Stellar Blade runs, 2 of 6 runs on main stopped at presentation on buffer descriptor uses an unsupported type and none of the 6 with the PR did (runs in the PR). The PR notes that this link is inferred from the failure type, not traced to a draw.

What #5631 changes, and why it could fit here:

  • In Stellar Blade, depth-only draws clear CB_TARGET_MASK, CB_SHADER_MASK and DB_SHADER_CONTROL but leave the previous pixel program bound and SPI_SHADER_Z_FORMAT non-zero.
  • main skips the pixel stage only when Z_FORMAT is also 0 (State.cpp#L1404-L1415). Otherwise it materializes that program with the current user data, which #5631 found was written for a different program.
  • That fits what you found: a buffer slot that holds a different T# from run to run, and then a 3D T# in a 2D slot of the same shader once you bound the buffer as empty.
  • #5631 drops the Z_FORMAT condition (State.cpp#L1400-L1412 at 75083acb3), and such a draw then gets the null pixel program before any of its resources are read (DrawDecode.cpp#L27-L30). If Stray's draw is in that state, the image-slot stop you found next should go away too, which a TYPE ≠ 0 rule for buffers would not cover. Whether it is in that state is not known; the run would show it.

Please also apply #5897 in the same build: as @YossiYad explains above, its message then names the shader and the V# if the stop remains. If you add a local print at that draw, 0x8e, 0x8f, 0x203 and 0x2dc (CB_TARGET_MASK, CB_SHADER_MASK, DB_SHADER_CONTROL, DB_ALPHA_TO_MASK) are the context registers #5631's check reads. Both PRs merge into main e34c47921 without conflicts, separately and together.

AI-assisted: written with Claude Code; I checked #5631's predicate change against PixelProgramSkipped on main e34c47921, where DecodeGraphicsPrograms substitutes the null pixel program, the Stellar Blade runs in #5631's body and gist, and that #5897 wraps the capture call. I ran git merge-tree for #5631 and #5897 against main e34c47921, each alone and both together. I did not run Stray or build these PRs.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6174005305 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5879#issuecomment-6174005305). Originally posted by [nikowolf123](https://github.com/nikowolf123) on 2026-10-14T17:13:17Z. --- @p3n1cillin, before anything is built on the TYPE ≠ 0 result @simonbronk measured above, it's worth checking whether this draw should run its pixel stage at all. Could you run current `main` with #5631 by @moong15 (head `75083acb3`) applied? It skips the pixel stage for draws in the state described below. In its matched Stellar Blade runs, 2 of 6 runs on `main` stopped at presentation on `buffer descriptor uses an unsupported type` and none of the 6 with the PR did ([runs in the PR](https://github.com/boykopovar/AnyPS5/pull/5631)). The PR notes that this link is inferred from the failure type, not traced to a draw. What #5631 changes, and why it could fit here: - In Stellar Blade, depth-only draws clear `CB_TARGET_MASK`, `CB_SHADER_MASK` and `DB_SHADER_CONTROL` but leave the previous pixel program bound and `SPI_SHADER_Z_FORMAT` non-zero. - `main` skips the pixel stage only when Z_FORMAT is also 0 ([State.cpp#L1404-L1415](https://github.com/boykopovar/AnyPS5/blob/e34c479210c78d7b160d7054f3e72de422b23d7a/core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp#L1404-L1415)). Otherwise it materializes that program with the current user data, which #5631 found was written for a different program. - That fits what you found: a buffer slot that holds a different T# from run to run, and then a 3D T# in a 2D slot of the same shader once you bound the buffer as empty. - #5631 drops the Z_FORMAT condition ([State.cpp#L1400-L1412 at `75083acb3`](https://github.com/boykopovar/AnyPS5/blob/75083acb346a048bcdf51512ff547a1decba82f8/core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp#L1400-L1412)), and such a draw then gets the null pixel program before any of its resources are read ([DrawDecode.cpp#L27-L30](https://github.com/boykopovar/AnyPS5/blob/e34c479210c78d7b160d7054f3e72de422b23d7a/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawDecode.cpp#L27-L30)). If Stray's draw is in that state, the image-slot stop you found next should go away too, which a TYPE ≠ 0 rule for buffers would not cover. Whether it is in that state is not known; the run would show it. Please also apply #5897 in the same build: as @YossiYad explains above, its message then names the shader and the V# if the stop remains. If you add a local print at that draw, `0x8e`, `0x8f`, `0x203` and `0x2dc` (`CB_TARGET_MASK`, `CB_SHADER_MASK`, `DB_SHADER_CONTROL`, `DB_ALPHA_TO_MASK`) are the context registers #5631's check reads. Both PRs merge into `main` `e34c47921` without conflicts, separately and together. AI-assisted: written with Claude Code; I checked #5631's predicate change against `PixelProgramSkipped` on `main` `e34c47921`, where `DecodeGraphicsPrograms` substitutes the null pixel program, the Stellar Blade runs in #5631's body and gist, and that #5897 wraps the capture call. I ran `git merge-tree` for #5631 and #5897 against `main` `e34c47921`, each alone and both together. I did not run Stray or build these PRs.
p3n1cillin commented 2026-10-14 19:51:53 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by p3n1cillin on 2026-10-14T19:51:53Z.


@nikowolf123 thanks, that was it. With #5631 (head 75083acb3) and #5897 merged onto main 4c1de0c0c, Stray gets past the loading screen into gameplay in 2 of 2 runs (250 s and 300 s). Neither the buffer-slot stop nor the image-slot stop comes up. Plain main stopped on buffer descriptor uses an unsupported type in all 6 of my runs. Details are in #5631. I'd leave this issue open until #5631 merges; @simonbronk's TYPE != 0 measurement then isn't needed for Stray.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6177010287 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5879#issuecomment-6177010287). Originally posted by [p3n1cillin](https://github.com/p3n1cillin) on 2026-10-14T19:51:53Z. --- @nikowolf123 thanks, that was it. With #5631 (head `75083acb3`) and #5897 merged onto `main` `4c1de0c0c`, Stray gets past the loading screen into gameplay in 2 of 2 runs (250 s and 300 s). Neither the buffer-slot stop nor the image-slot stop comes up. Plain `main` stopped on `buffer descriptor uses an unsupported type` in all 6 of my runs. Details are in #5631. I'd leave this issue open until #5631 merges; @simonbronk's `TYPE != 0` measurement then isn't needed for Stray.
MarcZX10 commented 2026-10-15 01:18:34 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T01:18:34Z.


Status update: #5631 has now merged (commit 75083acb3). The reported Stray stop was cleared in the reporter's 2/2 runs with #5631 and #5897, so the condition in the last update (leave this issue open until #5631 merges) is now met.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6182151493 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5879#issuecomment-6182151493). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T01:18:34Z. --- Status update: #5631 has now merged (commit 75083acb3). The reported Stray stop was cleared in the reporter's 2/2 runs with #5631 and #5897, so the condition in the last update (leave this issue open until #5631 merges) is now met.
ymatrix1 commented 2026-10-16 01:32:45 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ymatrix1 on 2026-10-16T01:32:45Z.


Same throw on Kena: Bridge of Spirits (PPSA01802), after Continue, and I think I can say where the descriptor comes from.

The V# is a user-data register the game never set for that draw

The failing shader declares four buffers. Dumping the user data of every failing materialization showed:

userData: 01151b40 00040010 00000002 00014204 | 00e6e000 00040015 00000800 00014204 | 84254063 80262e5f 8a23b36c 88245269 | 4c21379c 00100020 00000001 0004dfac
buf1 = regs 0..3   valid V#
buf2 = regs 4..7   valid V#
buf3 = regs 8..11  84254063 80262e5f 8a23b36c 88245269   <- the one that throws
buf0 = regs 12..15 valid V# (a 16-byte per-draw constant buffer, stride 16, 1 record)

Regs 8..11 differ on every draw and contain things that are not descriptors at all, for example c0017a00 20000243 00000400 c0033500 (PM4 headers), 00000001 00000008 00000000 bd000000, 0000008c 5d0c0000 00100020 00011800. Those are leftovers from earlier draws that used the same registers. The SET_SH_REG packets of these draws write only part of the bank. The indirect register lists were not the cause: I compared the list read at submit with a live read at execution and they were identical.

That fits the symptom in this issue and in #5769: the error changes from run to run (type 2, reserved bit, format 0, unaligned base, unreadable range 0x1d62a0000+0x200000, "exceeds descriptor range limit") because the stale words differ. The game works on the console, so the shader does not reach a vector access through that V#, or reaches it harmlessly.

Hardware behaviour is already measured above (loads leave the destination VGPRs untouched, stores and atomics do nothing, for TYPE 1..3). For a V# whose TYPE is 0 but whose other fields are junk (format 0, reserved bit 30 of word 1, a base that is not mapped), I have not measured anything.

Proposals

  1. Mirror #5828 for buffers: a V# with TYPE != 0 in a read-only slot binds as an empty buffer instead of failing the draw. The measured no-op is close to "reads return zero" and drops writes and atomics, so one rule covers loads, stores and atomics, and the existing test that requires the throw changes to require the empty binding.
  2. The same for the other validations that read the same stale words: reserved bit 30 of word 1, FORMAT 0 or above the last known format on a typed access, a base that is not aligned to the element, and a range that is not readable. For the unreadable case addGuestBuffer already clamps to RegisteredReadableEnd when the size exceeds maxStorageBufferRange; doing it for any size, with 0 meaning the empty buffer, removes the guest memory is not readable throw.
  3. If the maintainers prefer to keep failing on a descriptor the shader really reads: record, per user-data register, whether it was written by the packets of this draw or dispatch, and refuse only when the bad V# lives in registers written for it. Registers that carry data from an earlier draw would bind as empty. This keeps the strict behaviour for a game that really passes a broken descriptor, at the cost of tracking one bit per register.
  4. Independently of 1..3, the refusal should name the user-data registers the V# came from, so the next report shows right away whether the slot was ever set. #5897 already names the shader and V#.

I ran Kena with 1 and 2 applied locally (not a PR: the existing tests require the throw). Without them it stops after Continue; with them it stays up past Continue and reaches the loading screen (the in-game world itself I have not reached yet). It still ends later, in a run with frame dumping on, on AGC graphics: vertex fetch exceeds descriptor record count, which looks like the same family on a vertex buffer, and that one I have not looked into yet.

Menu and the loading screen after Continue with the local change (Kena 1.16, Windows, RTX 4070 Super):

Kena main menu

Kena loading screen after Continue

If one of these is acceptable I can turn it into a PR with the test changes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6205986816 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5879#issuecomment-6205986816). Originally posted by [ymatrix1](https://github.com/ymatrix1) on 2026-10-16T01:32:45Z. --- Same throw on Kena: Bridge of Spirits (PPSA01802), after Continue, and I think I can say where the descriptor comes from. **The V# is a user-data register the game never set for that draw** The failing shader declares four buffers. Dumping the user data of every failing materialization showed: ``` userData: 01151b40 00040010 00000002 00014204 | 00e6e000 00040015 00000800 00014204 | 84254063 80262e5f 8a23b36c 88245269 | 4c21379c 00100020 00000001 0004dfac buf1 = regs 0..3 valid V# buf2 = regs 4..7 valid V# buf3 = regs 8..11 84254063 80262e5f 8a23b36c 88245269 <- the one that throws buf0 = regs 12..15 valid V# (a 16-byte per-draw constant buffer, stride 16, 1 record) ``` Regs 8..11 differ on every draw and contain things that are not descriptors at all, for example `c0017a00 20000243 00000400 c0033500` (PM4 headers), `00000001 00000008 00000000 bd000000`, `0000008c 5d0c0000 00100020 00011800`. Those are leftovers from earlier draws that used the same registers. The SET_SH_REG packets of these draws write only part of the bank. The indirect register lists were not the cause: I compared the list read at submit with a live read at execution and they were identical. That fits the symptom in this issue and in #5769: the error changes from run to run (type 2, reserved bit, format 0, unaligned base, unreadable range `0x1d62a0000+0x200000`, "exceeds descriptor range limit") because the stale words differ. The game works on the console, so the shader does not reach a vector access through that V#, or reaches it harmlessly. **Hardware behaviour** is already measured above (loads leave the destination VGPRs untouched, stores and atomics do nothing, for TYPE 1..3). For a V# whose TYPE is 0 but whose other fields are junk (format 0, reserved bit 30 of word 1, a base that is not mapped), I have not measured anything. **Proposals** 1. Mirror #5828 for buffers: a V# with TYPE != 0 in a read-only slot binds as an empty buffer instead of failing the draw. The measured no-op is close to "reads return zero" and drops writes and atomics, so one rule covers loads, stores and atomics, and the existing test that requires the throw changes to require the empty binding. 2. The same for the other validations that read the same stale words: reserved bit 30 of word 1, FORMAT 0 or above the last known format on a typed access, a base that is not aligned to the element, and a range that is not readable. For the unreadable case `addGuestBuffer` already clamps to `RegisteredReadableEnd` when the size exceeds `maxStorageBufferRange`; doing it for any size, with 0 meaning the empty buffer, removes the `guest memory is not readable` throw. 3. If the maintainers prefer to keep failing on a descriptor the shader really reads: record, per user-data register, whether it was written by the packets of this draw or dispatch, and refuse only when the bad V# lives in registers written for it. Registers that carry data from an earlier draw would bind as empty. This keeps the strict behaviour for a game that really passes a broken descriptor, at the cost of tracking one bit per register. 4. Independently of 1..3, the refusal should name the user-data registers the V# came from, so the next report shows right away whether the slot was ever set. #5897 already names the shader and V#. I ran Kena with 1 and 2 applied locally (not a PR: the existing tests require the throw). Without them it stops after Continue; with them it stays up past Continue and reaches the loading screen (the in-game world itself I have not reached yet). It still ends later, in a run with frame dumping on, on `AGC graphics: vertex fetch exceeds descriptor record count`, which looks like the same family on a vertex buffer, and that one I have not looked into yet. Menu and the loading screen after Continue with the local change (Kena 1.16, Windows, RTX 4070 Super): ![Kena main menu](https://raw.githubusercontent.com/ymatrix1/AnyPS5/evidence/kena-5879/evidence/kena-menu.png) ![Kena loading screen after Continue](https://raw.githubusercontent.com/ymatrix1/AnyPS5/evidence/kena-5879/evidence/kena-after-continue.png) If one of these is acceptable I can turn it into a PR with the test changes.
MarcZX10 commented 2026-10-16 04:21:49 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T04:21:49Z.


Thanks for the new Kena trace. It separates this from the original Stray stop, which was cleared by #5631: here the slot contains stale user-data words not written by the current draw, and eager materialization rejects it before execution. Your RDNA2 probe gives concrete evidence for the narrow TYPE != 0 case: vector loads leave destinations untouched, and stores/atomics do not modify memory. That supports testing a null/empty binding for non-buffer TYPEs, while keeping the broader TYPE=0 malformed-field relaxations out until they have separate evidence. Since you have the reproducer and hardware probe, a focused PR from your branch would preserve that provenance and let reviewers evaluate the behavior and test changes together.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6208012974 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5879#issuecomment-6208012974). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T04:21:49Z. --- Thanks for the new Kena trace. It separates this from the original Stray stop, which was cleared by #5631: here the slot contains stale user-data words not written by the current draw, and eager materialization rejects it before execution. Your RDNA2 probe gives concrete evidence for the narrow TYPE != 0 case: vector loads leave destinations untouched, and stores/atomics do not modify memory. That supports testing a null/empty binding for non-buffer TYPEs, while keeping the broader TYPE=0 malformed-field relaxations out until they have separate evidence. Since you have the reproducer and hardware probe, a focused PR from your branch would preserve that provenance and let reviewers evaluate the behavior and test changes together.
MarcZX10 commented 2026-10-16 04:22:03 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T04:22:03Z.


One overlap note before implementation: #6412 is still open and defers TYPE rejection for guarded static buffer reads in eligible compute shaders. It does not cover this pixel-stage case or establish the no-op result, but it touches the same materialization/recompiler area, so please compare and coordinate with that author before choosing the implementation boundary.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6208015432 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5879#issuecomment-6208015432). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T04:22:03Z. --- One overlap note before implementation: #6412 is still open and defers TYPE rejection for guarded static buffer reads in eligible compute shaders. It does not cover this pixel-stage case or establish the no-op result, but it touches the same materialization/recompiler area, so please compare and coordinate with that author before choosing the implementation boundary.
MarcZX10 commented 2026-10-16 11:14:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T11:14:19Z.


I want to narrow my earlier suggestion about binding a null/empty buffer for a non-buffer TYPE. The RDNA2 probe shows that vector loads leave their destination VGPRs unchanged; a plain empty Vulkan buffer binding would return zeros, so it would not reproduce that measured behavior. The PS5 gfx1013 behavior is still unmeasured.

A conservative implementation direction is to defer rejection only for eligible, read-only, unformatted plain vector loads: bind a safe placeholder and record an invalid-descriptor fault if an active fragment actually executes the load, then report it at draw completion. If control flow skips the load, no fault is raised. This avoids emulating the RDNA2 no-op on PS5. It would extend the planning/materialization/fault machinery in #6412 from compute to pixel shaders, so I would coordinate the boundary with that PR's author before opening a stacked follow-up. I have not implemented or validated this change.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6214278261 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5879#issuecomment-6214278261). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T11:14:19Z. --- I want to narrow my earlier suggestion about binding a null/empty buffer for a non-buffer TYPE. The RDNA2 probe shows that vector loads leave their destination VGPRs unchanged; a plain empty Vulkan buffer binding would return zeros, so it would not reproduce that measured behavior. The PS5 gfx1013 behavior is still unmeasured. A conservative implementation direction is to defer rejection only for eligible, read-only, unformatted plain vector loads: bind a safe placeholder and record an invalid-descriptor fault if an active fragment actually executes the load, then report it at draw completion. If control flow skips the load, no fault is raised. This avoids emulating the RDNA2 no-op on PS5. It would extend the planning/materialization/fault machinery in #6412 from compute to pixel shaders, so I would coordinate the boundary with that PR's author before opening a stacked follow-up. I have not implemented or validated this change.
MarcZX10 commented 2026-10-17 02:38:51 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T02:38:51Z.


Following up on the Kena fragment-stage case: are you planning to submit the guarded-read change from your reproducer branch, or would you prefer that I prepare a separate follow-up after #6412 is coordinated and rebased? I will hold off on overlapping implementation until the ownership boundary and #6412 sequencing are clear. The conservative test scope remains an inactive guarded read that completes without a fault and an active guarded read that reports an InvalidDescriptor fault at its load PC.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6228601112 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5879#issuecomment-6228601112). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T02:38:51Z. --- Following up on the Kena fragment-stage case: are you planning to submit the guarded-read change from your reproducer branch, or would you prefer that I prepare a separate follow-up after #6412 is coordinated and rebased? I will hold off on overlapping implementation until the ownership boundary and #6412 sequencing are clear. The conservative test scope remains an inactive guarded read that completes without a fault and an active guarded read that reports an InvalidDescriptor fault at its load PC.
ymatrix1 commented 2026-10-19 14:22:34 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ymatrix1 on 2026-10-19T14:22:34Z.


Thanks. Please go ahead with #7689; I'm not going to submit a competing PR. My local change just binds empty buffers for those slots, which doesn't match the hardware no-op, so your deferred-fault approach is the better boundary. I have a Windows machine with an RTX 4070 Super and the Kena dump, so once #6412 and #7689 are stacked I can run Kena on them and report whether it gets past Continue. Separately, a later run still stopped on AGC graphics: vertex fetch exceeds descriptor record count. That looks like the same stale-register family on a vertex buffer, and I'll file it separately rather than expand this one.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6269511706 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5879#issuecomment-6269511706). Originally posted by [ymatrix1](https://github.com/ymatrix1) on 2026-10-19T14:22:34Z. --- Thanks. Please go ahead with #7689; I'm not going to submit a competing PR. My local change just binds empty buffers for those slots, which doesn't match the hardware no-op, so your deferred-fault approach is the better boundary. I have a Windows machine with an RTX 4070 Super and the Kena dump, so once #6412 and #7689 are stacked I can run Kena on them and report whether it gets past Continue. Separately, a later run still stopped on `AGC graphics: vertex fetch exceeds descriptor record count`. That looks like the same stale-register family on a vertex buffer, and I'll file it separately rather than expand this one.
dantdmdarealguy commented 2026-10-22 08:37:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by dantdmdarealguy on 2026-10-22T08:37:15Z.


Current main d6eafa54d, Stray (PPSA02100) 01.002.000, Windows 11 Pro, RTX 5080 (driver 32.0.16.1742): buffer descriptor uses an unsupported type did not occur in 18 runs on main (2 with a cold shader cache, 60-900 s, 5 of them through the first level load into gameplay). The Stray case of this issue looks fixed by #5631, as reported above; what's left here is the Kena (PPSA01802) stale user-data case that #7689 / #6412 address.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6336479713 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5879#issuecomment-6336479713). Originally posted by [dantdmdarealguy](https://github.com/dantdmdarealguy) on 2026-10-22T08:37:15Z. --- Current `main` `d6eafa54d`, Stray (PPSA02100) 01.002.000, Windows 11 Pro, RTX 5080 (driver 32.0.16.1742): `buffer descriptor uses an unsupported type` did not occur in 18 runs on `main` (2 with a cold shader cache, 60-900 s, 5 of them through the first level load into gameplay). The Stray case of this issue looks fixed by #5631, as reported above; what's left here is the Kena (PPSA01802) stale user-data case that #7689 / #6412 address.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#5879
No description provided.