libkernel: implement sceKernelAioWaitRequests #1109
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1109
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1109/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@NevesHenry on GitHub · 2026-10-06 17:29 UTC · original
NevesHenry:libkernel/aio-wait-requests→main· +81 −28 · 2 files · 1 commits · merged 2026-10-07 00:13 UTCSummary
sceKernelAioWaitRequests(lgK+oIWkJyA) is not registered. A game that waits for its AIO reads with it gets the unresolved-import stub, which returns 0 without writingstates, so the game keeps calling it.This adds it next to the other AIO calls:
sceKernelAioWaitRequestsceKernelAioPollRequests: EFAULT for null arrays, EINVAL fornumoutside 1..128, and ESRCH in the slot of an unknown IDmodeis not otherwise usedEvidence
Both logs show a burst of
Read N bytes (pos = ...)fromcas_*.casfiles (the AIO reads), then the stub call repeated until the log stops:Unresolved import stub called ... symbol=lgK+oIWkJyA[libkernel_v1][libkernel_v1.1]NHL 27 (#1101, 2026-10-05 build) also imports it but crashes before calling it. I don't have these games, so I can't say how far they get with this change.
Testing
TestAioBatchesintests/KernelFileSystemTests.cppnow also covers the batch wait:I couldn't run
kernel_file_system_testsas is: it creates a Vulkan device first, and the only one I have (lavapipe, Mesa 25.2) lacksVK_KHR_fragment_shader_barycentric. So I ran it in an Ubuntu 24.04 container (clang 18) with local-only edits that are not part of this PR: no window,Memory::InvalidateMemoryreturns early when no GPU context is installed, andmainonly callsTestAioBatches. Results:libKernel.cpp, the test aborts at "AIO exports resolve"The changed lines are clean under clang-format 22.1.3. Not built on Windows or macOS.
AI assistance
An AI coding assistant (Claude Code) helped me search the issue logs, find the missing export, write the change and the test, and run the builds above. I reviewed the code and the test results. All communication on this PR comes from me.
🤖 Generated with Claude Code
@coderabbitai[bot] on GitHub · 2026-10-06 17:32 UTC · original
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
9770e936-c7e6-4e15-9ef2-e420ddb59435📥 Commits
Reviewing files that changed from the base of the PR and between
fb7ff7ec03and a46559c4cb2aa2e0ee357ee2987b4b61c26deab4.📒 Files selected for processing (2)
src/libs/libKernel.cpptests/KernelFileSystemTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
📝 Walkthrough
Walkthrough
The change adds and exports
KernelAioWaitRequests. It validates the ID and state pointers and request count, then waits for each request in order. The function returns the first non-OKresult, orOKafter all waits. Tests cover modes 1 and 2, invalid IDs, invalid inputs, and a timed batch wait.Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
a4655No demonstrated batch-wait defect remains. Timeout semantics are unverified, so normal testing remains appropriate before merging.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.