Skip to content

fix(libs): return what the firmware returns from 29 more calls it does not implement - #9173

Merged
adriadam10 merged 4 commits into
boykopovar:mainfrom
hypermoist:fix/libs-firmware-constants-4
Oct 25, 2026
Merged

adriadam10 merged 4 commits into
boykopovar:mainfrom
hypermoist:fix/libs-firmware-constants-4

Conversation

@hypermoist

@hypermoist hypermoist commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What

These 29 exports were NotImplemented stubs. In the firmware modules (system/common/lib/<library>.sprx, firmware 13.60, read from disassembly, not measured on a console), each is a single constant return that reads no arguments and makes no IPC call or syscall, so the exports now return the same value. This follows #8303, #8305 and #8307. The names are removed from the pending-declaration lists in each library's debt file.

Library Export NID Offset in the module Firmware body Now
libSceComposite sceCompositorCreateIndirectRenderTarget meXSAmyPBUE 0x6290 mov eax, 0x80d40006; ret 0x80d40006;
libSceComposite sceCompositorDeleteIndirectRenderTarget wCqghwW7vQw 0x62a0 mov eax, 0x80d40006; ret 0x80d40006;
libSceComposite sceCompositorSetIndirectCanvasCommand -zpfGY1n49E 0x1870 xor eax, eax; ret 0
libSceComposite sceCompositorSetIndirectCompositionCommand M6wp6+JUSRI 0x1850 xor eax, eax; ret 0
libSceComposite sceCompositorSetIndirectRenderTargetConfigCommand kZ7Xre07w70 0x1860 xor eax, eax; ret 0
libSceFsInternalForVsh sceFsErriCtl iLxIuu5Xs2A 0xf5f0 mov eax, 0x8002002d; ret 0x8002002d;
libSceFsInternalForVsh sceFsErriGetState -1whCDzGK1E 0x181c0 mov eax, 0x8002002d; ret 0x8002002d;
libSceHttpCache sceHttpCacheDebugSetUrl FME0+DPciaU 0x3a5e0 xor eax, eax; ret 0
libScePlayReady scePlayReadyMemGetStats iktpef6dl3k 0x1db0 mov eax, 0x80004001; ret 0x80004001;
libSceSdma sceSdmaInitialize Xc+bwbBPK00 0x26b0 xor eax, eax; ret 0
libSceSdma sceSdmaFinalize mNFbFFiI-7A 0x2960 xor eax, eax; ret 0
libSceSdma sceSdmaQueryWorkingBufferSize 1FH-82oV3PY 0xd0 mov eax, 0x8000; ret 0x8000;
libSceSdma sceSdmaFlushAllWithEvent uHobIZSa1dI 0x2ab0 mov eax, 0x809900c9; ret 0x809900c9;
libSceSdma sceSdmaWaitForEvent rzfOSPn1w7k 0x2ac0 mov eax, 0x809900c9; ret 0x809900c9;
libSceSsl CRYPTO_uninitAsymmetricKey cW7VCIMCh9A 0x38d0 xor eax, eax; ret 0
libSceSsl VLONG_freeVlongQueue wcVuyTUr5ys 0x38e0 xor eax, eax; ret 0
libSceVisionManager sceVisionManagerOpen wzr6GTOo9Dw 0x162b0 mov eax, 0x80e70004; ret 0x80e70004;
libSceVisionManager sceVisionManagerClose P9+90HStC44 0x162c0 mov eax, 0x80e70004; ret 0x80e70004;
libSceVisionManager sceVisionManagerRequestFindUser F8aomqtpD98 0x16600 mov eax, 0x80e70004; ret 0x80e70004;
libSceVisionManager sceVisionManagerRequestFindUserInRegion iBbwD8vxSEk 0x16620 mov eax, 0x80e70004; ret 0x80e70004;
libSceVisionManager sceVisionManagerRequestFindUserWithoutIdentify CZgPsIdPqSk 0x165c0 mov eax, 0x80e70004; ret 0x80e70004;
libSceVisionManager sceVisionManagerRequestRegisterUserInRegion -RJmkkuBhaY 0x165e0 mov eax, 0x80e70004; ret 0x80e70004;
libSceVisionManager sceVisionManagerGetResultOfFindUser Nuhv71YjC+g 0x16610 mov eax, 0x80e70004; ret 0x80e70004;
libSceVisionManager sceVisionManagerGetResultOfFindUserInRegion Gop3lku7E+Q 0x16630 mov eax, 0x80e70004; ret 0x80e70004;
libSceVisionManager sceVisionManagerGetResultOfFindUserWithoutIdentify ES+vLK-z0+U 0x165d0 mov eax, 0x80e70004; ret 0x80e70004;
libSceVisionManager sceVisionManagerGetResultOfRegisterUserInRegion GYamKe-3LbY 0x165f0 mov eax, 0x80e70004; ret 0x80e70004;
libSceVisionManager sceVisionManagerLoadSettings l9zev-ybPNs 0x178a0 xor eax, eax; ret 0
libmdbg_syscore sceDebugGetProcessEventCntlFlag Zi+rAm6czUg 0x4af0 mov eax, 1; ret 1;
libmdbg_syscore sceDebugSetProcessEventCntlFlag --I4Ml0ADxQ 0x4b00 mov eax, 1; ret 1;

