Skip to content

test(libkernel): cover sceKernelSendNotificationRequest request validation - #12907

Closed
legendary-cookie wants to merge 1 commit into
boykopovar:mainfrom
legendary-cookie:test/kernel-notification-request
Closed

legendary-cookie wants to merge 1 commit into
boykopovar:mainfrom
legendary-cookie:test/kernel-notification-request

Conversation

@legendary-cookie

Copy link
Copy Markdown
Contributor

What

Adds TestNotificationRequest to GuestFilesystem.cpp, where sceKernelDebugOutText from the same Notification.cpp is tested. With a 3120-byte request: sizes 3119 and 3121, device -1 and a message with no terminator in its 1024 bytes return 0x80020016; a null request returns 0x8002000e; device 1, flags 1, type 1 and a non-zero byte 44 return 0x8002002d; and a type-0 request with a short message at offset 45 returns 0.

Source: the request layout (type at 0, an icon flag at 44, a 1024-byte message at 45, 3120 bytes) follows OpenOrbis' OrbisNotificationRequest. The error codes have no source, so a new entry under Unknown function info in docs/dev/debt/libkernel.md records the layout's origin, that only a plain-text request is shown, and that the codes are not measured.

Tested

Windows 11, WinLibs GCC 15.2.0 UCRT r7 (the CI toolchain), Release, BUILD_TESTING=ON, on main 9513717: ctest -R ^guest_filesystem$ passes, and the 12 filesystem, Hmd2 and AudioOut2 tests pass with this branch applied together with the other two opened alongside it. Mutation-checked: accepting a larger size, a null request returning another code, ignoring the flags or the icon byte, or another code for an unterminated message, each makes the test fail. tools/check_conventions.py --base origin/main passes; tools/pr_overlap.py reports no overlap. Not run on Linux or macOS.

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, OpenAI Codex)

🤖 Generated with Claude Code

…ation

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

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

Reviewed — changes requested

The new tests pin exact request-layout and error-code behavior that the PR's own debt entry says is not measured or sourced for PS5.

What I ran

  • Reviewed head 159b22e683e0d096d9e5b0211e04c7c81a1d1271 against current main bb04a4f1ea0175e9e4f149f0359a764d62ff3296.
  • Current-main merge preview: clean, tree 0d2781914e37f43a1801edd14cc94251cb2777ce.
  • Environment: Debian GNU/Linux 12, Python 3.11.2, Git 2.39.5. No C++ test or build was run locally.
  • Commands:
git merge-tree --write-tree upstream/main upstream/pr-12907
python3 tools/check_conventions.py --base upstream/main --head upstream/pr-12907
git diff --check upstream/main...upstream/pr-12907
gh pr checks 12907 --repo boykopovar/AnyPS5

Results

Check Result
Current-main merge preview Clean; tree 0d2781914e37f43a1801edd14cc94251cb2777ce
Conventions Passed
Diff check Passed; no output
Hosted policy checks Pending
Focused C++ suite Not run locally; the PR description reports Windows test results
Unedited output
All conventions checks passed.
0d2781914e37f43a1801edd14cc94251cb2777ce

git diff --check produced no output and exited successfully.

conventions	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/40886796453/job/123492583058
eligibility	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/40886796895/job/123492582511
intake	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/40886796763/job/123492584336
labels	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/40886796637/job/123492583755

Negative control

Assertion Change to code under test Result
Exact size, pointer, device, flags, type, icon-field, and message-termination outcomes in TestNotificationRequest Not mutated locally Not independently exercised; the author reports mutations for size, null handling, flags/icon, and unterminated-message behavior, but the results are author-reported.

Findings

Blocking

