Commit Graph

36853 Commits

Author SHA1 Message Date
Uwe Schindler bbf197fdc2
MMapDirectory with MemorySegment: Confirm that scope/session is no longer alive before throwing AlreadyClosedException (#12707) 2023-10-22 19:14:29 +02:00
Uwe Schindler 9729123369
Improve handling of NullPointerException in MMapDirectory's IndexInputs (check the "closed" condition) (#12705) 2023-10-22 10:58:44 +02:00
Dzung Bui ad06ee57b8
Remove direct dependency of NodeHash to FST (#12690)
* Remove direct dependency of NodeHash to FST

* tidy
2023-10-21 08:26:07 -04:00
Shubham Chaudhary de8ae1de7c
Optimize computing number of levels in MultiLevelSkipListWriter#bufferSkip (#12653)
* Optimize computing number of levels in MultiLevelSkipListWriter#bufferSkip

* CHANGES.txt entry
2023-10-21 07:52:28 -04:00
Rob Muir 90f8bac9f7 slight correction 2023-10-21 02:05:34 -04:00
Rob Muir c09fb560f7 add hsdis instructions for the macos 2023-10-21 02:02:24 -04:00
Michael McCandless afb2a60751
Bound the RAM used by the NodeHash (sharing common suffixes) during FST compilation (#12633)
* tweak comments; change if to switch

* remove old SOPs, minor comment styling, fixed silly performance bug on rehash using the wrong bitsRequired (count vs node)

* first raw cut; some nocommits added; some tests fail

* tests pass!

* fix silly fallback hash bug

* remove SOPs; add some temporary debugging metrics

* add temporary tool to test FST performance across differing NodeHash sizes

* remove (now deleted) shouldShareNonSingletonNodes call from Lucene90BlockTreeTermsWriter

* add simple tool to render results table to GitHub MD

* add simple temporary tool to iterate all terms from a provided luceneutil wikipedia index and build an FST from them

* first cut at using packed ints for hash t able again

* add some nocommits; tweak test_all_sizes.py to new RAM usage approach; when half of the double barrel is full, allocate new primary hash at full size to save cost of continuously rehashing for a large FST

* switch to limit suffix hash by RAM usage not count (more intuitive for users); clean up some stale nocommits

* switch to more intuitive approximate RAM (mb) limit for allowed size of NodeHash

* nuke a few nocommits; a few more remain

* remove DO_PRINT_HASH_RAM

* no more FST pruning

* remove final nocommit: randomly change allowed NodeHash suffix RAM size in TestFSTs.testRealTerms

* remove SOP

* tidy

* delete temp utility tools

* remove dead (FST pruning) code

* add CHANGES entry; fix one missed fst.addNode -> fstCompiler.addNode during merge conflict resolution

* remove a mal-formed nocommit

* fold PR feedback

* fold feedback

* add gradle help test details on how to specify heap size for the test JVM; fix bogus assert (uncovered by Test2BFST); add TODO to Test2BFST anticipating building massive FSTs in small bounded RAM

* suppress sysout checks for Test2BFSTs; add helpful comment showing how to run it directly

* tidy
2023-10-20 11:52:55 -04:00
Dzung Bui 0d8a3e6c4f
Fix index out of bounds when writing FST to different metaOut (#12697) (#12698)
* Fix index out of bounds when writing FST to different metaOut (#12697)

* Tidify code

* Update CHANGES.txt

* Re-add assertion
2023-10-20 07:25:04 -04:00
gf2121 343a9e7100
Avoid object construction when linear searching arcs (#12692) 2023-10-20 00:41:09 +08:00
Stéphane Campinas 6fde1db228
chore: update the Javadoc example in Analyzer (#12693)
Close #12666
2023-10-18 10:19:19 -04:00
iverase 723c05b047 coorect position on entry in CHANGES.txt 2023-10-18 08:14:56 +02:00
Ignacio Vera 17ea6d5a0d
Refactor ByteBlockPool so it is just a "shift/mask big array" (#12625)
Moved all the hairy allocSlice stuff as static method in TermsHashPerField and I introduce a BytesRefBlockPool to
 encapsulate of the BytesRefHash write/read logic.
2023-10-18 08:10:48 +02:00
Benjamin Trent ea272d0eda
Extract the hnsw graph merging from being part of the vector writer (#12657)
While working on the quantization codec & thinking about how merging will evolve, it became clearer that having merging attached directly to the vector writer is weird.

I extracted it out to its own class and removed the "initializedNodes" logic from the base class builder.

Also, there was on other refactoring around grabbing sorted nodes from the neighbor iterator, I just moved that static method so its not attached to the writer (as all bwc writers need it and all future HNSW writers will as well).
2023-10-17 13:45:25 -04:00
Adrien Grand 218eddec70
Specialize `BlockImpactsDocsEnum#nextDoc()`. (#12670)
When we initially introduced support for dynamic pruning, we had an
implementation of WAND that would almost exclusively use `advance()`. Now that
we switched to MAXSCORE and rely much more on `nextDoc()`, it makes sense to
specialize nextDoc() as well.
2023-10-17 14:13:40 +02:00
Adrien Grand f055ac6e16
Speed up TestIndexOrDocValuesQuery. (#12672)
This changes the following:
 - fewer docs indexed in non-nightly runs,
 - `QueryUtils#checkFirstSkipTo` uses the `ScorerSupplier` API to convey it
   will only check one doc,
 - `QueryUtils#checkFirstSkipTo` no longer relies on timing to run in a
   reasonably amount of time.
2023-10-17 14:13:21 +02:00
gf2121 8961dda2a4
Remove over-counting of deleted terms (#12586) 2023-10-17 19:13:24 +08:00
gf2121 da032535d6
Use MergeSorter in StableStringSorter (#12652) 2023-10-17 17:52:16 +08:00
gf2121 c6e76d3e01
Use radix sort to speed up the sorting of terms in TermInSetQuery (#12587) 2023-10-17 17:31:29 +08:00
Dawid Weiss 6dac2f7afc
Add timeouts to github jobs. Estimates taken from empirical run times (actions history), with a generous buffer added. (#12687) 2023-10-17 08:02:53 +02:00
Patrick Zhai a1cf22e6a9
Optimize OnHeapHnswGraph's data structure (#12651)
make the internal graph representation a 2d array
2023-10-16 13:13:37 -07:00
Dawid Weiss 2482f7688b
Add createClassLoader to replicator permissions (block specific to jacoco). (#12684) 2023-10-16 09:11:57 +02:00
Uwe Schindler f64bb19697 Move changes entry before backporting 2023-10-15 19:36:39 +02:00
Robert Muir 2b105f732e
CHANGES 2023-10-15 08:43:50 -04:00
Uwe Schindler c8852a012f Move testing properties to provider class (no classloading deadlock possible) and fallback to default provider in non-test mode 2023-10-15 14:33:43 +02:00
Robert Muir 650a47e707
Merge branch 'main' into vector_512: stomping over any possible conflicting changes: if you made any, i erased them. git is garbage. 2023-10-15 08:20:43 -04:00
Robert Muir db746bdbc3
simple cleanups to vector code (#12680)
* simple cleanups to vector code

* cleanup cosine too, no perf impact
2023-10-15 08:12:14 -04:00
Uwe Schindler dbda33fb2f
Better detect vector module in non-default setups (e.g., custom module layers) (#12677) 2023-10-15 12:45:52 +02:00
Robert Muir a69cdeff56
fix html 2023-10-14 19:56:42 -04:00
Robert Muir 90c01c1e80
tidy 2023-10-14 19:54:47 -04:00
Robert Muir 94619e00e0
fix Panama provider to only have static final constants, but allow sysprops for testing.
Set those sysprops by the build when running tests: force integer vectors on always, and randomize vector size
2023-10-14 19:51:59 -04:00
Robert Muir cce3cf106a
stop using SPECIES_PREFERRED except at the top of this file 2023-10-14 18:08:33 -04:00
Robert Muir 3ec9c26d67
speedup all binary functions on avx256, speedup binary square on avx512 2023-10-14 16:28:26 -04:00
Robert Muir e93bd524cf
cleanup cosine too, no perf impact 2023-10-14 14:10:32 -04:00
Patrick Zhai bac4dd28e0
Fix unstable test TestVectorSimilarityValuesSource (#12678) 2023-10-14 11:04:29 -07:00
Robert Muir a72bf7ce68
simple cleanups to vector code 2023-10-14 13:08:36 -04:00
Robert Muir 872aee6d18
Speedup integer functions for 128-bit neon vectors (#12632) 2023-10-14 11:38:33 -04:00
Robert Muir a4ff129de8
migrate all vectorbench methods to lucene (#12667)
* migrate all vectorbench methods to lucene

Co-authored-by: Uwe Schindler <uschindler@apache.org>
2023-10-14 11:36:42 -04:00
Uwe Schindler 2b8c4b0781
Improve logging for vector support (#12676) 2023-10-13 22:04:05 +02:00
Adrien Grand fb674aa7f2
Fix TestSizeBoundedForceMerge. (#12673)
This test sometimes fails because `SimpleText` has a non-deterministic size for
its segment info file, due to escape characters. The test now enforces the
default codec, and checks that segments have the expected size before moving
forward with forcemerge().

Closes #12648
2023-10-13 18:05:27 +02:00
Greg Miller 7b7b0d2119
Ensure LeafCollector#finish is only called once on the main collector during drill-sideways (#12642) 2023-10-13 07:24:40 -07:00
Greg Miller 681975d6e8
Add javadoc note to LeafCollector#finish (#12643) 2023-10-13 07:03:24 -07:00
Adrien Grand afc990cd2b
Fix lazy decoding of frequencies in `BlockImpactsDocsEnum`. (#12668)
The code was written as if frequencies should be lazily decoding, except that
when refilling buffers freqs were getting eagerly decoded instead of lazily.
2023-10-13 10:42:34 +02:00
Dawid Weiss 06341ffe1d GITHUB#12655: upgrade jacoco aggregation plugin (failed with gradle 8.x), change html output property. 2023-10-12 20:42:17 +02:00
Dawid Weiss a97d7a3e35 Adding Benjamin's readme change #12663 2023-10-12 20:30:58 +02:00
Dawid Weiss 603cd41ca1
Added JMH micro-benchmarks submodule (#12663) 2023-10-12 20:25:34 +02:00
Shubham Chaudhary 52dfe50e8f
Ability to compute vector similarity scores with DoubleValuesSource (#12548)
### Description

This PR addresses the issue #12394. It adds an API **`similarityToQueryVector`** to `DoubleValuesSource` to compute vector similarity scores between the query vector and the `KnnByteVectorField`/`KnnFloatVectorField` for documents using the 2 new DVS implementations (`ByteVectorSimilarityValuesSource` for byte vectors and `FloatVectorSimilarityValuesSource` for float vectors). Below are the method signatures added to DVS in this PR:

- `DoubleValues similarityToQueryVector(LeafReaderContext ctx, float[] queryVector, String vectorField)` *(uses ByteVectorSimilarityValuesSource)*
- `DoubleValues similarityToQueryVector(LeafReaderContext ctx, byte[] queryVector, String vectorField)` *(uses FloatVectorSimilarityValuesSource)*

Closes #12394
2023-10-12 13:34:37 -04:00
Simon Willnauer 268dd54a86
Cleanup flushing logic in DocumentsWriter (#12647)
DocumentsWriter had some duplicate logic for iterating over
segments to be flushed. This change simplifies some of the loops
and moves common code in on place. This also adds tests to ensure
we actually freeze and apply deletes on segment flush.

Relates to #12572
2023-10-12 16:49:39 +02:00
Uwe Schindler fad6653495
Fix Gradle toolchain download with Gradle 8.4 (#12655) (#12662) 2023-10-12 13:22:48 +02:00
Dawid Weiss 2e12a35c87 GITHUB#12655: javac options via -J only when the compiler is in forked mode. 2023-10-12 09:05:03 +02:00
Kevin Risden a8fba38f16
GITHUB#12655: Add google java format upgrade tidy / regen to blame ignore 2023-10-11 16:15:42 -04:00