Left out:

Tested

Linux (CachyOS, GCC), merged with current main: the eight libraries build. The new guest_firmware_constant_returns test (core/libs/tests/GuestFirmwareConstantReturns.cpp) calls all 29 exports and checks each exact return; it passes, as do the 10 existing tests matching these libraries' names. check_conventions passes. pr_overlap could not compare #6039, #8541, #8951 and #9137; I checked their hunks by hand, and none touches these functions or the debt lines edited here. No title was run.

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

🤖 Generated with Claude Code

https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Progress report (4017310 → f2f5267)

📈 System libraries: 49.84% (+0.23%, +29 implemented functions)

✅ 29 implemented
Library Name
libSceComposite sceCompositorCreateIndirectRenderTarget
libSceComposite sceCompositorDeleteIndirectRenderTarget
libSceComposite sceCompositorSetIndirectCanvasCommand
libSceComposite sceCompositorSetIndirectCompositionCommand
libSceComposite sceCompositorSetIndirectRenderTargetConfigCommand
libSceFsInternalForVsh sceFsErriCtl
libSceFsInternalForVsh sceFsErriGetState
libSceHttpCache sceHttpCacheDebugSetUrl
libScePlayReady scePlayReadyMemGetStats
libSceSdma sceSdmaFinalize
libSceSdma sceSdmaFlushAllWithEvent
libSceSdma sceSdmaInitialize
libSceSdma sceSdmaQueryWorkingBufferSize
libSceSdma sceSdmaWaitForEvent
libSceSsl CRYPTO_uninitAsymmetricKey
libSceSsl VLONG_freeVlongQueue
libSceVisionManager sceVisionManagerClose
libSceVisionManager sceVisionManagerGetResultOfFindUser
libSceVisionManager sceVisionManagerGetResultOfFindUserInRegion
libSceVisionManager sceVisionManagerGetResultOfFindUserWithoutIdentify
libSceVisionManager sceVisionManagerGetResultOfRegisterUserInRegion
libSceVisionManager sceVisionManagerLoadSettings
libSceVisionManager sceVisionManagerOpen
libSceVisionManager sceVisionManagerRequestFindUser
libSceVisionManager sceVisionManagerRequestFindUserInRegion
libSceVisionManager sceVisionManagerRequestFindUserWithoutIdentify
libSceVisionManager sceVisionManagerRequestRegisterUserInRegion
libmdbg_syscore sceDebugGetProcessEventCntlFlag
libmdbg_syscore sceDebugSetProcessEventCntlFlag
⚪ 12 behaviourally empty (constant return or throw)
Library Name
libSceComposite sceCompositorSetIndirectCanvasCommand
libSceComposite sceCompositorSetIndirectCompositionCommand
libSceComposite sceCompositorSetIndirectRenderTargetConfigCommand
libSceHttpCache sceHttpCacheDebugSetUrl
libSceSdma sceSdmaFinalize
libSceSdma sceSdmaInitialize
libSceSdma sceSdmaQueryWorkingBufferSize
libSceSsl CRYPTO_uninitAsymmetricKey
libSceSsl VLONG_freeVlongQueue
libSceVisionManager sceVisionManagerLoadSettings
libmdbg_syscore sceDebugGetProcessEventCntlFlag
libmdbg_syscore sceDebugSetProcessEventCntlFlag

