Add PyLucene integration and CPU/GPU end-to-end tests - #2475
Open
nvzm123 wants to merge 3 commits into
Open
Conversation
Co-authored-by: Corey J. Nolet <cjnolet@gmail.com> Signed-off-by: Zack Meeks <zmeeks@nvidia.com>
This was referenced Aug 17, 2026
nvzm123
added a commit
to nvzm123/cuvs
that referenced
this pull request
Aug 19, 2026
Use cuVS PR NVIDIA#2475 as the pinned source for matching native, cuvs-java, and cuvs-lucene artifacts. Refresh monorepo paths, validation commands, and adapter compatibility guidance. Signed-off-by: nvzm123 <zmeeks@nvidia.com>
Signed-off-by: Zack Meeks <zmeeks@nvidia.com>
nvzm123
marked this pull request as ready for review
August 20, 2026 04:05
cjnolet
reviewed
Aug 21, 2026
| @@ -0,0 +1,934 @@ | |||
| # SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | |||
| # SPDX-License-Identifier: Apache-2.0 | |||
Contributor
There was a problem hiding this comment.
We shouldn't be hosting python files in java directories. Please move to cuvs-bench.
cjnolet
reviewed
Aug 21, 2026
|
|
||
| """PyLucene end-to-end coverage for CPU HNSW and GPU cuVS search paths. | ||
|
|
||
| The parametrized cases cover segment and force-merge topologies, CAGRA search |
Contributor
There was a problem hiding this comment.
Again, this should be hosted in cuvs-bench, not in cuvs-lucene.
cjnolet
reviewed
Aug 21, 2026
| python3 -m pytest -q -s src/test/python/test_pylucene_end_to_end.py | ||
| ``` | ||
|
|
||
| The cases live in `src/test/python/test_pylucene_end_to_end.py`; reusable |
Contributor
There was a problem hiding this comment.
I mentioned this in the prior PR in cuvs-lucene- you should not need to list special instructions in the docs for running the pylucene tests. They should be part of the cuvs-bench python test suite. Please remove all this stuff from the docs. You also should not need to explicitly state how to run the java tests for cuvs-lucene- running cuvs-lucene tests should be enough to run all the java tests in cuvs-lucene.
cjnolet
requested changes
Aug 21, 2026
cjnolet
left a comment
Contributor
There was a problem hiding this comment.
This still needs some work.
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.
Summary
This ports NVIDIA/cuvs-lucene#174 into
java/cuvs-lucenefollowing the cuvs-lucene move into the cuVS monorepo. It adds PyLucene integration support and a pytest-owned CPU/GPU end-to-end suite.The test layout follows the current cuVS/cuML
test_*.pyconvention:java/cuvs-lucene/src/test/python/test_pylucene_end_to_end.pyowns test cases, parametrization, assertions, and reporting.java/cuvs-lucene/src/test/python/pylucene_test_support.pycontains reusable PyLucene index/search helpers.java/cuvs-lucene/src/test/java/com/nvidia/cuvs/lucene/PyLuceneTestSupport.javaprovides test-only codecs, execution-path diagnostics, and graph verification.python -m pytest -q -s src/test/python/test_pylucene_end_to_end.pyfromjava/cuvs-luceneonce the documented PyLucene, jar, JVM, and native-library environment is available.The standard thin
cuvs-lucenejar remains the artifact under test; Lucene andcuvs-javaremain external classpath dependencies, and the Java diagnostics stay intarget/test-classesrather than the published jar.The port also:
Lucene101Codecdelegate instead of dynamically selecting an older outer codecApache does not publish PyLucene 10.2.0, so the full suite uses a custom PyLucene wrapper generated against the same Lucene 10.2.0 sources as this project.
PyLucene test coverage
The suite explicitly proves these paths:
GPU-required cases assert the concrete accelerated writer, reader, and query implementations and fail on unavailable cuVS or CPU fallback. CPU cases construct and report a stock Lucene HNSW path.
Coverage includes:
searchWidthvalues 1, 16, and 32Vectors and queries are deterministic, and expected neighbors are computed by brute force. Assertions verify rank-one self matches where applicable, exact hit counts, no duplicates, inactive or filter-rejected document exclusion, and a configurable recall floor.
CAGRA configurations use
graphDegree=32andintermediateGraphDegree=64. Cases construct enough vectors to avoid cuVS graph-parameter clamping, including 24,832 vectors for the three-layer case.Validation
Validated from
java/cuvs-luceneon an NVIDIA A10G with matching cuVS Java/native 26.10 and Lucene/PyLucene 10.2 environments:bash -n build.sh: passedpython -m compileall -q src/test/python: passedpython -m pytest --collect-only -q src/test/python/test_pylucene_end_to_end.py: 24 tests collectedmvn -q spotless:check: passedmvn -Dtest=TestBackCompat,TestAcceleratedHNSWDeletedDocuments test: 17 tests, 0 failures, 0 errors, 0 skippedmvn -q clean verify -Dtests.seed=5A17C10120260817: 316 tests, 0 failures, 0 errors, 30 skippedpython -m pytest -q -s src/test/python/test_pylucene_end_to_end.py: 24 passed in 39.03 secondsThe Maven suite retains existing warnings from randomized small-dataset graph clamping, JVM vector/native access, and intentional fallback or invalid-configuration cases. The PyLucene suite emitted no cuVS graph-clamping or CPU-fallback warnings; its only warning was the JVM notice for the incubating vector module.
Known randomized-test failure
Seed
CC0EA94328BAB3E5exposes an existing failure inTestCuVSVectorsFormat.testRandomWithUpdatesAndGraph:IllegalStateException: Index not found for field:fieldatCuVS2510GPUVectorsReader.java:425.The same seed reproduces identically on this branch and on the untouched base commit
0fa5ebe5, including the secondary seed and stack trace. It is therefore not introduced by this port. Reproduction command fromjava/cuvs-lucene:mvn -q -Dtest=TestCuVSVectorsFormat#testRandomWithUpdatesAndGraph \ -Dtests.seed=CC0EA94328BAB3E5 \ -Dtests.locale=ti-Ethi-ET \ -Dtests.timezone=Greenwich testThe fixed-seed full validation listed above passes.
Follow-up multithreaded concurrency coverage is tracked in NVIDIA/cuvs#2407.