Skip to content

feat(libc): export std::__sce_v2::_Syserror_map_search - #11421

Open
edubox wants to merge 1 commit into
boykopovar:mainfrom
edubox:feat/libc-sce-v2-syserror-search
Open

edubox wants to merge 1 commit into
boykopovar:mainfrom
edubox:feat/libc-sce-v2-syserror-search

Conversation

@edubox

@edubox edubox commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

What

Exports std::__sce_v2::_Syserror_map_search(int) (a9DvgsV9dWw) and makes the versioned std::__sce_v2::_Syserror_map(int) use the same table.

The console libc.prx in PPSA02530 and PPSA28416 exports _Syserror_map_search at 0xce8b0 / 0xcfb50 (41 bytes). It walks 79 16-byte records, compares the int at offset 0 and returns the pointer at offset 8; the fallback is null. The record pointers are RELA relocations, so resolving them from the bundled module gives the 79 strings, including entry 0 {0, "success"} and the Sony codes 107, 108, 1040, 1050, 1051 and 1074. Codes 35 and 45 occur twice and the first record wins.

The versioned _Syserror_map (4ITMYcbipA0, 0xce870, 57 bytes) is the same loop with "unknown error" as the fallback. Before this change AnyPS5 used the shared FreeBSD list, which has no Sony codes and maps 95/96, which are not in the console's versioned table. Both versioned functions now share the console table; the unversioned _Syserror_map is unchanged.

Tested

Linux x86-64, GCC 16.2.1, Release, BUILD_TESTING=ON.

  • guest_sce_v2_exceptions and guest_generic_category pass.
  • python3 tools/check_conventions.py --base origin/main and git diff --check pass.
  • Not tested with a title: PPSA28416 stops at sceNpGetSandboxInfo before these imports are reached. No Windows product run; the hosted product jobs are skipped by path policy.

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 (PPSA28416 has no Game bring-up discussion)
  • GPUs tested: n/a
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Progress report (e67cc81 → 6a94996)

📈 System libraries: 26.23% (+0.0022%, +1 implemented functions)

✅ 1 implemented
Library Name
libc _ZNSt8__sce_v220_Syserror_map_searchEi_nid_postfix

Changed libraries (implemented exports)

Library Before After Change
libc 1484/1500 (98.93%) 1485/1501 (98.93%) +0.0007%

@MarcZX10

Copy link
Copy Markdown
Contributor

I reviewed the table and both callers against the PR description. The separate search function returns null when no entry matches, while the versioned mapper keeps its unknown error fallback; the tests cover the Sony-specific values, duplicate-code first-match behavior, and the distinction from the unversioned FreeBSD map. The symbol spelling also hashes to the stated NID a9DvgsV9dWw with the repository tool.

One repository rule remains: the head is based on 2db37cf1de, while current main is 035ac96edd (17 commits ahead). The intervening commits do not touch these implementation/test paths, and the merge preview is clean, but CONTRIBUTING.md says to keep branches up to date. Please sync to current main and let conventions rerun. I’ll recheck the pending hosted matrix after it finishes. The Linux focused-test results in the PR description are author-reported; I did not independently run them.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completed the source review and the implementation matches the supplied binary analysis: _Syserror_map_search returns null for misses, while versioned _Syserror_map preserves the unknown error fallback; selected tests cover Sony codes, duplicate-code order and the unchanged unversioned map. The stated symbol NID checks with tools/nid_names.py. I found no source defect in this patch.

The remaining merge blocker is the repository branch rule: this head is based on 2db37cf1de, while current main is 035ac96edd (17 commits ahead). The intervening commits do not touch the changed implementation or test files and the merge preview is clean. Please sync to current main and rerun conventions. Eligibility, conventions, intake, labels, report, Ubuntu relinker/ASan/register-context and the Windows relinker now pass; macOS relinker, register-context and write-watch jobs remain pending. The Linux focused test result in the PR description is author-reported, not independently run here.

@edubox

edubox commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main 035ac96edd; the change itself is unchanged. guest_sce_v2_exceptions and guest_generic_category pass on the rebased head 16ca7b8a3d, and check_conventions.py and git diff --check are clean. Could you recheck the pending hosted matrix?

@edubox
edubox force-pushed the feat/libc-sce-v2-syserror-search branch from 14903c2 to 16ca7b8 Compare October 26, 2026 13:05
@MarcZX10

Copy link
Copy Markdown
Contributor

