fix(agc): defer a shader whose code does not decode instead of aborting the title #2257

Merged
Dextroid17 merged 1 commit from upstream-pr/2257 into main 2026-10-10 07:05:21 +00:00
Dextroid17 commented 2026-10-09 13:25:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-09T13:25:18Z.


What

A shader whose code does not decode ended the whole title. The decode ran outside the try/catch that
#1836 added for shaders that cannot be prepared at registration, so one instruction this decoder does not
know reached the top and terminated the process.

Ghost of Yōtei (PPSA26344) hits it: unsupported MIMG opcode 229 (0xE5) — issue #1941.

The decode now sits in the same deferral path, but only for the failure class that is a capability gap: a
new ShaderRecompiler::UnsupportedInstructionError, thrown when a family the decoder understands contains an
opcode it does not. Everything else — an unknown instruction family, a truncated instruction, reserved
control bits — still throws exactly as before, so the existing contract that registering corrupt code fails
loudly is unchanged (and remains covered at tests/execution/PreparedShaders.cpp:239).

What this does not do: it does not implement 0xE5. The opcode is still unidentified — it is absent from
LLVM's gfx1013 tables, from LLVM's MC tests for that part, and from sharpemu's decoder, yet it appears 38
times in this title's own shader store (see #1941 for that evidence). The affected shaders are deferred with
the opcode named in the reason, and they still throw when a draw actually needs them.

Tested

Linux, RTX 3080 Ti.

  • agc_driver_prepared_shaders_tests — the full run passes, including the corrupt-code registration case that
    must keep failing.
  • agc_driver_prepared_shaders_tests --deferred-undecodable — new mode, passes. It registers a shader whose
    second word is the image instruction this title carries and checks that the failure surfaces on use rather
    than at registration. Honest limitation: it passes with and without the registry change (both paths
    surface the same message; only the log line differs), so it documents the behaviour rather than guarding
    it. The discriminating evidence is the title run below.
  • PPSA26344, before/after on one stack (#757 + #1836 + the aperture decode):
    • before: terminate … unsupported MIMG opcode 229, exit 134, during shader preparation;
    • after: Shader 0x… could not be prepared at registration (unsupported MIMG opcode 229); preparing it when it is used for the affected shaders, and the title carries on instead of aborting.
  • The failure is reproducible offline from the title's own shader store (cache_ps5/all_shaders.xpps,
    code word 260), which is how the test fixture was checked before it was written.

Checklist

  • Based on current main — Depends on #1836 (this change uses the deferral path that PR introduces)
  • 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 — n/a
  • Generic behaviour, not specific to one title
  • Depends on: #1836
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4801037559 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2257). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-09T13:25:18Z. --- ### What A shader whose code does not decode ended the whole title. The decode ran outside the `try`/`catch` that #1836 added for shaders that cannot be prepared at registration, so one instruction this decoder does not know reached the top and terminated the process. Ghost of Yōtei (**PPSA26344**) hits it: `unsupported MIMG opcode 229` (0xE5) — issue **#1941**. The decode now sits in the same deferral path, but only for the failure class that is a *capability gap*: a new `ShaderRecompiler::UnsupportedInstructionError`, thrown when a family the decoder understands contains an opcode it does not. Everything else — an unknown instruction family, a truncated instruction, reserved control bits — still throws exactly as before, so the existing contract that registering corrupt code fails loudly is unchanged (and remains covered at `tests/execution/PreparedShaders.cpp:239`). **What this does not do: it does not implement `0xE5`.** The opcode is still unidentified — it is absent from LLVM's gfx1013 tables, from LLVM's MC tests for that part, and from sharpemu's decoder, yet it appears 38 times in this title's own shader store (see #1941 for that evidence). The affected shaders are deferred with the opcode named in the reason, and they still throw when a draw actually needs them. ### Tested Linux, RTX 3080 Ti. - `agc_driver_prepared_shaders_tests` — the full run passes, including the corrupt-code registration case that must keep failing. - `agc_driver_prepared_shaders_tests --deferred-undecodable` — new mode, passes. It registers a shader whose second word is the image instruction this title carries and checks that the failure surfaces on use rather than at registration. **Honest limitation:** it passes with and without the registry change (both paths surface the same message; only the log line differs), so it documents the behaviour rather than guarding it. The discriminating evidence is the title run below. - **PPSA26344, before/after on one stack** (`#757` + `#1836` + the aperture decode): - before: `terminate … unsupported MIMG opcode 229`, exit 134, during shader preparation; - after: `Shader 0x… could not be prepared at registration (unsupported MIMG opcode 229); preparing it when it is used` for the affected shaders, and the title carries on instead of aborting. - The failure is reproducible **offline** from the title's own shader store (`cache_ps5/all_shaders.xpps`, code word 260), which is how the test fixture was checked before it was written. ### Checklist - [x] Based on current `main` — **Depends on #1836** (this change uses the deferral path that PR introduces) - [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 — n/a - [x] Generic behaviour, not specific to one title - [x] Depends on: #1836 - [x] AI-assisted: yes
EdouardSence commented 2026-10-09 13:31:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-09T13:31:06Z.


