feat(libScePad): answer the tracker DualShock 4, Blaster and Move queries #9664

Merged
krishalivaibhav merged 1 commit from upstream-pr/9664 into main 2026-10-23 00:01:08 +00:00
krishalivaibhav commented 2026-10-22 07:26:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by krishalivaibhav on 2026-10-22T07:26:31Z.


What

scePadIsDS4Connected, scePadIsBlasterConnected and scePadIsMoveConnected threw not implemented. They now return false for any handle.

  • Why false: the library reports one DualSense to every title (see the Touchpad resolution entry in docs/dev/debt/libScePad.md). So no DualShock 4, Blaster or Move controller is ever behind a handle.
  • Signatures: bool (int32_t handle), as already declared in Export.cpp.
  • Unverified: the console's answer for an invalid handle is not measured. This is recorded as a new entry under Unknown function info in docs/dev/debt/libScePad.md.
  • Overlap: open #5038, #6337, #7064, #7881, #7965, #8260, #8350 and #9178 also change libScePad/Export.cpp, GuestPad.cpp or the debt file, but none of them touches these three functions. tools/pr_overlap.py could not finish here: fetching every open PR's refs filled the disk twice. I checked each of those PR diffs by hand instead.

Tested

Linux: Ubuntu x86-64 chroot in a Lima VM on macOS (Apple Silicon), at 81ae747ac on main d6eafa54d. I built guest_pad_tests and guest_pad_vibration_mode_tests and ran ctest -R '^guest_pad': 2/2 pass.

guest_pad now runs CheckTrackerDevices(). It calls each of the three functions with the open handle and with an invalid one and requires false. On main the first call throws not implemented, so the test fails there.

tools/check_conventions.py --base origin/main passes. tools/progress.py goes from 4,834 to 4,837 done functions out of 11,181 (43.23% to 43.26%).

