feat(libkernel): implement sceKernelAioPollRequests #2118

Merged
rozbh merged 1 commit from upstream-pr/2118 into main 2026-10-09 21:59:30 +00:00
rozbh commented 2026-10-09 09:16:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by rozbh on 2026-10-09T09:16:41Z.


What

Implement sceKernelAioPollRequests(id[], num, state[]) in libkernel, replacing the NotImplemented_nid_no_patch stub. It copies the current state of every id into state without waiting.

Validation reuses ValidateIds, shared with sceKernelAioWaitRequests: null id or state returns EFAULT, a negative count or an invalid id returns EINVAL before any state is written, more than 128 ids throws. The signature follows shadPS4. The function is added to the existing AIO entry in TechnicalDebt; console behaviour is unverified.

GuestAio.cpp covers completed, aborted and cancelled states, the error codes, untouched output on invalid ids and on num == 0, and the 128-id limit.

Tested

  • Manjaro Linux, GCC 16.2.1: ctest -R '^guest_aio$' --repeat until-fail:3 passed 3/3.
  • Before this change (stub from main), the new checks fail with sceKernelAioPollRequests not implemented; with it they pass.
  • Full ctest with -DANYPS5_ENABLE_SPIRV_TOOLS=ON: 502/504 passed. agc_shader_fusion and agc_driver do not build locally on main either (spirv/unified1/spirv.hpp not found); unrelated to this change.
  • python3 tools/check_conventions.py --base origin/main passed.
  • No title tested.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4798477402 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2118). Originally posted by [rozbh](https://github.com/rozbh) on 2026-10-09T09:16:41Z. --- ### What Implement `sceKernelAioPollRequests(id[], num, state[])` in libkernel, replacing the `NotImplemented_nid_no_patch` stub. It copies the current state of every id into `state` without waiting. Validation reuses `ValidateIds`, shared with `sceKernelAioWaitRequests`: null `id` or `state` returns `EFAULT`, a negative count or an invalid id returns `EINVAL` before any state is written, more than 128 ids throws. The signature follows [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/kernel/aio.cpp). The function is added to the existing AIO entry in TechnicalDebt; console behaviour is unverified. `GuestAio.cpp` covers completed, aborted and cancelled states, the error codes, untouched output on invalid ids and on `num == 0`, and the 128-id limit. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. --> - Manjaro Linux, GCC 16.2.1: `ctest -R '^guest_aio$' --repeat until-fail:3` passed 3/3. - Before this change (stub from `main`), the new checks fail with `sceKernelAioPollRequests not implemented`; with it they pass. - Full `ctest` with `-DANYPS5_ENABLE_SPIRV_TOOLS=ON`: 502/504 passed. `agc_shader_fusion` and `agc_driver` do not build locally on `main` either (`spirv/unified1/spirv.hpp` not found); unrelated to this change. - `python3 tools/check_conventions.py --base origin/main` passed. - No title tested. ### 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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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] AI-assisted: yes
MarcZX10 commented 2026-10-09 09:50:34 +00:00 (Migrated from github.com)

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


I compared the full diffs of #2118 and #2120: they implement the same sceKernelAioPollRequests export and overlap in GuestAio.cpp/TechnicalDebt. #2118 has the more complete boundary coverage, including rejection of 129 IDs, so I recommend #2118 as canonical and #2120 as duplicate. Both still target d9484c71; current main is 745b775e2d883c68560b2d87f4ab96a01e221ccf. Please rebase #2118 and rerun its checks if retaining it. No full upstream Build is reported; the project requires a collaborator-triggered Build.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6078534005 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2118#issuecomment-6078534005). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T09:50:34Z. --- I compared the full diffs of #2118 and #2120: they implement the same `sceKernelAioPollRequests` export and overlap in `GuestAio.cpp`/TechnicalDebt. #2118 has the more complete boundary coverage, including rejection of 129 IDs, so I recommend #2118 as canonical and #2120 as duplicate. Both still target `d9484c71`; current `main` is `745b775e2d883c68560b2d87f4ab96a01e221ccf`. Please rebase #2118 and rerun its checks if retaining it. No full upstream Build is reported; the project requires a collaborator-triggered Build.
popcoder565 commented 2026-10-09 15:46:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T15:46:43Z.


Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head fde15390, merged onto main d70b8998 in one build with 38 other PRs that had no Windows run.

  • This PR's tests pass: guest_aio. None of them reported skipping a case.
  • Full ctest in that build: 519 of 519. That needed local fixes to three other PRs in the batch that don't build or pass on Windows: #1611, #1796 and #1824 (reported there).

No title was run.

🤖 Addressed by Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6084276267 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2118#issuecomment-6084276267). Originally posted by [popcoder565](https://github.com/popcoder565) on 2026-10-09T15:46:43Z. --- Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head `fde15390`, merged onto `main` d70b8998 in one build with 38 other PRs that had no Windows run. - This PR's tests pass: `guest_aio`. None of them reported skipping a case. - Full ctest in that build: 519 of 519. That needed local fixes to three other PRs in the batch that don't build or pass on Windows: #1611, #1796 and #1824 (reported there). No title was run. _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
adriadam10 commented 2026-10-09 21:59:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-09T21:59:26Z.


Checked build + ctest on top of current main (530/530, guest_aio passes), and the new checks fail against the stub from main. Semantics match shadPS4 (EFAULT on null state, states copied without waiting) with the same validation as sceKernelAioWaitRequests; the TechnicalDebt entry is updated. Windows run by @popcoder565 also passes. Merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6089956924 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2118#issuecomment-6089956924). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-09T21:59:26Z. --- Checked build + ctest on top of current main (530/530, `guest_aio` passes), and the new checks fail against the stub from main. Semantics match shadPS4 (EFAULT on null `state`, states copied without waiting) with the same validation as `sceKernelAioWaitRequests`; the TechnicalDebt entry is updated. Windows run by @popcoder565 also passes. Merging.
github-actions[bot] commented 2026-10-09 22:17:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T22:17:46Z.


Progress report (8b393b6 → 4f16f7c)

📈 System libraries: 84.72% (+0.03%, +1 implemented functions)

✅ 1 implemented
Library Name
libkernel sceKernelAioPollRequests
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6090177976 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2118#issuecomment-6090177976). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-09T22:17:46Z. --- <!-- progress-report --> ### Progress report (8b393b6 → 4f16f7c) 📈 **System libraries**: 84.72% (+0.03%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libkernel | `sceKernelAioPollRequests` | </details>
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!2118
No description provided.