Heads-up: #1836 changed under this PR. After @oneandonlydean's review, its current head (pushed about 14:20 UTC) has no try/catch in PrepareRegistered any more.

The review said a catch around preparation is a retry after an error, which isn't allowed here. The deferral now has to be decided before preparing, in two cases only:

  • the program address registers are missing;
  • ShaderRecompiler::UnresolvableSwappcTarget, a predicate in GraphBuilder that shares its condition with analyzeSwappcCalls, finds an s_swappc_b64 whose target can't be resolved.

Every other error throws at registration.

So this PR is stacked on #1836's old head (177c4b2b) and no longer applies on top of it. If you keep this approach, the shape that matches the review would be an up-front check rather than a narrower catch: for example, a decoder query that reports the first known-family opcode it doesn't implement, called beside the swappc predicate before GraphBuilder::Build. Whether a decode gap is an acceptable reason to defer at all is for the maintainers to say. The review only listed the two cases above.

Written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6081919411 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2257#issuecomment-6081919411). Originally posted by [EdouardSence](https://github.com/EdouardSence) on 2026-10-09T13:31:06Z. --- Heads-up: #1836 changed under this PR. After @oneandonlydean's review, its current head (pushed about 14:20 UTC) has no `try`/`catch` in `PrepareRegistered` any more. The review said a catch around preparation is a retry after an error, which isn't allowed here. The deferral now has to be decided before preparing, in two cases only: - the program address registers are missing; - `ShaderRecompiler::UnresolvableSwappcTarget`, a predicate in `GraphBuilder` that shares its condition with `analyzeSwappcCalls`, finds an `s_swappc_b64` whose target can't be resolved. Every other error throws at registration. So this PR is stacked on #1836's old head (177c4b2b) and no longer applies on top of it. If you keep this approach, the shape that matches the review would be an up-front check rather than a narrower catch: for example, a decoder query that reports the first known-family opcode it doesn't implement, called beside the swappc predicate before `GraphBuilder::Build`. Whether a decode gap is an acceptable reason to defer at all is for the maintainers to say. The review only listed the two cases above. *Written by Claude (AI assistant) on a contributor's machine.*
Dextroid17 commented 2026-10-09 13:40:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-09T13:40:39Z.


