Add PyLucene integration and CPU/GPU end-to-end tests - #2475
Draft
nvzm123 wants to merge 1 commit into
Draft
Conversation
Co-authored-by: Corey J. Nolet <cjnolet@gmail.com> Signed-off-by: Zack Meeks <zmeeks@nvidia.com>
This was referenced Aug 17, 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.
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.