Skip to content

fix(libkernel): report level-triggered equeue events once per wait - #3489

Merged
adriadam10 merged 2 commits into
boykopovar:mainfrom
MarcZX10:codex/carry-equeue-level-once-3115
Oct 11, 2026
Merged

adriadam10 merged 2 commits into
boykopovar:mainfrom
MarcZX10:codex/carry-equeue-level-once-3115

Conversation

@MarcZX10

Copy link
Copy Markdown
Contributor

What

Carry Hussein Kadhim's two commits from #3115, preserving the original authorship. A level-triggered user event now appears at most once in each sceKernelWaitEqueue result, while remaining ready for the next wait. The shared collector also preserves distinct queued AMPR completions and honors the caller's event count.

Rebasing the source branch onto current main required resolving its Equeue.cpp overlap with merged #1091. This change keeps #1091's socket polling and descriptor-wait behavior while sharing the event collection logic between polling and blocking paths.

Tested

Linux x86-64, GCC 12.2, Release, BUILD_TESTING=ON: built the equeue, socket-event, AMPR marker/thread, UDP and TCP tests. The following six CTests passed three consecutive runs each:

guest_equeue_events, guest_socket_events, guest_ampr_markers, guest_ampr_threads, guest_udp, guest_tcp.

python3 tools/check_conventions.py --base upstream/main and git diff --check passed. No Windows build or console run was performed here. The source issue reports a Windows 11 test run before the rebase onto current main.

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 (feat(libkernel): implement read and write events for guest sockets #1091 is merged)
  • AI-assisted: yes

A user event added with sceKernelAddUserEvent stays triggered until it is
deleted. The collection loop kept re-emitting it until the caller's event
buffer was full, so a wait with num > 1 returned the same event num times.
Like kevent, each event is now reported at most once per call; distinct
queued completions of one event are still delivered in order.

(cherry picked from commit db28ebb)
…vents

Document the level-triggered user event semantics of sceKernelWaitEqueue in TechnicalDebt.

(cherry picked from commit db79bee)
@github-actions

github-actions Bot commented Oct 11, 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
#3396 core/libs/tests/GuestEqueueEvents.cpp L31

@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the single-report-per-wait behaviour against FreeBSD kqueue_scan and kevent(2), and the new guest_equeue_events cases (level once per wait in poll and blocking mode, edge, repeated AMPR completions, num limit): they fail without the change and pass with it, together with guest_socket_events, guest_tcp and guest_udp on Linux; merging.

@adriadam10
adriadam10 merged commit eaffdc4 into boykopovar:main Oct 11, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants