Recompiler: relative VGPR addressing lowers to a select chain over the register window; Killzone: Liberation (PPSA11142) freezes compiling a 649k-word mesh shader; fix branch ready #3842
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 Mouad-Scriptz-0 on 2026-10-11T17:51:04Z.
Follow-up to #3622. With #3539, #3738 and local fixes for its barycentric and provoking-vertex stops, Killzone: Liberation (PPSA11142 01.000.004, Sony's PSP emulator wrapper, Linux) reaches its first PSP frame and then freezes: the frame needs a merged (geometry-path) program of 3176 ISA words that the recompiler turns into 649,515 SPIR-V words with 32,383
OpSelect, and Intel's compiler (Mesa 26.2.3, ANV, Arc Meteor Lake) did not finish it in six minutes and 7 GiB; the thread sits inbrw_opt_register_coalesce/brw_live_variables.Cause. The program addresses its vector registers relatively 104 times (
v_movrels_b3294,v_movreld_b3210, M0 from scalars such as(s34 << 1) - 2), with bases down to v0 and 154 registers allocated.readRelativeVector/writeRelativeVector(ControlFlowInstructions.cpp) lower each access to a compare-and-select chain over every register from the base to the program's last allocated register, so the IR carried 15,768SelectU32and 13,127IEqual32before any backend work (APS5_DUMP_IR).Fix branch ready:
Mouad-Scriptz-0:feat/recompiler-vector-window(f8ed012e, one commit onmaina11c8f7f). I cannot open it as a PR while #3738 is my one open pull request; anyone eligible is welcome to carry it, keeping the commit as is, or I open it once #3738 is decided.tools/pr_overlap.py --branchreports #3741 touching the same test-registration line inlibSceAgcDriver/CMakeLists.txt(one-line merge).LoadVectorWindowandStoreVectorWindow;IrBuilder::GetVectorReg/SetVectorRegroute plain accesses to those registers through the same array, so the SSA register model only covers the registers below the window. The window is chosen inTranslatefrom the decoded instructions before the entry prologue writes any register; programs without relative addressing are unchanged.UMin(base + offset, size - 1), a relative write one load, the exec-masked select (or theDppUpdateU32merge when the destination carries a DPP control, as a plain write does) and one store. An index past the window reads 0 and drops its write, as the RDNA ISA describes for out-of-range VGPR indexing; the chain read the base register and dropped the write. Neither is measured on the console (TechnicalDebt entry).scratch_dwordsand emitsOpAccessChain/OpLoad/OpStore.agc_vector_window(new) recompiles a compute program withv_movrels_b32/v_movreld_b32and checks for one function-scope array of the window's length, its access chains and no select chain, and that a program without relative addressing keeps no such array.agc_driver_relative_indexing,agc_driver_scalar_relative_indexingandagc_driver_dpp16_operandscover the semantics; the DPP merge was caught by the last one.Result. The program recompiles to 392,333 words with 4,992 selects (the rest is the driver's bounds and lane guards on its memory accesses, out of scope here). The title plays its logos and reaches its language menu at the PSP 30 fps cap on this iGPU. A new pipeline variant of that program still compiles for about 20 s with
APS5_NO_PIPELINE_LTO=1; with the background optimized link on, the link's second compile doubles CPU and memory and the stall runs into minutes, which may be worth a look on its own. Two rendering defects remain on the title and are being looked at separately: 4x4 texel blocks missing from PSP textures read through storage-image views of imported memory (absent withAPS5_NO_SAMPLED_FROM_STORAGE=1, so a refresh race rather than tiling), and half-drawn text sprites on the language menu, which is not yet attributed.Tested on Fedora 44 (kernel 7.2.8, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, Intel Arc Meteor Lake iGPU, Mesa 26.2.3):agc_vector_window,agc_driver_relative_indexing,agc_driver_scalar_relative_indexingandagc_driver_dpp16_operandspass.ctest -j4 --timeout 180on a tree carrying this change with #3622, #3534 and the two further local AGC fixes, without the sevenagc_driver_*tests that fail the same way on a cleanmainbuild on this iGPU: 821 passed, 5 skipped, 1 failed (agc_driver_emulated_color_compare, an ANV sRGB sampling limit that fails identically on cleanmain).tools/check_conventions.py --base origin/main,tools/check_test_registration.py buildandgit diff --checkpass. Not tested on Windows.AI-assisted: yes (Claude Code).