feat(libSceNpTus): check the arguments of 82 TUS and TSS requests and fail them signed out #9009

Merged
YossiYad merged 6 commits from upstream-pr/9009 into main 2026-10-22 05:53:42 +00:00
YossiYad commented 2026-10-21 09:39:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-21T09:39:27Z.


What

libSceNpTus already models TUS offline: an asynchronous call checks its arguments, then StartOffline marks the request started and it finishes with SCE_NP_ERROR_SIGNED_OUT; the synchronous form waits for it through Complete. 82 more calls of the library threw. They now do the same:

  • Variables (36): add-and-get, try-and-set, multi-user variable and friends variable calls, in their NpId, account (A), virtual-user (VUser) and cross-save forms.
  • Data (18): set, get and multi-slot delete data.
  • Data statuses (26): multi-slot, multi-user and friends data status.
  • TSS (2): sceNpTssGetSmallStorageAsync and sceNpTssGetSmallStorage.

Each asynchronous call runs the argument checks of shadPS4 in shadPS4's order, from its signature up to the point where shadPS4 resolves the request: null and missing arguments are INSUFFICIENT_ARGUMENT, a non-null option, a negative slot and an empty virtual user are INVALID_ARGUMENT, more than 64 slots is TOO_MANY_SLOTID, more than 101 users or 100 friends is TOO_MANY_NPID, an operation type outside 1-6 is INVALID_TYPE, and a TSS size above 64 KiB is INVALID_ARGUMENT. shadPS4's differences between forms are kept, and the debt entry names them: its NpId try-and-set calls return INVALID_ARGUMENT for a bad operation type, and its NpId and virtual-user multi-slot data status calls return TOO_MANY_NPID for too many slots. As for the multi-slot variable calls already here, output and structure sizes are not checked and no output is written, since their layouts are not verified.

Left out: the A and cross-save friends calls and sceNpTssGetDataAsync, whose shadPS4 checks read fields of an option structure whose layout is not known here, with their synchronous forms; the five calls shadPS4 does not implement; and the calls shadPS4 only stubs. None of the new results is measured on a PS5; the debt entry says so, and the 82 "unknown signature" lines are removed.

Tested

