Kena (PPSA01746): a draw's SRT walk reads through an unmapped pointer (0xdfac00000008) and aborts #5099
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 fma-rc on 2026-10-13T11:39:20Z.
On
mainb1328fc0fKena (PPSA01746) aborts 68 to 87 s into the run, before the first present, when a draw's SRT walk reads through a pointer that is not mapped.Setup: Arch Linux, RTX 5080 (NVIDIA 615.78.08), GCC 16.2.1, Release build.
Reproduction: start the title and wait. Seven runs:
AGC driver: guest memory is not readable at 0xdfac00000008 (range 0xdfac00000008+0x4)storage image access to depth/stencil surface ... is not implemented(the stop of #1409)With a local backtrace print in
GuestMemory'sverify, the throwing read isRight before it the same walk asks
ShaderMemory::accessibletwice (once for 0xdfac00000000+0x1000, once for 0xdfac00000008+0x4), both answer "not readable", and then the read goes ahead and throws. The line[gpu] layer/viewport index vertex exports are ignored (PA_CL_VS_OUT_CNTL=0x01240000)is printed once just before.I have not identified the shader or whether the read sits behind a branch in it.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T12:11:30Z.
I traced the current SRT evaluator path. In
EvaluateRawRead,ShaderMemory::accessibleis consulted only when the evaluator has an inaccessible-read sink, and an inaccessible address suppresses that dereference only whenLoadedFromMemory(handle)is also true. So if the twoaccessible=falseresults are for the reads that then fault, the useful next distinction is whether those handles are classified as memory-derived, or whether the faulting dereference is a separate raw read.APS5_SRT_DEBUG=1logs the SRT expressions and inaccessible-read/poison decisions. I have not identified the shader or a safe fix from the current report.Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-13T12:27:24Z.
Thanks,
APS5_SRT_DEBUG=1shows more. One run that ended on the same read (samemainb1328fc0flibraries):After the last
[srt] slot N = LoadAddressU32(...)line the log has 137[srt] cannot evaluate ...lines and then the abort, nothing else in between. The opcodes that start those chains areLaneId,GetBuiltinandLoadSharedU32, followed by the compares and selects built on them (ULessThan32,SelectU32,INotEqual32,LogicalAnd,LogicalNot, ...). The whole log has noreads inaccessible ... zero wordsline and no poison line, so the suppression you describe never engaged for 0xdfac00000008.So the walk that faults belongs to a shader whose branches depend on per-lane values the evaluator can't know at capture time. I have not shown yet that the faulting read sits in one of those branches; that is what I'd check next.
With the debug switch on, another run stopped differently:
image descriptor is incompatible with the static runtime image interface: descriptor format 56 decodes to {class 1, dim 4, ....Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-13T16:18:55Z.
Two new things on
main60fb61870.Stray (PPSA02100) stops on the same address: 5 of 13 runs end at 70 to 89 s, before the first present, with
guest memory is not readable at 0xdfac00000008.I added a local print to
Evaluator::EvaluateRawReadfor that address. The read's base handle has low word0x7and high word0x0004dfac, so the base is0xdfac00000007after the 48-bit mask, plus immediate 4. The raw reads just before it walk 16-byte buffer descriptors:So the faulting read uses words 2 and 3 of the first descriptor (record count 7 and the fourth word) as an address.
LoadedFromMemory(handle)is false for it, so the accessibility check before the read is skipped even though a sink is set.I have not yet found which instruction builds that handle.
Imported from boykopovar/AnyPS5. Originally posted by ThatsLeo on 2026-10-13T16:26:43Z.
Stray's EU release (PPSA02101 v01.002) stops on the same read:
guest memory is not readable at 0xdfac00000008 (range 0xdfac00000008+0x4). Fedora 44, Intel Arc (Meteor Lake, Mesa 26.2.3 ANV), Release, so not NVIDIA-specific.It came later than in your runs: about 335 s in, after the brightness calibration screen had been accepted and the next scene was loading. Before the first present it didn't happen here. That's one run, on
main5a76fd71with #5181 and a local SPIR-V mapping change on top, which only cut memory so the title got that far on a 14 GB machine. Neither touches the evaluator's raw reads.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-13T17:54:23Z.
@alfalfa-star the read is in
Evaluator::EvaluateRawRead. I printed the value chain of the faulting instruction on Stray,main60fb61870(1 stop in 3 runs this time). It is at pc 0x18, memory kind 2, and readsLoadAddressU32(GetAddressResource(GetUserData, GetUserData), 0, 0)with immediate 4. So the handle comes straight from two user-data registers, which hold 0x7 and 0x0004dfac in that draw.
LoadedFromMemory(handle)only looks forReadConst,LoadAddressU32andReadConstBufferunder the handle, so it is false here and the accessibility check before the read is skipped. A pointer loaded through an SRT would have been reported at that point; this one goes on to the read and throws.APS5_TRACE_UNREADABLE=1printed only absolute return addresses for me, so I have no module offset for the caller.I don't know yet whether the shader executes that read for this draw or whether those two registers are the wrong slots. I am printing the user-data words and the block's condition next.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T18:11:49Z.
I checked the current evaluator path against these traces.
EvaluateRawReadcalls the accessibility probe, but only records an inaccessible read and returns before dereferencing whenLoadedFromMemory(*handle)is true. That predicate searches the handle's inputs for earlierReadConst,LoadAddressU32, orReadConstBufferoperations. In the latest trace the handle is built directly fromGetAddressResource(GetUserData, GetUserData), so the predicate is false; the evaluator then proceeds to the raw read, which reachesGuestMemory::Readand throws. This matches the observed “probe says inaccessible, then read throws” sequence.That identifies the missing classification path, though it does not establish whether every direct user-data address should be treated as an SRT pointer. I’m investigating a narrow fix that reports this case to the existing unreadable-read handling without turning unrelated guest addresses into false positives.
AI-assisted: yes; I verified this against the current
SrtEvaluator.cppandSrtInstructionPredicates.cppimplementation.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T18:26:55Z.
I opened #5384 with the direct user-data root fix and regression test. It keeps snapshot-backed evaluation strict, while opting live AGC capture into recording an inaccessible direct
GetAddressResourceroot as poison. The new test verifies the reported0x7/0x0004dfacaddress shape is recorded and the read callback is not invoked. Linux GCC 12.2/Ninja Releaseagc_shader_memorypassed (1/1); no Kena or Stray runtime test was run.AI-assisted: yes; reviewed and tested by MarcZX100.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T20:29:50Z.
Thanks for the follow-up. This narrows the result: #5384 prevents the host-side SRT capture from aborting on the unmapped direct user-data root, but the shader still reaches an invalid GPU access, reported as a deferred write-back failure at
0xdfac00000004. The later Kena stops vary, and neither run establishes correct rendering or gameplay. I updated #5384's Tested section to record both the improvement and this remaining failure mode.Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-14T00:17:07Z.
I found the cause, and #5573 fixes it.
The failing draw is a fused geometry shader.
sceAgcFuseShaderHalvesbuilt the fused program in the caller's memory and registered it at that address. Stray fuses other halves into the same memory a few calls later, while draws that use the first result are still queued, so those draws ran the later program. That program reads a user-data word their layout does not have, which is where the0xdfac...pointer comes from.With #5573 on plain
main(without #5384) Stray stopped on this line in 0 of 10 runs of 120 s, against 2 of 6 onmain, and no run loggedBDA access failed. Kena got past it in 4 of 4 runs.@ThatsLeo, this may be worth a try for the hang you saw on Intel Arc after that fault.
Imported from boykopovar/AnyPS5. Originally posted by ThatsLeo on 2026-10-14T02:00:28Z.
@fma-rc thanks, tried it. #5573 (
d6f67d1be) onmain18c438b1with #5181 and a local SPIR-V mapping change on top (memory only), Stray PPSA02101 EU, Intel Arc (Meteor Lake, Mesa 26.2.3 ANV):The hang is gone. Before, right after the calibration screen was accepted, two
BDA access failed ... 0xdfac00000004lines came and presents stopped until the 120 s render-thread watchdog. With #5573 there is noBDA access failedand nonot readableline, and presents go on past that screen at the same rate as before (about 1.1 fps at 4K on this iGPU, frame 127 to 206). The run then ended on this machine's out-of-memory killer while the next scene loaded, which is a separate problem.It fits what I saw locally: the program at the failing draw's ES address had 8 user SGPRs while that draw's
SPI_SHADER_PGM_RSRC2_GSgave 12, and the code there no longer matched the registered copy.One clean run, so it doesn't say much about frequency.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T06:25:27Z.
Fixed by #5573: the fused geometry program now lives in memory libSceAgc owns, so a later fusion into the same caller memory no longer replaces the program that queued draws use, and the read through
0xdfac00000008is gone. Stray (PPSA02101) onmainstopped on it in 3 of 4 runs here and in none with #5573. The laterbuffer descriptor uses an unsupported typestop is a separate issue; please open one with the log if it blocks you.