docs(libc): correct stale rmdir, nanf and bad_optional_access debt statements #9364

Merged
thuanquang merged 1 commit from upstream-pr/9364 into main 2026-10-25 10:45:52 +00:00
thuanquang commented 2026-10-21 19:21:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-21T19:21:02Z.


What

Three statements in docs/dev/debt/libc.md no longer match main; each is replaced with what main does now, and nothing else in the entries changes.

  • rename, sceKernelRename: "rmdir("dir/."), unlink("dir/.") and the same calls with .. follow the same lookup rule in FreeBSD but are not changed here: the guest still resolves the dot component away and acts on dir or its parent". All four calls are changed on main now. PR #3436 (8c06d20f6a, merged as ea31cff19c) made rmdir("dir/.") fail with EINVAL before PR #8174 wrote this sentence, and #8797 (a2a77714d5, merged as a6fc8a467d) made sceKernelUnlink and sceKernelRmdir call RenameDotError_nid_no_patch, the check rename uses (core/libs/prx/libkernel/File/src/Open.cpp:439 and Stdio.cpp:1525). unlink and rmdir go through them (Stdio.cpp:1075-1077 and 1544-1546). core/libs/tests/GuestFilesystem.cpp:274-282 checks unlink, rmdir, sceKernelUnlink and sceKernelRmdir on dir/., dir/.. and both with a trailing slash (errno 22, 0x80020016), and unlink of . below a regular file (errno 20). Now: "unlink, rmdir, sceKernelUnlink and sceKernelRmdir follow the same rule".
  • nan and nanf: "VLC (PPSA85300) stops on nanf at start-up after strsep". nanf is exported and returns the quiet NaN 0x7fc00000 (core/libs/prx/libc/src/Math.cpp:664-667; nan is at :668-671; the test is core/libs/tests/GuestMath.cpp:1471-1478). PR #3315 added both (31906bf9b0, merged as 3fb2e29d75). The clause was written in that same commit, so it described main before the export. The commit message says VLC halted at nanf on Linux once strsep was available. That shows VLC imports nanf (NID DZU+K1wozGI), but it does not show when VLC calls it. Now: "VLC (PPSA85300) imports nanf".
  • std::bad_optional_access and std::_Throw_bad_optional_access: "PPSA26578 (issue #7624) and PPSA34015 import _ZSt26_Throw_bad_optional_accessv (KwzEip7m6TM) from libc, and fail to load on main with unresolved import (0xC0000139)". libc exports _ZSt26_Throw_bad_optional_accessv with no preprocessor guard (core/libs/prx/libc/src/exception/StandardExceptions.cpp:506; the type record and vtable are at :361-362). Its NID, computed with the tools/nid_names.py algorithm, is KwzEip7m6TM, so the import resolves. core/libs/tests/GuestBadOptionalAccess.cpp:34 and core/libs/tests/ExceptionRuntime.cpp:259 test it. PR #7872 added the export (2165427879 and e775e456d8, merged as 1e774a3b22) and wrote this clause about main before its own merge. Neither title was run. Now: "PPSA26578 (issue #7624) and PPSA34015 import _ZSt26_Throw_bad_optional_accessv (KwzEip7m6TM) from libc".

Tested

