fix(shader): accept signed less-than in runtime SRT values #3807

Merged
reyani-dev merged 1 commit from upstream-pr/3807 into main 2026-10-11 22:05:44 +00:00
reyani-dev commented 2026-10-11 16:56:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T16:56:14Z.


What

#2072 taught the SRT evaluator (SrtEvaluator.cpp) to compute SLessThan32, but IsRuntimeUniformOp (SrtInstructionPredicates.cpp) still leaves it out. So the runtime validator (SrtRuntimeValidator.cpp) rejects any descriptor dword computed through a signed comparison before the evaluator ever sees it. SLessThan32 was the only op the evaluator handles that the validator neither lists nor handles itself. This adds it, the same way #2790 added SMin32.

Titles: EVO Player (PPSA99039), PS5VR (PPSA99177), Jelly5 (PPSA99505), Emby5 (PPSA99515) and Nuvio PS5 (PPSA99997) all stop here at their first draw, once #3496 gets them past sceAgcCreatePrimState (where they stop on main a11c8f7f):

  what():  ShaderRecompiler::Recompile: GetImageResource dword 3 is not a valid runtime value; chain: SelectU32(SLessThan32(ReadConst(GetSrtResource, Immediate), Immediate), ReadConst(GetSrtResource, Immediate), BitwiseAnd32(ReadConst(GetSrtResource, Immediate), Immediate))

With this change on top of #3496:

  • PS5VR runs the full 60 s without an error and compiles 150 shaders.
  • The other four move on to AGC graphics: guest 2D texture descriptor has a nonzero depth or base array. That's a linear T# with its pitch in DEPTH; I have a separate branch for it and will open it after this one.

Tested

Windows 11 (26200), RTX 4070, WinLibs GCC 15.2.0 r7, Release, on main a11c8f7f:

  • agc_shader_memory: verifySignedSrtComparison now also runs the validator on its three SelectU32(SLessThan32(...)) dwords. That check fails with the predicate change reverted (the runtime validator rejects a descriptor dword the evaluator computes) and passes with it.
  • ctest -E "^agc_|video_out": 450/453. The 3 failures also fail on main on Windows: windows_exceptions (#3411), guest_kernel_sys (#3510) and guest_filesystem (#3518).
  • GPU suite (VK_LOADER_DRIVERS_DISABLE=*dzn*, #3255): 383/384. The failure, agc_driver_emulated_color_compare, also fails on main with NVIDIA (#3526).
  • The five titles above, on main + #3496, with and without this change.
  • tools/check_conventions.py and tools/pr_overlap.py: clean.

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: #3496 (no code dependency; the titles reach this stop only after it)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4820730501 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3807). Originally posted by [reyani-dev](https://github.com/reyani-dev) on 2026-10-11T16:56:14Z. --- ### What #2072 taught the SRT evaluator (`SrtEvaluator.cpp`) to compute `SLessThan32`, but `IsRuntimeUniformOp` (`SrtInstructionPredicates.cpp`) still leaves it out. So the runtime validator (`SrtRuntimeValidator.cpp`) rejects any descriptor dword computed through a signed comparison before the evaluator ever sees it. `SLessThan32` was the only op the evaluator handles that the validator neither lists nor handles itself. This adds it, the same way #2790 added `SMin32`. **Titles:** EVO Player (PPSA99039), PS5VR (PPSA99177), Jelly5 (PPSA99505), Emby5 (PPSA99515) and Nuvio PS5 (PPSA99997) all stop here at their first draw, once #3496 gets them past `sceAgcCreatePrimState` (where they stop on `main` a11c8f7f): ``` what(): ShaderRecompiler::Recompile: GetImageResource dword 3 is not a valid runtime value; chain: SelectU32(SLessThan32(ReadConst(GetSrtResource, Immediate), Immediate), ReadConst(GetSrtResource, Immediate), BitwiseAnd32(ReadConst(GetSrtResource, Immediate), Immediate)) ``` With this change on top of #3496: - PS5VR runs the full 60 s without an error and compiles 150 shaders. - The other four move on to `AGC graphics: guest 2D texture descriptor has a nonzero depth or base array`. That's a linear T# with its pitch in DEPTH; I have a separate branch for it and will open it after this one. ### Tested Windows 11 (26200), RTX 4070, WinLibs GCC 15.2.0 r7, Release, on `main` a11c8f7f: - `agc_shader_memory`: `verifySignedSrtComparison` now also runs the validator on its three `SelectU32(SLessThan32(...))` dwords. That check fails with the predicate change reverted (`the runtime validator rejects a descriptor dword the evaluator computes`) and passes with it. - `ctest -E "^agc_|video_out"`: 450/453. The 3 failures also fail on `main` on Windows: `windows_exceptions` (#3411), `guest_kernel_sys` (#3510) and `guest_filesystem` (#3518). - GPU suite (`VK_LOADER_DRIVERS_DISABLE=*dzn*`, #3255): 383/384. The failure, `agc_driver_emulated_color_compare`, also fails on `main` with NVIDIA (#3526). - The five titles above, on `main` + #3496, with and without this change. - `tools/check_conventions.py` and `tools/pr_overlap.py`: clean. ### Checklist - [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: #3496 (no code dependency; the titles reach this stop only after it) - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
adriadam10 commented 2026-10-11 22:05:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T22:05:40Z.


Checked the build and agc_shader_memory on Linux with the PR merged onto main. The new validator check fails without the predicate change (SLessThan32 was the only op the evaluator computes that the validator neither lists nor handles), and passes with it; merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114354804 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3807#issuecomment-6114354804). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T22:05:40Z. --- Checked the build and `agc_shader_memory` on Linux with the PR merged onto main. The new validator check fails without the predicate change (`SLessThan32` was the only op the evaluator computes that the validator neither lists nor handles), and passes with it; merging.
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!3807
No description provided.