Add PyLucene integration and CPU/GPU end-to-end tests - #2475
Draft
nvzm123 wants to merge 6 commits 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
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.
nvzm123
marked this pull request as draft
August 24, 2026 23:09
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 the cuVS-Lucene production changes from NVIDIA/cuvs-lucene#174 into
java/cuvs-luceneafter the project moved into the cuVS monorepo.The port:
Lucene101AcceleratedHNSWCodecSPI name;Lucene101Codecas the accelerated codecs' explicit delegate;cuvs-java, and test-only payloads.The PyLucene pytest suite and its test-only Java adapters are owned by the cuVS Bench backend in NVIDIA/cuvs#2385, not by the production
cuvs-luceneartifact. The standard thincuvs-luceneJAR remains the artifact under test; Lucene and the basecuvs-javaJAR remain external classpath dependencies.Apache does not publish PyLucene 10.2.0, so end-to-end validation uses a custom PyLucene wrapper generated against the same Lucene 10.2.0 sources as this project.
Test coverage
The in-tree Java coverage adds or strengthens:
verify.The dependent pytest matrix in #2385 proves these execution paths:
GPU-required cases assert the concrete accelerated writer, reader, and query implementations and fail on unavailable cuVS or CPU fallback. CPU cases explicitly verify a stock Lucene HNSW path.
The matrix covers a single live document, one and ten segments, 10-to-1 and 100-to-10 force merges, CAGRA
searchWidthvalues 1, 16, and 32, deletions, selective filters, persisted HNSW graph degree/layers, exact filtered search, and deterministic brute-force recall. Assertions check rank-one self matches where applicable, exact hit counts, duplicate exclusion, inactive/filter-rejected document exclusion, and configurable recall floors.Warning-free CAGRA cases use
graphDegree=32,intermediateGraphDegree=64, and enough vectors to avoid graph-parameter clamping, including 24,832 vectors for the three-layer case.Validation
Final producer revision:
d6fcab0946837d7d3997cec4ed18189d3faa12e6.Validated on an NVIDIA A10G with JDK 22, matching cuVS Java/native 26.10 artifacts, and Lucene/PyLucene 10.2:
pull/2475/headfrom GitHub and detached at the exact revision above: passed;./build.sh lucenefrom that detached checkout: passed;mvn clean verifyfrom that detached checkout: 332 tests, 0 failures, 0 errors, 30 skipped;ThinJarContentsIT: 1 test, 0 failures, 0 errors, 0 skipped;TestBackCompat,TestLucene102FormatConstruction: 20 passed;searchWidth16/32 cases: 2 passed, 18 deselected, recall 1.0;The Maven suite retains existing warnings from randomized small-dataset graph clamping, JVM vector/native access, intentional fallback or invalid-configuration cases, and the Javadoc plugin's existing unknown
includePackageNamesparameter. The PyLucene suite emitted no cuVS graph-clamping or CPU-fallback warnings; it emitted the expected JVM notice for the incubating vector module.A clean rebuild of all current-main native dependencies was not used for the final GPU rerun: after adding the container's missing matching
libcufile-devheaders, the build exposed 5,420 native targets and was stopped as impractical for this Java/Python-only change. The final producer JAR itself was built from the exact revision above and tested against a compatible native runtime reporting cuVS 26.10.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 full validation listed above passes.
Follow-up multithreaded concurrency coverage is tracked in NVIDIA/cuvs#2407.