fix(agc): publish relocated shader snapshot on ABI resolution #4043
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4043"
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 NRAPM on 2026-10-11T22:01:13Z.
Fixes #2914.
What
In titles such as Astro's Playroom (PPSA01325), shader ABI resolution calls (
ResolveGraphicsStagesAbi,ResolveShaderAbi,ResolveGraphicsAbi) can pass aShader*whose code pointer matches a registered shader, but whose header is allocated or copied at a different guest address.When
SameHeadermatches the relocated header, the snapshot was not published for the new address. When decoders resolve stage info against the registered snapshot, pointer offsets are computed against the original base address instead of the relocated copy, leading to out-of-bounds header offsets.This change:
RelocateSnapshotHeaderandPublishRegisteredShaderundermutexat the three resolve sites (ResolveGraphicsStagesAbi,ResolveShaderAbi,ResolveGraphicsAbi).ShaderSnapshotstrictly immutable withoutmutablemembers.PreparedShaders.cpptests with relocated header copies.Tested
python tools/check_conventions.py --base origin/main(passed).python -m unittest discover tools/tests(60 passed).git diff --check(clean).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T23:20:50Z.
Which line does PPSA01325 stop at on current main? Please post the log from an unpatched build. Two things I can't match with the description:
RegisteredHeaderreturns the registered snapshot with its ownheaderAddressand header bytes, and nothing rewrites them, so_readHeaderPodreads a consistent header. The stale-header case in #2914 comes from9ad1b82a, which isn't on main.RelocateSnapshotHeadercopiesheader_sizebytes from the pointer it is given. A caller that copies only theShaderstruct has nothing behind it (Shader copy = header.shaderinPreparedShaders.cpp,Registration), and every new copy address clones the registry and adds a snapshot.Do the two added resolves fail without the change? The Tested section lists no build or ctest run.
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-12T07:05:58Z.
Pre-review found a deterministic test regression on Linux — flagging early since full CI doesn't run automatically on PRs.
Independent pre-review (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV):tools/check_conventions.pypasses.Each fails fast with
AGC graphics: missing AGC user-data header.Negative control: the same 7-test family passes 100% at this branch's own merge base (
ad3369236) on the same machine — so the regression is introduced by the branch's changes, not the environment or the base.Separately: this branch is ~1364 commits behind
mainand will need a rebase before review regardless. Reproduce with:Happy to provide the full output if useful.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T02:44:08Z.
Closing: with this branch
agc_driver_prepared_shaders,_indirect,_uncachedand_debugfail withmissing AGC user-data header(blawesom's run above), and the questions from 10-11 are still open. Please reopen with a build and ctest run and the line PPSA01325 stops at on unpatched main.Pull request closed