Linux (Fedora 44, GCC, Ninja, -DBUILD_TESTING=ON), based on main 27c88a8d75:

  • New guest_np_tus_offline (core/libs/tests/GuestNpTusOffline.cpp): every one of the 43 asynchronous calls starts with valid arguments and its request finishes with 0x80550006, refuses an unknown request with INVALID_ID and a non-null option with INVALID_ARGUMENT; every one of the 39 synchronous calls returns 0x80550006. Targeted cases cover an empty virtual user (alone and inside an array), operation types 0 and 7 (INVALID_TYPE, and INVALID_ARGUMENT for the NpId form), a negative slot, 65 slots, 102 users, 101 friends, sort type 5 and a TSS size of 64 KiB + 1. It aborts on main's Export.cpp, and fails when one call drops its option check or one synchronous call returns 0.
  • The existing guest_np_tus passes on every commit.
  • Full ctest: 1780 of 1788 pass. The 8 failures fail the same way on main on this machine and do not link libSceNpTus: application_heap_scripting, application_heap_lazy, agc_driver_guest_memory_lifetime, agc_driver_image_array_window_past_layer_limit, agc_driver_tessellation and the three net_dontwait_blocking_* cases.
  • tools/progress.py --compare: libraries +0.93%, 82 functions implemented, none lost.
  • tools/check_conventions.py --base upstream/main passes on every commit. tools/pr_overlap.py finds no overlap; it could not compare Export.cpp with #6977, which conflicts with main, and #6977's NpTus additions are other functions.

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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4949520048 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9009). Originally posted by [YossiYad](https://github.com/YossiYad) on 2026-10-21T09:39:27Z. --- ### What libSceNpTus already models TUS offline: an asynchronous call checks its arguments, then `StartOffline` marks the request started and it finishes with `SCE_NP_ERROR_SIGNED_OUT`; the synchronous form waits for it through `Complete`. 82 more calls of the library threw. They now do the same: - **Variables (36):** add-and-get, try-and-set, multi-user variable and friends variable calls, in their NpId, account (`A`), virtual-user (`VUser`) and cross-save forms. - **Data (18):** set, get and multi-slot delete data. - **Data statuses (26):** multi-slot, multi-user and friends data status. - **TSS (2):** `sceNpTssGetSmallStorageAsync` and `sceNpTssGetSmallStorage`. Each asynchronous call runs the argument checks of [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/a808e76/src/core/libraries/np/np_tus/np_tus.cpp) in shadPS4's order, from its signature up to the point where shadPS4 resolves the request: null and missing arguments are `INSUFFICIENT_ARGUMENT`, a non-null option, a negative slot and an empty virtual user are `INVALID_ARGUMENT`, more than 64 slots is `TOO_MANY_SLOTID`, more than 101 users or 100 friends is `TOO_MANY_NPID`, an operation type outside 1-6 is `INVALID_TYPE`, and a TSS size above 64 KiB is `INVALID_ARGUMENT`. shadPS4's differences between forms are kept, and the debt entry names them: its NpId try-and-set calls return `INVALID_ARGUMENT` for a bad operation type, and its NpId and virtual-user multi-slot data status calls return `TOO_MANY_NPID` for too many slots. As for the multi-slot variable calls already here, output and structure sizes are not checked and no output is written, since their layouts are not verified. Left out: the `A` and cross-save friends calls and `sceNpTssGetDataAsync`, whose shadPS4 checks read fields of an option structure whose layout is not known here, with their synchronous forms; the five calls shadPS4 does not implement; and the calls shadPS4 only stubs. None of the new results is measured on a PS5; the debt entry says so, and the 82 "unknown signature" lines are removed. ### Tested Linux (Fedora 44, GCC, Ninja, `-DBUILD_TESTING=ON`), based on `main` `27c88a8d75`: - New `guest_np_tus_offline` (`core/libs/tests/GuestNpTusOffline.cpp`): every one of the 43 asynchronous calls starts with valid arguments and its request finishes with `0x80550006`, refuses an unknown request with `INVALID_ID` and a non-null option with `INVALID_ARGUMENT`; every one of the 39 synchronous calls returns `0x80550006`. Targeted cases cover an empty virtual user (alone and inside an array), operation types 0 and 7 (`INVALID_TYPE`, and `INVALID_ARGUMENT` for the NpId form), a negative slot, 65 slots, 102 users, 101 friends, sort type 5 and a TSS size of 64 KiB + 1. It aborts on `main`'s `Export.cpp`, and fails when one call drops its option check or one synchronous call returns 0. - The existing `guest_np_tus` passes on every commit. - Full `ctest`: 1780 of 1788 pass. The 8 failures fail the same way on `main` on this machine and do not link libSceNpTus: `application_heap_scripting`, `application_heap_lazy`, `agc_driver_guest_memory_lifetime`, `agc_driver_image_array_window_past_layer_limit`, `agc_driver_tessellation` and the three `net_dontwait_blocking_*` cases. - `tools/progress.py --compare`: libraries +0.93%, 82 functions implemented, none lost. - `tools/check_conventions.py --base upstream/main` passes on every commit. `tools/pr_overlap.py` finds no overlap; it could not compare `Export.cpp` with #6977, which conflicts with `main`, and #6977's NpTus additions are other functions. ### 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] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-21 09:40:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T09:40:18Z.


Progress report (b5d7637 → 1f407e5)

📈 System libraries: 51.9% (+0.93%, +82 implemented functions)

✅ 82 implemented
Library Name
libSceNpTus sceNpTssGetSmallStorage
libSceNpTus sceNpTssGetSmallStorageAsync
libSceNpTus sceNpTusAddAndGetVariable
libSceNpTus sceNpTusAddAndGetVariableA
libSceNpTus sceNpTusAddAndGetVariableAVUser
libSceNpTus sceNpTusAddAndGetVariableAVUserAsync
libSceNpTus sceNpTusAddAndGetVariableAsync
libSceNpTus sceNpTusAddAndGetVariableForCrossSave
libSceNpTus sceNpTusAddAndGetVariableForCrossSaveAsync
libSceNpTus sceNpTusAddAndGetVariableForCrossSaveVUser
libSceNpTus sceNpTusAddAndGetVariableForCrossSaveVUserAsync
libSceNpTus sceNpTusAddAndGetVariableVUser
libSceNpTus sceNpTusAddAndGetVariableVUserAsync
libSceNpTus sceNpTusDeleteMultiSlotData
libSceNpTus sceNpTusDeleteMultiSlotDataA
libSceNpTus sceNpTusDeleteMultiSlotDataAAsync
libSceNpTus sceNpTusDeleteMultiSlotDataAsync
libSceNpTus sceNpTusGetDataA
libSceNpTus sceNpTusGetDataAAsync
libSceNpTus sceNpTusGetDataAVUser
libSceNpTus sceNpTusGetDataAVUserAsync
libSceNpTus sceNpTusGetDataAsync
libSceNpTus sceNpTusGetDataForCrossSave
libSceNpTus sceNpTusGetDataForCrossSaveAsync
libSceNpTus sceNpTusGetDataVUserAsync
libSceNpTus sceNpTusGetFriendsDataStatus
libSceNpTus sceNpTusGetFriendsDataStatusAsync
libSceNpTus sceNpTusGetFriendsVariable
libSceNpTus sceNpTusGetFriendsVariableAsync
libSceNpTus sceNpTusGetMultiSlotDataStatus
libSceNpTus sceNpTusGetMultiSlotDataStatusA
libSceNpTus sceNpTusGetMultiSlotDataStatusAAsync
libSceNpTus sceNpTusGetMultiSlotDataStatusAVUser
libSceNpTus sceNpTusGetMultiSlotDataStatusAVUserAsync
libSceNpTus sceNpTusGetMultiSlotDataStatusAsync
libSceNpTus sceNpTusGetMultiSlotDataStatusForCrossSave
libSceNpTus sceNpTusGetMultiSlotDataStatusForCrossSaveAsync
libSceNpTus sceNpTusGetMultiSlotDataStatusForCrossSaveVUser
libSceNpTus sceNpTusGetMultiSlotDataStatusForCrossSaveVUserAsync
libSceNpTus sceNpTusGetMultiSlotDataStatusVUser
libSceNpTus sceNpTusGetMultiSlotDataStatusVUserAsync
libSceNpTus sceNpTusGetMultiUserDataStatus
libSceNpTus sceNpTusGetMultiUserDataStatusA
libSceNpTus sceNpTusGetMultiUserDataStatusAAsync
libSceNpTus sceNpTusGetMultiUserDataStatusAVUser
libSceNpTus sceNpTusGetMultiUserDataStatusAVUserAsync
libSceNpTus sceNpTusGetMultiUserDataStatusAsync
libSceNpTus sceNpTusGetMultiUserDataStatusForCrossSave
libSceNpTus sceNpTusGetMultiUserDataStatusForCrossSaveAsync
libSceNpTus sceNpTusGetMultiUserDataStatusForCrossSaveVUser
libSceNpTus sceNpTusGetMultiUserDataStatusForCrossSaveVUserAsync
libSceNpTus sceNpTusGetMultiUserDataStatusVUser
libSceNpTus sceNpTusGetMultiUserDataStatusVUserAsync
libSceNpTus sceNpTusGetMultiUserVariable
libSceNpTus sceNpTusGetMultiUserVariableA
libSceNpTus sceNpTusGetMultiUserVariableAAsync
libSceNpTus sceNpTusGetMultiUserVariableAVUser
libSceNpTus sceNpTusGetMultiUserVariableAVUserAsync
libSceNpTus sceNpTusGetMultiUserVariableAsync
libSceNpTus sceNpTusGetMultiUserVariableForCrossSaveAsync
libSceNpTus sceNpTusGetMultiUserVariableForCrossSaveVUser
libSceNpTus sceNpTusGetMultiUserVariableForCrossSaveVUserAsync
libSceNpTus sceNpTusGetMultiUserVariableVUser
libSceNpTus sceNpTusGetMultiUserVariableVUserAsync
libSceNpTus sceNpTusSetDataA
libSceNpTus sceNpTusSetDataAAsync
libSceNpTus sceNpTusSetDataAVUser
libSceNpTus sceNpTusSetDataAVUserAsync
libSceNpTus sceNpTusSetDataAsync
libSceNpTus sceNpTusSetDataVUserAsync
libSceNpTus sceNpTusTryAndSetVariable
libSceNpTus sceNpTusTryAndSetVariableA
libSceNpTus sceNpTusTryAndSetVariableAAsync
libSceNpTus sceNpTusTryAndSetVariableAVUser
libSceNpTus sceNpTusTryAndSetVariableAVUserAsync
libSceNpTus sceNpTusTryAndSetVariableAsync
libSceNpTus sceNpTusTryAndSetVariableForCrossSave
libSceNpTus sceNpTusTryAndSetVariableForCrossSaveAsync
libSceNpTus sceNpTusTryAndSetVariableForCrossSaveVUser
libSceNpTus sceNpTusTryAndSetVariableForCrossSaveVUserAsync
libSceNpTus sceNpTusTryAndSetVariableVUser
libSceNpTus sceNpTusTryAndSetVariableVUserAsync
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6312871704 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9009#issuecomment-6312871704). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T09:40:18Z. --- <!-- progress-report --> ### Progress report (b5d7637 → 1f407e5) 📈 **System libraries**: 51.9% (+0.93%, +82 implemented functions) <details> <summary>✅ 82 implemented</summary> | Library | Name | | - | - | | libSceNpTus | `sceNpTssGetSmallStorage` | | libSceNpTus | `sceNpTssGetSmallStorageAsync` | | libSceNpTus | `sceNpTusAddAndGetVariable` | | libSceNpTus | `sceNpTusAddAndGetVariableA` | | libSceNpTus | `sceNpTusAddAndGetVariableAVUser` | | libSceNpTus | `sceNpTusAddAndGetVariableAVUserAsync` | | libSceNpTus | `sceNpTusAddAndGetVariableAsync` | | libSceNpTus | `sceNpTusAddAndGetVariableForCrossSave` | | libSceNpTus | `sceNpTusAddAndGetVariableForCrossSaveAsync` | | libSceNpTus | `sceNpTusAddAndGetVariableForCrossSaveVUser` | | libSceNpTus | `sceNpTusAddAndGetVariableForCrossSaveVUserAsync` | | libSceNpTus | `sceNpTusAddAndGetVariableVUser` | | libSceNpTus | `sceNpTusAddAndGetVariableVUserAsync` | | libSceNpTus | `sceNpTusDeleteMultiSlotData` | | libSceNpTus | `sceNpTusDeleteMultiSlotDataA` | | libSceNpTus | `sceNpTusDeleteMultiSlotDataAAsync` | | libSceNpTus | `sceNpTusDeleteMultiSlotDataAsync` | | libSceNpTus | `sceNpTusGetDataA` | | libSceNpTus | `sceNpTusGetDataAAsync` | | libSceNpTus | `sceNpTusGetDataAVUser` | | libSceNpTus | `sceNpTusGetDataAVUserAsync` | | libSceNpTus | `sceNpTusGetDataAsync` | | libSceNpTus | `sceNpTusGetDataForCrossSave` | | libSceNpTus | `sceNpTusGetDataForCrossSaveAsync` | | libSceNpTus | `sceNpTusGetDataVUserAsync` | | libSceNpTus | `sceNpTusGetFriendsDataStatus` | | libSceNpTus | `sceNpTusGetFriendsDataStatusAsync` | | libSceNpTus | `sceNpTusGetFriendsVariable` | | libSceNpTus | `sceNpTusGetFriendsVariableAsync` | | libSceNpTus | `sceNpTusGetMultiSlotDataStatus` | | libSceNpTus | `sceNpTusGetMultiSlotDataStatusA` | | libSceNpTus | `sceNpTusGetMultiSlotDataStatusAAsync` | | libSceNpTus | `sceNpTusGetMultiSlotDataStatusAVUser` | | libSceNpTus | `sceNpTusGetMultiSlotDataStatusAVUserAsync` | | libSceNpTus | `sceNpTusGetMultiSlotDataStatusAsync` | | libSceNpTus | `sceNpTusGetMultiSlotDataStatusForCrossSave` | | libSceNpTus | `sceNpTusGetMultiSlotDataStatusForCrossSaveAsync` | | libSceNpTus | `sceNpTusGetMultiSlotDataStatusForCrossSaveVUser` | | libSceNpTus | `sceNpTusGetMultiSlotDataStatusForCrossSaveVUserAsync` | | libSceNpTus | `sceNpTusGetMultiSlotDataStatusVUser` | | libSceNpTus | `sceNpTusGetMultiSlotDataStatusVUserAsync` | | libSceNpTus | `sceNpTusGetMultiUserDataStatus` | | libSceNpTus | `sceNpTusGetMultiUserDataStatusA` | | libSceNpTus | `sceNpTusGetMultiUserDataStatusAAsync` | | libSceNpTus | `sceNpTusGetMultiUserDataStatusAVUser` | | libSceNpTus | `sceNpTusGetMultiUserDataStatusAVUserAsync` | | libSceNpTus | `sceNpTusGetMultiUserDataStatusAsync` | | libSceNpTus | `sceNpTusGetMultiUserDataStatusForCrossSave` | | libSceNpTus | `sceNpTusGetMultiUserDataStatusForCrossSaveAsync` | | libSceNpTus | `sceNpTusGetMultiUserDataStatusForCrossSaveVUser` | | libSceNpTus | `sceNpTusGetMultiUserDataStatusForCrossSaveVUserAsync` | | libSceNpTus | `sceNpTusGetMultiUserDataStatusVUser` | | libSceNpTus | `sceNpTusGetMultiUserDataStatusVUserAsync` | | libSceNpTus | `sceNpTusGetMultiUserVariable` | | libSceNpTus | `sceNpTusGetMultiUserVariableA` | | libSceNpTus | `sceNpTusGetMultiUserVariableAAsync` | | libSceNpTus | `sceNpTusGetMultiUserVariableAVUser` | | libSceNpTus | `sceNpTusGetMultiUserVariableAVUserAsync` | | libSceNpTus | `sceNpTusGetMultiUserVariableAsync` | | libSceNpTus | `sceNpTusGetMultiUserVariableForCrossSaveAsync` | | libSceNpTus | `sceNpTusGetMultiUserVariableForCrossSaveVUser` | | libSceNpTus | `sceNpTusGetMultiUserVariableForCrossSaveVUserAsync` | | libSceNpTus | `sceNpTusGetMultiUserVariableVUser` | | libSceNpTus | `sceNpTusGetMultiUserVariableVUserAsync` | | libSceNpTus | `sceNpTusSetDataA` | | libSceNpTus | `sceNpTusSetDataAAsync` | | libSceNpTus | `sceNpTusSetDataAVUser` | | libSceNpTus | `sceNpTusSetDataAVUserAsync` | | libSceNpTus | `sceNpTusSetDataAsync` | | libSceNpTus | `sceNpTusSetDataVUserAsync` | | libSceNpTus | `sceNpTusTryAndSetVariable` | | libSceNpTus | `sceNpTusTryAndSetVariableA` | | libSceNpTus | `sceNpTusTryAndSetVariableAAsync` | | libSceNpTus | `sceNpTusTryAndSetVariableAVUser` | | libSceNpTus | `sceNpTusTryAndSetVariableAVUserAsync` | | libSceNpTus | `sceNpTusTryAndSetVariableAsync` | | libSceNpTus | `sceNpTusTryAndSetVariableForCrossSave` | | libSceNpTus | `sceNpTusTryAndSetVariableForCrossSaveAsync` | | libSceNpTus | `sceNpTusTryAndSetVariableForCrossSaveVUser` | | libSceNpTus | `sceNpTusTryAndSetVariableForCrossSaveVUserAsync` | | libSceNpTus | `sceNpTusTryAndSetVariableVUser` | | libSceNpTus | `sceNpTusTryAndSetVariableVUserAsync` | </details>
clairtonmichel commented 2026-10-21 09:51:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by clairtonmichel on 2026-10-21T09:51:46Z.


Tested on AMD Ryzen 7 9800X3D and AMD Radeon RX 7900 XTX (Fedora Linux, Mesa 26.2.5):

  • Built cleanly with zero errors.
  • Ran the NP, TUS, and system utility test suites (guest_np_tus_offline, trophy data, web APIs, etc.): 100% passed successfully (55/55 green in 2.03s).
  • TUS and TSS signed-out argument validation behaves correctly. Ready to merge!
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6313096039 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9009#issuecomment-6313096039). Originally posted by [clairtonmichel](https://github.com/clairtonmichel) on 2026-10-21T09:51:46Z. --- Tested on AMD Ryzen 7 9800X3D and AMD Radeon RX 7900 XTX (Fedora Linux, Mesa 26.2.5): - Built cleanly with zero errors. - Ran the NP, TUS, and system utility test suites (`guest_np_tus_offline`, trophy data, web APIs, etc.): **100% passed successfully (55/55 green in 2.03s)**. - TUS and TSS signed-out argument validation behaves correctly. Ready to merge!
github-actions[bot] commented 2026-10-21 09:53:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T09:53:12Z.


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
PR 8925 core/libs/prx/libSceNpTus/Export.cpp L13-14, L345-347, L350-352, L355-357, L360-362, L745-747, L750-752, L755-757, L760-762, L765-767, L770-772, L775-777, L780-782
docs/dev/debt/libSceNpTus.md L5-6, L13-27, L97-110
sceNpTusTryAndSetVariable
sceNpTusTryAndSetVariableA
sceNpTusTryAndSetVariableAAsync
sceNpTusTryAndSetVariableAVUser
sceNpTusTryAndSetVariableAVUserAsync
sceNpTusTryAndSetVariableAsync
sceNpTusTryAndSetVariableForCrossSave
sceNpTusTryAndSetVariableForCrossSaveAsync
sceNpTusTryAndSetVariableForCrossSaveVUser
sceNpTusTryAndSetVariableForCrossSaveVUserAsync
sceNpTusTryAndSetVariableVUser
sceNpTusTryAndSetVariableVUserAsync
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6313122514 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9009#issuecomment-6313122514). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T09:53:12Z. --- <!-- 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 | |---|---|---|---| | [PR 8925](https://www.github.com/boykopovar/AnyPS5/pull/8925) | `core/libs/prx/libSceNpTus/Export.cpp` [L13-14](https://github.com/boykopovar/AnyPS5/blob/1896871ba75b9e3743e40af31a9c36779a42aafb/core/libs/prx/libSceNpTus/Export.cpp#L13-L14), [L345-347](https://github.com/boykopovar/AnyPS5/blob/1896871ba75b9e3743e40af31a9c36779a42aafb/core/libs/prx/libSceNpTus/Export.cpp#L345-L347), [L350-352](https://github.com/boykopovar/AnyPS5/blob/1896871ba75b9e3743e40af31a9c36779a42aafb/core/libs/prx/libSceNpTus/Export.cpp#L350-L352), [L355-357](https://github.com/boykopovar/AnyPS5/blob/1896871ba75b9e3743e40af31a9c36779a42aafb/core/libs/prx/libSceNpTus/Export.cpp#L355-L357), [L360-362](https://github.com/boykopovar/AnyPS5/blob/1896871ba75b9e3743e40af31a9c36779a42aafb/core/libs/prx/libSceNpTus/Export.cpp#L360-L362), [L745-747](https://github.com/boykopovar/AnyPS5/blob/1896871ba75b9e3743e40af31a9c36779a42aafb/core/libs/prx/libSceNpTus/Export.cpp#L745-L747), [L750-752](https://github.com/boykopovar/AnyPS5/blob/1896871ba75b9e3743e40af31a9c36779a42aafb/core/libs/prx/libSceNpTus/Export.cpp#L750-L752), [L755-757](https://github.com/boykopovar/AnyPS5/blob/1896871ba75b9e3743e40af31a9c36779a42aafb/core/libs/prx/libSceNpTus/Export.cpp#L755-L757), [L760-762](https://github.com/boykopovar/AnyPS5/blob/1896871ba75b9e3743e40af31a9c36779a42aafb/core/libs/prx/libSceNpTus/Export.cpp#L760-L762), [L765-767](https://github.com/boykopovar/AnyPS5/blob/1896871ba75b9e3743e40af31a9c36779a42aafb/core/libs/prx/libSceNpTus/Export.cpp#L765-L767), [L770-772](https://github.com/boykopovar/AnyPS5/blob/1896871ba75b9e3743e40af31a9c36779a42aafb/core/libs/prx/libSceNpTus/Export.cpp#L770-L772), [L775-777](https://github.com/boykopovar/AnyPS5/blob/1896871ba75b9e3743e40af31a9c36779a42aafb/core/libs/prx/libSceNpTus/Export.cpp#L775-L777), [L780-782](https://github.com/boykopovar/AnyPS5/blob/1896871ba75b9e3743e40af31a9c36779a42aafb/core/libs/prx/libSceNpTus/Export.cpp#L780-L782)<br>`docs/dev/debt/libSceNpTus.md` [L5-6](https://github.com/boykopovar/AnyPS5/blob/1896871ba75b9e3743e40af31a9c36779a42aafb/docs/dev/debt/libSceNpTus.md#L5-L6), [L13-27](https://github.com/boykopovar/AnyPS5/blob/1896871ba75b9e3743e40af31a9c36779a42aafb/docs/dev/debt/libSceNpTus.md#L13-L27), [L97-110](https://github.com/boykopovar/AnyPS5/blob/1896871ba75b9e3743e40af31a9c36779a42aafb/docs/dev/debt/libSceNpTus.md#L97-L110) | `sceNpTusTryAndSetVariable`<br>`sceNpTusTryAndSetVariableA`<br>`sceNpTusTryAndSetVariableAAsync`<br>`sceNpTusTryAndSetVariableAVUser`<br>`sceNpTusTryAndSetVariableAVUserAsync`<br>`sceNpTusTryAndSetVariableAsync`<br>`sceNpTusTryAndSetVariableForCrossSave`<br>`sceNpTusTryAndSetVariableForCrossSaveAsync`<br>`sceNpTusTryAndSetVariableForCrossSaveVUser`<br>`sceNpTusTryAndSetVariableForCrossSaveVUserAsync`<br>`sceNpTusTryAndSetVariableVUser`<br>`sceNpTusTryAndSetVariableVUserAsync` | |
pipe1os commented 2026-10-21 14:48:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by pipe1os on 2026-10-21T14:48:28Z.


Ran this on Windows, since the only run so far was on Linux.

Windows 11 Pro 26300, WinLibs GCC 15.2.0, Ninja, Release, BUILD_TESTING=ON. 1f407e5 merged onto main 2c4b116 without conflicts.

  • ctest --test-dir build -R '^guest_np_tus': guest_np_tus and guest_np_tus_offline both pass.
  • With only core/libs/prx/libSceNpTus/Export.cpp reverted to main, guest_np_tus_offline fails with 0xc0000409 and sceNpTssGetSmallStorageAsync not implemented. All 82 newly implemented functions are called in the test.
  • The NID-patched libSceNpTus.prx exports the same 136 NIDs as main's.
  • tools/check_conventions.py --base origin/main passes.

I also compared the order of the error returns in all 82 against shadPS4 a808e76 (np_tus.cpp is identical at c1b2655 and at shadPS4's current tip). They match everywhere except the INVALID_ALIGNMENT size checks, which the debt entry already lists as skipped. That includes the try-and-set opeType split and the friends sortType ranges.

Heads up: #8925 (mine, opened a few hours before this one) does the 12 sceNpTusTryAndSetVariable* calls with the same checks, so whichever lands first leaves the other conflicting. If this one goes in, I'll close mine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6318937209 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9009#issuecomment-6318937209). Originally posted by [pipe1os](https://github.com/pipe1os) on 2026-10-21T14:48:28Z. --- Ran this on Windows, since the only run so far was on Linux. Windows 11 Pro 26300, WinLibs GCC 15.2.0, Ninja, Release, `BUILD_TESTING=ON`. 1f407e5 merged onto main 2c4b116 without conflicts. - `ctest --test-dir build -R '^guest_np_tus'`: `guest_np_tus` and `guest_np_tus_offline` both pass. - With only `core/libs/prx/libSceNpTus/Export.cpp` reverted to main, `guest_np_tus_offline` fails with `0xc0000409` and `sceNpTssGetSmallStorageAsync not implemented`. All 82 newly implemented functions are called in the test. - The NID-patched `libSceNpTus.prx` exports the same 136 NIDs as main's. - `tools/check_conventions.py --base origin/main` passes. I also compared the order of the error returns in all 82 against shadPS4 a808e76 (`np_tus.cpp` is identical at c1b2655 and at shadPS4's current tip). They match everywhere except the `INVALID_ALIGNMENT` size checks, which the debt entry already lists as skipped. That includes the try-and-set `opeType` split and the friends `sortType` ranges. Heads up: #8925 (mine, opened a few hours before this one) does the 12 `sceNpTusTryAndSetVariable*` calls with the same checks, so whichever lands first leaves the other conflicting. If this one goes in, I'll close mine.
xXPBSXx commented 2026-10-21 15:14:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T15:14:06Z.


Independent Windows run of this PR (data only).

Environment: Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, BUILD_TESTING=ON. Merge-tree of the PR head against main is clean. I built only guest_np_tus_offline_tests; ctest -N -R guest_np_tus_offline lists exactly one test.

PR head tested: 1f407e5970411881fc20f14835df729c721693c1.

Results (3 runs each):

  • PR head: guest_np_tus_offline passes 3/3.
  • Baseline: I kept the PR's test and replaced only core/libs/prx/libSceNpTus/Export.cpp with the version from the PR's merge base (27c88a8d75), then rebuilt. The test fails 3/3 (exit 0xc0000409). I restored the PR's files afterwards.

GPU: the run output has no Selected GPU line; no GPU claim is made.

Not run: other platforms, the other tests in the same family, the full repository CTest, and any title or console run.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6319460588 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9009#issuecomment-6319460588). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-21T15:14:06Z. --- Independent Windows run of this PR (data only). **Environment:** Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, BUILD_TESTING=ON. Merge-tree of the PR head against `main` is clean. I built only `guest_np_tus_offline_tests`; `ctest -N -R guest_np_tus_offline` lists exactly one test. **PR head tested:** `1f407e5970411881fc20f14835df729c721693c1`. **Results (3 runs each):** - PR head: `guest_np_tus_offline` passes 3/3. - Baseline: I kept the PR's test and replaced only `core/libs/prx/libSceNpTus/Export.cpp` with the version from the PR's merge base (`27c88a8d75`), then rebuilt. The test fails 3/3 (exit 0xc0000409). I restored the PR's files afterwards. **GPU:** the run output has no `Selected GPU` line; no GPU claim is made. **Not run:** other platforms, the other tests in the same family, the full repository CTest, and any title or console run. AI-assisted (Claude Code).
YossiYad commented 2026-10-21 19:43:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-21T19:43:21Z.


Thanks @clairtonmichel for the Linux run, and @pipe1os and @xXPBSXx for the Windows ones. The baseline runs with Export.cpp reverted are the useful part, since they show the test actually reaches the new code.

@pipe1os you're right about #8925, and yours was opened first. If it lands before this one I'll rebase on it and drop my 12 sceNpTusTryAndSetVariable* calls, so you don't need to close anything. Thanks also for checking the error order against np_tus.cpp.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6324960949 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9009#issuecomment-6324960949). Originally posted by [YossiYad](https://github.com/YossiYad) on 2026-10-21T19:43:21Z. --- Thanks @clairtonmichel for the Linux run, and @pipe1os and @xXPBSXx for the Windows ones. The baseline runs with `Export.cpp` reverted are the useful part, since they show the test actually reaches the new code. @pipe1os you're right about #8925, and yours was opened first. If it lands before this one I'll rebase on it and drop my 12 `sceNpTusTryAndSetVariable*` calls, so you don't need to close anything. Thanks also for checking the error order against `np_tus.cpp`.
YossiYad commented 2026-10-22 05:34:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-22T05:34:44Z.


@oneandonlydean @adriadam10 ready from my side: CI is green and it has one Linux and two Windows runs, with the test failing on main's Export.cpp. It overlaps pipe1os's #8925 on the 12 sceNpTusTryAndSetVariable* calls; either order works, and if #8925 goes first I'll rebase this one onto it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6333570759 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9009#issuecomment-6333570759). Originally posted by [YossiYad](https://github.com/YossiYad) on 2026-10-22T05:34:44Z. --- @oneandonlydean @adriadam10 ready from my side: CI is green and it has one Linux and two Windows runs, with the test failing on `main`'s `Export.cpp`. It overlaps pipe1os's #8925 on the 12 `sceNpTusTryAndSetVariable*` calls; either order works, and if #8925 goes first I'll rebase this one onto it.
oneandonlydean commented 2026-10-22 05:37:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-22T05:37:53Z.


@YossiYad thanks, it's in my review queue now. I'll come back here with the result.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6333612985 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9009#issuecomment-6333612985). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-22T05:37:53Z. --- @YossiYad thanks, it's in my review queue now. I'll come back here with the result.
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!9009
No description provided.