TestNotificationRequest asserts exact return codes for invalid sizes, a null pointer, unsupported device/flags/type/icon values, and an unterminated message, as well as a 3120-byte request layout. The PR's own debt entry says the error codes have no source and the layout comes from OpenOrbis' PS4 OrbisNotificationRequest; neither is measured on a PS5. These tests would make those assumptions durable as expected PS5 behavior. Please provide evidence for the PS5 layout and error results, or omit the assertions that pin unmeasured behavior until such evidence is available.

Non-blocking

The PR reports a passing Windows guest_filesystem run and mutation checks; these are author-reported, not reproduced here. The cited OpenOrbis header documents a PS4 request type and does not establish PS5 error-code behavior.

Sources

Not verified

I did not run the C++ suite, a Linux/macOS build, or a PS5 firmware/console measurement. Hosted policy checks were pending.

To get this to a good state

Provide PS5-specific evidence for the request layout and each asserted error result, or remove the unmeasured assertions from this test-only change. I will rerun the same merge and convention checks and the focused test on the updated head.

@github-actions

github-actions Bot commented Oct 29, 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 9199 docs/dev/debt/libkernel.md L24-25

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 4630 docs/dev/debt/libkernel.md
PR 5021 docs/dev/debt/libkernel.md
PR 6149 docs/dev/debt/libkernel.md
PR 6936 docs/dev/debt/libkernel.md
PR 7088 docs/dev/debt/libkernel.md
PR 7105 docs/dev/debt/libkernel.md
PR 7121 docs/dev/debt/libkernel.md
PR 7135 docs/dev/debt/libkernel.md
PR 7149 docs/dev/debt/libkernel.md
PR 7192 docs/dev/debt/libkernel.md
PR 7447 docs/dev/debt/libkernel.md
PR 7464 docs/dev/debt/libkernel.md
PR 7509 docs/dev/debt/libkernel.md
PR 7804 docs/dev/debt/libkernel.md
PR 8605 docs/dev/debt/libkernel.md
PR 9156 docs/dev/debt/libkernel.md
PR 9242 docs/dev/debt/libkernel.md
PR 9293 docs/dev/debt/libkernel.md
PR 9297 docs/dev/debt/libkernel.md
PR 9302 docs/dev/debt/libkernel.md
PR 9326 docs/dev/debt/libkernel.md
PR 9371 core/libs/tests/GuestFilesystem.cpp
PR 9389 docs/dev/debt/libkernel.md
PR 9557 docs/dev/debt/libkernel.md
PR 9566 docs/dev/debt/libkernel.md
PR 10442 docs/dev/debt/libkernel.md
PR 10620 core/libs/tests/GuestFilesystem.cpp
PR 10645 docs/dev/debt/libkernel.md
PR 10749 docs/dev/debt/libkernel.md
PR 11002 docs/dev/debt/libkernel.md
PR 11215 docs/dev/debt/libkernel.md
PR 11625 docs/dev/debt/libkernel.md
PR 12560 core/libs/tests/GuestFilesystem.cpp
docs/dev/debt/libkernel.md

@adriadam10 adriadam10 self-assigned this Oct 29, 2026
@JJenkx

JJenkx commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Windows run of this head (159b22e683), merged onto main bb04a4f1ea (clean merge, local only). Windows 11 Enterprise 10.0.22621, WinLibs GCC 15.2.0 UCRT r7, Ninja, Release, BUILD_TESTING=ON, no Vulkan driver visible.

  • The new TestNotificationRequest() runs first in main() and passes. Every sceKernelSendNotificationRequest check holds.
  • guest_filesystem as a whole fails later, at a check that fails the same way on main without this PR. I patched Check locally to record the line: merged-file line 1579, unlink_nid_postfix(danglingDirectoryLink...) == 0, guest errno 13. That's a pre-existing failure on this Windows build (22621; the CI image, 26100, doesn't hit it), fixed separately in fix(libkernel): unlink a dangling Windows directory link #12820, and unrelated to this PR.
  • This PR changes tests only, so there is no source to revert for a negative control.

AI-assisted: yes (Claude Code).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants