Repository navigation
Fix Coconut disk streaming with bounded LSM updates - #82
Merged
Merged
Conversation
sophisid
marked this pull request as ready for review
October 21, 2026 10:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Coconut writes its initial index to disk but keeps every subsequent insertion in an unbounded RAM buffer. This change persists bounded memtables and compacts immutable sorted runs, so streaming updates actually remain disk-backed.
The implementation follows the materialized Coconut-LSM-Full design: external-sort bulk loading, sortable-SAX run trees, Gaussian SAX pruning, asynchronous binary compaction, and exact squared-L2 top-k/range search with stable stream IDs. Independent queries share bounded candidate reads while retaining separate exact heaps. Recent-window top-k, disk/merge/query counters, Python bindings, demos, a streaming benchmark, and regression tests are included. Completed insertion timing includes
waitForMerges().This is DaiSy's paper-based implementation, not the authors' executable. Raw vectors live in disk runs; resident SAX summaries still require O(N) RAM. Indexes are temporary POSIX files, without reopening/WAL/recovery or concurrent caller inserts/searches. Adaptive breakpoints and DTW remain unsupported.
Validation on current main (
d98008d):BUILD_COCONUT=OFF: separate library/Python build, successful import, no Coconut class or targets.Based directly on current main. Existing MESSI/SAX fixes are preserved; experiment scripts, datasets, logs and figures are excluded.
/scripts/experiments/is already ignored on main.