refactor(npuniversaldatasystem): drop errno saves around guest copies #26190

Merged
LeandroLP23 merged 1 commit from upstream-pr/26190 into main 2026-11-23 13:00:17 +00:00
LeandroLP23 commented 2026-11-23 12:28:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-11-23T12:28:34Z.


What

Same change as #25937, #25944 and #25945, for libSceNpUniversalDataSystem. GuestCopyIn_nid_no_patch, GuestCopyOut_nid_no_patch and GuestWritable_nid_no_patch restore errno themselves since #21243 (RestoreErrno in libc/src/General.cpp), so saving and restoring errno around them does nothing.

19 inline saves around a guest copy are removed, in EventPropertyArray.cpp, EventPropertyObject.cpp, Handle.cpp, Record.cpp and System.cpp. A save is kept where the saved value is used again later in the function. 38 lines removed.

Context.cpp and Event.cpp are left out because #21557 changes them.

No change in behaviour.

Tested

Windows 11 (10.0.26300), WinLibs GCC 15.2.0 r7, Release. ctest -R 'universal_?data|np_?uds', with its 3 build outputs from tools/select_tests.py targets: 3 of 3 on main 709342e209 and 3 of 3 with this change applied to it. tools/check_conventions.py passes. tools/pr_overlap.py --branch finds no overlap with the 2550 open pull requests.

Not run: Linux and macOS.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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:5453107343 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26190). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-11-23T12:28:34Z. --- ### What Same change as #25937, #25944 and #25945, for `libSceNpUniversalDataSystem`. `GuestCopyIn_nid_no_patch`, `GuestCopyOut_nid_no_patch` and `GuestWritable_nid_no_patch` restore `errno` themselves since #21243 (`RestoreErrno` in `libc/src/General.cpp`), so saving and restoring `errno` around them does nothing. 19 inline saves around a guest copy are removed, in `EventPropertyArray.cpp`, `EventPropertyObject.cpp`, `Handle.cpp`, `Record.cpp` and `System.cpp`. A save is kept where the saved value is used again later in the function. 38 lines removed. `Context.cpp` and `Event.cpp` are left out because #21557 changes them. No change in behaviour. ### Tested Windows 11 (10.0.26300), WinLibs GCC 15.2.0 r7, Release. `ctest -R 'universal_?data|np_?uds'`, with its 3 build outputs from `tools/select_tests.py targets`: 3 of 3 on `main` `709342e209` and 3 of 3 with this change applied to it. `tools/check_conventions.py` passes. `tools/pr_overlap.py --branch` finds no overlap with the 2550 open pull requests. Not run: Linux and macOS. ### 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) and the licence notice of code adapted from upstream (see AGENTS.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
mihiii1337 commented 2026-11-23 12:47:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mihiii1337 on 2026-11-23T12:47:27Z.

Review: APPROVED


I ran a native Windows GCC 15.2 A/B fixture built from all five changed UDS sources on base 81a4fdbfe0 and head 71f053d135. Both revisions passed 22 export cases, including 2 real read-hook and 18 write-hook calls that deliberately changed errno. Rejected outputs preserved the caller's errno and left the event property and record containers unchanged. Retrying into writable memory attached the clone. Omitting the optional child output attached the child without invoking the write hook. The fixture ran entirely in process.

The Windows CI log also shows np_uds_events and patched_libraries passing. Test merges with #23418 and #22049 were clean. The Context.cpp and Event.cpp conflicts with #21557 are already present against base.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6021943125 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26190#pullrequestreview-6021943125). Originally posted by [mihiii1337](https://github.com/mihiii1337) on 2026-11-23T12:47:27Z. **Review:** APPROVED --- I ran a native Windows GCC 15.2 A/B fixture built from all five changed UDS sources on base 81a4fdbfe0 and head 71f053d135. Both revisions passed 22 export cases, including 2 real read-hook and 18 write-hook calls that deliberately changed errno. Rejected outputs preserved the caller's errno and left the event property and record containers unchanged. Retrying into writable memory attached the clone. Omitting the optional child output attached the child without invoking the write hook. The fixture ran entirely in process. The Windows CI log also shows np_uds_events and patched_libraries passing. Test merges with #23418 and #22049 were clean. The Context.cpp and Event.cpp conflicts with #21557 are already present against base. 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!26190
No description provided.