Update DiskANN FFI - #1992
Draft
kevin-montrose wants to merge 13 commits into
Draft
Conversation
This was referenced Jul 29, 2026
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.
Making what are (hopefully) the final big FFI changes before stabilization.
nint logCallbacktocreate_indexlogCallbackis:LogCallbackUnmanaged(ulong context, nint logMessage, nuint logMessageLength)contextlow bits are used to enrich log line on the Garnet sidelogMessageis utf8 encoded textlogMessageLengthis the byte count oflogMessagevalueLengthHinttoreadCallbackActiveReadGeometryestimates on the Garnet side - allowing DiskANN to own record size informationcontinue_search(ulong context, nint index, nint continuation, nint output_ids, nuint output_ids_len, nint output_distances, nuint output_distances_len, nint new_continuation)search_xxx(...)function can't fit all of the results into the providedoutput_idsbuffercontinuationcontinuation- should be null if an error is encounteredbyte random_members(ulong context, nint index, uint count, nint output_ids, nuint output_ids_len)VRANDMEMBERcountrandom (external) ids and places them inoutput_ids, length prefixedint search_neighbors(ulong context, nint index, nint id_data, nuint id_len, nint output_ids, nuint output_ids_len, nint output_distances, nuint output_distances_len, nint continuation)VLINKSwhich is basically "give me the neighbors of an element + distances to each"continuationwill be set and search can continue withcontinue_search(...)filter_callbackto accept data in place rather than the parsed internal idbackfill_quant_vectorsdataCallbacksare 4-byte alignedCode is naturally mostly untested since the DiskANN side isn't ready yet, but everything has a sketched out implementation so the basics can be validated and proper tests written once we have binary to test with.