Rechecked the fresh run 40327664941 at head 16ca7b8a3d. Eligibility, conventions, intake, labels, report, Ubuntu relinker, Ubuntu Debug/Release register-context and ASan pass. The Windows relinker is still running; macOS relinker, macOS register-context and write-watch jobs are queued. Linux/Windows product checks are skipped by path policy. I’ll check back after the remaining matrix finishes before updating the review state.

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 7851 core/libs/prx/libc/include/Api.hpp
PR 10397 core/libs/prx/libc/include/Api.hpp
PR 10780 core/libs/prx/libc/include/Api.hpp
PR 11831 core/libs/prx/libc/include/Api.hpp
PR 12682 core/libs/prx/libc/include/Api.hpp
PR 12688 core/libs/prx/libc/include/Api.hpp
PR 12700 core/libs/prx/libc/include/Api.hpp
PR 12965 core/libs/prx/libc/include/Api.hpp
PR 13486 core/libs/prx/libc/include/Api.hpp
PR 15799 core/libs/prx/libc/src/exception/StandardExceptions.cpp
PR 15800 core/libs/prx/libc/include/Api.hpp
core/libs/prx/libc/src/exception/StandardExceptions.cpp
PR 15801 core/libs/prx/libc/include/Api.hpp
core/libs/prx/libc/src/exception/StandardExceptions.cpp
PR 15802 core/libs/prx/libc/include/Api.hpp
core/libs/prx/libc/src/exception/StandardExceptions.cpp
PR 15803 core/libs/prx/libc/include/Api.hpp
core/libs/prx/libc/src/exception/StandardExceptions.cpp
PR 15804 core/libs/prx/libc/include/Api.hpp
core/libs/prx/libc/src/exception/StandardExceptions.cpp
PR 15807 core/libs/prx/libc/include/Api.hpp
core/libs/prx/libc/src/exception/StandardExceptions.cpp

@MarcZX10

Copy link
Copy Markdown
Contributor

I manually checked the overlap bot’s two Api.hpp warnings against the current heads: #7851 changes _Atomic_assert near line 104, #9772 adds _Stopfx declarations near line 975, and this PR adds _Syserror_map_search near line 1408. They touch distinct declarations and have no duplicate symbol or overlapping hunk, so I found no dependency. The macOS jobs on run 40327664941 remain queued; I’ll wait for those before changing the review state.

@ycbuzi

ycbuzi commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

A native Windows run of 16ca7b8a3d: Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, merged onto main e38fcb00dc with no conflicts. Plain ctest --repeat until-fail:3.

  • guest_sce_v2_exceptions passes, 3 of 3. The build has no warnings.
  • No negative control: with main's libc/include/Api.hpp and StandardExceptions.cpp, the test doesn't build ('_ZNSt8__sce_v220_Syserror_map_searchEi_nid_postfix' was not declared in this scope at GuestSceV2Exceptions.cpp:175).

AI-assisted: yes (Claude Code)

@edubox
edubox force-pushed the feat/libc-sce-v2-syserror-search branch from 16ca7b8 to 362482d Compare October 26, 2026 16:09
@edubox

edubox commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (518d36eaec); head is now 362482dbd0. Rebuilt guest_sce_v2_exceptions on the rebased head: passes. check_conventions.py --base origin/main: all checks passed.

@github-actions github-actions Bot added the libc label Oct 26, 2026
@edubox
edubox force-pushed the feat/libc-sce-v2-syserror-search branch from 362482d to 89e17c6 Compare October 26, 2026 17:55
@edubox

edubox commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (88795ed448); head is now 89e17c62a5. The change itself is unchanged. Rebuilt and ran guest_sce_v2_exceptions and guest_generic_category on the rebased head: both pass. check_conventions.py --base origin/main and git diff --check are clean. Could you re-check the exact head?

@edubox
edubox force-pushed the feat/libc-sce-v2-syserror-search branch from 89e17c6 to 201ad43 Compare October 26, 2026 21:39
@edubox

edubox commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased again onto current main (85071975fb); head is now 201ad43d93. No code changes. guest_sce_v2_exceptions and guest_generic_category pass; conventions/diff-check clean. Could you re-check the exact head?

@edubox

edubox commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased automatically onto current main (fc2594c7ac); head is now 94e7c49bbc. Focused tests pass; check_conventions.py --base origin/main and git diff --check are clean.

@edubox
edubox force-pushed the feat/libc-sce-v2-syserror-search branch from 201ad43 to 94e7c49 Compare October 26, 2026 22:02
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 26, 2026
@edubox
edubox force-pushed the feat/libc-sce-v2-syserror-search branch from 94e7c49 to dd732db Compare October 26, 2026 22:16
@edubox

edubox commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main 74acfad65b; the conflict in StandardExceptions.cpp was main's future-error/category block overlapping the tail of the file. Kept both changes: the future-error exports and the new _Syserror_map_search next to the versioned _Syserror_map. Head is now dd732db60a.

