Skip to content

fix(libSceSysmodule): test and document unknown module ids - #6559

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
Bonjourcestmatt:fix/sysmodule-unknown-id-coverage
Oct 17, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
Bonjourcestmatt:fix/sysmodule-unknown-id-coverage

Conversation

@Bonjourcestmatt

Copy link
Copy Markdown
Contributor

What

sceSysmoduleIsLoaded, sceSysmoduleLoadModule and sceSysmoduleUnloadModule return 0 for a module id missing from kModuleTable (b4db9fd, a2520aa: titles that load or unload such an id aborted otherwise). The behaviour was neither tested nor listed as a silent stub, and two commented-out throw lines were left in the code.

  • Remove the two commented-out throw lines.
  • List the three functions under Silent stubs in docs/dev/debt/libSceSysmodule.md.
  • Test that an id absent from the table succeeds without changing state, and that sceSysmoduleLoadModuleInternal, sceSysmoduleUnloadModuleInternal and sceSysmoduleLoadModuleInternalWithArg still throw for it. The test picks the id from kModuleTable, so it stays valid when ids are added.

No behaviour change.

Tested

  • python3 tools/check_conventions.py --base origin/main: passed.
  • The new check built and run on Windows 11 against Export.cpp in a standalone harness (MinGW GCC 16.1, APS5_VABI neutralized, sceKernelDlsym and dlopen_nid_postfix stubbed): passed.
  • Full CMake build and ctest (guest_sysmodule): not run, the submodules were not fetched and the toolchain is not the documented one.

Checklist

🤖 Generated with Claude Code

sceSysmoduleIsLoaded, sceSysmoduleLoadModule and sceSysmoduleUnloadModule
return success for an id missing from the module table, because titles that
load or unload such an id aborted otherwise (b4db9fd, a2520aa). Nothing
tested or recorded it, and two commented-out throws were left in the code.

Remove the commented-out throws, list the three functions under Silent stubs
in the library's technical debt file, and test that unknown ids succeed
without changing state while the internal variants still throw.

Written with AI assistance (Claude).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6370 docs/dev/debt/libSceSysmodule.md L2

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/prx/libSceSysmodule/Export.cpp
PR 6044 core/libs/tests/GuestSysmodule.cpp
PR 6222 core/libs/prx/libSceSysmodule/Export.cpp

@jotitadev jotitadev 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.

Full build and ctest on Linux, since the description says they were not run.

Ubuntu 26.04, Intel i7-8700, GCC 15.2, Ninja, Release, BUILD_TESTING=ON, full build with submodules. main 31cbb55 with head 3f8337e merged on top.

  • guest_sysmodule and guest_sysmodule_maps_scan pass 3 runs of 3. CheckUnknownIds runs in the real guest_sysmodule_tests binary against the real libSceSysmodule (no harness or stubs).
  • With Export.cpp reverted to main, the test still passes, as expected: the PR only removes the commented-out throw lines, so there is no behaviour change for it to catch.
  • Non-GPU suite (ctest -E "^agc|gpu|vulkan|video_out" -j8): 648/650, same as main on this machine. The 2 failures (file_writer_binary, file_writer_text) also fail on main here.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

…-id-coverage

Keep both sides in GuestSysmodule.cpp (the unknown id check and the Windows
unwind region checks) and in libSceSysmodule.md (Silent stubs and Functional).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@oneandonlydean oneandonlydean self-assigned this Oct 17, 2026
@oneandonlydean
oneandonlydean merged commit fbcaec0 into boykopovar:main Oct 17, 2026
1 check passed
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.

3 participants