Repository navigation
docs(debt): record libSceFios2 init parameters and error mapping from the PS4 module - #14869
Conversation
… the PS4 module Read from the disassembly of the PS4 libSceFios2.sprx whose init banner reports SDK 0x10710001: the sceFiosInitialize, sceFiosUpdateParameters and sceFiosIsInitialized contract, the SceFiosParams defaults, the kernel error mapping and the error code names. Not measured on a console and not checked against a PS5 module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wm5hiXXANzPqoVGkSdDP4q
BunnyFl
left a comment
There was a problem hiding this comment.
A note on the source: the PS5 13.42 system dump I have has no libSceFios2.sprx under system/ or system_ex/, so I couldn't cross-check any of this against a PS5 module, unlike the PS4 one you read. If PS5 titles ship libSceFios2 themselves (in sce_module), those copies would be the stronger source, and AGENTS.md's rule on title-shipped modules may apply to how far this library gets reimplemented. It might be worth one line in the entry.
I can't verify the PS4 10.71 reading from here, so this is a comment rather than an approval. The new entries read cleanly. check_conventions.py warns only about main's existing long pending-list line (line 5), not about these entries.
|
Hi ntamas94, #14869 now conflicts with main in docs/dev/debt/libSceFios2.md, and this one can't be merged mechanically, because main has implemented much of what the new entries describe as missing:
Could you merge current main and rewrite the new entries against it? Keep what main still lacks (for example the SceFiosParams layout and defaults, the BAD_SIZE/BAD_FLAGS checks in init if main doesn't make them, and the kernel-error mapping if main doesn't apply it yet), and drop what main now implements. Thanks for the disassembly notes; the error-name table and the defaults are useful detail. |
|
95d9dd4 shortens the initialization debt entry to 849 characters and completes the kernel-error differences: ENFILE/EMFILE (23/24) map to CANT_ALLOCATE_FH in the implementation but return unchanged in the PS4 module; ENAMETOOLONG (63) maps to PATH_TOO_LONG here but BAD_PATH there. The kernel-error entry is 816 characters. Conventions against upstream/main report no findings. Whitespace, UTF-8 without BOM and mojibake checks pass. Documentation only. Normal push, no history rewrite. AI-assisted: yes (Codex). |
✅ AMD GPU test: passedPR head
Failing on main too (1, not counted against this PR)Validated but not compared (45, not in the main baseline's validation pass)Validation IDs already present on main (8 IDs in 404 tests)Skipped (4)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
PS4 Fios2 probe summaryFirmware 10.710.001, SDK 0x05050001, neo_mode=0. All 62 exports in the debt list were invoked at least once using signatures/branches guided by the PS4 disassembly. The table groups the final probe observations; it is not a full valid-input conformance suite.
A first incorrect TraceTimestamp signature crashed; only the later dump-guided buffer call is counted above. The 62 cases passed their final runner self-checks. These are PS4 observations only: they do not establish PS5 parity or all valid-input behavior. No firmware binary is attached. |
What
Documentation only. Records in
docs/dev/debt/libSceFios2.mdwhat the PS4 firmware module settles forsceFiosInitialize,sceFiosUpdateParametersandsceFiosIsInitialized, theSceFiosParamsdefaults, the kernel error mapping and the error code names. Main now implements these functions and declares the error constants. The entries record the remaining differences in parameter validation, defaults, update semantics and kernel-error mapping; no code changes.Source, per reading titles and libraries: the PS4
libSceFios2.sprxwhose init banner reports SDK0x10710001, read from its disassembly. No binary is attached.PS4 console probe supplement — firmware 10.710.001, SDK 0x05050001, neo_mode=0: all 62 exports in this debt list received a dump-guided probe invocation. These are bounded observations of selected inputs and branches, not a complete valid-input conformance suite. An initial incorrect
sceFiosTraceTimestampsignature crashed; the dump-guided mutable-buffer call then returned two terminated timestamp strings with adjacent guard bytes intact. The null-descriptorsceFiosIOFilterPsarcDearchiverpath repeatedly returned0x80820006. Three async directory-create attempts returned raw 0 and created no kernel-visible directory.The last
sceFiosArchiveSetDecompressorThreadCountprobe used a fresh, uninitialized module: getter 0, setter(1) raw 0, getter still 0, then successful module stop/unload. This does not exercise initialized worker callbacks. Probe results are PS4 evidence only and do not establish PS5 parity.What the module shows:
test rbx,rbx; jeleads tomov r15d,0x80820006(BAD_PTR) and "sceFiosInitialize: NULL parameters."bextr esi,[rbx],0xf01; cmp esi,0xb0; jneleads to0x80820008(BAD_SIZE) and "Unsupported paramsSize (%d, most recent is %d)".movzx esi,BYTE PTR [rbx+0x19]; cmp esi,0x4; jaeleads to0x80820021(BAD_FLAGS).extraFlagsfails oncmp eax,0x3; jaorand eax,0x1; jne. All lead to0x80820008and "A reserved, padding, or extraFlags field is not zero."sceFiosUpdateParametersand returns 0 before the size check.and eax,[rdi]with0xfffe, thencmp eax,0x160; it also returns early before init. It copies 0x14, 0x70, 0x78 and 0x88 to 0x9c.cmpagainst -1, 0 or a minimum is followed by a store of the default listed in the entry.test BYTE PTR [params],0x1; jeskips the scheduler, and the call goes tosceKernelRead,sceKernelOpenorsceKernelTruncatedirectly.lea ecx,[rax+0x7ffdffff]; cmp ecx,0x58. Its default case,test eax,eax; jle, returns any other negative code unchanged. In a PS4libkernel_sys.sprx, 122 wrappers end inlea ecx,[rax-0x7ffe0000]; test eax,eax; cmovne eax,ecx, so a kernel code is 0x80020000 plus the errno.lea eax,[rcx+0x7f7e0000]; cmp eax,0x24over 37 cases. Each case loads oneSCE_FIOS_ERROR_*string, and 0x20 falls through to a number.Sources disagree on one point. sonny-tel/libSceFios2 declares
void sceFiosInitialize(SceFiosParams)with the struct by value. The module tests and dereferencesrdiand returns the codes above. Every offset of that header'sSceFiosParamsmatches the module.The implementation is now on main. This PR preserves its debt entries and adds PS4 evidence for the remaining gaps; it implements nothing.
Tested
The 62 final PS4 probe cases passed their runner self-checks on firmware 10.710.001 (SDK 0x05050001, neo_mode=0). The AnyPS5 implementation was not run on console; no title-compatibility test or PS5 equivalence check was performed.
python3 tools/check_conventions.py --base upstream/mainreports 0 errors; its one warning is the existing over-long entry on line 5, which this change shortens.tools/pr_overlap.pyneeds GitHub GraphQL, which was unavailable where this was prepared; a REST search of open pull requests found only #12269 touching libSceFios2.Refresh — 2026-11-03 (Codex, AI-assisted): Merged main 086c068. Rewrote the findings against Control.cpp, Runtime.cpp and Types.hpp: the exports and error constants already exist; the remaining gaps are parameter validation/layout/defaults, update semantics and kernel-error mapping. Documentation only. Conventions: 0 errors (the existing long pending-list warning remains); diff against main has no whitespace errors. No console or runtime tests were run for this refresh.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)