feat(razor): implement the libSceRazorCpu CPU profiler stubs #564

Merged
Phi1ow merged 1 commit from upstream-pr/564 into main 2026-10-04 22:46:11 +00:00
Phi1ow commented 2026-10-04 21:12:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Phi1ow on 2026-10-04T21:12:55Z.


What

libSceRazorCpu is the CPU-side instrumentation for the Razor capture tool. AnyPS5 does not host
that tool, so the four exports do nothing and succeed, which is also what shadPS4 does:

  • sceRazorCpuIsCapturing -> 0 (no capture is in progress, so titles skip their profiling paths).
  • sceRazorCpuJobManagerDispatch / sceRazorCpuJobManagerJob / sceRazorCpuJobManagerSequence -> 0.

These exports only feed the profiler; they do not affect execution. Adds a CMakeLists.txt so the
library can carry its guest test.

Tested

New test core/libs/tests/GuestRazorCpu.cpp (registered as guest_razor_cpu) checks the four
return values.

Built with MinGW-w64 GCC 15.2.0 (the CI toolchain) on Windows 11; ctest -R guest_razor_cpu
passes. On main the four functions throw not implemented, so the test aborts without the change.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4737663077 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/564). Originally posted by [Phi1ow](https://github.com/Phi1ow) on 2026-10-04T21:12:55Z. --- ### What `libSceRazorCpu` is the CPU-side instrumentation for the Razor capture tool. AnyPS5 does not host that tool, so the four exports do nothing and succeed, which is also what shadPS4 does: - `sceRazorCpuIsCapturing` -> `0` (no capture is in progress, so titles skip their profiling paths). - `sceRazorCpuJobManagerDispatch` / `sceRazorCpuJobManagerJob` / `sceRazorCpuJobManagerSequence` -> `0`. These exports only feed the profiler; they do not affect execution. Adds a `CMakeLists.txt` so the library can carry its guest test. ### Tested New test `core/libs/tests/GuestRazorCpu.cpp` (registered as `guest_razor_cpu`) checks the four return values. Built with MinGW-w64 GCC 15.2.0 (the CI toolchain) on Windows 11; `ctest -R guest_razor_cpu` passes. On `main` the four functions throw `not implemented`, so the test aborts without the change. ### 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: none - [x] AI-assisted: yes
oneandonlydean commented 2026-10-04 22:38:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T22:38:18Z.


Thanks. The four NIDs recompute to the names in the PR (EboejOQvLL4 sceRazorCpuIsCapturing, dnEdyY4+klQ sceRazorCpuJobManagerDispatch, KP+TBWGHlgs sceRazorCpuJobManagerJob, 9FowWFMEIM8 sceRazorCpuJobManagerSequence). With no Razor capture tool attached, "not capturing" is the exact answer for sceRazorCpuIsCapturing, and the three job manager calls only feed a capture, so returning 0 has nothing for the title to observe. The new CMakeLists.txt follows the libSceRtc pattern, so the parent loop still links libkernel and libc.

guest_razor_cpu passes here on current main (main has no such functions, so it can't link there).

Ready to merge from my side once CI has run.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5985221365 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/564#issuecomment-5985221365). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T22:38:18Z. --- Thanks. The four NIDs recompute to the names in the PR (EboejOQvLL4 sceRazorCpuIsCapturing, dnEdyY4+klQ sceRazorCpuJobManagerDispatch, KP+TBWGHlgs sceRazorCpuJobManagerJob, 9FowWFMEIM8 sceRazorCpuJobManagerSequence). With no Razor capture tool attached, "not capturing" is the exact answer for `sceRazorCpuIsCapturing`, and the three job manager calls only feed a capture, so returning 0 has nothing for the title to observe. The new `CMakeLists.txt` follows the libSceRtc pattern, so the parent loop still links libkernel and libc. `guest_razor_cpu` passes here on current main (main has no such functions, so it can't link there). Ready to merge from my side once CI has run.
github-actions[bot] commented 2026-10-04 22:39:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-04T22:39:16Z.


Progress report (76c3427 → ce6b26f)

📈 System libraries: 77.52% (+0.13%, +4 implemented functions)

✅ 4 implemented
Library Name
libSceRazorCpu sceRazorCpuIsCapturing
libSceRazorCpu sceRazorCpuJobManagerDispatch
libSceRazorCpu sceRazorCpuJobManagerJob
libSceRazorCpu sceRazorCpuJobManagerSequence
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5985228560 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/564#issuecomment-5985228560). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-04T22:39:16Z. --- <!-- progress-report --> ### Progress report (76c3427 → ce6b26f) 📈 **System libraries**: 77.52% (+0.13%, +4 implemented functions) <details> <summary>✅ 4 implemented</summary> | Library | Name | | - | - | | libSceRazorCpu | `sceRazorCpuIsCapturing` | | libSceRazorCpu | `sceRazorCpuJobManagerDispatch` | | libSceRazorCpu | `sceRazorCpuJobManagerJob` | | libSceRazorCpu | `sceRazorCpuJobManagerSequence` | </details>
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!564
No description provided.