test(libSceAudioIn): audit open-ex format bounds, per-path silent state, and buffer guard boundaries #15899

Merged
slopgobblercobbler merged 2 commits from upstream-pr/15899 into main 2026-11-24 17:21:15 +00:00
slopgobblercobbler commented 2026-11-04 22:47:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by slopgobblercobbler on 2026-11-04T22:47:33Z.


What

Audit sceAudioInOpenEx parameter bounds, per-open-path silent states across sceAudioInOpen, sceAudioInOpenEx, sceAudioInHqOpen, sceAudioInHqOpenEx, and sceAudioInAsyncOpen, and input buffer underflow/overflow guard byte integrity in core/libs/tests/GuestAudioIn.cpp.

Tested

  • Standalone guest test guest_audio_in_tests covering open-ex format validation (format 0 S16 mono success, formats 3 and 4 parameter rejection), active port silent state verification, and input buffer boundary guard preservation.
  • Verified conventions via python tools/check_conventions.py --base upstream/main --head HEAD (0 errors).

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5162862768 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15899). Originally posted by [slopgobblercobbler](https://github.com/slopgobblercobbler) on 2026-11-04T22:47:33Z. --- ### What Audit `sceAudioInOpenEx` parameter bounds, per-open-path silent states across `sceAudioInOpen`, `sceAudioInOpenEx`, `sceAudioInHqOpen`, `sceAudioInHqOpenEx`, and `sceAudioInAsyncOpen`, and input buffer underflow/overflow guard byte integrity in `core/libs/tests/GuestAudioIn.cpp`. ### Tested - Standalone guest test `guest_audio_in_tests` covering open-ex format validation (format 0 S16 mono success, formats 3 and 4 parameter rejection), active port silent state verification, and input buffer boundary guard preservation. - Verified conventions via `python tools/check_conventions.py --base upstream/main --head HEAD` (0 errors). ### Checklist - [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
MarcZX10 commented 2026-11-16 23:56:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T23:56:27Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

Changes are required before merge: fix the undefined ReportsNotImplemented calls and correct the invalid-handle checks in the new tests.

What I ran

Reviewed head 09ea35c6887a6e694bd9c8514cacf442df21c47e using repo_read.py reader calls only; no test or build commands were run.

Results

Check Result Note
Diff review passed Both changed files were read.
Build and tests not run No commands were run.

Findings

Blocking

  • core/libs/tests/GuestAudioIn.cpp:94 calls ReportsNotImplemented three times, but the changed test file contains no declaration or definition for it. The project’s test target includes this file directly, so these calls prevent the test executable from compiling. Add the helper (or use an existing helper available to this translation unit).
  • core/libs/tests/GuestAudioIn.cpp:80 and core/libs/tests/GuestAudioIn.cpp:87 assume small integers 1–8 are invalid sceAudioInGetSilentState handles. The implementation validates the handle encoding and then returns AUDIO_IN_ERROR_INVALID_STATE for an unused slot; consequently those assertions expect the wrong error. TestActivePortStates also expects INVALID_HANDLE for unused slot 9 at line 175, while the implementation returns INVALID_STATE. Update the expected errors to match the implementation or use handles with invalid encodings.

Non-blocking

None.

Not verified

No test or build was run. The review bundle’s files.json was not readable through the reader, so its reviewed/excluded classification could not be checked. The prepared bundle lists core/libs/tests/GuestAudioIn.cpp and docs/dev/debt/libSceAudioIn.md as included; both full changed files were read. No other repository files were reviewed.

To get this to a good state

Fix the compile error and the invalid-handle expectations, then run the guest audio input test target.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5930106498 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15899#pullrequestreview-5930106498). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-16T23:56:27Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested Changes are required before merge: fix the undefined `ReportsNotImplemented` calls and correct the invalid-handle checks in the new tests. ## What I ran Reviewed head `09ea35c6887a6e694bd9c8514cacf442df21c47e` using `repo_read.py` reader calls only; no test or build commands were run. ## Results | Check | Result | Note | |---|---|---| | Diff review | passed | Both changed files were read. | | Build and tests | not run | No commands were run. | ## Findings ### Blocking - `core/libs/tests/GuestAudioIn.cpp:94` calls `ReportsNotImplemented` three times, but the changed test file contains no declaration or definition for it. The project’s test target includes this file directly, so these calls prevent the test executable from compiling. Add the helper (or use an existing helper available to this translation unit). - `core/libs/tests/GuestAudioIn.cpp:80` and `core/libs/tests/GuestAudioIn.cpp:87` assume small integers 1–8 are invalid `sceAudioInGetSilentState` handles. The implementation validates the handle encoding and then returns `AUDIO_IN_ERROR_INVALID_STATE` for an unused slot; consequently those assertions expect the wrong error. `TestActivePortStates` also expects `INVALID_HANDLE` for unused slot 9 at line 175, while the implementation returns `INVALID_STATE`. Update the expected errors to match the implementation or use handles with invalid encodings. ### Non-blocking None. ## Not verified No test or build was run. The review bundle’s `files.json` was not readable through the reader, so its reviewed/excluded classification could not be checked. The prepared bundle lists `core/libs/tests/GuestAudioIn.cpp` and `docs/dev/debt/libSceAudioIn.md` as included; both full changed files were read. No other repository files were reviewed. ## To get this to a good state Fix the compile error and the invalid-handle expectations, then run the guest audio input test target.
MarcZX10 commented 2026-11-20 20:25:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T20:25:37Z.

Review: COMMENTED


Reviewed — no blocking findings

The reviewed test changes contain no verified blocking defect; the PR description’s reported test and convention runs were not run during this review.

What I ran

Reviewed head f16031f454d08cc91066619e3785db1249cdb0ad. Read core/libs/tests/GuestAudioIn.cpp and the relevant audio input implementation in core/libs/prx/libSceAudioIn/Export.cpp through repo_read.py.

Results

Check Result Note
Changed test logic passed No concrete defect found
Test execution not run Description reports a standalone test run
Convention check not run Description reports zero errors

Findings

Blocking

None.

Non-blocking

None.

Not verified

The standalone guest_audio_in_tests and convention check were not run. Only core/libs/tests/GuestAudioIn.cpp was read among the changed files; files.json was unavailable through the reader, so the complete reviewed-file set could not be confirmed. Hardware and console behavior were not tested.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5998882601 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15899#pullrequestreview-5998882601). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T20:25:37Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The reviewed test changes contain no verified blocking defect; the PR description’s reported test and convention runs were not run during this review. ## What I ran Reviewed head `f16031f454d08cc91066619e3785db1249cdb0ad`. Read `core/libs/tests/GuestAudioIn.cpp` and the relevant audio input implementation in `core/libs/prx/libSceAudioIn/Export.cpp` through `repo_read.py`. ## Results | Check | Result | Note | |---|---|---| | Changed test logic | passed | No concrete defect found | | Test execution | not run | Description reports a standalone test run | | Convention check | not run | Description reports zero errors | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The standalone `guest_audio_in_tests` and convention check were not run. Only `core/libs/tests/GuestAudioIn.cpp` was read among the changed files; `files.json` was unavailable through the reader, so the complete reviewed-file set could not be confirmed. Hardware and console behavior were not tested. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-22 04:46:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T04:46:24Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this test-only change; no tests were run in this review, and the prepared inputs include the complete changed file.

What I ran

Reviewed head f0b7460688e65ea4e9e3c3984d6ea94f88e366fe from the prepared diff and the pinned head copy of core/libs/tests/GuestAudioIn.cpp. No commands or tests were run.

Results

Check Result Note
Diff and changed test code passed One changed file read in full
Programmatic checks not run No commands run

Findings

Blocking

None.

Non-blocking

None.

Not verified

The standalone guest audio tests and convention check reported in the description were not run or independently confirmed. No files were excluded by the manifest; files.json was not available through the reader. The prepared diff and complete changed file were read.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6010416278 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15899#pullrequestreview-6010416278). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T04:46:24Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this test-only change; no tests were run in this review, and the prepared inputs include the complete changed file. ## What I ran Reviewed head `f0b7460688e65ea4e9e3c3984d6ea94f88e366fe` from the prepared diff and the pinned head copy of `core/libs/tests/GuestAudioIn.cpp`. No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Diff and changed test code | passed | One changed file read in full | | Programmatic checks | not run | No commands run | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The standalone guest audio tests and convention check reported in the description were not run or independently confirmed. No files were excluded by the manifest; `files.json` was not available through the reader. The prepared diff and complete changed file were read. ## To get this to a good state Nothing is required.
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!15899
No description provided.