fix(libSceNpUniversalDataSystem): return the module's codes from sceNpUniversalDataSystemInitialize #16324

Merged
sherySJ merged 1 commit from upstream-pr/16324 into main 2026-11-12 13:27:03 +00:00
sherySJ commented 2026-11-06 08:34:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by sherySJ on 2026-11-06T08:34:00Z.


What

sceNpUniversalDataSystemInitialize (core/libs/prx/libSceNpUniversalDataSystem/src/System.cpp:12) threw std::invalid_argument for a null param and for any size != 16, which ends the title, and returned 0 for pool_size == 0. The native module returns a code in all three cases.

Source: docs/dev/debt/libSceNpUniversalDataSystem.md:26 and the table in https://github.com/boykopovar/AnyPS5/pull/12803#issuecomment-6517047831, which @BunnyFl posted (thank you). It is a run of the 13.42 libSceNpUniversalDataSystem.sprx (function at 0x1ae0) in a host harness on Windows, not on a console, three identical runs. The module's own start routine failed in the harness and two setup steps were run by hand, so only the error returns come from the module.

Call Result
param == NULL 0x80553102
size 0, 8, 0xf, 0x11, 0x18, 0x20, 0x100, ~0 (pool_size 0x10000) 0x80553112
size 0x10, pool_size 0 0x80553102
size 0x18, pool_size 0 0x80553112
size 0x10, pool_size 0x10000 0

The checks run null, then size, then pool_size. The function now returns these codes in that order (NpUniversalDataSystem.hpp gets SCE_NP_UNIVERSAL_DATA_SYSTEM_ERROR_INVALID_PARAM_SIZE = 0x80553112). The queries test asserts every row above. The initialized state (0x80553118 on a repeated call) stays unimplemented and is the only thing left in the debt entry at line 26, with the #12803 comment as its source.

Tested

  • Linux, GCC 16.2.1, cmake --build build --target guest_np_uds_queries_tests, ctest -R '^guest_np_uds_queries$' run three times on the head: Passed each time.
  • Negative control: main's System.cpp with this test aborts (terminate called after throwing an instance of 'std::invalid_argument', what(): sceNpUniversalDataSystemInitialize: invalid argument) on the first row, the null param. On main the wrong-size rows also throw and the pool_size 0 row returns 0. The head passes.
  • python3 tools/check_conventions.py --base origin/main: passed.
  • Windows: @JJenkx ran guest_np_uds_queries 3 of 3 passing on Windows 11 with GCC 15.2 UCRT (comment). The values come from a module run, not a console.

Overlap

Base e509b29247. Open PRs touching docs/dev/debt/libSceNpUniversalDataSystem.md elsewhere: #14912, #13606, #14212 (draft), #14330. git merge-tree of this head with #14912, #13606 and #14330 is clean; #14212 already conflicts with main in tools/debt_split.py and not in these files. No open PR touches System.cpp or GuestNpUniversalDataSystemQueries.cpp.

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:5185142988 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16324). Originally posted by [sherySJ](https://github.com/sherySJ) on 2026-11-06T08:34:00Z. --- ### What `sceNpUniversalDataSystemInitialize` (`core/libs/prx/libSceNpUniversalDataSystem/src/System.cpp:12`) threw `std::invalid_argument` for a null `param` and for any `size != 16`, which ends the title, and returned 0 for `pool_size == 0`. The native module returns a code in all three cases. Source: `docs/dev/debt/libSceNpUniversalDataSystem.md:26` and the table in https://github.com/boykopovar/AnyPS5/pull/12803#issuecomment-6517047831, which @BunnyFl posted (thank you). It is a run of the 13.42 `libSceNpUniversalDataSystem.sprx` (function at 0x1ae0) in a host harness on Windows, not on a console, three identical runs. The module's own start routine failed in the harness and two setup steps were run by hand, so only the error returns come from the module. | Call | Result | |---|---| | `param == NULL` | `0x80553102` | | `size` 0, 8, 0xf, 0x11, 0x18, 0x20, 0x100, `~0` (`pool_size` 0x10000) | `0x80553112` | | `size` 0x10, `pool_size` 0 | `0x80553102` | | `size` 0x18, `pool_size` 0 | `0x80553112` | | `size` 0x10, `pool_size` 0x10000 | `0` | The checks run null, then `size`, then `pool_size`. The function now returns these codes in that order (`NpUniversalDataSystem.hpp` gets `SCE_NP_UNIVERSAL_DATA_SYSTEM_ERROR_INVALID_PARAM_SIZE = 0x80553112`). The queries test asserts every row above. The initialized state (`0x80553118` on a repeated call) stays unimplemented and is the only thing left in the debt entry at line 26, with the #12803 comment as its source. ### Tested - Linux, GCC 16.2.1, `cmake --build build --target guest_np_uds_queries_tests`, `ctest -R '^guest_np_uds_queries$'` run three times on the head: Passed each time. - Negative control: main's `System.cpp` with this test aborts (`terminate called after throwing an instance of 'std::invalid_argument'`, `what(): sceNpUniversalDataSystemInitialize: invalid argument`) on the first row, the null param. On main the wrong-size rows also throw and the `pool_size` 0 row returns 0. The head passes. - `python3 tools/check_conventions.py --base origin/main`: passed. - Windows: @JJenkx ran `guest_np_uds_queries` 3 of 3 passing on Windows 11 with GCC 15.2 UCRT ([comment](https://github.com/boykopovar/AnyPS5/pull/16324#issuecomment-6681002736)). The values come from a module run, not a console. ### Overlap Base `e509b29247`. Open PRs touching `docs/dev/debt/libSceNpUniversalDataSystem.md` elsewhere: #14912, #13606, #14212 (draft), #14330. `git merge-tree` of this head with #14912, #13606 and #14330 is clean; #14212 already conflicts with `main` in `tools/debt_split.py` and not in these files. No open PR touches `System.cpp` or `GuestNpUniversalDataSystemQueries.cpp`. ### 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 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
gabichuuuuu commented 2026-11-09 08:52:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-09T08:52:27Z.

Review: COMMENTED


Windows run of head f68e23b4d7, merged onto main 286b14d2f7 in one tree with 47 other small open PRs that touch different files. Setup: Windows 11, WinLibs GCC 15.2 r7 (x86_64-ucrt-posix-seh, the CI toolchain), Release, BUILD_TESTING=ON.

  • guest_np_uds_queries with --repeat until-fail:5: 5 / 5 pass.
  • Negative control, with main's NpUniversalDataSystem.hpp, System.cpp and this PR's test: 5 / 5 runs fail.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5823552117 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16324#pullrequestreview-5823552117). Originally posted by [gabichuuuuu](https://github.com/gabichuuuuu) on 2026-11-09T08:52:27Z. **Review:** COMMENTED --- Windows run of head `f68e23b4d7`, merged onto `main` `286b14d2f7` in one tree with 47 other small open PRs that touch different files. Setup: Windows 11, WinLibs GCC 15.2 r7 (`x86_64-ucrt-posix-seh`, the CI toolchain), Release, `BUILD_TESTING=ON`. - `guest_np_uds_queries` with `--repeat until-fail:5`: 5 / 5 pass. - **Negative control,** with `main`'s `NpUniversalDataSystem.hpp`, `System.cpp` and this PR's test: 5 / 5 runs fail.
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!16324
No description provided.