Docs only; nothing was built or run. On origin/main 1698d1ea6a I read the following code, checked each sentence's history with git log -S, and recomputed the NIDs KwzEip7m6TM and DZU+K1wozGI with the tools/nid_names.py algorithm: unlink, sceKernelRmdir and rmdir (core/libs/prx/libkernel/File/src/Stdio.cpp:1054-1057 and 1463-1485), sceKernelUnlink (Open.cpp:423-436), the guest path resolver loop and FinalPathComponentIsDot_nid_no_patch (core/libs/prx/libc/src/General.cpp:351-363 and 717-723), the dot-directory test (core/libs/tests/GuestFilesystem.cpp:1304-1314), nanf and nan (core/libs/prx/libc/src/Math.cpp:595-602, a file with no preprocessor guards) with their test (GuestMath.cpp:1325-1332), and the bad_optional_access exports (StandardExceptions.cpp:341-348 and 486, built through src/exception/Exports.cpp from libc CMakeLists.txt:103) with their tests. (main 1896871ba7). Rebased onto main 11d6efa06c for the conflict with #9777 (merged; its atanf entry now sits above this one) in docs/dev/debt/libc.md. #8797 (merged 2026-10-22) had made the rename part stale, so that sentence now says what main does (see What); every location in What was rechecked on 11d6efa06c. Each statement was found by a read-only sweep of the debt files and confirmed by two independent verifier passes and a final check on current main. No open pull request edits these sentences (checked against every open PR's diff of this file).

  • python tools/check_conventions.py --base origin/main with this title and body: 0 errors; the rename, sceKernelRename entry goes from 1074 characters to 943, under the debt-length limit.
  • Not tested: behaviour on any machine; this changes text only.

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 (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4957093360 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9364). Originally posted by [thuanquang](https://github.com/thuanquang) on 2026-10-21T19:21:02Z. --- ### What Three statements in `docs/dev/debt/libc.md` no longer match `main`; each is replaced with what `main` does now, and nothing else in the entries changes. - **rename, sceKernelRename**: "`rmdir("dir/.")`, `unlink("dir/.")` and the same calls with `..` follow the same lookup rule in FreeBSD but are not changed here: the guest still resolves the dot component away and acts on `dir` or its parent". All four calls are changed on `main` now. PR #3436 (8c06d20f6a, merged as ea31cff19c) made `rmdir("dir/.")` fail with `EINVAL` before PR #8174 wrote this sentence, and #8797 (a2a77714d5, merged as a6fc8a467d) made `sceKernelUnlink` and `sceKernelRmdir` call `RenameDotError_nid_no_patch`, the check `rename` uses (core/libs/prx/libkernel/File/src/Open.cpp:439 and Stdio.cpp:1525). `unlink` and `rmdir` go through them (Stdio.cpp:1075-1077 and 1544-1546). core/libs/tests/GuestFilesystem.cpp:274-282 checks `unlink`, `rmdir`, `sceKernelUnlink` and `sceKernelRmdir` on `dir/.`, `dir/..` and both with a trailing slash (errno 22, 0x80020016), and `unlink` of `.` below a regular file (errno 20). Now: "`unlink`, `rmdir`, `sceKernelUnlink` and `sceKernelRmdir` follow the same rule". - **nan and nanf**: "VLC (PPSA85300) stops on nanf at start-up after strsep". `nanf` is exported and returns the quiet NaN `0x7fc00000` (core/libs/prx/libc/src/Math.cpp:664-667; `nan` is at :668-671; the test is core/libs/tests/GuestMath.cpp:1471-1478). PR #3315 added both (31906bf9b0, merged as 3fb2e29d75). The clause was written in that same commit, so it described main before the export. The commit message says VLC halted at nanf on Linux once strsep was available. That shows VLC imports nanf (NID `DZU+K1wozGI`), but it does not show when VLC calls it. Now: "VLC (PPSA85300) imports nanf". - **std::bad_optional_access and std::_Throw_bad_optional_access**: "PPSA26578 (issue #7624) and PPSA34015 import `_ZSt26_Throw_bad_optional_accessv` (`KwzEip7m6TM`) from `libc`, and fail to load on main with unresolved import (0xC0000139)". libc exports `_ZSt26_Throw_bad_optional_accessv` with no preprocessor guard (core/libs/prx/libc/src/exception/StandardExceptions.cpp:506; the type record and vtable are at :361-362). Its NID, computed with the tools/nid_names.py algorithm, is `KwzEip7m6TM`, so the import resolves. core/libs/tests/GuestBadOptionalAccess.cpp:34 and core/libs/tests/ExceptionRuntime.cpp:259 test it. PR #7872 added the export (2165427879 and e775e456d8, merged as 1e774a3b22) and wrote this clause about main before its own merge. Neither title was run. Now: "PPSA26578 (issue #7624) and PPSA34015 import `_ZSt26_Throw_bad_optional_accessv` (`KwzEip7m6TM`) from `libc`". ### Tested Docs only; nothing was built or run. On origin/main 1698d1ea6a I read the following code, checked each sentence's history with git log -S, and recomputed the NIDs KwzEip7m6TM and DZU+K1wozGI with the tools/nid_names.py algorithm: unlink, sceKernelRmdir and rmdir (core/libs/prx/libkernel/File/src/Stdio.cpp:1054-1057 and 1463-1485), sceKernelUnlink (Open.cpp:423-436), the guest path resolver loop and FinalPathComponentIsDot_nid_no_patch (core/libs/prx/libc/src/General.cpp:351-363 and 717-723), the dot-directory test (core/libs/tests/GuestFilesystem.cpp:1304-1314), nanf and nan (core/libs/prx/libc/src/Math.cpp:595-602, a file with no preprocessor guards) with their test (GuestMath.cpp:1325-1332), and the bad_optional_access exports (StandardExceptions.cpp:341-348 and 486, built through src/exception/Exports.cpp from libc CMakeLists.txt:103) with their tests. (`main` `1896871ba7`). Rebased onto `main` `11d6efa06c` for the conflict with #9777 (merged; its atanf entry now sits above this one) in `docs/dev/debt/libc.md`. #8797 (merged 2026-10-22) had made the rename part stale, so that sentence now says what `main` does (see What); every location in What was rechecked on `11d6efa06c`. Each statement was found by a read-only sweep of the debt files and confirmed by two independent verifier passes and a final check on current `main`. No open pull request edits these sentences (checked against every open PR's diff of this file). - `python tools/check_conventions.py --base origin/main` with this title and body: 0 errors; the rename, sceKernelRename entry goes from 1074 characters to 943, under the `debt-length` limit. - Not tested: behaviour on any machine; this changes text only. ### 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 (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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!9364
No description provided.