Local verification:

  • guest_sce_v2_exceptions and guest_generic_category pass.
  • python3 tools/check_conventions.py --base origin/main and git diff --check pass.
  • PR is now MERGEABLE; eligibility should rerun on the new head.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 26, 2026
@edubox

edubox commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Rebased automatically onto current main (6e719cc497); head is now b44626a8f7. Focused tests pass; check_conventions.py --base origin/main and git diff --check are clean.

@edubox
edubox force-pushed the feat/libc-sce-v2-syserror-search branch from dd732db to b44626a Compare October 27, 2026 02:02
@edubox

edubox commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Rebased automatically onto current main (b986c11a34); head is now f4a07d5bab. Focused tests pass; check_conventions.py --base origin/main and git diff --check are clean.

@edubox
edubox force-pushed the feat/libc-sce-v2-syserror-search branch 2 times, most recently from f4a07d5 to 8262410 Compare October 27, 2026 05:02
@edubox

edubox commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Synced to current main (rebase onto 0a570f617d, clean) and pushed 826241081d.

  • guest_sce_v2_exceptions and guest_generic_category pass locally (Linux x86-64, GCC 16.2.1, Release).
  • python3 tools/check_conventions.py --base origin/main and git diff --check pass.
  • The previous Windows relinker failure was check_compile_modes_test_library_directory_values_can_look_like_modes (Timeout), an unrelated relinker test timeout; the changed paths are libc-only. The rebuilt matrix on the new head will confirm.

No source changes were needed; the patch still matches the console analysis.

@edubox
edubox force-pushed the feat/libc-sce-v2-syserror-search branch from 8262410 to 20a525a Compare October 27, 2026 05:06
@edubox

edubox commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up: main advanced to 2e85f47aef (the two new commits touch only ElfTypes.hpp). Rebased again onto it and pushed the final head 20a525a914; guest_sce_v2_exceptions and guest_generic_category still pass, and check_conventions.py --base origin/main is clean. The hosted matrix is rerunning on this head.

@edubox

edubox commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

Rebased automatically onto current main (c9207624bc); head is now 711aaa241d. Focused tests pass; check_conventions.py --base origin/main and git diff --check are clean.

@edubox
edubox force-pushed the feat/libc-sce-v2-syserror-search branch from 1ff2ac7 to 711aaa2 Compare October 28, 2026 23:03
@edubox

edubox commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Rebased automatically onto current main (3a2b919816); head is now eec100b71d. Focused tests pass; check_conventions.py --base origin/main and git diff --check are clean.

@edubox
edubox force-pushed the feat/libc-sce-v2-syserror-search branch from 711aaa2 to eec100b Compare October 29, 2026 00:02
@edubox

edubox commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Rebased automatically onto current main (2960e9a6e7); head is now 1f50efe485. Focused tests pass; check_conventions.py --base origin/main and git diff --check are clean.

@edubox
edubox force-pushed the feat/libc-sce-v2-syserror-search branch from eec100b to 1f50efe Compare October 29, 2026 06:02
@edubox

edubox commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Rebased automatically onto current main (edf6804cf5); head is now f444b3b38a. Focused tests pass; check_conventions.py --base origin/main and git diff --check are clean.

@edubox
edubox force-pushed the feat/libc-sce-v2-syserror-search branch 2 times, most recently from f444b3b to 4d4c3cd Compare October 29, 2026 08:02
@edubox

edubox commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Rebased automatically onto current main (4c7d275bef); head is now 4d4c3cd17f. Focused tests pass; check_conventions.py --base origin/main and git diff --check are clean.

@edubox

edubox commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Rebased automatically onto current main (aaccd0ba39); head is now 4791239555. Focused tests pass; check_conventions.py --base origin/main and git diff --check are clean.

@edubox
edubox force-pushed the feat/libc-sce-v2-syserror-search branch from 4d4c3cd to 4791239 Compare October 29, 2026 09:01

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prior source review found the new versioned error-map search behavior consistent with the referenced runtime and its tests cover the Sony codes, duplicate-code ordering, and unchanged unversioned map. The author has refreshed the branch through current main and reports focused tests, conventions and diff checks passing. I did not run them locally. No new source concern is visible in this rebase.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 29, 2026
@adriadam10
adriadam10 force-pushed the feat/libc-sce-v2-syserror-search branch from 4791239 to 9f68772 Compare October 30, 2026 06:15
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 30, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-checked — looks good

I reviewed head 9f687728a12434730faa1fa95496c8f66a11a441 against recorded base 0839e8f3442331a951efe82b5ba700007bc36539; the three-file diff remains scoped to the versioned error-map export/table and focused tests. The hosted Windows product check passes and Linux was skipped; I ran no local C++ tests. I found no blocking issue.

@edubox