Changed libraries (implemented exports)

Library Before After Change
libmdbg_syscore 0/143 (0.00%) 2/143 (1.40%) +1.40 pp
libSceComposite 0/78 (0.00%) 5/78 (6.41%) +6.41 pp
libSceFsInternalForVsh 0/176 (0.00%) 2/176 (1.14%) +1.14 pp
libSceHttpCache 2/27 (7.41%) 3/27 (11.11%) +3.70 pp
libScePlayReady 0/50 (0.00%) 1/50 (2.00%) +2.00 pp
libSceSdma 0/26 (0.00%) 5/26 (19.23%) +19.23 pp
libSceSsl 33/55 (60.00%) 35/55 (63.64%) +3.64 pp
libSceVisionManager 0/56 (0.00%) 11/56 (19.64%) +19.64 pp

@github-actions

github-actions Bot commented Oct 21, 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 5021 core/libs/CMakeLists.txt
PR 6039 docs/dev/debt/libSceSsl.md
PR 7201 core/libs/CMakeLists.txt
PR 7275 core/libs/CMakeLists.txt
PR 7780 core/libs/CMakeLists.txt
PR 8285 core/libs/CMakeLists.txt
PR 8650 core/libs/CMakeLists.txt
PR 9284 core/libs/CMakeLists.txt
PR 9293 core/libs/CMakeLists.txt
PR 9297 core/libs/CMakeLists.txt
PR 9302 core/libs/CMakeLists.txt
PR 9535 core/libs/CMakeLists.txt
PR 9536 core/libs/CMakeLists.txt
PR 9571 core/libs/CMakeLists.txt
PR 9822 core/libs/prx/libSceSsl/Export.cpp
PR 9826 core/libs/prx/libSceSsl/Export.cpp
PR 10167 core/libs/prx/libSceSsl/Export.cpp

@github-actions github-actions Bot added docs prx needs rebase Conflicts with main, rebase needed labels Oct 21, 2026
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 22, 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.

Review

The implementations are small and consistent with the stated firmware behavior. I did not find a source-level defect in the constant returns. I’m requesting changes because the submitted test counts do not exercise these new exports, and the firmware evidence is not yet specific enough to verify all 29 values.

Direct regression coverage

I searched core/libs/tests for the 29 export names in this change and found no direct references. The reported 24 library tests passing therefore do not demonstrate that these functions now return the claimed values.

Please add focused assertions that call each export and check its return constant (grouping them by library is fine). This will also ensure the changed definitions are linked and callable. Please rerun those tests after updating the branch.

Firmware evidence

The description identifies firmware 12.00 and says these bodies were read from disassembly, but the table only provides the inferred instruction shape and result. Please add concise verification context for each group (module and function offsets or an attached disassembly excerpt) so reviewers can check the 29 constant-return claims. The debt notes should continue to say these behaviors have not been measured on console.

Base and overlap

The head is 104 commits behind current main; the three-way merge check is clean, but CONTRIBUTING asks branches to stay up to date. Please rebase/update before merge and rerun the focused library tests.

