feat(libSceLibcInternal): implement the aligned nothrow array new and the aligned array delete #14240

Merged
miguelcoxcaballero merged 2 commits from upstream-pr/14240 into main 2026-11-01 04:37:40 +00:00
miguelcoxcaballero commented 2026-11-01 02:58:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by miguelcoxcaballero on 2026-11-01T02:58:15Z.


What

Implements two exports of libSceLibcInternal that threw NotImplemented:

  • s2eGsgUF9vk (_ZnamSt11align_val_tRKSt9nothrow_t): aligned nothrow array operator new.
  • v09ZcAhZzSc (_ZdaPvSt11align_val_t): aligned array operator delete.

Both take the standard C++17 signatures their mangled names give and forward to the existing libc exports of the same names, so they share the application heap and the new handler. The debt entry in docs/dev/debt/libSceLibcInternal.md records what is unverified: the console's libSceLibcInternal.sprx was not read and no title was seen calling them.

Tested

Ubuntu 24.04, GCC, Release build: tools/check_conventions.py --base origin/main passes; the new test plus the existing new_handler, mutex and init_once tests pass; the built library exports both NIDs. Not tested on Windows or macOS, 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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5103847317 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14240). Originally posted by [miguelcoxcaballero](https://github.com/miguelcoxcaballero) on 2026-11-01T02:58:15Z. --- ### What Implements two exports of `libSceLibcInternal` that threw `NotImplemented`: - `s2eGsgUF9vk` (`_ZnamSt11align_val_tRKSt9nothrow_t`): aligned nothrow array `operator new`. - `v09ZcAhZzSc` (`_ZdaPvSt11align_val_t`): aligned array `operator delete`. Both take the standard C++17 signatures their mangled names give and forward to the existing `libc` exports of the same names, so they share the application heap and the new handler. The debt entry in `docs/dev/debt/libSceLibcInternal.md` records what is unverified: the console's `libSceLibcInternal.sprx` was not read and no title was seen calling them. ### Tested Ubuntu 24.04, GCC, Release build: `tools/check_conventions.py --base origin/main` passes; the new test plus the existing new_handler, mutex and init_once tests pass; the built library exports both NIDs. Not tested on Windows or macOS, 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 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-01 03:05:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T03:05:35Z.

Review: APPROVED


Reviewed — looks good

The current head 631aa9c369cca92cc0c8cacd352b67a3da8d9384 adds two aligned array operator exports that forward to the matching existing libc implementations; the source review and no-build checks found no blocking issue.

What I ran

Reviewed head 631aa9c369cca92cc0c8cacd352b67a3da8d9384. The current main base was dc9dc7eaaeaf99b1c491d426e68bb999def3da16; Git's merge preview was clean. Environment: Linux x86_64, Python 3.11.2, Git 2.39.5. I did not invoke a compiler.

git diff --check dc9dc7eaaeaf99b1c491d426e68bb999def3da16...631aa9c369cca92cc0c8cacd352b67a3da8d9384
git merge-tree --write-tree dc9dc7eaaeaf99b1c491d426e68bb999def3da16 631aa9c369cca92cc0c8cacd352b67a3da8d9384
python3 tools/check_conventions.py --base dc9dc7eaaeaf99b1c491d426e68bb999def3da16 --head 631aa9c369cca92cc0c8cacd352b67a3da8d9384 --title 'feat(libSceLibcInternal): implement the aligned nothrow array new and the aligned array delete' --body /tmp/anyps5-14240-body.md
python3 tools/pr_stack_check.py 14240 --repo boykopovar/AnyPS5
python3 core/libs/tests/test_public_headers.py --audit-only
python3 tools/pr_abi_audit.py --base dc9dc7eaaeaf99b1c491d426e68bb999def3da16 --head 631aa9c369cca92cc0c8cacd352b67a3da8d9384 --json
gh pr checks 14240 -R boykopovar/AnyPS5

The PR body reports an Ubuntu 24.04 GCC Release build and the new aligned-new plus existing new-handler, mutex, and init-once tests as passing. Those are author-reported, not independently run here.

Results

Check Result
git diff --check Passed; no whitespace errors.
Current-main merge preview Passed; clean tree 5ed8053dec4bea75bc783245260c8d78fd2c7c67.
Repository conventions and PR template Passed against current main.
Public-header audit Passed: unique declarations and umbrella coverage verified; audit-only mode did not compile headers.
Export/ABI source audit A workspace-local lexical helper (not checked into this PR) returned passed_with_warnings; both warnings are the intentional removal of the old placeholder declarations for these two NIDs. Manual inspection confirmed the new explicit NID exports and matching declarations/definitions. This audit does not prove binary ABI or runtime behavior.
Hosted CI intake passed; conventions and labels were pending at the last refresh.
Build and C++ tests Not run locally; the PR description reports them as passing.
Unedited output from checks

git diff --check stdout (empty):

git merge-tree --write-tree:

5ed8053dec4bea75bc783245260c8d78fd2c7c67

Conventions checker:

All conventions checks passed.

Public-header audit:

394 libraries, 25208 exports: unique declarations and umbrella coverage verified

ABI helper result and relevant findings (selected JSON fields; its full symbol inventory is omitted):

{
  "status": "passed_with_warnings",
  "findings": [
    {
      "symbol": "sceLibcInternalUnknown6_003_s2eGsgUF9vk_nid_no_patch",
      "kind": "export-removed",
      "message": "This APS5_VABI declaration, definition, or explicit alias appeared in the changed base files but not in the corresponding head files; verify that removing it is intentional."
    },
    {
      "symbol": "sceLibcInternalUnknown6_052_v09ZcAhZzSc_nid_no_patch",
      "kind": "export-removed",
      "message": "This APS5_VABI declaration, definition, or explicit alias appeared in the changed base files but not in the corresponding head files; verify that removing it is intentional."
    }
  ]
}

Hosted CI snapshot:

conventions	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41267526759/job/124733331972
intake	pass	20s	https://github.com/boykopovar/AnyPS5/actions/runs/41267285079/job/124732626208
labels	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41267285093/job/124732626534

Findings

Blocking

None.

Non-blocking

The PR records that the console's libSceLibcInternal.sprx and title call sites were not inspected, so same-heap behavior on console remains unverified. The wrapper delegates both allocation and deallocation to the matching existing libc operators, and the PR documents this limitation; no contrary evidence surfaced in this review.

Sources

Not verified

  • I did not compile or run C++ tests on this exact head. The build and test results in the PR description are author-reported.
  • Windows, macOS, PS5 console behavior, the console module implementation, and title call sites were not independently checked.
  • The precheck's test-quality helper was absent from the PR checkout; I inspected the new assertions directly. No negative-control mutation was run.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5726191012 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14240#pullrequestreview-5726191012). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T03:05:35Z. **Review:** APPROVED --- # Reviewed — looks good The current head `631aa9c369cca92cc0c8cacd352b67a3da8d9384` adds two aligned array operator exports that forward to the matching existing `libc` implementations; the source review and no-build checks found no blocking issue. ## What I ran Reviewed head `631aa9c369cca92cc0c8cacd352b67a3da8d9384`. The current `main` base was `dc9dc7eaaeaf99b1c491d426e68bb999def3da16`; Git's merge preview was clean. Environment: Linux x86_64, Python 3.11.2, Git 2.39.5. I did not invoke a compiler. ```sh git diff --check dc9dc7eaaeaf99b1c491d426e68bb999def3da16...631aa9c369cca92cc0c8cacd352b67a3da8d9384 git merge-tree --write-tree dc9dc7eaaeaf99b1c491d426e68bb999def3da16 631aa9c369cca92cc0c8cacd352b67a3da8d9384 python3 tools/check_conventions.py --base dc9dc7eaaeaf99b1c491d426e68bb999def3da16 --head 631aa9c369cca92cc0c8cacd352b67a3da8d9384 --title 'feat(libSceLibcInternal): implement the aligned nothrow array new and the aligned array delete' --body /tmp/anyps5-14240-body.md python3 tools/pr_stack_check.py 14240 --repo boykopovar/AnyPS5 python3 core/libs/tests/test_public_headers.py --audit-only python3 tools/pr_abi_audit.py --base dc9dc7eaaeaf99b1c491d426e68bb999def3da16 --head 631aa9c369cca92cc0c8cacd352b67a3da8d9384 --json gh pr checks 14240 -R boykopovar/AnyPS5 ``` The PR body reports an Ubuntu 24.04 GCC Release build and the new aligned-new plus existing new-handler, mutex, and init-once tests as passing. Those are author-reported, not independently run here. ## Results | Check | Result | |---|---| | `git diff --check` | Passed; no whitespace errors. | | Current-main merge preview | Passed; clean tree `5ed8053dec4bea75bc783245260c8d78fd2c7c67`. | | Repository conventions and PR template | Passed against current `main`. | | Public-header audit | Passed: unique declarations and umbrella coverage verified; audit-only mode did not compile headers. | | Export/ABI source audit | A workspace-local lexical helper (not checked into this PR) returned `passed_with_warnings`; both warnings are the intentional removal of the old placeholder declarations for these two NIDs. Manual inspection confirmed the new explicit NID exports and matching declarations/definitions. This audit does not prove binary ABI or runtime behavior. | | Hosted CI | `intake` passed; `conventions` and `labels` were pending at the last refresh. | | Build and C++ tests | Not run locally; the PR description reports them as passing. | <details><summary>Unedited output from checks</summary> `git diff --check` stdout (empty): ```text ``` `git merge-tree --write-tree`: ```text 5ed8053dec4bea75bc783245260c8d78fd2c7c67 ``` Conventions checker: ```text All conventions checks passed. ``` Public-header audit: ```text 394 libraries, 25208 exports: unique declarations and umbrella coverage verified ``` ABI helper result and relevant findings (selected JSON fields; its full symbol inventory is omitted): ```json { "status": "passed_with_warnings", "findings": [ { "symbol": "sceLibcInternalUnknown6_003_s2eGsgUF9vk_nid_no_patch", "kind": "export-removed", "message": "This APS5_VABI declaration, definition, or explicit alias appeared in the changed base files but not in the corresponding head files; verify that removing it is intentional." }, { "symbol": "sceLibcInternalUnknown6_052_v09ZcAhZzSc_nid_no_patch", "kind": "export-removed", "message": "This APS5_VABI declaration, definition, or explicit alias appeared in the changed base files but not in the corresponding head files; verify that removing it is intentional." } ] } ``` Hosted CI snapshot: ```text conventions pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41267526759/job/124733331972 intake pass 20s https://github.com/boykopovar/AnyPS5/actions/runs/41267285079/job/124732626208 labels pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41267285093/job/124732626534 ``` </details> ## Findings ### Blocking None. ### Non-blocking The PR records that the console's `libSceLibcInternal.sprx` and title call sites were not inspected, so same-heap behavior on console remains unverified. The wrapper delegates both allocation and deallocation to the matching existing `libc` operators, and the PR documents this limitation; no contrary evidence surfaced in this review. ## Sources - [PR implementation and explicit NID exports at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/631aa9c369cca92cc0c8cacd352b67a3da8d9384/core/libs/prx/libSceLibcInternal/AlignedNew.cpp#L8-L19) - [Added aligned allocation tests at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/631aa9c369cca92cc0c8cacd352b67a3da8d9384/core/libs/tests/GuestLibcInternalAlignedNew.cpp#L65-L94) - [Existing matching `libc` operators at the current base](https://github.com/boykopovar/AnyPS5/blob/dc9dc7eaaeaf99b1c491d426e68bb999def3da16/core/libs/prx/libc/src/StdioExtras.cpp#L171-L200) ## Not verified - I did not compile or run C++ tests on this exact head. The build and test results in the PR description are author-reported. - Windows, macOS, PS5 console behavior, the console module implementation, and title call sites were not independently checked. - The precheck's test-quality helper was absent from the PR checkout; I inspected the new assertions directly. No negative-control mutation was run.
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!14240
No description provided.