edubox commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Watchdog status on 9f687728a1: the only failing checks are the two write-watch jobs, and they fail while configuring main, not in this patch. core/libs/tests/write_watch/CMakeLists.txt on current main (98ddd9c179) registers write_watch_execute-fault and write_watch_read-fault twice (the foreach(mode execute-fault read-fault) block added by #12117 and again by #12435), so CMake aborts with add_test given test NAME ... which already exists. This PR does not touch that file; #13220 removes the duplicate and its write-watch jobs pass. The added test lines and implementation are unchanged from the head where guest_sce_v2_exceptions passed, and python3 tools/check_conventions.py --base origin/main is clean. Branch left unchanged; no rebase or push.

AI-assisted: yes

@edubox

edubox commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Status check on exact head 9f687728a1 (no push, the PR is approved and is not rebased per policy):

Nothing to change in this branch for that failure; leaving the approved head untouched.

AI-assisted: yes (Claude Code).

@edubox

edubox commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

The two write-watch failures are not from this PR. Both jobs fail while configuring core/libs/tests/write_watch on main:

CMake Error at core/libs/tests/write_watch/CMakeLists.txt:42 (add_test):
  add_test given test NAME "write_watch_execute-fault" which already exists
  in this directory.

and the same for write_watch_read-fault: main registers both tests twice. #13220 removes the duplicate registration. This PR touches only core/libs/prx/libc/include/Api.hpp, StandardExceptions.cpp and GuestSceV2Exceptions.cpp.

Verified here at head 9f687728a1: guest_sce_v2_exceptions and guest_generic_category pass, and python3 tools/check_conventions.py --base origin/main passes. No push: the head is already approved and the remaining red checks are the open #13220.

@edubox

edubox commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Watchdog status on 9f687728a1: the PR is approved, so it is not rebased. Nothing is pushed.

  • guest_sce_v2_exceptions passes; check_conventions.py --base origin/main and git diff --check are clean.
  • The two write-watch failures are not from this patch. main registers write_watch_execute-fault and write_watch_read-fault twice in core/libs/tests/write_watch/CMakeLists.txt, so CMake aborts at configure time. test(libc): register the macOS write watch fault tests once #13220 fixes that registration and is owned by another author.

@edubox

edubox commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Watchdog re-check on 9f687728a1: no change since the last status on this head, so nothing is pushed.

  • The PR is approved, so it is not rebased.
  • guest_sce_v2_exceptions passes; check_conventions.py --base origin/main and git diff --check are clean.
  • The two write-watch failures are not from this patch: main registers write_watch_execute-fault and write_watch_read-fault twice in core/libs/tests/write_watch/CMakeLists.txt. test(libc): register the macOS write watch fault tests once #13220 fixes that registration and is owned by another author.

@edubox

edubox commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Watchdog re-check on 9f687728a1: the PR is approved (two APPROVED reviews), so it is not rebased, and the head has not changed since the last status. Nothing is pushed.

  • guest_sce_v2_exceptions and guest_generic_category pass; check_conventions.py --base origin/main and git diff --check are clean.
  • The two write-watch failures are not from this patch: main still registers write_watch_execute-fault and write_watch_read-fault twice in core/libs/tests/write_watch/CMakeLists.txt. test(libc): register the macOS write watch fault tests once #13220 (e9f09f54fa, open) fixes that registration; this branch is left untouched.

AI-assisted: yes

@edubox

edubox commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Watchdog re-check on 9f687728a1 against origin/main 474030e584: the PR is approved, so it is not rebased, and the head needs no change. Nothing is pushed.

  • guest_sce_v2_exceptions and guest_generic_category rebuilt and pass; python3 tools/check_conventions.py --base origin/main and git diff --check are clean.
  • The two write-watch failures are not from this patch: main registers write_watch_execute-fault and write_watch_read-fault twice in core/libs/tests/write_watch/CMakeLists.txt, so CMake aborts at configure time. test(libc): register the macOS write watch fault tests once #13220 (e9f09f54fa, open) fixes that registration; this branch is left untouched.

AI-assisted: yes

@edubox

edubox commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Watchdog status on approved head 9f687728a1 (not rebased, no code changes).

  • ctest --test-dir build -R '^guest_sce_v2_exceptions$': passes.
  • python3 tools/check_conventions.py --base origin/main and git diff --check: clean.
  • The two write-watch failures are upstream: both jobs fail configuring core/libs/tests/write_watch on main because write_watch_execute-fault and write_watch_read-fault are registered twice; test(libc): register the macOS write watch fault tests once #13220 fixes that. They do not come from this PR.

Nothing is pushed.

@edubox
edubox force-pushed the feat/libc-sce-v2-syserror-search branch from 9f68772 to 6a94996 Compare November 1, 2026 10:53

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants