fix(recompiler): split descriptor webs whose Phis sit in different blocks #2653
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2653"
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 oneandonlydean on 2026-10-10T10:08:02Z.
What
#1274 splits an image read whose T#/S# reaches it through a web of SRT Phis, but its walk requires every Phi of the descriptor tuple to sit in one block. When a sample chooses its T# in one if/else and its S# in a later one, the Phis sit in two blocks. The walk gives up and the plan throws:
Astro Bot (PPSA21564) stops with this line after its first frames.
Tested
Linux (CachyOS, GCC, RTX 4090), Release:
ctestpasses, exceptagc_driver_dcc_keys_first_write, which fails onmaintoo.tools/check_conventions.pypasses.agc_shader_memory,verifyDescriptorPhis: a T# chosen by one if/else and an S# chosen by a second one plan two images and two samplers and recompile. Onmainit throws the line above.mainwith #1274 and this change: a pixel shader with eleven such samples stopped with the line above. With this change, the level loads.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 repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by Mouhand-Kaddo on 2026-10-10T10:16:30Z.
Additional platform validation on standalone PR head
58d1f5ab18cffe68f9215a1dd891eab21e3caf76:Windows: passed — Windows 11, supported WinLibs GCC 15.2.0 UCRT/POSIX/SEH r7; CMake 4.3.1 / Ninja.
Release /
BUILD_TESTING=ON: built the selected test targets; 1 CTest cases, 0 failures, 0 CTest skips.Tests:
agc_shader_memory.Reproduce after building the test targets:
ctest --test-dir <build> --verbose --no-tests=error --timeout 30 -R "^agc_shader_memory$".Vulkan: native AMD RX 6900 XT, driver 32.0.21045.5002.
This shader-memory case validates compiler planning and recompilation, not execution of a GPU workload or a retail title
Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-10T11:53:36Z.
Tested on Linux with Astro Bot (PPSA21567).
Setup: CachyOS (kernel 7.2.9), RX 9070 XT (RADV), Release, headless gamescope with scripted input. This PR (
58d1f5ab1) cherry-picked onto mainb5f5362d3, nothing else.Without this PR: the title stops about 100 s in on
With this PR: that stop is gone. The next stop, about 80 s in, is unrelated to this change:
(a 2D-array comparison sample with emulated compare bound to a plain 2D T#; details in a separate issue). Adding #425 does not change either result here.
Tested and written by Claude (AI assistant) on a contributor's machine.
Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-10T14:49:55Z.
Independent validation on real hardware
Built and ran the PR head
58d1f5abon my own box:Release,BUILD_TESTING=ON.Result:
agc_shader_memory— PASSES (exit 0) ("Shader memory capture, strict validation and deterministic replay passed"), including the newverifyDescriptorPhiscase where a T# is chosen in one block and an S# in another (plans 2 images + 2 samplers and recompiles).Rigor check (is the test real?): I changed the web walk to require every tuple Phi to sit in a single block (i.e. reverted the "split at the latest block" behavior), rebuilt, and the test failed —
GetImageResource dword 0 is not a valid runtime value; chain: Phi(ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate))(exit 1), which is exactly the error line in your PR description. Restoring the change → PASS. So the newverifyDescriptorPhiscase genuinely exercises the multi-block split rather than passing unconditionally.Honest limits: I verified the recompiler planning/compilation path on one GPU (the 5090). I did not run Astro Bot (no game/ROM here) or the full
ctestsuite (you noteagc_driver_dcc_keys_first_writefails onmaintoo), and I did not test Linux.Written with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-10T18:57:10Z.
Tested with Astro Bot PPSA21564 v01.007.000 on NVIDIA: the stop this PR targets is reproducible here on
mainand gone with the PR.Setup: Arch Linux 7.2.9, GCC 16.2.1, Release, RTX 5080 (NVIDIA 615.78.08), 31 GB RAM.
main57f96fd2against the same commit with this PR's head58d1f5abmerged, nothing else. Relinker output unchanged between the two; only the libraries were rebuilt.APS5_HOST_IMPORT_MIB=12288in all four runs, because with the default budget this title does not get far enough here to compile the shader.mainLevelDocument Loaded: ui_pause_nextmainLevelDocument Loaded: ui_pause_nextmain+ this PRStartLevel ps_logo,GAME: Level has started: ps_logo,LevelDocument Loaded: title_controller_shipmain+ this PRNot established: what comes after
title_controller_ship. Both runs with the PR were ended by my own memory guard, not by the title: the process was at about 25.5 GB resident and the machine had under 4 GiB available. So I cannot say whether there is a later stop on this GPU, and I did not look at the picture.