-
Notifications
You must be signed in to change notification settings - Fork 115
HNSW using the linear package #3691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
4cfef2a to
3a04055
Compare
8fcb3a6 to
fc7994f
Compare
alecgrieser
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has obviously taken a bit of time, but this is part one of the review. It covers:
- The
HNSWclass and core algorithm - The
NodeandNodeKindclasses
Still yet to look at are:
- The
StorageAdapterand implementations - Change sets
- Any of the changes to the linear and RaBitQ packages
- All tests
As hopefully is clear in the review, a lot of what's in it are requests for clarification. Some of these should probably turn into comments.
I also think that it would be good to take another look at the teamscale findings. Most of those are also pretty minor, but it would be good to try to conform a bit more to them. I'm less concerned about things like method length, nesting, or number of parameters (especially for private methods), but it would be nice to take another look at them.
Overall, I think the approach makes sense, through. Nice!
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/HNSW.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/HNSW.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/HNSW.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/HNSW.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/HNSW.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/HNSW.java
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/HNSW.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/HNSW.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/HNSW.java
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/HNSW.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/AbstractNode.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/AbstractStorageAdapter.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/AccessInfo.java
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/AggregatedVector.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/BaseNeighborsChangeSet.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/linear/AffineOperator.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/linear/VectorOperator.java
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/linear/VectorOperator.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/test/java/com/apple/foundationdb/async/hnsw/HNSWHelpersTest.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/test/java/com/apple/foundationdb/async/hnsw/HNSWTest.java
Outdated
Show resolved
Hide resolved
267e633 to
1963a0a
Compare
alecgrieser
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, this adds more to the review, in particular focusing on the storage serialization/deserialization. I still have:
- The changes to the other packages
- Tests
- Looking at updates since the last review
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/AccessInfo.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/StorageAdapter.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/StorageAdapter.java
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/StorageAdapter.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/StorageAdapter.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/AbstractStorageAdapter.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/InliningStorageAdapter.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/CompactStorageAdapter.java
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/StorageTransform.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/linear/AffineOperator.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/Config.java
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/HNSW.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/HNSW.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/HNSW.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/StorageAdapter.java
Show resolved
Hide resolved
0a243ee to
bedfd30
Compare
|
@normen662 @alecgrieser @MMcM Looking at the coverage report from the actions, I think the test gaps in teamscale are incorrect, but I would trust the findings, at least mostly. |
alecgrieser
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I overall like what's being done with Transform. I did leave one comment about a usage pattern that is a bit surprising, if not understandable. I looked at the tests, and they seem like a good set of basic high-level tests. I'm not sure off the top of my head what improvements I'd like to see, but it does seem like we should stress it a bit more. It may also be the kind of thing where if we took the current version and then devised more interesting testing strategies, that would be fine
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/ResultEntry.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/ResultEntry.java
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/AccessInfo.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/InliningStorageAdapter.java
Show resolved
Hide resolved
fdb-extensions/src/test/java/com/apple/foundationdb/async/hnsw/HNSWTest.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/test/java/com/apple/foundationdb/async/hnsw/HNSWTest.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/test/java/com/apple/foundationdb/async/hnsw/HNSWTest.java
Show resolved
Hide resolved
fdb-extensions/src/test/java/com/apple/foundationdb/async/hnsw/HNSWTest.java
Show resolved
Hide resolved
d6bc44c to
e83340d
Compare
MMcM
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few mores dates.
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/InliningNode.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/InliningStorageAdapter.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/InsertNeighborsChangeSet.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/NeighborsChangeSet.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/Node.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/OnReadListener.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/OnWriteListener.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/StorageAdapter.java
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/package-info.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/test/java/com/apple/foundationdb/async/hnsw/HNSWTest.java
Outdated
Show resolved
Hide resolved
e83340d to
0971796
Compare
26d135a to
b0b03ff
Compare
alecgrieser
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM. The only serious thing is the question raised about the StorageTransform change that went in
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/InliningStorageAdapter.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/StorageTransform.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/test/java/com/apple/foundationdb/async/hnsw/DataRecordsTest.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/test/java/com/apple/foundationdb/async/hnsw/HNSWTest.java
Show resolved
Hide resolved
alecgrieser
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM. There are failing tests, which I think are all from using hasToString instead of doesNotHaveToString in the latest update in a few places. If that's all that's wrong, and correcting that results in a passing PRB, I think this is good to merge
fdb-extensions/src/test/java/com/apple/foundationdb/async/hnsw/DataRecordsTest.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/test/java/com/apple/foundationdb/async/hnsw/DataRecordsTest.java
Outdated
Show resolved
Hide resolved
fdb-extensions/src/test/java/com/apple/foundationdb/async/hnsw/DataRecordsTest.java
Outdated
Show resolved
Hide resolved
a35f7d9 to
3f25776
Compare
3f25776 to
2dc59a9
Compare
This PR implements the HNSW paper using the recently introduced linear package together with RaBitQ.