Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion native/src/main/java/org/humemai/nativelib/ArcadeNative.java
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,9 @@ public static CCharPointer diag(final IsolateThread thread) {
sb.append(",\"max_heap\":").append(Runtime.getRuntime().maxMemory());
sb.append(",\"exec_timers_ns\":{\"calls\":").append(T[0]).append(",\"args\":").append(T[1]).append(",\"json\":").append(T[2])
.append(",\"engine\":").append(T[3]).append(",\"reply\":").append(T[4]).append('}');
final io.github.jbellis.jvector.vector.VectorizationProvider vp = io.github.jbellis.jvector.vector.VectorizationProvider.getInstance();
// through the engine, never VectorizationProvider.getInstance(): jvector picks its provider once per process, and asked first it
// would pick on its own (Panama, the uncompiled Vector API, where no libjvector ships) before the engine sets the scalar default
final io.github.jbellis.jvector.vector.VectorizationProvider vp = com.arcadedb.utility.VectorApiSupport.jvectorProvider();
sb.append(",\"provider\":");
NativeCodec.quote(sb, vp.getClass().getName());
sb.append(",\"util_support\":");
Expand Down
6 changes: 5 additions & 1 deletion tests/test_native_vector_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ def test_without_the_library_the_scalar_provider_stays(tmp_path):


def _provider(tmp_path, value=None) -> str:
"""The VectorizationProvider class an isolate of a fresh process runs, with ARCADEDB_VECTOR_PROVIDER unset or set to ``value``."""
"""The VectorizationProvider class an isolate of a fresh process runs, with ARCADEDB_VECTOR_PROVIDER unset or set to ``value``.

``diag()`` is the child's first call, before any database: jvector picks its provider once per process, so this also checks that
``diag()`` leaves the choice to the engine (it picked Panama on macOS and Windows when it asked jvector first).
"""
env = {k: v for k, v in os.environ.items() if k != "ARCADEDB_VECTOR_PROVIDER"}
env["ARCADEDB_LOG_DIR"] = str(tmp_path / "log")
if value is not None:
Expand Down
Loading