Skip to content

feat(diskann): add macOS POSIX AIO with kqueue completion#605

Open
iaojnh wants to merge 83 commits into
alibaba:mainfrom
iaojnh:feat/diskann-macos
Open

feat(diskann): add macOS POSIX AIO with kqueue completion#605
iaojnh wants to merge 83 commits into
alibaba:mainfrom
iaojnh:feat/diskann-macos

Conversation

@iaojnh

@iaojnh iaojnh commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Relationship to #557

This PR supersedes #557 and contains its head commit. It preserves the Linux support introduced there, while updating the branch to the current main and replacing the macOS I/O prototype with a complete POSIX AIO implementation.

The main difference is the role of kqueue:

  • [WIP] feat(diskann): add macOS support via kqueue-based async IO #557 registered the regular file descriptor with EVFILT_READ, but still executed every read synchronously using pread(). Therefore, kqueue acted only as a readiness wrapper and did not provide asynchronous disk I/O.
  • This PR submits actual asynchronous requests with aio_read() and uses SIGEV_KEVENT / EVFILT_AIO through kevent64() for completion notification.

The new implementation batches requests, validates every completion, safely drains outstanding AIO operations on failure, and falls back to synchronous pread() when POSIX AIO or kqueue cannot be used.

It also limits this path explicitly to macOS, exposes POSIX_AIO as a distinct backend through the C and Python APIs, and adds tests that verify both the actual POSIX AIO path and the synchronous fallback.

richyreachy and others added 17 commits July 9, 2026 15:14
# Conflicts:
#	.github/workflows/03-macos-linux-build.yml
#	.github/workflows/nightly_coverage.yml
#	CMakeLists.txt
#	examples/c++/CMakeLists.txt
#	python/tests/detail/fixture_helper.py
#	python/tests/test_collection_diskann.py
#	python/zvec/__init__.py
#	src/binding/python/model/common/python_config.cc
#	src/core/CMakeLists.txt
#	src/core/algorithm/diskann/CMakeLists.txt
#	src/core/algorithm/diskann/diskann_builder.cc
#	src/core/algorithm/diskann/diskann_file_reader.cc
#	src/core/algorithm/diskann/diskann_file_reader.h
#	src/core/algorithm/diskann/diskann_searcher.cc
#	src/core/algorithm/diskann/diskann_streamer.cc
#	src/db/index/common/schema.cc
@iaojnh iaojnh changed the title Feat/diskann macos feat(diskann): add macOS POSIX AIO with kqueue completion Jul 20, 2026
@iaojnh
iaojnh marked this pull request as ready for review July 20, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants