Astro's Playroom (PPSA01325): shader ABI resolution passes a different Shader* header pointer for the same code #2914
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 Unkown607 on 2026-10-10T18:26:38Z.
Astro's Playroom (PPSA01325): shader ABI resolution passes a different
Shader*header pointer for the same codeSymptom
Astro's Playroom (PPSA01325, first-party title, FW 13.60) crashes while preparing a vertex-stage shader:
exit code 134 (SIGABRT). The throw is
_readHeaderPodinGraphics/src/ShaderInputState.cpp:46.Context
This is a different root cause from #2026 (closed): that was opengnm emitting shader headers without C++ tail padding, resolved by #2063. Here the header-size/padding is not the issue — the game is a first-party title compiled with Sony's toolchain.
Diagnosis
The title calls
ResolveGraphicsAbi/ResolveShaderAbi/ResolveGraphicsStagesAbiwith aShader*whosecodepointer matches a registered shader, but whose header pointer differs from the snapshot'sheaderAddresscaptured at registration time.Upstream (
ShaderRegistry.cpp) requires exact header-address identity and throws"rectangle ABI refers to a replaced shader header"in that case. On our fork we relaxed that to updatesnapshot.headerAddressunder the mutex instead of throwing (9ad1b82a).The problem: updating
headerAddresswithout re-reading the header bytes leavessnapshot.headerstale. The header contains absolute guest pointers (shader.user_data,shader.input_semantics, …) that are relative to the original header address.DecodeVertexStageInfothen computesoffset = pointer - headerAddressagainst the new address, lands outsideheader.size(), and_readHeaderPodthrows.Proposed fix
When the header pointer changes, re-capture the header bytes from the new
Shader*(the size is already available asshader->header_size):This requires
ShaderSnapshot::headerto bemutable(likeheaderAddress), and should be applied at all three resolve sites.Repro notes
libc.prx/libSceNpCppWebApi.prxrelinked).data/prein/save_data/*.xml,.odx/.codx/.cdx) to be present — without it the title crashes earlier (gatcha data lookup). Config-only dump is sufficient; textures/audio are not needed to reach this crash.Can't find model: data/prein/.../*.jxmwarnings (non-fatal), then the throw.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by NRAPM on 2026-10-10T21:26:22Z.
I have implemented and tested this fix on branch
NRAPM:fix/agc-shader-abi-relocated-header(commit7fb5b337, rebased on latestmainintegratingRegisteredHeader):SameHeader,RelocateSnapshotHeaderpublishes a new snapshot for the relocated header under drivermutexat the three resolve sites (ResolveGraphicsStagesAbi,ResolveShaderAbi,ResolveGraphicsAbi).ShaderSnapshotimmutable (no mutable members or technical debt needed).PreparedShaders.cppwith relocated full header copies.python tools/check_conventions.py --base origin/mainandpython -m unittest discover tools/tests.PR #2969 was created with this change, but was auto-closed due to the intake pause (minimum 10 merged PRs threshold). Maintainers are welcome to carry or cherry-pick this commit (
7fb5b337).Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T01:09:08Z.
#2856 (merged 10-10) keeps every registered header for the same code and resolves the ABI to the matching one. Does PPSA01325 still stop on current main?
Imported from boykopovar/AnyPS5. Originally posted by NRAPM on 2026-10-11T10:22:28Z.
Yes, it still crashes on current main.
#2856 matches registered headers sharing code, but here the game passes a relocated copy at ABI resolve that was never registered.
RegisteredHeadermatches it viaSameHeader, but leaves the originalheaderAddressand header bytes untouched. Downstream in_readHeaderPod, calculating offsets against the oldheaderAddresslands out of bounds and aborts.UpdateSnapshotHeaderupdatessnapshot.headerAddressand copies the new bytes to fix it.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T03:20:59Z.
I closed #5830 because it carried code from the intake-paused #2969, and independent reports reproduced regressions in existing tests. I then traced the current
mainat5d9dcc42d:ResolveGraphicsStagesAbiselects a registered snapshot, andDecodeGraphicsProgramsresolves the program by code address and passes that snapshot's header bytes and base toDecodeVertexStageInfo. In the current source path I inspected, I do not see the caller's relocatedShader*reaching that decoder. Since the reported reproduction predates several changes tomain, could you verify it again on the current head and share the exact current stack trace if it still fails? I have not opened a replacement until the failure is demonstrated against currentmain.Imported from boykopovar/AnyPS5. Originally posted by ebosido444-ai on 2026-10-16T22:33:03Z.
Verified on current
main(e9a3343) without the title binary, as asked.A driver test that registers a vertex header and then resolves the ABI with a relocated copy of it — every embedded pointer moved into the copy, the copy itself never registered — fails today:
RegisteredHeader→SameHeaderis where it stops.RelocatedRegistersaccepts a copy whose register array alone moved, and the fixed-field comparison accepts one whose only moved pointer isuser_data, but a copy that moved its other referenced arrays with the header matches nothing, and the resolution refuses.The
_readHeaderPodthrow in the report came from the fork's own relaxation (re-pointingheaderAddresswhile keeping the snapshot's bytes, so B-relative pointers were computed against A-sized header bytes). Upstream never reaches that path: it refuses earlier. So the title's stop onmainshould be the refusal above, notAGC header pointer is outside the registered shader header— worth confirming against the title's log.#6966 accepts a copy when every array it names still holds the registered bytes, so the registered header decodes exactly what the copy describes: no snapshot copy, no registry publish,
ShaderSnapshotstays immutable, and a copy whose registers, context registers, specials or semantics differ (or whose arrays are unreadable) still throws.RelocatedHeaders()intests/execution/PreparedShaders.cppfails on unmodifiedmainand passes with the change (agc_driver_prepared_shaders11/11; Windows 11 26200.8117, winlibs GCC 15.2.0, GeForce GTX 1650 Ti 617.14 Vulkan).That test is the reproduction: run it on
mainas it stands in #6966 and it fails there.AI-assisted: yes.