fix(agc): link agc_driver_pm4_tests against the shader recompiler #6333

Merged
milescoviello merged 1 commit from upstream-pr/6333 into main 2026-10-15 12:16:40 +00:00
milescoviello commented 2026-10-15 12:06:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-15T12:06:56Z.


What

agc_driver_pm4_tests no longer compiles on main b3f9f89e6:

core/libs/prx/libSceAgcDriver/Execution/include/ShaderMemory.hpp:4:10: fatal error: Recompiler.hpp: No such file or directory
FAILED: core/libs/prx/libSceAgcDriver/CMakeFiles/agc_driver_pm4_tests.dir/tests/Pm4.cpp.o

Since #5364 (merge 6ea62f9b4), Driver/Draw/DrawRegisterKey.hpp includes Driver/Shaders/ShaderRegistry.hpp, which reaches ShaderMemory.hpp and its "Recompiler.hpp". tests/Pm4.cpp already included DrawRegisterKey.hpp, but the target links only libSceAgcDriver, libc and libkernel, so the recompiler's include directories are not on its path. The test targets that already reach ShaderMemory.hpp (agc_shader_memory_tests, agc_write_tracking_tests and others) link shader_recompiler_agc_driver; this target now does too.

The target is declared EXCLUDE_FROM_ALL, but with BUILD_TESTING on the loop at CMakeLists.txt line 1503 turns that off for it, so a default build stops here too (corrected after merge; the first version of this description said a default build did not hit it). Its four tests are agc_driver_pm4, agc_driver_pm4_failure, agc_driver_pm4_failure_inline and agc_driver_pm4_priority_refused.

Tested

Ubuntu 24.04, GCC 13.3, Release (SPIRV-Tools on):

  • Pm4.cpp compiles at 6ea62f9b4's first parent f50d4335a, fails with the error above at 6ea62f9b4 and at main b3f9f89e6, and compiles with this change.
  • With it, the four tests pass 3 of 3 runs. 596 of the 597 agc_* tests pass with every test target built. The one failure, agc_pending_key_stores, fails the same way on main (reported on #6247).
  • @Amoenus checked it on Windows: Windows 11, WinLibs MinGW-w64 GCC 15.2.0, Release, SPIRV-Tools on. Without the patch the full build stops at Pm4.cpp with the same error; with it the target compiles and links, and agc_driver_pm4, agc_driver_pm4_failure and agc_driver_pm4_failure_inline pass 5 of 5 runs under each GPU selector.
  • tools/check_conventions.py --base upstream/main passes, and tools/pr_overlap.py --branch fix/pm4-tests-recompiler-includes finds no overlap.

Windows: see Amoenus's run above.

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 under Silent stubs in their library's technical debt file
  • 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
  • Unblocks: none
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4872973075 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6333). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-15T12:06:56Z. --- ### What `agc_driver_pm4_tests` no longer compiles on `main` b3f9f89e6: ``` core/libs/prx/libSceAgcDriver/Execution/include/ShaderMemory.hpp:4:10: fatal error: Recompiler.hpp: No such file or directory FAILED: core/libs/prx/libSceAgcDriver/CMakeFiles/agc_driver_pm4_tests.dir/tests/Pm4.cpp.o ``` Since #5364 (merge 6ea62f9b4), `Driver/Draw/DrawRegisterKey.hpp` includes `Driver/Shaders/ShaderRegistry.hpp`, which reaches `ShaderMemory.hpp` and its `"Recompiler.hpp"`. `tests/Pm4.cpp` already included `DrawRegisterKey.hpp`, but the target links only `libSceAgcDriver`, `libc` and `libkernel`, so the recompiler's include directories are not on its path. The test targets that already reach `ShaderMemory.hpp` (`agc_shader_memory_tests`, `agc_write_tracking_tests` and others) link `shader_recompiler_agc_driver`; this target now does too. The target is declared `EXCLUDE_FROM_ALL`, but with `BUILD_TESTING` on the loop at `CMakeLists.txt` line 1503 turns that off for it, so a default build stops here too (corrected after merge; the first version of this description said a default build did not hit it). Its four tests are `agc_driver_pm4`, `agc_driver_pm4_failure`, `agc_driver_pm4_failure_inline` and `agc_driver_pm4_priority_refused`. ### Tested Ubuntu 24.04, GCC 13.3, Release (SPIRV-Tools on): - `Pm4.cpp` compiles at 6ea62f9b4's first parent f50d4335a, fails with the error above at 6ea62f9b4 and at `main` b3f9f89e6, and compiles with this change. - With it, the four tests pass 3 of 3 runs. 596 of the 597 `agc_*` tests pass with every test target built. The one failure, `agc_pending_key_stores`, fails the same way on `main` (reported on #6247). - @Amoenus [checked it on Windows](https://github.com/boykopovar/AnyPS5/pull/6333#issuecomment-6191862396): Windows 11, WinLibs MinGW-w64 GCC 15.2.0, Release, SPIRV-Tools on. Without the patch the full build stops at `Pm4.cpp` with the same error; with it the target compiles and links, and `agc_driver_pm4`, `agc_driver_pm4_failure` and `agc_driver_pm4_failure_inline` pass 5 of 5 runs under each GPU selector. - `tools/check_conventions.py --base upstream/main` passes, and `tools/pr_overlap.py --branch fix/pm4-tests-recompiler-includes` finds no overlap. Windows: see Amoenus's run above. ### 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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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] Unblocks: none - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
adriadam10 commented 2026-10-15 12:16:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T12:16:43Z.


