Stray (PPSA02100): a pixel shader reads a 2D image descriptor as a buffer ("buffer descriptor uses an unsupported type") #5879
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 p3n1cillin on 2026-10-14T14:37:04Z.
Stray (PPSA02100, Unreal Engine 4) on Windows 11, RTX 5070, MinGW GCC 15, Release,
main066b58fa1, 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:A local print at the throw in
materializeTables(ResourceMaterializer.cpp) showed: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 inucrtbase!abortunderLibcException::DefaultTerminateand 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)
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 intests/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 with0x91b00f2estill returns the buffer's data. The same test requires a vector or mixed access with that word to keep throwingbuffer 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 memoryin 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.Imported from boykopovar/AnyPS5. Originally posted by p3n1cillin on 2026-10-14T15:04:18Z.
More detail from later runs, same setup:
20da2600 c3800000 001dc13f a1b00fac, with word 3's nibble0xA. It is always buffer 2 of 3 in a pixel shader, read by vector memory loads.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 throughDrawCapture'sMaterializecall. The RDNA2 ISA only saysTYPEmust be 0 for a V# and doesn't define a buffer read through a T#, so I haven't proposed a fix.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:0x91b00f2eand0xa1b00facboth 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_dwordandbuffer_load_dwordx2withoffen;buffer_load_format_xyzwandbuffer_load_dwordwithidxen):0x31016fac, TYPE 0) reads the data.0xdeadbeefpreset. 96 of 96 offset/index rows, num_records0x1000and0x100.Stores and atomics (
buffer_store_dword,buffer_atomic_add ... glc), 64 lanes, read back through the same V# with TYPE 0: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
probe_buffer_type_store.py
Output
AI-assisted (Claude Code).
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)inDriver::materializeDrawStage(the capture materializes the snapshot), which is why theMaterializecall there never sees it. #5897 putsshader 0x<address> stage <n>:on failures of both calls, adds the buffer slot and V# words to this message, and withAPS5_DUMP_SHADERS=1dumps the stage's request. A run with it should name the shader and give a.reqto replay.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
mainwith #5631 by @moong15 (head75083acb3) applied? It skips the pixel stage for draws in the state described below. In its matched Stellar Blade runs, 2 of 6 runs onmainstopped at presentation onbuffer descriptor uses an unsupported typeand 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:
CB_TARGET_MASK,CB_SHADER_MASKandDB_SHADER_CONTROLbut leave the previous pixel program bound andSPI_SHADER_Z_FORMATnon-zero.mainskips 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.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,0x203and0x2dc(CB_TARGET_MASK,CB_SHADER_MASK,DB_SHADER_CONTROL,DB_ALPHA_TO_MASK) are the context registers #5631's check reads. Both PRs merge intomaine34c47921without conflicts, separately and together.AI-assisted: written with Claude Code; I checked #5631's predicate change against
PixelProgramSkippedonmaine34c47921, whereDecodeGraphicsProgramssubstitutes the null pixel program, the Stellar Blade runs in #5631's body and gist, and that #5897 wraps the capture call. I rangit merge-treefor #5631 and #5897 againstmaine34c47921, each alone and both together. I did not run Stray or build these PRs.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 ontomain4c1de0c0c, 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. Plainmainstopped onbuffer descriptor uses an unsupported typein all 6 of my runs. Details are in #5631. I'd leave this issue open until #5631 merges; @simonbronk'sTYPE != 0measurement then isn't needed for Stray.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.
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:
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
addGuestBufferalready clamps toRegisteredReadableEndwhen the size exceedsmaxStorageBufferRange; doing it for any size, with 0 meaning the empty buffer, removes theguest memory is not readablethrow.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):
If one of these is acceptable I can turn it into a PR with the test changes.
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.
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.
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.
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.
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.Imported from boykopovar/AnyPS5. Originally posted by dantdmdarealguy on 2026-10-22T08:37:15Z.
Current
maind6eafa54d, Stray (PPSA02100) 01.002.000, Windows 11 Pro, RTX 5080 (driver 32.0.16.1742):buffer descriptor uses an unsupported typedid not occur in 18 runs onmain(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.