Commit Graph
100 Commits
Author SHA1 Message Date
xzfc 90f1fd6942 UIO read benchmark (#8575) 2026-05-08 13:46:01 +02:00
xzfc 85b524e2c3 IoUringFile: don't use io_uring for single operations (#8576) 2026-05-08 13:45:58 +02:00
xzfc 5638d1799c Drop RocksDB (#8529)
* Skip broken tests

* Add rocksdb dropper

This is a temporary tool. It will be removed later in this PR.

* [automated] Drop rocksdb

This commit is made by running tools/rocksdb/drop.sh

* Touch-up after ast-grep

The previous automated commit removed items, but not their comments.
Also, some blocks are left with only one item.
Also, ast-grep can't handle macros like `vec![]`.

This commit completes the job.

* Remove RocksDB dropper

* Remove mentions of rocksdb feature in CI

* Fix clippy warnings

These `FIXME` comments added previously in this PR by ast-grep by
"peeling" cfg_attr like this:

    -#[cfg_attr(not(feature = "rocksdb"), expect(...))]
    +#[expect(...)] // FIXME(rocksdb): ...

This commit removes these allow/expect attributes and fixes clippy
lints.

* Remove leftover rocksdb-related code

Removed:
- Cargo.toml: rocksdb cargo feature flag and dependencies.
- code: rocksdb-related items that was not under feature flag.
- flags.rs: rocksdb-related qdrant feature flags.

Disabled:
- Some benchmarks because these do not compile now.

* Print warning if rocksdb leftovers found in snapshots

* Remove Clone from tokenizer

* Regenerate openapi.json
2026-05-08 13:45:44 +02:00
xzfc 45c519995a Add TypedStorage wrapper (#8508)
* Remove UniversalRead::is_empty

Reason: Less methods to override in wrappers. And I don't think this
method makes much sense.

* Move common::universal_io::{ => wrappers}::read_only

* Update ReadOnly wrapper

Implement missing methods, and follow the code style of the upcoming
TypedStrorage wrapper.

* Add TypedStorage

* Use TypedStorage

* Add reminder comments

* Clarify TypedStorage use-case
2026-03-26 18:52:41 +01:00
xzfc 07f5341e98 Propagate OperationResult (#8433) 2026-03-26 18:44:06 +01:00
xzfc 33c97e8120 Propagate OperationResult [3/4]: estimate_cardinality (#8446) 2026-03-26 18:35:41 +01:00
xzfc 530027002a edge 0.6.0 (#8459) 2026-03-26 18:28:52 +01:00
xzfc 4d560bd88f Touch-up UIO traits (#8457)
* UIO traits: require Sized

I don't think we ever going to add unsized implementation. So, lets,
require it on the whole trait rather than on individual methods.

* Move `AccessPattern` to the `common` package

Was: segment::vector_storage::vector_storage_base::AccessPattern
Now: common::generic_consts::AccessPattern

* UIO traits: replace `bool` with `AccessPattern`
2026-03-26 18:28:33 +01:00
xzfc 09c96ead01 Propagate OperationResult [2/4]: SegmentEntry (#8445) 2026-03-26 18:24:24 +01:00
xzfc 206a5c65f4 Propagate OperationResult [1/4]: payload_blocks (#8444) 2026-03-26 18:23:40 +01:00
xzfc 6a719a7726 Use GeoHash instead of &GeoHash (#8443) 2026-03-26 18:22:51 +01:00
xzfc e6497cb31e Edge flat api (#8381)
* refactor(edge): let edge re-export segment/shard/sparse

* chore(ast-grep-rules): handle path like `::shard::blah::Blah`

This commit was required during the refactoring. It turns out we don't
need it right now, but it might be useful in the future. Or not.

* refactor(edge-rs): Rehaul public API
2026-03-26 18:21:40 +01:00
xzfc da4c15a5fc DiscoveryQuery -> DiscoverQuery (#8378) 2026-03-26 17:55:57 +01:00
xzfc c41a582296 Chores (#8370)
* chore: gitignore .idea and .vscode globally

Reason: `lib/edge/publish` is a separate Cargo workspace and I'd like to
have a separate rust-analyzier configuration for it, which is stored in
`.vscode/settings.json`. Not sure about `.idea`, but I guess the same
logic applies.

* chore: Use Iterator::is_sorted (stabilized in Rust 1.82)

* chore: remove unrelated files

These were added in #5501 (42fd2e27), perhaps by accident?
2026-03-26 17:52:01 +01:00
xzfc 6d16442357 Test edge examples on CI (#8318)
* lib/edge/publish/cargo: improve target directory discovery

Don't hardcode workspace root, ask cargo instead.

* Fix warning in qdrant-edge amalgamation

`cargo check` in `lib/edge/publish` produces the following warning:

    warning: type `PointerUpdates` is more private than the item `gridstore::tracker::Tracker::<S>::write_pending`

* lib/edge/publish/examples: fix compiler warnings

* refactor: lib/edge/publish/examples: put DATA_DIRECTORY into lib.rs

To match python examples that have the same constant in `common.py`.

* Use `lib/edge/data` dir for both Python and Rust examples

Before this commit, `lib/edge/publish/data` and `lib/edge/python/data`
were used. I'd like Python and Rust to use the same prepared resources
in the future.

* Add lib/edge/Justfile with recipes to build/run examples

I constantly keep forgetting how to compile and run edge stuff.
Also, this would be used in CI in subsequent commits.

* doc: lib/edge/README.md: Combine Rust and Python Edge readmes

Also now we can rename `creates-io-readme.md` to `README.md` like
reasonable people.

* doc: Add qdrant-edge-py README.md

Since the previous commit removed qdrant-edge-py README.md, we need to
add something in its place instead.
The new README is adapted from Rust edge README.
And the previous README wasn't good anyway, see [1], it mentions maturin
which is irrelevant for users.

[1]: https://pypi.org/project/qdrant-edge-py/0.5.0/

* GHA: Add "Setup Qdrant" composite action

We need running Qdrant instance to test edge examples on CI. We can't
use docker for this because we want to run tests on Windows and macOS.
OTOH, this action downloads binaries for all platforms provided in
https://github.com/qdrant/qdrant/releases/tag/v1.17.0

* GHA: Use single worflow for python and rust edge examples

Merge workflows to reuse build cache. Also, modernize it by using `uv`,
and recently introduced `setup-qdrant` and Justfile. Also, make it run
on three platforms (only on merges).

* GHA: edge-{py,rust}-release: also run examples before publishing

Use similar approach as in the previous commit. But note that this time
we build/test also on ARM Linux and Windows.
2026-03-26 17:51:49 +01:00
xzfc 1f9946f6d3 Update Readmes/manifest for qdrant-edge Rust package (#8316) 2026-03-26 17:40:36 +01:00
xzfc 2efc29507f Synchronize Rust and Python edge examples (#8312) 2026-03-26 17:39:38 +01:00
xzfc 89333b49eb Fix edge examples (#8295)
* amalgamate.py: replace `env!("CARGO_PKG_VERSION")`

Otherwise segment thinks it's v0.0.0 which breaks examples.

* Fix lib/edge/python/examples/repr.py

It it broken by d9393acac6 (#7933), which renamed `SegmentConfig` →
`EdgeConfig` and removed `index` parameter from `VectorDataConfig` by
hardcoding it to `Plain`.

Before:

    $ python lib/edge/python/examples/repr.py
    NameError: name 'SegmentConfig' is not defined

After:

    $ python lib/edge/python/examples/repr.py
    EdgeConfig(vector_data={"": VectorDataConfig(size=128, ...)}, ...)

* gitignore output of Rust edge examples

* Restore `lib/edge/python/examples/.gitignore`

I'm not sure why it's removed in 65312a1e82e6ae4d/#7522.

* Add `prepare_facet_snapshot.sh` for `facet_test.rs`

The script is based on steps mentioned in #8045.

* Remove `edge-cli.rs` example

It was added in 895318913afbad4a/#7140 and seems incomplete.
2026-03-26 17:37:53 +01:00
xzfc e23cc13d0a Remove shard dependency on api (#8284)
* Move `DenseVector`/`MultiDenseVector` from `api` to `segment`

* Move `OrderByInterface` from `api` to `segment`

Reason: it's used in `edge` which shouldn't depend on `api`.

* Make `shard` -> `api` dependency optional

* Remove `api` from the amalgamation

* Don't install protoc in edge Actions
2026-03-26 17:37:48 +01:00
xzfc 91d2d7cbb1 Qdrant edge rust fixes (#8277)
* amalgamate.py: specify encoding="utf-8"

For legacy platforms that still default to cp1252.

* amalgamate.py: use `shutil.which`

In case if `ast-grep` is a cmd wrapper.

* amalgamate.py: write rules to temporary file

Windows runner don't like inline-rules.

* amalgamate.py: Add decription to package

Required for publishing to crates.io.

* amalgamate.py: package build scripts for `common` and `segment`

Also, add more comments.

* amalgamate.py: keep generated module order deterministic

Not an issue, but nice to have. Suggested by CodeRabbit.

* edge-rust-release.yml: also check on arm machines

* edge-rust-release.yml: Use cargo build instead of cargo check

To catch linker errors.

* edge-rust-release.yml: disable fail-fast (for easier debugging)

* edge-rust-release.yml: add --no-verify to cargo publish

The previous job `edge-rust-check` already builds it, no need to build
it again in the `publish` job.
2026-03-26 17:30:44 +01:00
xzfc 7e2d6b588c Workflow to publish qdrant-edge on crates.io (#8260)
* [ai] Workflow to publish qdrant-edge on crates.io

* Doc, tune Cargo.toml
2026-03-26 17:29:53 +01:00
xzfc 3fa476865b Single edge crate (#8173)
* Fixups of amalgamator

Fix issues that break `qdrant-edge` build process:
- `use … as segment;` - this causes `ast-grep` rules to replace wrong
  paths. So, rename to avoid collisions.
- `#[macro_use]` and `extern crate` required be in the top-level
  `lib.rs`.
- `format!("…", crate::something::…)` - `ast-grep` can't fix paths
  inside macros. Fixed by moving `crate::something::…` out of the macro.

* Add lib/edge/publish workspace and amalgamation script

* Move `lib/edge/examples` into `lib/edge/publish/` workspace

And fix them to use the generated `qdrant-edge` crate.

* Add github workflow

* Cleanup `qdrant-edge` public API

Removes empty modules. Checked by `cargo doc`.
2026-03-26 17:02:24 +01:00
xzfc bc838f6aa9 Use qdrant-rust-stemmers from crates.io (#8199) 2026-03-26 16:56:05 +01:00
xzfc 8fb7adea98 Move github.com/qdrant/wal into lib/wal (#8185)
* Copy github.com/qdrant/wal into lib/wal

Commit: c07fb56ebc8120ebe4e3c602d31ce98f356f4676 2026-02-18

* Clean cruft

* Integrate lib/wal into workspace

* Cargo fmt

* Fix clippy warnings

* Adhere to our conventions

* Fix codespell warnings
2026-03-26 16:53:55 +01:00
xzfc 66d0c36009 Merge io and memory into common (#8155)
* Unify parking_lot/arc_lock feature

* Move lib/common/{io,memory}/* -> lib/common/common/*

- Mmap-related items are grouped into `common::mmap` sub-module:
  - `memory/src/chunked_utils.rs`      -> `common/src/mmap/chunked.rs`
  - `memory/src/madvise.rs`            -> `common/src/mmap/advice.rs`
  - `memory/src/mmap_ops.rs`           -> `common/src/mmap/ops.rs`
  - `memory/src/mmap_type_readonly.rs` -> `common/src/mmap/mmap_readonly.rs`
  - `memory/src/mmap_type.rs`          -> `common/src/mmap/mmap_rw.rs`
- Filesystem-related items are grouped into `common::fs` sub-module:
  - `common/src/fs.rs`          -> `common/src/fs/sync.rs`
  - `io/src/file_operations.rs` -> `common/src/fs/ops.rs`
  - `io/src/move_files.rs`      -> `common/src/fs/move.rs`
  - `io/src/safe_delete.rs`     -> `common/src/fs/safe_delete.rs`
  - `memory/src/checkfs.rs`     -> `common/src/fs/check.rs`
  - `memory/src/fadvise.rs`     -> `common/src/fs/fadvise.rs`
- Rest is moved straight into `common`:
  - `io/src/storage_version.rs` -> `common/src/storage_version.rs`

The old `io` and `memory` are now hollow crates that re-export items
from `common`. These hollow crates will be removed in next commits.

* Replace uses of `io` and `memory` with new paths in `common`

Since `io` and `memory` are just re-exports of `common`, these
replacements are no-op.

* Remove `io` and `memory` crates
2026-02-17 11:01:14 +01:00
xzfc 22e8a56b86 Fix Cargo.lock (#8157) 2026-02-17 11:01:14 +01:00
xzfc 88c51ae772 Add doc for #[pyclass_repr] (#8110) 2026-02-13 09:55:46 +01:00
xzfc b1e3e421b0 Chore: promote dependencies to workspace level (#8061)
* Promote `env_logger` to workspace dependency

* Promote `anyhow` to workspace dependency

* Promote `rmp-serde` to workspace dependency

* Promote `tinyvec` to workspace dependency

* Promote `async-trait` to workspace dependency

* Promote `url` to workspace dependency

* Promote `self_cell` to workspace dependency

* Promote `cc` to workspace dependency

* Promote `bitpacking` to workspace dependency
2026-02-10 00:02:45 +01:00
xzfc 5d72481af3 Callback-based DenseVectorStorage::for_each_in_dense_batch (#8033)
* Generalized vector offset

* Replace get_batch-like methods with for_each-like methods
2026-02-09 23:58:14 +01:00
xzfc 8fb203eeb5 Update GET collections/{}/optimizations (#7946)
* refactor(SegmentOptimizer::name): make it `&'static`

* refactor(TrackerStatus): add is_running()

* refactor: add TrackerSegmentInfo

* feat: rework optimizations endpoint

* feat(collections/{}/optimizations): trim spaces
2026-02-09 23:28:03 +01:00
xzfc 5c8da73447 Fix hnsw_incremental_build benchmark (#7978)
* Fix hnsw_incremental_build benchmark

* More docs
2026-02-09 23:26:12 +01:00
xzfc de04a66d3c Sync LocalShard::optimizers (#7962) 2026-02-09 23:20:48 +01:00
xzfc 6abd5a1776 Enforce segment UUIDs (#7958)
* Swap docstrings for segment_ids/segment_uuids

Terse internal docs, detailed user-facing docs, not vice versa.

* Enforce segment UUIDs

* Export upcoming segment UUID to telemetry

* Add `optimize_for_test` wrapper

* Tune log message

Reason: the UUID is now guaranteed.

* Improve argument naming/docs
2026-02-09 23:20:44 +01:00
xzfc cada712738 GET /optimizations: re-plan on each request (#7945) 2026-02-09 23:14:02 +01:00
xzfc d9d2801c71 Expose planned optimizations in API (#7784)
* Expose pending optimizations in API

* Address review comments
2026-02-09 23:07:34 +01:00
xzfc 722fa2fc31 OptimizationPlanner (#7752)
* refactor(SegmentHolder::iter): use SegmentId, not &SegmentId

* refactor(SegmentHolder): Add SegmentHolder::iter_original

* refactor: inline *Optimizer::worst_segment() into SegmentOptimizer::check_condition

* refactor(ConfigMismatchOptimizer): extract config_mismatch function

* Fix comments

* refactor: consistent variable naming

It's `segment_id`/`_segment_id`, not `idx`/`sid`/`x.0`/`_`.

* refactor(IndexingOptimizer): extract large chunks of logic

* refactor(SegmentOptimizer): simplify unwrap_proxy/handle_cancellation

* SegmentHolder: add running_optimizations counter

* OptimizationPlanner

* MergeOptimizer: allow merging two segments, update doc
2026-02-09 23:03:57 +01:00
xzfc fbb310e633 Put unreliable unsafe block behind "testing" feature flag (#7884) 2026-02-09 22:52:07 +01:00
xzfc b08c19ed88 Use syncfs (#7883)
* Remove call to Archive::set_sync

Also, this method was the last remaining part of our `tar-rs` fork,
so we can switch to the upstream version now.

* Do syncfs
2026-02-09 22:48:16 +01:00
xzfc 0c8dad0db3 Remove ProgressState::Skipped (#7873) 2026-02-09 22:39:45 +01:00
xzfc 62f18d5f94 Safe delete (#7830)
* Replace `Option<Segment>` with `enum LoadSegmentOutcome`

* Replace some Path/PathBuf with str/String

* Rename field Segment::{current_path -> segment_path}

* safe_delete
2026-02-09 22:35:57 +01:00
xzfc d8c6e4ca41 Re-style .proto files (#7475)
* proto: doc comment style

* proto: clang-format

* proto: manually reflow some comments

* proto: proofread
2025-12-18 17:28:51 +01:00
xzfc 0e37e7577e Optimization panic status cleanup (#7783) 2025-12-18 17:28:51 +01:00
xzfc 188bd3a51c Register trackers only after successfull start (#7766) 2025-12-18 17:28:51 +01:00
xzfc 86a36984c9 Fix shell.nix for tikv-jemallocator 0.6.1 (#7697) 2025-12-18 17:27:18 +01:00
xzfc 8013c73978 Ignore deprecation warnings for schemathesis (#7730) 2025-12-18 17:27:18 +01:00
xzfc 6c0d10abe7 Indexing progress (#7625)
* Add progress_tracker.rs

* Pass progress tracker around

* Populate progress tracker with actual data

* Expose progress on `/collections/{name}/optimizations` endpoint
2025-12-18 17:27:18 +01:00
xzfcandgenerall 01837c85d9 Don't reuse links with vectors, optimize OldIndexCandidate::evaluate (#7467)
* links_empty

* Don't reuse links with vectors

* review fixes

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-11-14 12:30:14 +01:00
xzfc 1f3cad76b4 Replace RwLock<BitVec> with BitVec<AtomicUsize> (#7468) 2025-11-14 12:30:14 +01:00
xzfc c90d138902 Drop docs/grpc/docs.md (#7453) 2025-11-14 12:30:13 +01:00
xzfc 828f6bc275 Misc edge dev env fixes (#7456) 2025-11-14 12:30:12 +01:00
xzfc af32c530d3 Expose AcornSearchParams to edge Python bindings (#7455) 2025-11-14 12:30:12 +01:00
xzfcandgenerall 21329ca529 Add ACORN-1 search (#7414)
* GraphLayersBase::try_for_each_link

* Add FilteredScorer::score_points_unfiltered

* Add GraphLayersBase::search_on_level_acorn()

* Add SearchParams::acorn API parameter

* Integrate ACORN to HNSW search

* Add doc

* review fixes

* Misc fixes

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-11-14 12:30:12 +01:00
xzfc 9da05521ab Refactor: merge _search_on_level into search_on_level (#7403)
* Call search_on_level instead of _search_on_level

* Inline _search_on_level into search_on_level

* Inline _search_on_level_with_vectors into search_on_level_with_vectors
2025-11-14 12:29:32 +01:00
xzfc 3b66552c2f Use fs_err::exists and fs_err::tokio::try_exists (#7401) 2025-11-14 12:29:31 +01:00
xzfc d2e47f54f5 Rename HnswConfig::{copy_vectors -> inline_storage} (#7389) 2025-11-14 12:28:14 +01:00
xzfc 783c765d22 DiffConfig: replace serde-based impl with explicit impl (#7294)
* refactor: replace serde-based DiffConfig implementation with macro

* refactor: macroexpand impl_diff_config

* refactor: drop `merge` dependency as unused
2025-11-14 12:26:53 +01:00
xzfc 59b8c886b3 Add CollectionInfo::warnings field (#7293)
* refactor: swap DiffConfig parmeters

was: diff.update(&config)
now: config.update(diff)

* refactor: introduce DiffConfig::update_opt

* feat: add CollectionInfo::configuration_status field

* rename ConfigurationStatus to CollectionWarning
2025-11-14 12:26:52 +01:00
xzfc 6a2830db1c Use fs-err (#7319) 2025-11-14 12:26:51 +01:00
xzfcandgenerall 122430109d Integrate hnsw_with_vectors (#7232)
* StorageGraphLinksVectors::try_new, make GraphLinksVectorsLayout non-fallible

* Integrate hnsw_with_vectors

* remove unused function

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-09-29 11:30:43 +02:00
xzfc 46e292c225 Limit concurrent calls to load_segment (#7233)
* Limit concurrent calls to `load_segment`

* Use StreamExt::buffer_unordered
2025-09-29 11:29:22 +02:00
xzfc 322c347796 Fix: config mismatch optimizer trigger loop (#7242) 2025-09-29 11:29:22 +02:00
xzfc 111c1f8d76 HNSW: use new graph format during search (#7195)
* point_scorer: generic `Filters` -> non-generic `ScorerFilters`

point_scorer: rename FilteredQuantizedScorer -> FilteredBytesScorer

* Use ScorerFilters when appropriate

* {CustomQueryScorer,MetricQueryScorer}: SupportsBytes = True

* Add GraphLayersWithVectors::search_with_vectors

* Use GraphLayersWithVectors::search_with_vectors in HNSWIndex::search_with_graph

* Move `BoxCow` and `SimpleCow` to a common module

* Review remarks
2025-09-29 11:27:40 +02:00
xzfc c75bc7ca03 Fixup remaining PeerId anonymization (#7207) 2025-09-29 11:27:40 +02:00
xzfc a13f437607 CompressedWithVectors: include base/full vectors (#7171)
* Add VectorStorageEnum::{get_vector_bytes_opt, get_vector_layout}

* Update CompressedWithVectors format to include base vectors

* StorageGraphLinksVectors

* Clarify code
2025-09-29 11:26:37 +02:00
xzfc 4473d36834 Generic AccessPattern (#7166) 2025-09-29 11:26:00 +02:00
xzfc 008629b3f3 Misc fixes (#7134)
* PrimitiveVectorElement: use zerocopy

* PrimitiveVectorElement: also use zerocopy::FromBytes

* serialize_graph_links: back_index is Vec<PointOffsetType>

* for_each_link_with_vector: loosen lifetimes
2025-08-26 13:20:06 +02:00
xzfc 5e80d190ba Clean up GraphLayers::search_entry_on_level a bit (#6946)
review remarks

are you happy fmt

don't do unnecessary scoring
2025-08-26 13:19:38 +02:00
xzfc 55adf7fc3d Add memory::madvise::will_need_multiple_pages() (#7124) 2025-08-26 13:19:36 +02:00
xzfc 9e292a3d8e Remove unused GraphLinks::on_disk method (#7125) 2025-08-26 13:19:36 +02:00
xzfc f040579646 Graph links serializer: avoid large intermediate allocations (#7118)
* Introduce io::file_operations::atomic_save

* Replace GraphLinksSerializer with serialize_graph_links
2025-08-26 13:18:36 +02:00
xzfc b9638786e4 Add AI review rules (#7080) 2025-08-26 13:16:40 +02:00
xzfc 518138c7c4 Optional scorer methods via TBool (#6989)
* Add common::typelevel module

* Use common::typelevel for score_bytes

* Revert "Split FilteredScorer into FilteredScorer and FilteredQuantizedScorer"

This reverts commit ff3a93ee95.

* FilteredQuantizedScorer

* Extract `struct Filters` from `FilteredScorer` and `FilteredQuantizedScorer`

* Revert "QuantizedVectors::query_scorer_bytes"

This reverts commit 9dee824afd.

* Partial revert "Add QueryScorerBytes::score_bytes"

This reverts commit d80af4f698, but keeps
the QueryScorerBytes trait while removing implementations.

* Partial revert "Add EncodedVectorsBytes::score_point_vs_bytes"

This partially reverts commit c741e42f9a.
- trait `EncodedVectorsBytes` and its implementations: reverted/removed
- calls to `EncodedVectorsBytes::score_point_vs_bytes`: replaced with
  calls to `EncodedVectors::score_bytes`

* Remove unused method FilteredScorer::new_from_raw
2025-08-26 13:16:39 +02:00
xzfc 27a45246b9 shell.nix: switch to rustup (#7049)
* shell.nix: npins upgrade

* shell.nix: bump to rust 1.89

* shell.nix: use rustup instead of fenix
2025-08-14 14:30:26 +02:00
xzfc f918904f74 Implement GraphLinksFormat::CompressedWithVectors (#6982)
* Simplify graph_links tests

* Rstest-ify hnsw_index::tests::test_save_load

* Rename EncodedVectorsU8::{get_quantized_vector => get_quantized_vector_offset_and_code}

Reason: it was inconsistent with other implementations of
get_quantized_vector().

* Add QuantizedVectors::{get_quantized_vectors, get_quantized_vector_layout}

* Rename `links_map` to `for_each_link`

* pack_links: expose the updated `raw_links` order

* TestRawScorerProducer: support quantization

* Make GraphLinksSerializer::new return Result

* Rename links/compressed_links into `neighbors`

* Implement GraphLinksFormat::CompressedWithVectors

* GraphLayersWithVectors

* bitpacking: add packed_links_size

* Reorder neighbors: N__VVVVVVVcccccccccc -> Ncccccccccc__VVVVVVV
2025-08-14 14:28:04 +02:00
xzfc cfa5f9e804 TestRawScorerProducer to use VectorStorageEnum (#6965)
* TestRawScorerProducer to use VectorStorageEnum

* TestRawScorerProducer:🆕 accept distance as an argument

* Drop TMetric from TestRawScorerProducer

* Remove `impl VectorStorage for TestRawScorerProducer`

* Add TestRawScorerProducer::internal_scorer

* Remove TestRawScorerProducer::get_vector

* Rename TestRawScorerProducer::{get_scorer => scorer}
2025-08-11 13:16:55 +02:00
xzfc e329b0a43e Add Distance::preprocess_vector (#6964) 2025-08-11 13:15:57 +02:00
xzfc 0a53f72e31 QueryScorerBytes (#6945)
* Add EncodedVectorsBytes::score_point_vs_bytes

* Add QueryScorerBytes::score_bytes

* QuantizedVectors::query_scorer_bytes

* Split FilteredScorer into FilteredScorer and FilteredQuantizedScorer
2025-08-11 13:15:49 +02:00
xzfc b79757d072 Introduce StableHash (#6940)
* Introduce StableHash

* Use SipHasher24 explicitly
2025-08-11 13:15:14 +02:00
xzfc 916d84a2aa MADV_POPULATE_READ on sequential mmaps (#6923) 2025-07-24 08:46:18 +02:00
xzfc ceb9ea1f34 GraphLayersHealer: use quantized vectors (#6795) 2025-07-17 13:42:14 +02:00
xzfc e8fc86cbdf Compare versions, not vectors (#6779) 2025-07-17 13:41:10 +02:00
xzfc 231567c31a Configurable HNSW healing threshold (#6756) 2025-07-17 13:26:25 +02:00
xzfc 6bc67f42c8 Clean up QuantizedVectors::raw_internal_scorer (#6740) 2025-07-17 13:18:52 +02:00
xzfc fad498ff27 Generalize RawScorer construction (#6733)
* Generic raw_scorer_impl and new_scorer_with_metric

* Generic raw_multi_scorer_impl and new_multi_scorer_with_metric

* Remove unused imports
2025-07-17 13:17:28 +02:00
xzfc 847bc2faf6 Fix CI cargo --locked build (#6732) 2025-07-17 13:17:20 +02:00
xzfc 85f74b459f Add hnsw_incremental_build benchmark (#6615) 2025-07-17 13:17:15 +02:00
xzfc 38e0bbd640 Insert backlinks during healing (#6650)
* refactor: add GraphLinks::to_edges

* refactor: copy-on-write is no more

* Healing: insert backlinks

* Replace SearchContext with FixedLengthPriorityQueue
2025-07-17 13:16:23 +02:00
xzfc aa2e46a949 Replace some generic parameters with associated types (#6711)
* Make EncodedVectors::EncodedQuery associated type

* Make EncodedStorageBuilder::Storage associated type

* Make QueryScorer::TVector associated type

* Remove TVector from RawScorerImpl generic parameters
2025-07-17 13:14:32 +02:00
xzfc 3f81dfe3e1 Move .github/workflows/actions to .github/actions (#6697) 2025-07-17 13:13:51 +02:00
xzfc e365ddca69 Move codespell config to tools/codespell.toml (#6707) 2025-07-17 13:12:49 +02:00
xzfc 8bc1e6c9f9 migrate_point_on_level: heal up to level_m (#6624) 2025-07-17 13:02:47 +02:00
xzfc 9ad04f427b Introduce HnswM (#6647) 2025-07-17 13:02:23 +02:00
xzfc 8e4fc674d4 Invert feature_flags.hnsw_healing (#6589) 2025-05-23 11:40:19 +02:00
xzfcandgenerall 08b343e0ab HNSW healing (#6543)
* Let SearchContext::new create empty context

* FixedLengthPriorityQueue: add `is_full()`

* Implement HNSW healing

* Apply review suggestions

* review comments and docstrcigs

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-05-22 23:18:32 +02:00
xzfc bf4363d786 shell.nix: bump to rust 1.87 (#6547)
* shell.nix: bump to rust 1.87

* shell.nix: workaround for jemalloc
2025-05-22 23:18:21 +02:00
xzfc d70a8d8157 Remove some generics from scorer (#6544)
* Make TInputQuery constructor parameter, not struct parameter

* VectorElementType could be implicit
2025-05-22 23:18:15 +02:00
xzfc 07fbab30fa Heuristic optimization (#6501)
* Refactor out LinksContainer

This commit extracts Vec<PointOffsetType> and heuristic related
functions from graph_layers_builder.rs into a new file.

No significant changes in logic are made.

* Optimize LinksContainer

* Add illustration

* Fixups

* Add more comments and rename `score` to `cached_score`
2025-05-22 23:08:27 +02:00
xzfc ce1adf4026 Move filtering logic from RawScorer to FilteredScorer (#6245) 2025-05-22 22:49:19 +02:00
xzfc 1f805b618e Clear disk cache after read (#6396)
* Move clear_disk_cache to memory::fadvise

* Add memory::fadvise::OneshotFile

* Use OneshotFile
2025-04-21 00:08:52 +02:00
xzfc feb06c9113 Enable incremental_hnsw_building default (#6355) 2025-04-21 00:02:36 +02:00