Merged without waiting for the full Build: main has been failing to compile agc_driver_pm4_tests on both Linux and Windows since #5364, and that holds up every other merge. Built and ran agc_driver_pm4_tests and agc_driver_register_key_tests locally on this head (rc=0). The next main push build is the check. Thanks!

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191832913 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6333#issuecomment-6191832913). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-15T12:16:43Z. --- Merged without waiting for the full Build: main has been failing to compile `agc_driver_pm4_tests` on both Linux and Windows since #5364, and that holds up every other merge. Built and ran `agc_driver_pm4_tests` and `agc_driver_register_key_tests` locally on this head (rc=0). The next main push build is the check. Thanks!
Amoenus commented 2026-10-15 12:18:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-15T12:18:19Z.


Windows validation of the exact one-line patch at 2c9ab96a0, composed on maintainer-refreshed #5554 c9a96a548 (main b3f9f89e6): fork213cd7dc6. Original authorship retained; #5554's published branch is untouched.

  • Before this patch, our configured full build stops at tests/Pm4.cpp → ShaderMemory.hpp:4:10: fatal error: Recompiler.hpp: No such file or directory. Its compile command has only the library include directory.
  • With this patch, the named agc_driver_pm4_tests target compiles and links.
  • The three Windows groups (agc_driver_pm4, agc_driver_pm4_failure, agc_driver_pm4_failure_inline) pass5/5 under each NVIDIA/AMD selector:30 successful iterations, no CTest skips/timeouts, maximum0.27s. They emit no physical-device identity, so this is Windows test coverage, not evidence of execution on two GPU vendors. Linux's fourth priority-refusal group is not registered here.

Windows11 Enterprise26200, WinLibs MinGW-w64 GCC15.2.0r7, Ninja, Release, BUILD_TESTING ON, SPIRV-Tools ON, shader caches disabled, serial tests. The full Windows app/libs composition build has now completed successfully. The broader27-group regression also passes once plus five repeats per selector (324 executions; no skips/timeouts; maximum5.73s). This remains composition213cd7dc6 evidence, not an unchanged-PR-head full build or a full-suite result. AI-assisted: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191862396 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6333#issuecomment-6191862396). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-15T12:18:19Z. --- <!-- codex-windows-pm4-dependency-v1 --> Windows validation of the exact one-line patch at `2c9ab96a0`, composed on maintainer-refreshed #5554 `c9a96a548` (main `b3f9f89e6`): [fork213cd7dc6](https://github.com/Amoenus/AnyPS5/commit/213cd7dc6884d9c26dedcbf19203f1b13ca51926). Original authorship retained; #5554's published branch is untouched. - Before this patch, our configured full build stops at `tests/Pm4.cpp` → `ShaderMemory.hpp:4:10: fatal error: Recompiler.hpp: No such file or directory`. Its compile command has only the library include directory. - With this patch, the named `agc_driver_pm4_tests` target compiles and links. - The three Windows groups (`agc_driver_pm4`, `agc_driver_pm4_failure`, `agc_driver_pm4_failure_inline`) pass5/5 under each NVIDIA/AMD selector:30 successful iterations, no CTest skips/timeouts, maximum0.27s. They emit no physical-device identity, so this is Windows test coverage, not evidence of execution on two GPU vendors. Linux's fourth priority-refusal group is not registered here. Windows11 Enterprise26200, WinLibs MinGW-w64 GCC15.2.0r7, Ninja, Release, BUILD_TESTING ON, SPIRV-Tools ON, shader caches disabled, serial tests. The full Windows app/libs composition build has now completed successfully. The broader27-group regression also passes once plus five repeats per selector (324 executions; no skips/timeouts; maximum5.73s). This remains composition213cd7dc6 evidence, not an unchanged-PR-head full build or a full-suite result. AI-assisted: Codex. <!-- /codex-windows-pm4-dependency-v1 -->
milescoviello commented 2026-10-15 12:19:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-15T12:19:17Z.


Thanks for the Windows run. I added it to the description.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191879887 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6333#issuecomment-6191879887). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-15T12:19:17Z. --- Thanks for the Windows run. I added it to the description. AI-assisted: yes
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!6333
No description provided.