fix(shader): follow scheduled jump table index writes #7630
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7630"
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 JJenkx on 2026-10-18T18:05:53Z.
What
Recognize bounded two-dword PC-relative jump tables when unrelated instructions separate the index bound, index shift and base-address calculation. The existing matcher requires the bound and shift immediately before the three base-address instructions. A shader in Crimson Spires PPSA03568 instead schedules vector work in those gaps and is refused at
s_setpc_b64PC0x3e0.Reuse the conservative last-writer search for the SMEM offset register to identify its scale and bound. Intervening writes to that register or control-flow boundaries still reject the match; the existing bound, scale, branch-entry, table-range and destination checks remain. No dynamic indirect-branch fallback or title-specific path is added.
One commit
eaa6d89ff9on main8d17389a73. The depth-bounds fix in #7627 is excluded from this branch; it is only a prerequisite for the native integration evidence below.Tested
Linux Release, GCC 16.2.1, Ryzen 9 7950X; AMD RX 6650 XT, RADV Mesa 26.2.4.
libs, control-flow and scalar-setpc targets build. Four focused CTests pass, no skips (0.34 s), withANYPS5_REQUIRE_VULKAN=1: control-flow default, iteration-selection-off, forced fallback, and scalar-setpc GPU readback.unsupported dynamic s_setpc_b64PC0x38); restored candidate passes. The private captured title request changes from its PC0x3e0refusal to a full 54,275-word SPIR-V result. No title code or serialized requests are attached.4be62bfde14d= mainc34e9d855c+ #7627 + this shader change: input at46.79 s passes the previous crash, loading screenshot at60 s and opening-story screen at110 s visually inspected. Ordinary close at121.32 s; exit0 after123.33 s, process gone, temporary udmabuf limit restored to64 MiB. Explicit existingAPS5_PLAYGO_UNLISTED_CHUNKS=installedwas used because this dump lacks chunk metadata. Gameplay, FPS gains and visual completeness are untested. This native result is the older integration, not the refreshed standalone branch.Sanitized validation and test/negative-control logs, assets prefixed
crimson-scheduled. Local Windows and full-suite runs were not performed. Contributor validation is recorded below.Contributor validation: LeandroLP23 reports all four focused CTests passing three runs each with
ANYPS5_REQUIRE_VULKAN=1and no skips on Windows 11 26300, Radeon 860M (RDNA 3.5), AMD driver 32.0.13058.8001, WinLibs GCC 15.2.0 r7 Release. That build combines mainc3591adf9with #7629, #7630 and #7627; this is contributor integration validation, not an isolated Windows run of this branch. MarcZX10 reviewed the #6977 overlap warning and found that its PS4 GCN control-flow changes implement separate behavior.savvaniss independently reports all four focused tests passing three runs each on Windows 11 Pro 26300, Intel UHD 770 (32.0.101.7088) and AMD RX 9070 XT (32.0.31041.1004), WinLibs GCC 15.2.0 r7 Release. The tested composition merges exact head
eaa6d89ffinto mainf3059421f, with shader caching disabled and serial CTest. A control using this PR's tests on that main without its implementation fails all four tests on both GPUs. This is contributor composition evidence, not our own Windows run or a title-performance result.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-18T18:13:51Z.
Follow-up native validation on newer main
5057673804b2plus #7627 and this shader change (local integratione3635481b941): the full runtime and focused targets build, and all four focused CTests pass with Vulkan required (zero skips, 0.36 s).A five-minute run now advances beyond the opening quotation: scheduled Cross input enters the in-car scene with narration at 200 s, then a later dialogue line with Erika’s portrait at 280 s. Both captures were visually inspected. Ordinary close at 301.51 s; exit zero at 303.51 s; native process gone and temporary udmabuf limit restored to 64 MiB. This used the same explicit installed-chunk override recorded above.
Sanitized native validation and focused test log. This establishes opening dialogue progression for the two-fix integration, not full gameplay, visual correctness or an FPS improvement.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T18:26:47Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/shader/recompiler/ControlFlow/src/GraphBuilder.cppImported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-18T18:28:33Z.
Windows and AMD's proprietary driver, since the description lists Windows and other GPUs as not tested. Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), Windows 11 26300, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON. Build:mainc3591adf9with #7629, #7630 and #7627 merged together (each merge clean, built once).With
ANYPS5_REQUIRE_VULKAN=1,agc_shader_control_flow,agc_shader_control_flow_iteration_selection_off,agc_shader_control_flow_forced_fallbackandagc_driver_scalar_setpcpass 3 runs of 3, with no skips.AI-assisted
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T18:31:09Z.
I manually checked the overlap bot warning against #6977. That PR is a broad PS4 GCN/Limbo integration and is currently conflicted; its GraphBuilder.cpp change is gated to PS4 GCN shader control flow, while this PR changes scheduled jump-table index tracking for the existing path. The code changes do not implement the same behavior. The reported Windows/Radeon 860M focused CTest runs also add useful validation for this PR.
Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-18T21:53:01Z.
Intel and AMD Windows data: the four tests fail on
mainand pass with this PR on an Intel UHD 770 and an AMD RX 9070 XT.Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built,
ANYPS5_NO_SHADER_CACHE=1, serial CTest. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, withVkCacheemptied first. This headeaa6d89ffmerged intomainf3059421f. "Without" means this PR's test files onmainf3059421f, with none of its other changes.agc_driver_scalar_setpc,agc_shader_control_flow,agc_shader_control_flow_forced_fallback,agc_shader_control_flow_iteration_selection_offI also ran full CTest with this PR and the 14 other open AGC PRs I tested in the same batch merged together (#7647, #7641, #7627, #7603, #7600, #7591, #7579, #7535, #7533, #7474, #7462, #7050, #7048, #7650). Neither GPU showed a failure beyond
main's own, except #7650's new test.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-19T03:33:46Z.
Additional Windows validation with this PR alone on upstream main
fd423f9b2e4051e84aec3d4315a6f15a90c3473e: cherry-picked exact PR headeaa6d89ff981f558f8213ac1b3dd5f9abd51eb6f, producing local validation head5eac5e88134251f5607397ab41a75540ee4fbad3. No other PR changes were included.Windows 11 Enterprise build 22621, Ryzen 9 5950X, Radeon RX 6700 XT, AMD proprietary Vulkan driver 26.8.1 (Vulkan API 1.4.315), WinLibs GCC 15.2.0 UCRT r7, Release,
BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=ON.ANYPS5_REQUIRE_VULKAN=1; the execution test explicitly selected the RX 6700 XT.Built
agc_shader_control_flow_testsandagc_driver_scalar_setpc_tests, then ran:All four tests passed three consecutive runs each (12 executions), with zero skips; CTest total time 9.49 seconds. Saved JUnit reports four tests, zero failures, zero disabled and zero skipped. This is focused test coverage, not a title performance comparison.
AI-assisted validation.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-20T11:05:24Z.
Rechecked against current main: the new GraphBuilder changes touch the table-call/descriptor search, not
resolveJumpTableorfindLastWriter, so the matcher change and its checks (adjacent base-address triple, writer search stopping at branches/setpc/endpgm, bound/scale/branch-entry/table-range) are unchanged, and the tests still pin the exact table values, the rejected rewritten-index cases and the GPU readback in both wave sizes; merged.