You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by so...@apache.org on 2024/10/03 14:42:06 UTC
(lucene) branch branch_10x updated (0f2fac699a3 -> fae57d03ca8)
This is an automated email from the ASF dual-hosted git repository.
sokolov pushed a change to branch branch_10x
in repository https://gitbox.apache.org/repos/asf/lucene.git
from 0f2fac699a3 Prevent flattening of ordered and unordered interval sources (#13819)
new 8c9204d1cc0 add infostream status messages to HnswGraphBuilder.connectComponents (#13849)
new fae57d03ca8 search on proper level when connecting graph components (#13846)
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../org/apache/lucene/util/hnsw/HnswGraphBuilder.java | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
(lucene) 01/02: add infostream status messages to HnswGraphBuilder.connectComponents (#13849)
Posted by so...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sokolov pushed a commit to branch branch_10x
in repository https://gitbox.apache.org/repos/asf/lucene.git
commit 8c9204d1cc003ade547cf67c88916ab088b2f5b4
Author: Michael Sokolov <so...@falutin.net>
AuthorDate: Wed Oct 2 11:27:48 2024 -0400
add infostream status messages to HnswGraphBuilder.connectComponents (#13849)
---
.../org/apache/lucene/util/hnsw/HnswGraphBuilder.java | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java b/lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java
index 1f5253ef7f8..317814e4604 100644
--- a/lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java
+++ b/lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java
@@ -439,7 +439,11 @@ public class HnswGraphBuilder implements HnswBuilder {
maxConn *= 2;
}
List<Component> components = HnswUtil.components(hnsw, level, notFullyConnected, maxConn);
- // System.out.println("HnswGraphBuilder.connectComponents level=" + level + ": " + components);
+ if (infoStream.isEnabled(HNSW_COMPONENT)) {
+ infoStream.message(
+ HNSW_COMPONENT, "connect " + components.size() + " components on level=" + level);
+ }
+ // System.out.println("HnswGraphBuilder. level=" + level + ": " + components);
boolean result = true;
if (components.size() > 1) {
// connect other components to the largest one
@@ -457,6 +461,10 @@ public class HnswGraphBuilder implements HnswBuilder {
if (c.start() == NO_MORE_DOCS) {
continue;
}
+ if (infoStream.isEnabled(HNSW_COMPONENT)) {
+ infoStream.message(HNSW_COMPONENT, "connect component " + c + " to " + c0);
+ }
+
beam.clear();
eps[0] = c0.start();
RandomVectorScorer scorer = scorerSupplier.scorer(c.start());
@@ -475,8 +483,14 @@ public class HnswGraphBuilder implements HnswBuilder {
// System.out.println("link " + c0 + "." + c0node + " to " + c + "." + c.start());
link(level, c0node, c.start(), score, notFullyConnected);
linked = true;
+ if (infoStream.isEnabled(HNSW_COMPONENT)) {
+ infoStream.message(HNSW_COMPONENT, "connected ok " + c0node + " -> " + c.start());
+ }
}
if (!linked) {
+ if (infoStream.isEnabled(HNSW_COMPONENT)) {
+ infoStream.message(HNSW_COMPONENT, "not connected; no free nodes found");
+ }
result = false;
}
}
(lucene) 02/02: search on proper level when connecting graph components (#13846)
Posted by so...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sokolov pushed a commit to branch branch_10x
in repository https://gitbox.apache.org/repos/asf/lucene.git
commit fae57d03ca8272df37e9807db5a92d1f8d540333
Author: Michael Sokolov <so...@falutin.net>
AuthorDate: Wed Oct 2 12:47:49 2024 -0400
search on proper level when connecting graph components (#13846)
---
lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java b/lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java
index 317814e4604..75b579f0bd9 100644
--- a/lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java
+++ b/lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java
@@ -470,7 +470,7 @@ public class HnswGraphBuilder implements HnswBuilder {
RandomVectorScorer scorer = scorerSupplier.scorer(c.start());
// find the closest node in the largest component to the lowest-numbered node in this
// component that has room to make a connection
- graphSearcher.searchLevel(beam, scorer, 0, eps, hnsw, notFullyConnected);
+ graphSearcher.searchLevel(beam, scorer, level, eps, hnsw, notFullyConnected);
boolean linked = false;
while (beam.size() > 0) {
int c0node = beam.popNode();