Skip to content

fix(libSceSystemGesture): report no touch events for the primitive and recognizer calls - #3174

Merged
adriadam10 merged 3 commits into
boykopovar:mainfrom
adriadam10:carry/system-gesture-no-touch
Oct 11, 2026
Merged

adriadam10 merged 3 commits into
boykopovar:mainfrom
adriadam10:carry/system-gesture-no-touch

Conversation

@adriadam10

Copy link
Copy Markdown
Collaborator

What

Carries @xXPBSXx's branch from #3144 (fix/systemgesture-no-touch-events, commits kept with their authorship). Intake is paused for new contributors, and the issue asks a maintainer to carry it.

Ten libSceSystemGesture exports threw on main. They now follow the no-touch model the file already uses: recognizers exist but never report an event, and handle and pointer arguments are checked.

  • GetPrimitiveTouchEvents and GetTouchEvents report 0 events and leave the buffer untouched.
  • GetPrimitiveTouchEventsCount returns 0.
  • GetPrimitiveTouchEventByIndex returns INDEX_OUT_OF_ARRAY, like GetTouchEventByIndex on main.
  • Append, Remove, Reset and UpdateAll succeed for a valid handle and recognizer, as do ResetPrimitiveTouchRecognizer and UpdateTouchRecognizerRectangle.
  • UpdateTouchRecognizer now returns INVALID_ARGUMENT for a null recognizer, as KytyPS5 does.
  • GetTouchEventByEventID, GetPrimitiveTouchEventByPrimitiveID and GetTouchRecognizerInformation keep throwing. Their not-found code and the information layout aren't settled.

Titles that stop on these on main:

Behaviour follows KytyPS5 (libSystemService.cpp, SystemGesture), except for the error codes. Those stay at the 0x80D1 values this file already uses on main, which @oneandonlydean OK'd on #572. KytyPS5 uses 0x8089 (INVALID_ARGUMENT 0x80890001, INVALID_HANDLE 0x80890006). TechnicalDebt now lists the disagreement, and the no-touch line moved from "Functional" to "Silent stubs".

My commit adds the handle and null checks of Remove/Reset/Update/UpdateTouchRecognizerRectangle to the test.

Tested

Linux (CachyOS), GCC 16, Release.

  • guest_system_gesture passes.
  • On main the first new call throws.
  • Negative checks: each of 21 mutations makes the test fail. Each one removes one handle check, null check or count write.
  • tools/check_conventions.py passes.

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 in TechnicalDebt
  • 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
  • AI-assisted: yes

xXPBSXx and others added 3 commits October 11, 2026 02:01
…d recognizer calls

WIP: the TechnicalDebt entry for the silently successful calls is still missing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…recognizer call

Moves the no-touch line to "Silent stubs" and records the error-code disagreement with KytyPS5.

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

Copy link
Copy Markdown

Progress report (942a174 → 894ef6d)

📈 System libraries: 85.93% (+0.31%, +10 implemented functions)

✅ 10 implemented
Library Name
libSceSystemGesture sceSystemGestureAppendTouchRecognizer
libSceSystemGesture sceSystemGestureGetPrimitiveTouchEventByIndex
libSceSystemGesture sceSystemGestureGetPrimitiveTouchEvents
libSceSystemGesture sceSystemGestureGetPrimitiveTouchEventsCount
libSceSystemGesture sceSystemGestureGetTouchEvents
libSceSystemGesture sceSystemGestureRemoveTouchRecognizer
libSceSystemGesture sceSystemGestureResetPrimitiveTouchRecognizer
libSceSystemGesture sceSystemGestureResetTouchRecognizer
libSceSystemGesture sceSystemGestureUpdateAllTouchRecognizer
libSceSystemGesture sceSystemGestureUpdateTouchRecognizerRectangle

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

The shape of this one is what makes it reviewable: ten exports, each given the answer the file's existing no-touch model gives, and the three that are not settled named as still throwing with the reason they are not. Leaving GetTouchEventByEventID, GetPrimitiveTouchEventByPrimitiveID and GetTouchRecognizerInformation on NotImplemented because their not-found code and information layout are not established is the right call, and saying so is what stops it reading as an oversight.

The negative test is the strongest part, and it is worth saying why. Every handle check, null check and count write in the test has a mutation that removes it and a run that then fails, which demonstrates that a case exists behind each one — the thing a test for a table of behaviours otherwise never establishes. Those runs and the Linux/GCC 16 pass are the author's measurements; what a reviewer can reproduce locally is that the first new call throws on main.

The INDEX_OUT_OF_ARRAY choice is the one worth naming. Having GetPrimitiveTouchEventByIndex return what GetTouchEventByIndex already returns on main, rather than something that seemed more correct, keeps the two recognizer kinds consistent — and INVALID_ARGUMENT for a null recognizer is what KytyPS5 returns for the same call, which is checkable rather than a matter of taste. Both are the right kind of default.

The three that still throw are left throwing deliberately. They keep NotImplemented because their not-found code and information layout are not settled, and throwing is the conventions-compliant state for an unimplemented path — so they belong with the throwing paths, not with the silent stubs that need a debt entry. Nothing further needed.

Written with AI assistance.

@adriadam10
adriadam10 merged commit 343163a into boykopovar:main Oct 11, 2026
15 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator Author

Merged with Linux CI red on three AGC tests (agc_unit_shadow, agc_driver_flat_apertures, agc_driver_image_packed16_load). The main push build at 942a174 (run 38097151664) fails the same three, and nothing in this PR touches AGC. Windows passed, and so did guest_system_gesture on both.

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.

3 participants