feat(equeue): implement macOS edge watches #12741
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12741"
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?
Imported from boykopovar/AnyPS5. Originally posted by SHOnnay on 2026-10-29T06:33:01Z.
What
On macOS,
EV_CLEARon guest sockets and pipes threw because EdgeWatch had no host backend. This adds one: a private host kqueue withEV_CLEAR, close-on-exec and zero-timeout retrieval, following the existing Linux epoll design. Pipe-write events and the other unsupported cases still throw.The isolated fixture in
core/libs/tests/EdgeWatch.cppcompiles the productionEdgeWatch.cpp. A dedicatedmacos-15-intelandmacos-15CI job is a near-copy of write-watch, with eligibility wiring for its build inputs. The existing debt entries are updated narrowly. Linux and Windows code paths are byte-for-byte unchanged: removing the two added__APPLE__blocks reproduces upstream's file exactly.Related:
This backend builds and passes against upstream/main without either PR. The overlap check reported documentation conflicts only; it reported no overlap in EdgeWatch.cpp or the workflow.
Tested
macOS ARM64 only. Intel macOS, Linux and Windows were not run locally. The fixture does not establish full guest-runtime kevent behaviour.
The fixture covers socket and pipe repeated arrivals (including while prior data remains unread), no repeated idle notification, EOF with buffered data, and blocking waits; plus socket write fill/drain, close-on-exec, descriptor cleanup and invalid registration. Pipe reads can themselves raise new host notifications, including EOF reads; the fixture consumes those notifications before asserting idle silence. Waits use bounded polling with deadlines and no fixed sleeps.
Commands:
Before: the final fixture was built against upstream/main's unchanged production EdgeWatch.cpp, temporarily restored for the baseline and then restored to the implementation afterwards. Four of five tests fail:
After restoring the implementation, a clean rebuild avoided reusing baseline objects:
Repeated locally 20 times per case (100 of 100 executions passed):
Additional checks:
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)