fix(recompiler): read P10 of a flat input as the provoking vertex #4030

Merged
AlxcBTW merged 2 commits from upstream-pr/4030 into main 2026-10-12 14:41:23 +00:00
AlxcBTW commented 2026-10-11 21:35:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-11T21:35:57Z.


What

Fixes the stop last provoking vertex with explicit per-vertex flat interpolation is unsupported for the case ps5-opengl titles hit (#3581, #1413). A FLAT_SHADE input without pass-through that a pixel shader reads through v_interp_mov_f32 P10 became an explicit per-vertex input and read vertex 1 minus vertex 0. With the last provoking vertex the pipeline then threw.

ps5-opengl reads every flat input through P10 when GL's last-vertex convention is in effect, and its driver passes the GL 4.6 CTS on a PS5 (#1413).

  • P10 read: such a read now returns the provoking vertex's value, as P0 does. Only a P20 read keeps a flat input per vertex.
  • First provoking vertex: the lane was not measured on the console itself, so FragmentParameter records it (flatP10) and a pipeline using the first provoking vertex throws.
  • TechnicalDebt: the PA_SU_SC_MODE_CNTL.PROVOKING_VTX_LAST entry describes this.

Titles that stop there on main and get past it with this change:

  • Homebrew UI Lab (PPSA99050), VITA5 (PPSA39410), SymphonyStation5 (PPSA17641), ProsperoTV (PPSA99003), Stremio Plus (PPSA74126) and Surround Sound Studio (PPSA99051): confirmed by @orishamir on an RTX 4080, same tree with and without the change (table). Surround Sound Studio then stops at sceAudioOutSysGetHdmiMonitorInfo, which is #2887.
  • ProsperoStore (PPSA99000): confirmed by @orishamir (analysis), renders its UI.
  • Five of these (SymphonyStation5, VITA5, Homebrew UI Lab, ProsperoStore, Stremio Plus with #3493) also go from a start-up stop to running in @AchrafReyani's merge map, Windows 11, RTX 4070, main a11c8f7f.
  • PShare (PPSA99773): confirmed by @Lorkydey on a GTX 1660 SUPER, Windows 11, main a11c8f7f + #3606; without the change it aborts with the guard, with c18298c3 it renders (comment).

The open question on #1413 stays: CouchRiv measured 0 on gfx1036. This change follows the PS5-side evidence for exactly this case and keeps the other cases as throws.

Tested

Windows 11 (26200), WinLibs GCC 15.2.0, Release, rebased onto main a11c8f7f7:

  • New checks in agc_driver_graphics (ProvokingVertexTests): a flat P10 input compiles to a flat, non-per-vertex input recorded as flatP10 and apart from P0; it validates with the last provoking vertex and is rejected with the first.
  • Non-GPU suite (Lenovo node, ctest -E "^agc_driver|^video_out|^guest_video"): 527/530 pass. The three failures, guest_kernel_sys, guest_filesystem (access denied on a created file) and windows_exceptions, fail the same way (0xc0000409) on unrelated trees there; windows_exceptions also fails on main (CI).
  • GPU suites on NVIDIA (RTX 5070 Laptop, AMD iGPU hidden): agc_driver_graphics, agc_driver_draw_cache_reuse and agc_driver_draw_cache_reuse_off: 3/3 pass.
  • Conventions: tools/check_conventions.py --base origin/main passes.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4822541207 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4030). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-11T21:35:57Z. --- ### What Fixes the stop `last provoking vertex with explicit per-vertex flat interpolation is unsupported` for the case ps5-opengl titles hit (#3581, #1413). A FLAT_SHADE input without pass-through that a pixel shader reads through `v_interp_mov_f32` P10 became an explicit per-vertex input and read vertex 1 minus vertex 0. With the last provoking vertex the pipeline then threw. ps5-opengl reads every flat input through P10 when GL's last-vertex convention is in effect, and its driver passes the GL 4.6 CTS on a PS5 (#1413). - **P10 read:** such a read now returns the provoking vertex's value, as P0 does. Only a P20 read keeps a flat input per vertex. - **First provoking vertex:** the lane was not measured on the console itself, so `FragmentParameter` records it (`flatP10`) and a pipeline using the first provoking vertex throws. - **TechnicalDebt:** the `PA_SU_SC_MODE_CNTL.PROVOKING_VTX_LAST` entry describes this. Titles that stop there on `main` and get past it with this change: - Homebrew UI Lab (PPSA99050), VITA5 (PPSA39410), SymphonyStation5 (PPSA17641), ProsperoTV (PPSA99003), Stremio Plus (PPSA74126) and Surround Sound Studio (PPSA99051): confirmed by @orishamir on an RTX 4080, same tree with and without the change ([table](https://github.com/boykopovar/AnyPS5/issues/3581#issuecomment-6109839314)). Surround Sound Studio then stops at `sceAudioOutSysGetHdmiMonitorInfo`, which is #2887. - ProsperoStore (PPSA99000): confirmed by @orishamir ([analysis](https://github.com/boykopovar/AnyPS5/issues/3581#issuecomment-6109689736)), renders its UI. - Five of these (SymphonyStation5, VITA5, Homebrew UI Lab, ProsperoStore, Stremio Plus with #3493) also go from a start-up stop to running in @AchrafReyani's [merge map](https://github.com/boykopovar/AnyPS5/issues/1578#issuecomment-6111925637), Windows 11, RTX 4070, `main` a11c8f7f. - PShare (PPSA99773): confirmed by @Lorkydey on a GTX 1660 SUPER, Windows 11, `main` a11c8f7f + #3606; without the change it aborts with the guard, with c18298c3 it renders ([comment](https://github.com/boykopovar/AnyPS5/issues/3581#issuecomment-6112623122)). The open question on #1413 stays: CouchRiv measured 0 on gfx1036. This change follows the PS5-side evidence for exactly this case and keeps the other cases as throws. ### Tested Windows 11 (26200), WinLibs GCC 15.2.0, Release, rebased onto `main` a11c8f7f7: - **New checks in `agc_driver_graphics` (`ProvokingVertexTests`):** a flat P10 input compiles to a flat, non-per-vertex input recorded as `flatP10` and apart from P0; it validates with the last provoking vertex and is rejected with the first. - **Non-GPU suite (Lenovo node, `ctest -E "^agc_driver|^video_out|^guest_video"`):** 527/530 pass. The three failures, `guest_kernel_sys`, `guest_filesystem` (access denied on a created file) and `windows_exceptions`, fail the same way (`0xc0000409`) on unrelated trees there; `windows_exceptions` also fails on `main` (CI). - **GPU suites on NVIDIA (RTX 5070 Laptop, AMD iGPU hidden):** `agc_driver_graphics`, `agc_driver_draw_cache_reuse` and `agc_driver_draw_cache_reuse_off`: 3/3 pass. - **Conventions:** `tools/check_conventions.py --base origin/main` passes. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Kikoarl commented 2026-10-11 21:52:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-11T21:52:26Z.


Tested on Linux (CachyOS x86_64, GCC) with an NVIDIA GeForce RTX 5060 Ti (driver 615.78.08, Vulkan 1.4):

  • agc_driver_graphics (including the new ProvokingVertexTests checks): PASSED (3.53s).
  • agc_driver_draw_cache_reuse & agc_driver_draw_cache_reuse_off: PASSED (0.35s & 0.28s).
  • tools/check_conventions.py passes clean.

Confirms correct behavior and tests passing on desktop Linux + NVIDIA. LGTM!

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114204922 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4030#issuecomment-6114204922). Originally posted by [Kikoarl](https://github.com/Kikoarl) on 2026-10-11T21:52:26Z. --- Tested on **Linux (CachyOS x86_64, GCC)** with an **NVIDIA GeForce RTX 5060 Ti (driver 615.78.08, Vulkan 1.4)**: - `agc_driver_graphics` (including the new `ProvokingVertexTests` checks): **PASSED** (3.53s). - `agc_driver_draw_cache_reuse` & `agc_driver_draw_cache_reuse_off`: **PASSED** (0.35s & 0.28s). - `tools/check_conventions.py` passes clean. Confirms correct behavior and tests passing on desktop Linux + NVIDIA. LGTM!
oneandonlydean commented 2026-10-12 03:06:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T03:06:49Z.


Passed our title check together with the other queued PRs. It conflicts with main in docs/dev/TechnicalDebt.md only (the PROVOKING_VTX_LAST line next to main's new v_rcp, v_rsq line); please rebase so the full build can run, then it can go in.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6117016272 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4030#issuecomment-6117016272). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-12T03:06:49Z. --- Passed our title check together with the other queued PRs. It conflicts with main in `docs/dev/TechnicalDebt.md` only (the `PROVOKING_VTX_LAST` line next to main's new `v_rcp, v_rsq` line); please rebase so the full build can run, then it can go in.
AlxcBTW commented 2026-10-12 03:09:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-12T03:09:54Z.


@oneandonlydean thanks. I merged current main (f0674d3c0) into the branch as a7ed14c74 rather than force-pushing. The only conflict was the docs/dev/TechnicalDebt.md pair: I kept this PR's PROVOKING_VTX_LAST entry and main's updated v_rcp, v_rsq, … entry unchanged. The diff against main is the same 7 files as before, and check_conventions.py passes. If you'd rather have a linear rebase, say so.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6117043804 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4030#issuecomment-6117043804). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-12T03:09:54Z. --- @oneandonlydean thanks. I merged current `main` (f0674d3c0) into the branch as a7ed14c74 rather than force-pushing. The only conflict was the `docs/dev/TechnicalDebt.md` pair: I kept this PR's `PROVOKING_VTX_LAST` entry and `main`'s updated `v_rcp, v_rsq, …` entry unchanged. The diff against `main` is the same 7 files as before, and `check_conventions.py` passes. If you'd rather have a linear rebase, say so. AI-assisted: yes (Claude Code)
orishamir commented 2026-10-12 11:22:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by orishamir on 2026-10-12T11:22:29Z.


Windows run of this head on current main, with one more title that stops here: Forwarder Manager (PPSA99930).

main 3d8ffeb2 against main + a7ed14c7 (clean merge). Windows 11, RTX 4080 (driver 616.56), WinLibs GCC 15.2.0 r7, Release, catalog builds with eboot.bin and sce_module/libc.prx unwrapped, 45 s each. Both arms use the same relinker and libraries except libSceAgcDriver.prx. Screens are from frames saved with APS5_DUMP_FRAMES.

Title main with this PR
ProsperoStore (PPSA99000) stops at this line after 34 s runs 45 s; Discover page, "Offline"
Homebrew UI Lab (PPSA99050) stops at this line after 27 s runs 45 s; full home screen
VITA5 (PPSA39410) stops at this line after 26 s runs 45 s; "Dock your PS Vita" screen
SymphonyStation5 (PPSA17641) stops at this line after 27 s runs 45 s; Navidrome login form
Stremio Plus (PPSA74126) stops at this line runs 45 s; its own "App storage is unavailable" screen (lstat /data, errno 2)
Forwarder Manager (PPSA99930) stops at this line after 31 s runs 45 s; its own "No access to /data/homebrew" screen (it expects a jailbroken console)
[videoout] presentation failed: AGC graphics: last provoking vertex with explicit per-vertex flat interpolation is unsupported

With #3512 and #3493 merged, all six now stop here on plain main. ProsperoTV (PPSA99003) is not in the table: on main it still stops earlier at poll: descriptor 3 is not a socket (#3521).

AI-assisted: yes (Claude Code Opus 5.5 xhigh)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6123261683 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4030#issuecomment-6123261683). Originally posted by [orishamir](https://github.com/orishamir) on 2026-10-12T11:22:29Z. --- Windows run of this head on current `main`, with one more title that stops here: Forwarder Manager (PPSA99930). `main` 3d8ffeb2 against `main` + a7ed14c7 (clean merge). Windows 11, RTX 4080 (driver 616.56), WinLibs GCC 15.2.0 r7, Release, catalog builds with `eboot.bin` and `sce_module/libc.prx` unwrapped, 45 s each. Both arms use the same relinker and libraries except `libSceAgcDriver.prx`. Screens are from frames saved with `APS5_DUMP_FRAMES`. | Title | `main` | with this PR | |---|---|---| | ProsperoStore (PPSA99000) | stops at this line after 34 s | runs 45 s; Discover page, "Offline" | | Homebrew UI Lab (PPSA99050) | stops at this line after 27 s | runs 45 s; full home screen | | VITA5 (PPSA39410) | stops at this line after 26 s | runs 45 s; "Dock your PS Vita" screen | | SymphonyStation5 (PPSA17641) | stops at this line after 27 s | runs 45 s; Navidrome login form | | Stremio Plus (PPSA74126) | stops at this line | runs 45 s; its own "App storage is unavailable" screen (`lstat /data`, errno 2) | | Forwarder Manager (PPSA99930) | stops at this line after 31 s | runs 45 s; its own "No access to /data/homebrew" screen (it expects a jailbroken console) | ``` [videoout] presentation failed: AGC graphics: last provoking vertex with explicit per-vertex flat interpolation is unsupported ``` With #3512 and #3493 merged, all six now stop here on plain `main`. ProsperoTV (PPSA99003) is not in the table: on `main` it still stops earlier at `poll: descriptor 3 is not a socket` (#3521). AI-assisted: yes (Claude Code Opus 5.5 xhigh)
AlxcBTW commented 2026-10-12 11:23:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-12T11:23:30Z.


@orishamir thank you, that's a clean A/B: six titles that stop at this exact line on current main and run with the PR, and the merge with main 3d8ffeb2 is still clean. Good to know the earlier stops (#3512, #3493) are out of the way, so this line is now the common blocker for all of them.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6123276533 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4030#issuecomment-6123276533). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-12T11:23:30Z. --- @orishamir thank you, that's a clean A/B: six titles that stop at this exact line on current `main` and run with the PR, and the merge with `main` 3d8ffeb2 is still clean. Good to know the earlier stops (#3512, #3493) are out of the way, so this line is now the common blocker for all of them. AI-assisted: yes (Claude Code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!4030
No description provided.