Repository navigation
test(libScePad): pin special-port zeroing in scePadGetExtControllerInformation - #21765
Conversation
|
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.
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.
|
|
@mrvlajnic two things before this can be reviewed. The Conventions check fails on the description: the The change itself, a checked |
5370b8a to
fad4cd0
Compare
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against fad4cd08fe:
- Conventions:
tools/check_conventions.pypassed. - Build:
guest_pad_testsbuilt cleanly. - CTest (
guest_pad):1/1 Test #4620: guest_pad ........................ Passed 5.50 sec 100% tests passed, 0 tests failed out of 1 - Negative control: the tests still pass with the change reverted, so they do not cover it
Requesting changes for the points above.
|
Windows result for head Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release,
AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
fad4cd0 to
cf3031b
Compare
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against cf3031bd85:
- Conventions:
tools/check_conventions.pypassed. - Build:
guest_pad_testsbuilt cleanly. - CTest (
guest_pad):1/1 Test #4814: guest_pad ........................ Passed 4.95 sec 100% tests passed, 0 tests failed out of 1 - Negative control: the tests still pass with the change reverted, so they do not cover it
Requesting changes for the points above.
|
Tested
AI-assisted: yes (Claude Code); the runs are automated, this summary was written from their reports. |
|
Retested head Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release,
AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
|
I read the diff against main. In Export.cpp the change only renames zeroed to zero and restructures the return. Main already does a checked 0x2c GuestCopyOut of zeros, keeps errno, and returns INVALID_ARG on failure, so behaviour is identical and there is no game effect. The new tests pass with the change reverted (PrivacyOnion's negative control), and the body says "Tested: Not tested" while adding tests. Please drop the Export.cpp rename and restructure; the special-port test can stay if you want it as a pin of the existing behaviour, with the Tested line corrected. PR 5038 also touches libScePad Export.cpp and the debt doc, so please check it for overlap. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The change is sound at head cf3031bd8566bd22c1dd85bc5fd294248130e2cb; no checks were run, and the changed implementation, test, and documentation were read.
What I ran
No commands or tests were run. The PR description reports that it was not tested.
Results
| Check | Result | Note |
|---|---|---|
| Code review | passed | All three changed files read |
| Tests | not run | No runtime behavior exercised |
Findings
Blocking
None.
Non-blocking
None.
Sources
The special-handle path copies 0x2c zero bytes with GuestCopyOut_nid_no_patch, restores errno, and returns PAD_ERROR_INVALID_ARG if copying fails (core/libs/prx/libScePad/Export.cpp:291-296). The added test checks zeroing, preservation of trailing bytes, unwritable-pointer handling, and errno preservation (core/libs/tests/GuestPad.cpp:248-257).
Not verified
No tests or builds were run, and physical-console behavior was not verified. The prepared manifest lists three changed files, all included; each was read. No excluded files were provided for review.
To get this to a good state
Nothing is required.
|
Tested head Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release,
Whole batch: the full This is one combined tree, not a run of this PR alone. AI-assisted: yes (Claude Code) |
cf3031b to
584cbec
Compare
|
Reworked as a test-only PR at
Overlap check: #5038 changes VR functions and a different debt entry, and #16288 adds a touchpad test earlier in the same file; neither touches Thanks to @PrivacyOnion for the negative control — it is now the point of the PR rather than a contradiction: the test pins what |
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 584cbecc5c:
- Conventions:
tools/check_conventions.pypassed. - Build:
guest_pad_testsbuilt cleanly. - CTest (
guest_pad):1/1 Test #5201: guest_pad ........................ Passed 4.85 sec 100% tests passed, 0 tests failed out of 1 - Code reading:
- Verified core/libs/tests/GuestPad.cpp:442-451 opens PAD_PORT_TYPE_SPECIAL (0x20000099), checks handle validity with Require(special > 0), and ensures cleanup with scePadClose_nid_postfix(special).
- Verified 0x2c zero-fill assertion and verified that trailing bytes ([0x2c, extended.size()) remain untouched at sentinel value 0x5a in extended buffer.
- Verified error-handling and errno preservation when passing unwritable guest pointer 0x10, returning PAD_ERROR_INVALID_ARG and preserving errno == 71.
- Verified AGENTS.md compliance: no comments added, no debt file modifications needed for test-only PR, conventions gate passed.
Looks Good To Me
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The added test assertions match the implementation and existing coverage for special-port output zeroing and invalid guest pointers; no blocking defect was identified.
What I ran
Reviewed head 584cbecc5c4554bf4fc131375af3ed9aace0ef06; no commands or tests were run.
Results
| Check | Result | Note |
|---|---|---|
| Diff and targeted code review | passed | One changed test file |
| Build and test execution | not run | No local execution performed |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The build, test suite, and platform-specific behavior were not verified. Read core/libs/tests/GuestPad.cpp, core/libs/prx/libScePad/Export.cpp, core/libs/tests/GuestPadControllerInfoCapabilitiesBounds.cpp, and core/libs/tests/GuestPadQueryGuestPointers.cpp. The bundle lists only core/libs/tests/GuestPad.cpp as reviewed; it was included in manifest.json. No excluded changed files were listed.
To get this to a good state
Nothing is required.
What
Test-only change; the
Export.cpprename/restructure and the directdocs/dev/debt/libScePad.mdedit from earlier revisions are dropped.mainalready zeroes the special-port output through a checkedGuestCopyOut_nid_no_patchof a 0x2c block, restoreserrnoand returnsPAD_ERROR_INVALID_ARGfor an unwritable pointer, so this PR pins that behaviour inCheckExtControllerInformation(core/libs/tests/GuestPad.cpp):0x20000099, fills the 0x2c-byte output with0x5a, and checks that a successful call zeroes exactly the first 0x2c bytes and leaves the tail untouched;0x10as the output pointer returnsPAD_ERROR_INVALID_ARGand leaveserrnoat 71;No implementation file changes; the debt files are untouched (a test-only PR makes no behavioural claim, and entries are edited only through fragments).
Tested
main851212fb98; the whole diff is 10 added lines incore/libs/tests/GuestPad.cpp, andpython tools/check_conventions.py --base origin/main --head HEADpasses.cf3031bd85: @maskym reportedguest_pad3/3 on Windows 11 (i7-12700K, WinLibs GCC 15.2.0), @ycbuzi's full-suite runs passed on Windows Server 2022/2025, and @kiwe147 built it in a 30-PR batch on Windows 11.libexec/gcc/.../cc1plus.exe, so no C++ compilation can run here. The added lines are byte-identical to the ones those runs exercised.mainby construction (the negative control @PrivacyOnion ran is the same observation).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)