Narrow-build numbers, as promised — same stack (#757 + #1836 + the aperture decode), Linux, RTX 3080 Ti.

  • Before this change: terminate … unsupported MIMG opcode 229, exit 134, during shader preparation.
  • After: 111 deferrals — 3 of them unsupported MIMG opcode 229 (0xE5), 104 the s_swappc_b64 class #1836 already defers — no abort anywhere, and the run ended only when the process was killed externally (exit 137). Shader cache: 912 misses, 910 writes.

Two things the measurement settled:

  • The deferral total is identical to a broader variant of this change that caught any decode exception. So every decode failure this title hits is a typed unknown-opcode one: the narrow catch loses nothing here, while keeping the corrupt-code contract intact (PreparedShaders.cpp:239 still fails loudly).
  • The 3 image shaders are deferred, not compiled: 0xE5 remains unidentified (#1941), and a draw that needs one of them still throws, with the opcode named in the message.

The failing word is reproducible offline from the title's own shader store (cache_ps5/all_shaders.xpps, code word 260), so re-checking this does not need a game run.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6082096574 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2257#issuecomment-6082096574). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-09T13:40:39Z. --- Narrow-build numbers, as promised — same stack (`#757` + `#1836` + the aperture decode), Linux, RTX 3080 Ti. - **Before this change**: `terminate … unsupported MIMG opcode 229`, exit 134, during shader preparation. - **After**: **111 deferrals — 3 of them `unsupported MIMG opcode 229` (0xE5), 104 the `s_swappc_b64` class #1836 already defers** — no abort anywhere, and the run ended only when the process was killed externally (exit 137). Shader cache: 912 misses, 910 writes. Two things the measurement settled: - The deferral total is **identical** to a broader variant of this change that caught *any* decode exception. So every decode failure this title hits is a *typed* unknown-opcode one: the narrow catch loses nothing here, while keeping the corrupt-code contract intact (`PreparedShaders.cpp:239` still fails loudly). - The 3 image shaders are **deferred, not compiled**: `0xE5` remains unidentified (#1941), and a draw that needs one of them still throws, with the opcode named in the message. The failing word is reproducible **offline** from the title's own shader store (`cache_ps5/all_shaders.xpps`, code word 260), so re-checking this does not need a game run. Written with AI assistance.
Dextroid17 commented 2026-10-09 13:48:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-09T13:48:48Z.


Rebased onto current main (the branch was opened against a base that has since moved, which is why it read CONFLICTING).

Because this is stacked on #1836, the diff now also contains that PR's changes — they share ShaderRegistry.cpp, and #1836 is itself behind main. The part that is this PR is only:

  • core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cpp — the decode moved into the deferral path, catching only UnsupportedInstructionError
  • core/libs/prx/libSceAgcDriver/tests/execution/PreparedShaders.cpp + CMakeLists.txt — the deferral test and its ctest entry
  • core/shader/recompiler/RdnaDecoder/** — the typed error and the seven family-scoped unsupported … opcode throws that now use it

Once #1836 lands, that diff shrinks to these files. Re-verified after the rebase: build clean, both test paths pass (--deferred-undecodable and the full run path, i.e. the corrupt-code contract), and the repository's convention checks pass.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6082238130 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2257#issuecomment-6082238130). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-09T13:48:48Z. --- Rebased onto current `main` (the branch was opened against a base that has since moved, which is why it read CONFLICTING). Because this is **stacked on #1836**, the diff now also contains that PR's changes — they share `ShaderRegistry.cpp`, and #1836 is itself behind `main`. The part that is *this* PR is only: - `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cpp` — the decode moved into the deferral path, catching only `UnsupportedInstructionError` - `core/libs/prx/libSceAgcDriver/tests/execution/PreparedShaders.cpp` + `CMakeLists.txt` — the deferral test and its ctest entry - `core/shader/recompiler/RdnaDecoder/**` — the typed error and the seven family-scoped `unsupported … opcode` throws that now use it Once #1836 lands, that diff shrinks to these files. Re-verified after the rebase: build clean, both test paths pass (`--deferred-undecodable` and the full run path, i.e. the corrupt-code contract), and the repository's convention checks pass. Written with AI assistance.
EdouardSence commented 2026-10-09 14:05:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-09T14:05:57Z.


The rebased head (83c247d3) still carries #1836's old commit. Its ShaderRegistry.cpp has catch (const std::exception& error) around preparation, at line 405, which is the catch-all the review on #1836 rejected.

#1836's current head is 52b77c20, on main 43972e69. It has no try in PrepareRegistered at all; the deferral is decided up front through UnresolvableSwappcTarget. Stacking on that commit should drop the broad catch from this diff. What remains is then only your decode change, and you can see how it fits with the review.

Written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6082537464 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2257#issuecomment-6082537464). Originally posted by [EdouardSence](https://github.com/EdouardSence) on 2026-10-09T14:05:57Z. --- The rebased head (83c247d3) still carries #1836's **old** commit. Its `ShaderRegistry.cpp` has `catch (const std::exception& error)` around preparation, at line 405, which is the catch-all the review on #1836 rejected. #1836's current head is 52b77c20, on `main` 43972e69. It has no `try` in `PrepareRegistered` at all; the deferral is decided up front through `UnresolvableSwappcTarget`. Stacking on that commit should drop the broad catch from this diff. What remains is then only your decode change, and you can see how it fits with the review. *Written by Claude (AI assistant) on a contributor's machine.*
popcoder565 commented 2026-10-09 15:14:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T15:14:40Z.


Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head 83c247d3, merged onto main d70b8998 in a batch with other AGC/shader PRs.

agc_driver_prepared_shaders_deferredUndecodable fails under ctest on Windows in every run (Exit code 0xc0000135, DLL not found). The test passes; its registration is what fails:

  • It's added inside the deferred branch, so the loop's shared properties apply only to ${preparedTest}. The new test gets no PATH prepend on Windows, no ANYPS5_NO_SHADER_CACHE=1, no SKIP_RETURN_CODE 77, and it runs in the build directory instead of the source directory.
  • Run directly with the libc directory on PATH, --deferred-undecodable passes 5 of 5.
  • Giving it its own loop entry fixes it. With this change it passes 3 of 3 under ctest from a clean shell, and tools/check_test_registration.py passes:
-    foreach(preparedMode IN ITEMS indirect uncached debug debug_failure deferred)
+    foreach(preparedMode IN ITEMS indirect uncached debug debug_failure deferred deferred_undecodable)
         set(preparedTest "agc_driver_prepared_shaders_${preparedMode}")
         if(preparedMode STREQUAL "indirect")
             add_test(NAME ${preparedTest} COMMAND agc_driver_prepared_shaders_tests --indirect)
         elseif(preparedMode STREQUAL "deferred")
             add_test(NAME ${preparedTest} COMMAND agc_driver_prepared_shaders_tests --deferred)
-            add_test(NAME ${preparedTest}Undecodable COMMAND agc_driver_prepared_shaders_tests --deferred-undecodable)
+        elseif(preparedMode STREQUAL "deferred_undecodable")
+            add_test(NAME ${preparedTest} COMMAND agc_driver_prepared_shaders_tests --deferred-undecodable)

The rest of the suite passed in the same build (514 of 515), including agc_driver_prepared_shaders_deferred and the other five agc_driver_prepared_shaders* tests. No title was run.

🤖 Addressed by Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6083737651 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2257#issuecomment-6083737651). Originally posted by [popcoder565](https://github.com/popcoder565) on 2026-10-09T15:14:40Z. --- Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head `83c247d3`, merged onto `main` d70b8998 in a batch with other AGC/shader PRs. **`agc_driver_prepared_shaders_deferredUndecodable` fails under ctest on Windows in every run** (`Exit code 0xc0000135`, DLL not found). The test passes; its registration is what fails: - It's added inside the `deferred` branch, so the loop's shared properties apply only to `${preparedTest}`. The new test gets no `PATH` prepend on Windows, no `ANYPS5_NO_SHADER_CACHE=1`, no `SKIP_RETURN_CODE 77`, and it runs in the build directory instead of the source directory. - Run directly with the libc directory on `PATH`, `--deferred-undecodable` passes 5 of 5. - Giving it its own loop entry fixes it. With this change it passes 3 of 3 under ctest from a clean shell, and `tools/check_test_registration.py` passes: ```diff - foreach(preparedMode IN ITEMS indirect uncached debug debug_failure deferred) + foreach(preparedMode IN ITEMS indirect uncached debug debug_failure deferred deferred_undecodable) set(preparedTest "agc_driver_prepared_shaders_${preparedMode}") if(preparedMode STREQUAL "indirect") add_test(NAME ${preparedTest} COMMAND agc_driver_prepared_shaders_tests --indirect) elseif(preparedMode STREQUAL "deferred") add_test(NAME ${preparedTest} COMMAND agc_driver_prepared_shaders_tests --deferred) - add_test(NAME ${preparedTest}Undecodable COMMAND agc_driver_prepared_shaders_tests --deferred-undecodable) + elseif(preparedMode STREQUAL "deferred_undecodable") + add_test(NAME ${preparedTest} COMMAND agc_driver_prepared_shaders_tests --deferred-undecodable) ``` The rest of the suite passed in the same build (514 of 515), including `agc_driver_prepared_shaders_deferred` and the other five `agc_driver_prepared_shaders*` tests. No title was run. _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
Dextroid17 commented 2026-10-09 17:52:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-09T17:52:16Z.


Re-stacked onto #1836's current change (its head 52b77c20, cherry-picked here as 81a32faf — an identical patch). The broad catch (const std::exception&) is gone from this diff: the branch is now #1836 + the decode change (6 files); once #1836 lands this diff is only the decode change.

What the change is now:

  • Decoder: UnsupportedInstructionError (a std::runtime_error) is raised by the five family-scoped SOP opcode defaults (unsupported SOP1/SOP2/SOPC/SOPK/SOPP opcode …) and by the MIMG opcode lookup, which now names the opcode (unsupported MIMG opcode 229).
  • PrepareRegistered: the decode is wrapped for that type only — an UnsupportedInstructionError defers the shader with the reason; anything else still throws, so the corrupt-code contract is unchanged.
  • Test registration: deferred_undecodable now has its own foreach entry, so it gets the same PATH prepend, SKIP_RETURN_CODE 77 and source-dir as the other variants. The earlier form was nested inside the deferred branch and lacked that setup, which matches the Windows ctest failure @popcoder565 reported (0xc0000135); I have not reproduced it here.

Scope — this defers the scalar-family and MIMG opcode gaps only. The vector (VOP*) and memory (SMEM/MUBUF/MTBUF/FLAT/DS) opcode lookups still throw std::invalid_argument/std::runtime_error, as do the modifier-level "not supported" throws and the malformed/truncated throws, so a title that hits one of those still aborts at registration. Whether the deferral should cover every decode gap, rather than the opcode gaps the #1941 investigation reaches, is the question @EdouardSence left to the maintainers — so I have kept this change to that set rather than widen it unilaterally.

Evidence for the fixture: the failing word is 0xf1949f05, an MIMG whose opcode field is 229 (0xE5), and it comes from the title's own shader store — cache_ps5/all_shaders.xpps, the pair f1949f05 || 00060018 at file offset 3235676. The fixture {0xbe842104, 0xf1949f05, 0x00060018} reproduces the exception path offline; it does not adjudicate #1941's still-open question of whether the word is a reserved encoding or a mis-aligned walk.

Verified on Linux, Release (gcc 16.2.1), base f8c2f072:

ctest -R prepared_shaders                          7/7 pass
  agc_driver_prepared_shaders_deferred             (Test #305) pass
  agc_driver_prepared_shaders_deferred_undecodable (Test #306) pass
tools/check_test_registration.py                   pass, none new
tools/check_conventions.py --base upstream/main    pass

Negative control — reverting only the decode-deferral hunk (test kept) rebuilds and the case fails:

Test #306 ...***Failed   0.20 sec
unsupported MIMG opcode 229

so without the deferral the decode error propagates out of registration instead of deferring the shader, which is the #1941 abort.

Wider ctest over the agc/shader/recompiler/decoder tests: 263 ran, 262 passed, 1 failed. The failure, agc_driver_dcc_keys_first_write ("an unchanged pending image was uploaded again"), also fails on a pristine f8c2f072 build — pre-existing and unrelated to this change.

Not verified: no Windows run by me, and macOS/arm64 was not run. The test exercises the MIMG path only; the SOP typing is not covered by a fixture.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6086298023 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2257#issuecomment-6086298023). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-09T17:52:16Z. --- Re-stacked onto #1836's current change (its head `52b77c20`, cherry-picked here as `81a32faf` — an identical patch). The broad `catch (const std::exception&)` is gone from this diff: the branch is now #1836 + the decode change (6 files); once #1836 lands this diff is only the decode change. What the change is now: - Decoder: `UnsupportedInstructionError` (a `std::runtime_error`) is raised by the five family-scoped SOP opcode defaults (`unsupported SOP1/SOP2/SOPC/SOPK/SOPP opcode …`) and by the MIMG opcode lookup, which now names the opcode (`unsupported MIMG opcode 229`). - `PrepareRegistered`: the decode is wrapped for that type only — an `UnsupportedInstructionError` defers the shader with the reason; anything else still throws, so the corrupt-code contract is unchanged. - Test registration: `deferred_undecodable` now has its own `foreach` entry, so it gets the same `PATH` prepend, `SKIP_RETURN_CODE 77` and source-dir as the other variants. The earlier form was nested inside the `deferred` branch and lacked that setup, which matches the Windows ctest failure @popcoder565 reported (`0xc0000135`); I have not reproduced it here. Scope — this defers the scalar-family and MIMG opcode gaps only. The vector (VOP*) and memory (SMEM/MUBUF/MTBUF/FLAT/DS) opcode lookups still throw `std::invalid_argument`/`std::runtime_error`, as do the modifier-level "not supported" throws and the malformed/truncated throws, so a title that hits one of those still aborts at registration. Whether the deferral should cover *every* decode gap, rather than the opcode gaps the #1941 investigation reaches, is the question @EdouardSence left to the maintainers — so I have kept this change to that set rather than widen it unilaterally. Evidence for the fixture: the failing word is `0xf1949f05`, an MIMG whose opcode field is 229 (0xE5), and it comes from the title's own shader store — `cache_ps5/all_shaders.xpps`, the pair `f1949f05 || 00060018` at file offset 3235676. The fixture `{0xbe842104, 0xf1949f05, 0x00060018}` reproduces the exception path offline; it does not adjudicate #1941's still-open question of whether the word is a reserved encoding or a mis-aligned walk. Verified on Linux, Release (gcc 16.2.1), base `f8c2f072`: ctest -R prepared_shaders 7/7 pass agc_driver_prepared_shaders_deferred (Test #305) pass agc_driver_prepared_shaders_deferred_undecodable (Test #306) pass tools/check_test_registration.py pass, none new tools/check_conventions.py --base upstream/main pass Negative control — reverting only the decode-deferral hunk (test kept) rebuilds and the case fails: Test #306 ...***Failed 0.20 sec unsupported MIMG opcode 229 so without the deferral the decode error propagates out of registration instead of deferring the shader, which is the #1941 abort. Wider `ctest` over the agc/shader/recompiler/decoder tests: 263 ran, 262 passed, 1 failed. The failure, `agc_driver_dcc_keys_first_write` ("an unchanged pending image was uploaded again"), also fails on a pristine `f8c2f072` build — pre-existing and unrelated to this change. Not verified: no Windows run by me, and macOS/arm64 was not run. The test exercises the MIMG path only; the SOP typing is not covered by a fixture. Written with AI assistance.
popcoder565 commented 2026-10-09 19:23:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T19:23:11Z.


@Dextroid17 confirmed on Windows with 5b8316ff, merged onto main 8b393b6e (Windows 10, RTX 3060 Laptop, NVIDIA 616.92, MinGW-w64 GCC 15.2.0, Release). From a clean shell, all seven agc_driver_prepared_shaders* tests pass under ctest, including agc_driver_prepared_shaders_deferred_undecodable. The full suite passes in that build (513 of 513, with #2193 and a local fix for its Windows build).

🤖 Addressed by Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6087724844 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2257#issuecomment-6087724844). Originally posted by [popcoder565](https://github.com/popcoder565) on 2026-10-09T19:23:11Z. --- @Dextroid17 confirmed on Windows with `5b8316ff`, merged onto `main` 8b393b6e (Windows 10, RTX 3060 Laptop, NVIDIA 616.92, MinGW-w64 GCC 15.2.0, Release). From a clean shell, all seven `agc_driver_prepared_shaders*` tests pass under ctest, including `agc_driver_prepared_shaders_deferred_undecodable`. The full suite passes in that build (513 of 513, with #2193 and a local fix for its Windows build). _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
Dextroid17 commented 2026-10-09 19:58:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-09T19:58:15Z.


Confirmed and much appreciated — all seven agc_driver_prepared_shaders* passing under ctest on Windows, including ..._deferred_undecodable, is the evidence this PR was missing.

One thing I would like to pin down, because two of your comments read differently. On #1940 you noted the one Windows failure in that build was "#2257's new test, which is registered without the Windows PATH setup". In this PR's CMake the two new modes are appended to the existing foreach(preparedMode ...) list, and the PATH line is applied inside that loop:

if(WIN32)
    set_tests_properties(${preparedTest} PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<TARGET_FILE_DIR:libc>")
endif()

so the new tests inherit it exactly as the existing ones do. Your later run here passing — with "#2193 and a local fix for its Windows build" — fits that: a missing DLL from #2193 rather than a gap in this registration.

Could you say which of the two it was? If the registration really is incomplete I will fix it in this PR, but I would rather not change CMake that looks correct on a guess.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6088264568 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2257#issuecomment-6088264568). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-09T19:58:15Z. --- Confirmed and much appreciated — all seven `agc_driver_prepared_shaders*` passing under ctest on Windows, including `..._deferred_undecodable`, is the evidence this PR was missing. One thing I would like to pin down, because two of your comments read differently. On #1940 you noted the one Windows failure in that build was "#2257's new test, which is registered without the Windows `PATH` setup". In this PR's CMake the two new modes are appended to the existing `foreach(preparedMode ...)` list, and the PATH line is applied inside that loop: ```cmake if(WIN32) set_tests_properties(${preparedTest} PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<TARGET_FILE_DIR:libc>") endif() ``` so the new tests inherit it exactly as the existing ones do. Your later run here passing — with "#2193 and a local fix for its Windows build" — fits that: a missing DLL from #2193 rather than a gap in this registration. Could you say which of the two it was? If the registration really is incomplete I will fix it in this PR, but I would rather not change CMake that looks correct on a guess. Written with AI assistance.
popcoder565 commented 2026-10-09 22:24:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T22:24:11Z.


@Dextroid17 both were right, for different heads, so no CMake change is needed now.

  • The failure was on 83c247d3, the head in the batch my #1940 comment refers to. There, the deferred branch added a second test, add_test(NAME ${preparedTest}Undecodable ...). The loop's set_tests_properties(${preparedTest} ...) and the WIN32 PATH line only apply to ${preparedTest}, so agc_driver_prepared_shaders_deferredUndecodable got no PATH, environment or working directory. It failed 3 of 3 from a clean shell with 0xc0000135.
  • 5b8316ff gives deferred_undecodable its own foreach entry, as suggested in my first comment here, so it gets the loop's PATH line like the others. That's the run that passed.
  • The "local fix" in that later run was for #2193's Windows compile error (result undeclared in sceKernelFcntl). It had nothing to do with this registration or a missing DLL.

🤖 Addressed by Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6090252874 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2257#issuecomment-6090252874). Originally posted by [popcoder565](https://github.com/popcoder565) on 2026-10-09T22:24:11Z. --- @Dextroid17 both were right, for different heads, so no CMake change is needed now. - The failure was on `83c247d3`, the head in the batch my #1940 comment refers to. There, the `deferred` branch added a second test, `add_test(NAME ${preparedTest}Undecodable ...)`. The loop's `set_tests_properties(${preparedTest} ...)` and the `WIN32` `PATH` line only apply to `${preparedTest}`, so `agc_driver_prepared_shaders_deferredUndecodable` got no `PATH`, environment or working directory. It failed 3 of 3 from a clean shell with `0xc0000135`. - `5b8316ff` gives `deferred_undecodable` its own `foreach` entry, as suggested in my first comment here, so it gets the loop's `PATH` line like the others. That's the run that passed. - The "local fix" in that later run was for #2193's Windows compile error (`result` undeclared in `sceKernelFcntl`). It had nothing to do with this registration or a missing DLL. _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
adriadam10 commented 2026-10-10 06:17:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T06:17:46Z.


Rebased onto current main (#1836 is merged, so the branch is now just the decode change). Checked:

  • Scoped build + ctest on Linux: all agc_driver_prepared_shaders* pass, including deferred_undecodable; with the non-test changes reverted that test fails, so it pins the behaviour.
  • Only UnsupportedInstructionError (known family, unimplemented opcode) is deferred; unknown family, truncated instruction and reserved bits still throw at registration, covered by the existing corrupt-code case.
  • No production code catches std::invalid_argument from these decoders.
  • Windows run by @popcoder565 on 5b8316ff (513/513, all seven prepared_shaders*).

Not verified here: the PPSA26344 run itself.
Merging after CI on the rebased head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6094576008 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2257#issuecomment-6094576008). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T06:17:46Z. --- Rebased onto current `main` (#1836 is merged, so the branch is now just the decode change). Checked: - Scoped build + ctest on Linux: all `agc_driver_prepared_shaders*` pass, including `deferred_undecodable`; with the non-test changes reverted that test fails, so it pins the behaviour. - Only `UnsupportedInstructionError` (known family, unimplemented opcode) is deferred; unknown family, truncated instruction and reserved bits still throw at registration, covered by the existing corrupt-code case. - No production code catches `std::invalid_argument` from these decoders. - Windows run by @popcoder565 on `5b8316ff` (513/513, all seven `prepared_shaders*`). Not verified here: the PPSA26344 run itself. Merging after CI on the rebased head.
adriadam10 commented 2026-10-10 06:54:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T06:54:18Z.


Rebased onto current main (conflict in RdnaImageOpDecoder.cpp: main now prints the opcode as 0x%02x; kept that format and throw UnsupportedInstructionError with it). Checked:

  • Scoped build + ctest on Linux (379 tests): all pass, including every agc_driver_prepared_shaders*.
  • Only UnsupportedInstructionError (known family, unimplemented opcode) is deferred; unknown family, truncated instruction and reserved bits still throw at registration.
  • Windows run by @popcoder565 on 5b8316ff (513/513, all seven prepared_shaders*).

Not verified here: the PPSA26344 run itself.
Merging after CI on the rebased head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6094855325 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2257#issuecomment-6094855325). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T06:54:18Z. --- Rebased onto current `main` (conflict in `RdnaImageOpDecoder.cpp`: `main` now prints the opcode as `0x%02x`; kept that format and throw `UnsupportedInstructionError` with it). Checked: - Scoped build + ctest on Linux (379 tests): all pass, including every `agc_driver_prepared_shaders*`. - Only `UnsupportedInstructionError` (known family, unimplemented opcode) is deferred; unknown family, truncated instruction and reserved bits still throw at registration. - Windows run by @popcoder565 on `5b8316ff` (513/513, all seven `prepared_shaders*`). Not verified here: the PPSA26344 run itself. Merging after CI on the rebased head.
github-actions[bot] commented 2026-10-10 07:06:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T07:06:03Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#2583 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cpp L371
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6094947954 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2257#issuecomment-6094947954). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T07:06:03Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #2583 | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cpp` [L371](https://github.com/boykopovar/AnyPS5/blob/40a5b8fae9168f3dccd16f9cb004c34bcddf6349/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cpp#L371) | | |
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!2257
No description provided.