Windows: not built. 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

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4963707012 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9664). Originally posted by [krishalivaibhav](https://github.com/krishalivaibhav) on 2026-10-22T07:26:31Z. --- ### What `scePadIsDS4Connected`, `scePadIsBlasterConnected` and `scePadIsMoveConnected` threw `not implemented`. They now return false for any handle. - **Why false:** the library reports one DualSense to every title (see the Touchpad resolution entry in `docs/dev/debt/libScePad.md`). So no DualShock 4, Blaster or Move controller is ever behind a handle. - **Signatures:** `bool (int32_t handle)`, as already declared in `Export.cpp`. - **Unverified:** the console's answer for an invalid handle is not measured. This is recorded as a new entry under Unknown function info in `docs/dev/debt/libScePad.md`. - **Overlap:** open #5038, #6337, #7064, #7881, #7965, #8260, #8350 and #9178 also change `libScePad/Export.cpp`, `GuestPad.cpp` or the debt file, but none of them touches these three functions. `tools/pr_overlap.py` could not finish here: fetching every open PR's refs filled the disk twice. I checked each of those PR diffs by hand instead. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Linux: Ubuntu x86-64 chroot in a Lima VM on macOS (Apple Silicon), at 81ae747ac on `main` d6eafa54d. I built `guest_pad_tests` and `guest_pad_vibration_mode_tests` and ran `ctest -R '^guest_pad'`: 2/2 pass. `guest_pad` now runs `CheckTrackerDevices()`. It calls each of the three functions with the open handle and with an invalid one and requires false. On `main` the first call throws `not implemented`, so the test fails there. `tools/check_conventions.py --base origin/main` passes. `tools/progress.py` goes from 4,834 to 4,837 done functions out of 11,181 (43.23% to 43.26%). Windows: not built. No title was run. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-22 07:27:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-22T07:27:19Z.


Progress report (d6eafa5 → 81ae747)

📈 System libraries: 43.26% (+0.03%, +3 implemented functions)

✅ 3 implemented
Library Name
libScePad scePadIsBlasterConnected
libScePad scePadIsDS4Connected
libScePad scePadIsMoveConnected
⚪ 3 behaviourally empty (constant return or throw)
Library Name
libScePad scePadIsBlasterConnected
libScePad scePadIsDS4Connected
libScePad scePadIsMoveConnected
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6335242398 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9664#issuecomment-6335242398). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-22T07:27:19Z. --- <!-- progress-report --> ### Progress report (d6eafa5 → 81ae747) 📈 **System libraries**: 43.26% (+0.03%, +3 implemented functions) <details> <summary>✅ 3 implemented</summary> | Library | Name | | - | - | | libScePad | `scePadIsBlasterConnected` | | libScePad | `scePadIsDS4Connected` | | libScePad | `scePadIsMoveConnected` | </details> <details> <summary>⚪ 3 behaviourally empty (constant return or throw)</summary> | Library | Name | | - | - | | libScePad | `scePadIsBlasterConnected` | | libScePad | `scePadIsDS4Connected` | | libScePad | `scePadIsMoveConnected` | </details>
fogydes commented 2026-10-22 08:34:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fogydes on 2026-10-22T08:34:04Z.


Reviewed; this checks out. Answering all three tracker queries with an unconditional false is the only answer consistent with what the module already reports elsewhere: scePadGetInfo_nid_postfix sets slot.deviceType = PAD_DEVICE_TYPE_DUAL_SENSE (Export.cpp:213) and the device-class promotions report PAD_DEVICE_CLASS_STANDARD, and the debt file's Touchpad-resolution entry already records that the library reports one DualSense to every title. So no DualShock 4, Blaster or Move device can ever be behind a handle here, and false for every handle is not an invented value but a consequence of the established pad table. The new debt entry states exactly that and honestly marks the unmeasured part (invalid-handle answer), the signatures were already bool (int32_t) from the pending-export declarations so nothing is invented there either, and the test reuses the file's existing invalid-handle pattern (handle + 1, as in CheckAccessibilityControllerState) with no new registration needed.

Two notes, neither blocking:

  1. The PR body says the pad test run was on Steam Deck only ("deck-only claim") — the Windows CI leg will exercise GuestPad.cpp too, so worth watching its first green run before merge.
  2. The PR body says the 8-PR overlap check was done by hand because pr_overlap.py ran out of disk — a maintainer re-run of python3 tools/pr_overlap.py --branch <branch> would confirm that result cheaply.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6336418955 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9664#issuecomment-6336418955). Originally posted by [fogydes](https://github.com/fogydes) on 2026-10-22T08:34:04Z. --- Reviewed; this checks out. Answering all three tracker queries with an unconditional `false` is the only answer consistent with what the module already reports elsewhere: `scePadGetInfo_nid_postfix` sets `slot.deviceType = PAD_DEVICE_TYPE_DUAL_SENSE` (`Export.cpp:213`) and the device-class promotions report `PAD_DEVICE_CLASS_STANDARD`, and the debt file's Touchpad-resolution entry already records that the library reports one DualSense to every title. So no DualShock 4, Blaster or Move device can ever be behind a handle here, and `false` for every handle is not an invented value but a consequence of the established pad table. The new debt entry states exactly that and honestly marks the unmeasured part (invalid-handle answer), the signatures were already `bool (int32_t)` from the pending-export declarations so nothing is invented there either, and the test reuses the file's existing invalid-handle pattern (`handle + 1`, as in `CheckAccessibilityControllerState`) with no new registration needed. Two notes, neither blocking: 1. The PR body says the pad test run was on Steam Deck only ("deck-only claim") — the Windows CI leg will exercise `GuestPad.cpp` too, so worth watching its first green run before merge. 2. The PR body says the 8-PR overlap check was done by hand because `pr_overlap.py` ran out of disk — a maintainer re-run of `python3 tools/pr_overlap.py --branch <branch>` would confirm that result cheaply.
MarcZX10 commented 2026-10-22 09:07:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T09:07:09Z.

Review: CHANGES_REQUESTED


The unconditional false answers are consistent with the existing emulation, which exposes a single DualSense rather than DS4, Move or Blaster devices. The invalid-handle uncertainty is explicitly documented, and the regression checks both a valid and invalid handle. Exact-head diff-check and conventions pass; hosted eligibility/intake/labels/report pass. Linux/Windows product build jobs are skipped, so the 2/2 guest_pad run is author-reported. The existing open PR overlaps are acknowledged in the description; I did not find a behavior overlap in the listed changes.

I’ve noticed that holding this PR because of #5239 isn’t necessary. It’s fine for PRs to keep coming in; they’ll be handled in due course. Please disregard my earlier request to hold or defer it.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5611771522 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9664#pullrequestreview-5611771522). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T09:07:09Z. **Review:** CHANGES_REQUESTED --- The unconditional `false` answers are consistent with the existing emulation, which exposes a single DualSense rather than DS4, Move or Blaster devices. The invalid-handle uncertainty is explicitly documented, and the regression checks both a valid and invalid handle. Exact-head diff-check and conventions pass; hosted eligibility/intake/labels/report pass. Linux/Windows product build jobs are skipped, so the 2/2 `guest_pad` run is author-reported. The existing open PR overlaps are acknowledged in the description; I did not find a behavior overlap in the listed changes. I’ve noticed that holding this PR because of #5239 isn’t necessary. It’s fine for PRs to keep coming in; they’ll be handled in due course. Please disregard my earlier request to hold or defer it.
krishalivaibhav commented 2026-10-22 09:22:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by krishalivaibhav on 2026-10-22T09:22:47Z.


Thanks @MarcZX10, and @fogydes for the review. That's fair: none of the titles I'm testing reaches these. I checked the original modules of Balatro (PPSA21402), Don't Starve Together (PPSA02070) and Vampire Survivors (PPSA21703) for the NIDs of scePadIsDS4Connected, scePadIsBlasterConnected and scePadIsMoveConnected: none imports them (all three import scePadOpen). I'm converting this to a draft and holding it until a title needs these, and I'll take library work from functions a title actually stops on, with the title ID and log line.

(For the record, the guest_pad runs were in an x86-64 Ubuntu chroot in a Lima VM, not on a Steam Deck.)

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6337337650 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9664#issuecomment-6337337650). Originally posted by [krishalivaibhav](https://github.com/krishalivaibhav) on 2026-10-22T09:22:47Z. --- Thanks @MarcZX10, and @fogydes for the review. That's fair: none of the titles I'm testing reaches these. I checked the original modules of Balatro (PPSA21402), Don't Starve Together (PPSA02070) and Vampire Survivors (PPSA21703) for the NIDs of `scePadIsDS4Connected`, `scePadIsBlasterConnected` and `scePadIsMoveConnected`: none imports them (all three import `scePadOpen`). I'm converting this to a draft and holding it until a title needs these, and I'll take library work from functions a title actually stops on, with the title ID and log line. (For the record, the `guest_pad` runs were in an x86-64 Ubuntu chroot in a Lima VM, not on a Steam Deck.) AI-assisted: yes (Claude Code).
MarcZX10 commented 2026-10-22 14:34:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T14:34:37Z.

Review: APPROVED


Correction: my earlier changes-requested review was based only on the mistaken queue hold tied to #5239. I found no code blocker in this PR; PRs may continue to be submitted and will be handled in due course.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5615928688 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9664#pullrequestreview-5615928688). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T14:34:37Z. **Review:** APPROVED --- Correction: my earlier changes-requested review was based only on the mistaken queue hold tied to #5239. I found no code blocker in this PR; PRs may continue to be submitted and will be handled in due course.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!9664
No description provided.