The overlap report lists #6039 in docs/dev/debt/libSceSsl.md. I checked its hunk: it edits a separate entry, so I found no dependency or merge-order issue there. The other overlap PRs you checked are likewise described as separate hunks.

Checks

  • git diff --check against current main: passed.
  • Current conventions check: zero errors (five debt-length warnings in touched library debt files); hosted conventions, eligibility, labels, and report jobs passed.
  • Hosted Linux, Windows, register-context, relinker, ASan relinker, and write-watch jobs were skipped.
  • I did not build or run the library tests locally in this session. The 24 passing results in the description are author-reported and were run on the earlier base.

The firmware-derived return values are a reasonable implementation direction; direct tests and reviewable source evidence are still needed before approval.

@BunnyFl

BunnyFl commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Checked these 29 against firmware 13.42 as well: each is the same constant return as in your description, and the code returns those values.

AI-assisted: yes (Claude Code)

@hypermoist

Copy link
Copy Markdown
Contributor Author

@MarcZX10 thanks, all three addressed:

  • Tests: guest_firmware_constant_returns (core/libs/tests/GuestFirmwareConstantReturns.cpp, registered in core/libs/CMakeLists.txt with the Windows DLL paths of all eight libraries) calls each of the 29 exports and checks its exact return, grouped by library. It passes on Linux, as do the existing tests for those libraries.
  • Evidence: the description table now gives each export's NID and function offset in its .sprx (firmware 12.00) next to its body. It still says the values are read from disassembly and not measured on a console, and the debt files don't claim otherwise.
  • Base: I merged current main (7b1c9ca) before running the tests.

@github-actions github-actions Bot added the build label Oct 22, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 23, 2026
@hypermoist

Copy link
Copy Markdown
Contributor Author

Merged main (ea8fb12) to clear the core/libs/CMakeLists.txt conflict, keeping the constant-returns test after main's new barrier and pthread tests. Rebuilt fresh: guest_firmware_constant_returns passes on Linux and under Wine (WinLibs 15.2), and all eight patched .prx files build.

Assisted With AI: Yes But all test done locally on actual hardware

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

Copy link
Copy Markdown
Contributor Author

Correction: I mislabelled the firmware. The decrypted modules I read are firmware 13.60, not 12.00 (each module's module-param segment records SDK 13.60). The behaviour described is unchanged; only the version label was wrong. I've updated the description.

Assisted With AI: Yes But all test done locally on actual hardware

@adriadam10 adriadam10 self-assigned this Oct 25, 2026
@adriadam10
adriadam10 dismissed MarcZX10’s stale review October 25, 2026 10:26

Dismissing a stale review: the requested changes were addressed after it (new head) and the merge queue blocks on it. Please request changes again if anything is still open.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 25, 2026
hypermist and others added 4 commits October 25, 2026 14:16
…s not implement

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
… test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt returns

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@adriadam10
adriadam10 force-pushed the fix/libs-firmware-constants-4 branch from 360f184 to f2f5267 Compare October 25, 2026 13:20
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 25, 2026
@adriadam10
adriadam10 merged commit 5949d8b into boykopovar:main Oct 25, 2026
10 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator
  • Rebased onto current main: resolved the core/libs/CMakeLists.txt test-block conflict (both blocks kept) and the libSceHttpCache debt conflict (main now returns zero from sceHttpCacheSystemSendStatistics/sceHttpCacheSystemTerm; sceHttpCacheDebugSetUrl joins that line and leaves the pending list).
  • guest_firmware_constant_returns still pins all 29 values; core/libs tests pass on the rebased head; merged.

@zaryabzip

Copy link
Copy Markdown
Contributor

@hypermoist Some exports your sweeps measured as fixed returns but left out still throw on main, and the reasons for leaving them out have gone:

Would you like to take them? If not, could you post the value each one returns, and the firmware you read it on? Then I'll put them in a small PR citing your reading.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants