Skip to content

feat(libkernel): accept a kevent read event on descriptor 0 - #6343

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
klosixgaming-arch:feat/kevent-standard-input
Oct 18, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
klosixgaming-arch:feat/kevent-standard-input

Conversation

@klosixgaming-arch

@klosixgaming-arch klosixgaming-arch commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What

EA SPORTS FC 27 (PPSA34015) creates a kqueue at start-up and registers EVFILT_READ for descriptor 0 in it. The code (eboot 0xba76b90) sets up an input console command, then calls kqueue() and kevent(kq, {ident 0, EVFILT_READ, EV_ADD}, 1, NULL, 0, NULL), stores the kqueue, and ignores kevent's result. With the PPSA34015 pull requests listed under Tested applied on main, the title then stops with:

terminate called after throwing an instance of 'std::runtime_error'
  what():  kevent: EVFILT_READ on a non-socket descriptor not implemented
FATAL: abort() (SIGABRT)

kevent now accepts a read event on the host stream on descriptor 0. The event never triggers, the same way select never reports descriptor 0 readable (libkernel debt, "console title with no input"). The change is limited to that case:

  • Write events on descriptors 0 to 2 still throw.
  • Read events on other non-socket descriptors still throw.
  • A descriptor 0 that was not open when libkernel loaded still follows the existing path.

The debt entry for kqueue and kevent records the new case.

Tested

Checklist

  • Based on current main; no other open PR implements the same functions (feat(libkernel): support EVFILT_READ on the read end of a pipe #5973 adds pipe read ends to the same function; descriptor 0 here is a console, not a pipe)
  • 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
  • Unblocks: PPSA34015 EA SPORTS FC 27 (PPSA34015) #6344
  • GPUs tested: RTX 5090
  • AI-assisted: yes. Written with AI assistance and reviewed by me.

This was referenced Oct 15, 2026
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6542 docs/dev/debt/libkernel.md L112-113
PR 7075 docs/dev/debt/libkernel.md L113
PR 7121 docs/dev/debt/libkernel.md L113-114
PR 7129 core/libs/prx/libkernel/Equeue/src/Kqueue.cpp L142
docs/dev/debt/libkernel.md L113
PR 7653 core/libs/prx/libkernel/Equeue/src/Kqueue.cpp L2-3
docs/dev/debt/libkernel.md L113

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 5021 docs/dev/debt/libkernel.md
PR 6044 core/libs/tests/GuestKqueue.cpp
PR 6446 docs/dev/debt/libkernel.md
PR 6510 core/libs/prx/libkernel/Equeue/src/Kqueue.cpp
core/libs/tests/GuestKqueue.cpp
docs/dev/debt/libkernel.md
PR 6519 docs/dev/debt/libkernel.md
PR 6534 docs/dev/debt/libkernel.md
PR 6908 docs/dev/debt/libkernel.md
PR 6936 docs/dev/debt/libkernel.md
PR 6977 docs/dev/debt/libkernel.md
PR 7039 docs/dev/debt/libkernel.md
PR 7049 core/libs/prx/libkernel/Equeue/src/Kqueue.cpp
core/libs/tests/GuestKqueue.cpp
docs/dev/debt/libkernel.md
PR 7088 core/libs/prx/libkernel/Equeue/src/Kqueue.cpp
core/libs/tests/GuestKqueue.cpp
docs/dev/debt/libkernel.md
PR 7105 docs/dev/debt/libkernel.md
PR 7149 docs/dev/debt/libkernel.md
PR 7192 docs/dev/debt/libkernel.md
PR 7332 docs/dev/debt/libkernel.md
PR 7509 docs/dev/debt/libkernel.md

@klosixgaming-arch

Copy link
Copy Markdown
Contributor Author

No dependency — this PR builds on neither:

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 15, 2026
@klosixgaming-arch
klosixgaming-arch force-pushed the feat/kevent-standard-input branch from 66989b2 to 8078b7e Compare October 15, 2026 23:24
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 16, 2026

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

Windows check of head 8078b7ef3, merged onto main 5d9dcc42d (clean merge). Windows 11 Pro (26300), WinLibs GCC 15.2.0 r7, Ninja Release.

  • guest_kqueue passes on Windows here, including the new StandardInput case and DeniedParentWatch. So the failure you saw in DeniedParentWatch looks specific to that machine. guest_select, guest_select_wait, guest_poll and guest_equeue_events also pass.
  • It does conflict with #5973, contrary to the comment above. With both heads, git merge-tree reports content conflicts in Kqueue.cpp and in the kqueue bullet of docs/dev/debt/libkernel.md. In Kqueue.cpp, #5973 rewrites the if (!GuestSockets::IsOpen(descriptor)) block that this PR's new branch sits directly above. The resolution is mechanical: keep this PR's descriptor-0 branch first, then #5973's socket-or-pipe block. The debt sentence needs both additions. Whichever merges second needs that resolution.
  • One interaction for that resolution: with this branch first, a descriptor 0 that the host attached to a pipe (a run with stdin redirected) gets the never-triggering knote rather than #5973's pipe readiness, because File::IsHostStream(0) is true for any stream libkernel found at load. That seems the right choice for a console title, which has no input on descriptor 0. If it's intended, the debt sentence could say so.

AI-assisted: yes. I ran the build and tests above and the trial merge with #5973.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 17, 2026
@klosixgaming-arch
klosixgaming-arch force-pushed the feat/kevent-standard-input branch from 8078b7e to 30b2314 Compare October 17, 2026 16:08
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 17, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 17, 2026
PPSA34015 (EA SPORTS FC 27) registers EVFILT_READ for descriptor 0 in a
new kqueue at start-up, ignores the result, and stopped with "kevent:
EVFILT_READ on a non-socket descriptor not implemented". A read event on
the host stream on descriptor 0 is now accepted and never triggers, as
select never reports descriptor 0 readable.
@hugodearaujo

Copy link
Copy Markdown
Contributor

Another title needs this: Assassin's Creed Mirage (PPSA13960, 01.007.000). On main 0d078f7 it stops 7 s after start with kevent: EVFILT_READ on a descriptor that is neither a socket nor the read end of a pipe not implemented. With this PR's Kqueue.cpp change it passes that point; the next stop is a separate main-thread stack issue (#7532), and with #7532 and #7533 as well it runs through its start-up screens (#7534). EA SPORTS FC 25 (PPSA20049) also stops at this kevent read in my runs on main 66702f1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs libkernel unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants