feat(libSceLibcInternal): implement the placement operator delete and delete[] #14837

Merged
miguelcoxcaballero merged 3 commits from upstream-pr/14837 into main 2026-11-06 20:20:51 +00:00
miguelcoxcaballero commented 2026-11-01 19:18:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by miguelcoxcaballero on 2026-11-01T19:18:44Z.


What

Implements two libSceLibcInternal exports that threw NotImplemented:

  • 1vo6qqqa9F4 (_ZdlPvS_): operator delete(void*, void*)
  • Suc8W0QPxjw (_ZdaPvS_): operator delete[](void*, void*)

These are the placement forms, whose effect the C++ standard defines as "Intentionally performs no action" (new.delete.placement). Both are noexcept and return without reading or freeing either pointer. libc does not export them. The two stubs, their declarations and their two table rows are removed, and a debt entry records what is unverified: the console's libSceLibcInternal.sprx was not read and no title was seen calling them.

Tested

Ubuntu 24.04, GCC 13.3, Release, BUILD_TESTING=ON, full build:

  • tools/check_conventions.py --base origin/main passes.
  • New guest_libc_internal_placement_delete: on a recording application heap, both functions called with (block, block) and with (nullptr, block) release nothing and leave the 32 bytes of the block unchanged; the block is then freed once through _ZdlPv. It passes, together with guest_libc_internal_aligned_new, guest_libc_internal_mtx, guest_init_once, guest_locale and guest_libc_threads.
  • The patched libSceLibcInternal.prx exports each of the two NIDs once.
  • This branch merges cleanly with my other open libSceLibcInternal branches (#14659, #14660, #14664, #14666) and the merged tree builds and passes their tests.

Not tested on Windows, macOS or a PS5, nor with any title.

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 (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none (open #14796 touches neighbouring lines of the same files, for different exports)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5110693297 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14837). Originally posted by [miguelcoxcaballero](https://github.com/miguelcoxcaballero) on 2026-11-01T19:18:44Z. --- ### What Implements two `libSceLibcInternal` exports that threw `NotImplemented`: - `1vo6qqqa9F4` (`_ZdlPvS_`): `operator delete(void*, void*)` - `Suc8W0QPxjw` (`_ZdaPvS_`): `operator delete[](void*, void*)` These are the placement forms, whose effect the C++ standard defines as "Intentionally performs no action" ([new.delete.placement](https://eel.is/c++draft/new.delete.placement)). Both are `noexcept` and return without reading or freeing either pointer. `libc` does not export them. The two stubs, their declarations and their two table rows are removed, and a debt entry records what is unverified: the console's `libSceLibcInternal.sprx` was not read and no title was seen calling them. ### Tested Ubuntu 24.04, GCC 13.3, Release, `BUILD_TESTING=ON`, full build: - `tools/check_conventions.py --base origin/main` passes. - New `guest_libc_internal_placement_delete`: on a recording application heap, both functions called with `(block, block)` and with `(nullptr, block)` release nothing and leave the 32 bytes of the block unchanged; the block is then freed once through `_ZdlPv`. It passes, together with `guest_libc_internal_aligned_new`, `guest_libc_internal_mtx`, `guest_init_once`, `guest_locale` and `guest_libc_threads`. - The patched `libSceLibcInternal.prx` exports each of the two NIDs once. - This branch merges cleanly with my other open `libSceLibcInternal` branches (#14659, #14660, #14664, #14666) and the merged tree builds and passes their tests. Not tested on Windows, macOS or a PS5, nor with any title. ### 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 (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none (open #14796 touches neighbouring lines of the same files, for different exports) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-01 19:24:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T19:24:56Z.

Review: COMMENTED


Reviewed — no blocking findings

I reviewed all seven changed files at head 5accbac52a3a3660d6e63946cf7f1c20ff9124bd and found no source-level blocker; approval is withheld while the hosted Windows job is pending.

What I ran

The diff is against base f2d874c1fdccf781c0fa5d86619bb5dd8894b958. Its merge preview against current main (e0caf1360035286bd22b9f2a3030e97b880ffb28) is clean. Environment: Linux x86_64, Debian 12, Python 3.11.2, Git 2.39.5. I did not build or compile.

git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...5accbac52a3a3660d6e63946cf7f1c20ff9124bd
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14837
python3 tools/pr_stack_check.py 14837 --repo boykopovar/AnyPS5
gh pr checks 14837 --repo boykopovar/AnyPS5
# Read all seven changed files and inspect the current PR head, description, reviews and checks.

Results

Check Result Note
Diff whitespace passed No whitespace errors
Conventions and template passed Local and hosted checks passed
Stack merge preview passed Clean against current main
Hosted Windows build not run Pending at review time
Hosted Linux and specialized jobs not run Skipped by workflow
C++ test not run No local build
ABI and test-quality helpers not run Helper scripts absent from isolated PR snapshot
Unedited command output
git diff --check: exited 0; no output
precheck: diff_check passed; conventions_and_pr_template passed; live_dependency_and_mergeability_check passed
precheck helper failures: tools/pr_abi_audit.py and tools/pr_test_quality.py are absent from the isolated PR snapshot
hosted: conventions pass; eligibility pass; intake pass; labels pass; library-portability pass; report pass; windows pending; linux, register-context, relinker, relinker-asan and write-watch skipped

Negative control

Not run. I did not alter either implementation to test whether the new C++ test would fail under a deliberately incorrect freeing behavior.

Findings

Blocking

None found in the seven changed files.

Non-blocking

The PR reports the new test and full build passing on Ubuntu 24.04 with GCC 13.3; I did not independently rerun those checks. The current hosted Windows job is still pending, so this review does not approve the change yet.

Sources

Not verified

No local build, C++ test, Windows/macOS run, PS5 run or title compatibility test was performed. Hosted Windows remained pending; Linux and specialized jobs were skipped. The author-reported build and tests were read from the PR description only.

To get this to a good state

No source change is requested. Once the hosted Windows job completes, I will recheck the exact head and its required checks before deciding whether approval is appropriate.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729839272 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14837#pullrequestreview-5729839272). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T19:24:56Z. **Review:** COMMENTED --- # Reviewed — no blocking findings I reviewed all seven changed files at head `5accbac52a3a3660d6e63946cf7f1c20ff9124bd` and found no source-level blocker; approval is withheld while the hosted Windows job is pending. ## What I ran The diff is against base `f2d874c1fdccf781c0fa5d86619bb5dd8894b958`. Its merge preview against current `main` (`e0caf1360035286bd22b9f2a3030e97b880ffb28`) is clean. Environment: Linux x86_64, Debian 12, Python 3.11.2, Git 2.39.5. I did not build or compile. ```sh git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...5accbac52a3a3660d6e63946cf7f1c20ff9124bd python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14837 python3 tools/pr_stack_check.py 14837 --repo boykopovar/AnyPS5 gh pr checks 14837 --repo boykopovar/AnyPS5 # Read all seven changed files and inspect the current PR head, description, reviews and checks. ``` ## Results | Check | Result | Note | |---|---|---| | Diff whitespace | passed | No whitespace errors | | Conventions and template | passed | Local and hosted checks passed | | Stack merge preview | passed | Clean against current `main` | | Hosted Windows build | not run | Pending at review time | | Hosted Linux and specialized jobs | not run | Skipped by workflow | | C++ test | not run | No local build | | ABI and test-quality helpers | not run | Helper scripts absent from isolated PR snapshot | <details><summary>Unedited command output</summary> ```text git diff --check: exited 0; no output precheck: diff_check passed; conventions_and_pr_template passed; live_dependency_and_mergeability_check passed precheck helper failures: tools/pr_abi_audit.py and tools/pr_test_quality.py are absent from the isolated PR snapshot hosted: conventions pass; eligibility pass; intake pass; labels pass; library-portability pass; report pass; windows pending; linux, register-context, relinker, relinker-asan and write-watch skipped ``` </details> ## Negative control Not run. I did not alter either implementation to test whether the new C++ test would fail under a deliberately incorrect freeing behavior. ## Findings ### Blocking None found in the seven changed files. ### Non-blocking The PR reports the new test and full build passing on Ubuntu 24.04 with GCC 13.3; I did not independently rerun those checks. The current hosted Windows job is still pending, so this review does not approve the change yet. ## Sources - [Placement delete implementations at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/5accbac52a3a3660d6e63946cf7f1c20ff9124bd/core/libs/prx/libSceLibcInternal/PlacementDelete.cpp) - [Test registration and implementation at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/5accbac52a3a3660d6e63946cf7f1c20ff9124bd/core/libs/prx/libSceLibcInternal/CMakeLists.txt#L46-L59) ## Not verified No local build, C++ test, Windows/macOS run, PS5 run or title compatibility test was performed. Hosted Windows remained pending; Linux and specialized jobs were skipped. The author-reported build and tests were read from the PR description only. ## To get this to a good state No source change is requested. Once the hosted Windows job completes, I will recheck the exact head and its required checks before deciding whether approval is appropriate.
MarcZX10 commented 2026-11-01 19:38:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T19:38:39Z.

Review: APPROVED


Re-checked — Windows CI passed, approved

The exact head is unchanged, its hosted Windows build and test job passed, and my earlier full source review found no blocker.

What I ran

Rechecked head 5accbac52a3a3660d6e63946cf7f1c20ff9124bd against base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 using GitHub’s live PR and check state. Environment: Debian 12 x86_64; no local build or compiler run.

gh api repos/boykopovar/AnyPS5/pulls/14837 --jq '{state:.state,head:.head.sha,base:.base.sha}'
gh pr checks 14837 --repo boykopovar/AnyPS5

Results

Check Result Note
Hosted Windows build and tests passed Completed on the reviewed head.
Conventions, labels, report and portability passed Hosted checks completed successfully.
Linux and specialized jobs not applicable Skipped by workflow.
Local build or C++ tests not run No local compilation in this follow-up.
Captured hosted-check output
windows	pass	10m55s	https://github.com/boykopovar/AnyPS5/actions/runs/41341096620/job/124951109313
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41341096620/job/124951110558
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41341096620/job/124951110527
relinker	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41341096620/job/124951110355
relinker-asan	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41341096620/job/124951110505
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41341096620/job/124951110360
conventions	pass	13s	https://github.com/boykopovar/AnyPS5/actions/runs/41341093984/job/124951070716
eligibility	pass	6s	https://github.com/boykopovar/AnyPS5/actions/runs/41341096620/job/124951076886
intake	pass	24s	https://github.com/boykopovar/AnyPS5/actions/runs/41341094013/job/124951070055
labels	pass	5s	https://github.com/boykopovar/AnyPS5/actions/runs/41341094045/job/124951070482
library-portability	pass	1m21s	https://github.com/boykopovar/AnyPS5/actions/runs/41341096641/job/124951076462
report	pass	1m27s	https://github.com/boykopovar/AnyPS5/actions/runs/41341096657/job/124951076535

Findings

Blocking

None found in the reviewed source.

Non-blocking

The author-reported Linux test results were not independently rerun here.

Sources

Not verified

I did not rerun a local C++ build, CTest, Linux/macOS tests, or console behavior. Linux and specialized hosted jobs were skipped.

To get this to a good state

No further action is needed for the reviewed head. If it changes, I will review the new head and its checks.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729883949 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14837#pullrequestreview-5729883949). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T19:38:39Z. **Review:** APPROVED --- # Re-checked — Windows CI passed, approved The exact head is unchanged, its hosted Windows build and test job passed, and my earlier full source review found no blocker. ## What I ran Rechecked head `5accbac52a3a3660d6e63946cf7f1c20ff9124bd` against base `f2d874c1fdccf781c0fa5d86619bb5dd8894b958` using GitHub’s live PR and check state. Environment: Debian 12 x86_64; no local build or compiler run. ```sh gh api repos/boykopovar/AnyPS5/pulls/14837 --jq '{state:.state,head:.head.sha,base:.base.sha}' gh pr checks 14837 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | Note | |---|---|---| | Hosted Windows build and tests | passed | Completed on the reviewed head. | | Conventions, labels, report and portability | passed | Hosted checks completed successfully. | | Linux and specialized jobs | not applicable | Skipped by workflow. | | Local build or C++ tests | not run | No local compilation in this follow-up. | <details><summary>Captured hosted-check output</summary> ```text windows pass 10m55s https://github.com/boykopovar/AnyPS5/actions/runs/41341096620/job/124951109313 linux skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41341096620/job/124951110558 register-context skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41341096620/job/124951110527 relinker skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41341096620/job/124951110355 relinker-asan skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41341096620/job/124951110505 write-watch skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41341096620/job/124951110360 conventions pass 13s https://github.com/boykopovar/AnyPS5/actions/runs/41341093984/job/124951070716 eligibility pass 6s https://github.com/boykopovar/AnyPS5/actions/runs/41341096620/job/124951076886 intake pass 24s https://github.com/boykopovar/AnyPS5/actions/runs/41341094013/job/124951070055 labels pass 5s https://github.com/boykopovar/AnyPS5/actions/runs/41341094045/job/124951070482 library-portability pass 1m21s https://github.com/boykopovar/AnyPS5/actions/runs/41341096641/job/124951076462 report pass 1m27s https://github.com/boykopovar/AnyPS5/actions/runs/41341096657/job/124951076535 ``` </details> ## Findings ### Blocking None found in the reviewed source. ### Non-blocking The author-reported Linux test results were not independently rerun here. ## Sources - [Reviewed implementation and tests at this exact head](https://github.com/boykopovar/AnyPS5/tree/5accbac52a3a3660d6e63946cf7f1c20ff9124bd/core/libs/prx/libSceLibcInternal) - [Hosted Windows job for this head](https://github.com/boykopovar/AnyPS5/actions/runs/41341096620/job/124951109313) ## Not verified I did not rerun a local C++ build, CTest, Linux/macOS tests, or console behavior. Linux and specialized hosted jobs were skipped. ## To get this to a good state No further action is needed for the reviewed head. If it changes, I will review the new head and its checks.
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!14837
No description provided.