Commit Graph
71 Commits
Author SHA1 Message Date
Luis Cossío 47207f6b25 refactor and apply to filter as id iterator 2026-06-17 18:20:49 -04:00
Luis Cossío af867b8b63 override for_values_map for OnDiskMapIndex 2026-06-17 16:16:36 -04:00
Luis Cossío ad91199b13 polish comments 2026-06-16 11:17:43 -04:00
Luis Cossío 5160029152 no duplicate values in map index 2026-06-16 10:53:13 -04:00
Luis Cossío 7474eae2a3 refactor tests 2026-06-15 18:46:03 -04:00
Luis Cossío 79b6604499 fix rebase + clippy 2026-06-15 14:23:03 -04:00
Luis Cossío 6a60a794b3 avoid sampling with restrictive filter 2026-06-15 14:14:24 -04:00
Luis Cossío f34b2b4366 precollect filter into bitmap 2026-06-15 14:14:23 -04:00
Luis Cossío 1876f4a927 [AI] implement candidate-based lookups
[AI] 🧹
2026-06-15 14:14:23 -04:00
Luis Cossío d514869cdc manual simplification 2026-06-15 14:14:23 -04:00
Luis Cossío b0d1482138 [AI] simplify, use single file
[AI] better selection of filtering approach

fmt

[AI] simplify, use single file
2026-06-15 14:14:23 -04:00
Luis Cossío da8a213ee1 Add facets bench (#9456) 2026-06-15 09:29:12 -04:00
Luis Cossío 729392b893 Standardize full text index (#9387)
* rename to OnDiskFullTextIndex

* rename module to `on_disk_text_index`

* rename to OnDiskPostings

* rename module to `on_disk_inverted_index`

* rename to OnDiskInvertedIndex

* remove `Box`ing

* get rid of `is_on_disk` field, propagate Populate

* add separate OnDisk and Immutable readonly variants

* rename in tests too

* nits
2026-06-09 10:33:01 +02:00
Luis Cossío 33575bb8da [UIO] Sorted offsets in LiveReload (#9385) 2026-06-08 16:43:01 -04:00
Luis Cossío 1a8d8dfdba Standardize on-disk geo index & friends (#9339)
* rename GeoMapIndex -> GeoIndex

* rename on_disk module

* fmt

* remove `Box`ing

* add separate immutable and on-disk read-only variants

* propagate Populate, respect `on_disk`, remove `is_on_disk`

* rename to `new_immutable` and fix tests

* more geomap -> geo renaming

* more adhoc `open_*` suffixes
2026-06-05 15:16:42 -04:00
Luis Cossío 61c557f373 de-duplicate ingestion method for geo-index (#9322) 2026-06-04 20:51:06 -04:00
Luis Cossío d67f7d098d chore: Refactor mutable map index inner (#9319)
* replace `ingest` with `add_many_to_map`

* rename to InMemoryMapIndex

* rename module

* fmt

* clippy

* don't index if there's no values
2026-06-04 15:32:05 -04:00
Luis Cossío 513f05a28d Standardize map index (#9305)
* rename to OnDiskMapIndex

* rename module

* remove `is_on_disk` field from `OnDiskMapIndex`

* add separate Immutable and OnDisk ReadOnlyMapIndex

* rename StoredPointToValues to OnDiskPointToValues

* rename module to `on_disk_point_to_values`

* rename to `build_from_iter` and add `populate` arg

* fix test
2026-06-04 10:05:44 +02:00
Luis Cossío 66be8bd30a Rename indexes variants (#9281) + fixup for #9294
* rename IndexSelector variants

* rename MapIndex::Mmap to MapIndex::OnDisk

* rename NumericIndex::Mmap to NumericIndex::OnDisk

* rename BoolIndex::Mmap to BoolIndex::Mutable

* rename FullTextIndex::Mmap to FullTextIndex::OnDisk

* rename GeoMapIndex::Storage to GeoMapIndex::OnDisk

Also rename a few functions and test variants

* Standardize numeric index (#9294)

* remove `UniversalNumericIndex.is_on_disk` field

* have separate Immutable and OnDisk variants for ReadOnlyNumericIndexInner

* rename UniversalNumericIndex -> OnDiskNumericIndex

* rename module to `on_disk_numeric_index`

* actually load as immutable if on_disk=false

* fixup! Standardize numeric index (#9294)

Make builder also return proper Immutable variant

* review nits
2026-06-03 14:59:51 -04:00
Luis Cossío c073fe3137 [UIO] More read_json_via (#9270) 2026-06-02 13:14:38 -04:00
Luis Cossío e0d948980a [UIO] Open UniversalMapIndex with S::Fs (#9256)
* open UniversalMapIndex with `S::Fs`

* Not found is Ok(None)
2026-06-01 14:46:45 -04:00
Luis Cossío fe28339d15 [UIO] Universal load numeric index (#9234)
* rename module, use read_via

* propagate S to `UniversalNumericIndex<T, S>`
2026-05-29 22:12:17 +02:00
Luis Cossío 5bc9847972 [UIO] Load GraphLinks with any backend (#9214)
* load with any universal io

* Don't populate with sequential advice

* use appropriate fs for `exists`

* use `read_whole_via` more

* TODO

* clear ram cache after read_whole
2026-05-29 11:06:26 -04:00
a827be89e9 [#9159 alternative] Oversample with approx facet (#9208)
* Oversample with approx facet

* return early for limit=0

* Document distributed limit flow on Collection::facet

Add an ASCII diagram showing how the facet limit is oversampled once on
the entry node and how peer nodes enter via facet_internal without
re-oversampling.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: generall <andrey@vasnetsov.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 09:54:01 -04:00
Luis Cossío fe70f1ecfc [DiskCache tests] Fix reopen on windows (#9189)
* reactivate tests

* try to release remote
2026-05-27 12:22:45 -04:00
Luis Cossío 49eebeb852 [DiskCache] use and impl schedule_whole (#9185)
* impl schedule_whole for DiskCache

* use schedule_whole for background prefill

* ignore unit arg in bench

* bundle R bounds into trait
2026-05-27 10:28:15 -04:00
Luis Cossío 815b55deb0 flush BitmaskGaps before reopening (#9186) 2026-05-27 10:24:40 -04:00
Luis Cossío 48363df9d7 [UIO] Use UniversalRead::reopen (#9127)
* use universal reopen

* remove unused fs args
2026-05-26 13:00:22 -04:00
Luis Cossío 8fdc86bcfb bump ecow to 0.3.0 (#9182) 2026-05-26 11:43:22 -04:00
Luis Cossío 557051ecf0 [UIO] Impl DiskCache::reopen (#9143) 2026-05-25 15:01:14 -04:00
Luis Cossío ed9489523c [UIO] Introduce OwnedReadPipeline::schedule_whole (#9128) 2026-05-25 12:53:17 -04:00
Luis Cossío cf8d968991 Merge pull request #9097
* impl async prefill

* use enum in `init_lock`

* init from scratch if channel closes

* cfg tests with prefill

* dirty update to pipe2

* cleanup & deduplicate code

* fix prefill pipeline

* self nits

* fix rebase

* separate file for `LocalState`

* more doc comments

* use acq/rel ordering

* handle empty byte range conversion

* todo reopen

* review: remove redundant functions

* review: T: + Send

* fmt
2026-05-25 16:47:26 +02:00
Luis Cossío 965cf4c4b3 [UIO] Introduce UniversalRead::reopen (#9123)
* add `UniversalRead::reopen` fn

* thx coderabbit
2026-05-22 08:22:08 -04:00
9e32c940e4 Introduce simple disk cache (#8792)
* [AI + manual] initial impl

[AI] read_batch which actually batches

manual nits

[AI] better handling of local and remote paths

manual refactor, respect open options

don't delete local file

dumbify read_batch

we want to refactor it anyway

simplify

rename to `DiskCache` in `simple_disk_cache` module

* refactor to use always use ReadPipeline

pass meta to remote pipeline

* nits

* run tests for more Remotes

* fix no more <T> in UniversalRead

* fmt

* chore(deps): unify roaring as workspace dep, move duplicate to dev-deps

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: generall <andrey@vasnetsov.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 13:11:51 -04:00
Luis Cossío b6744f6353 [UIO] Generic quantized storage (#9059)
* use generic in QuantizedMmapStorage

* rename to QuantizedStorage

* be explicit about S

* rename builder to `QuantizedStorageBuilder`

* rename file to `quantized_storage.rs`
2026-05-15 21:13:19 -04:00
Luis Cossío 757bc9606f accept Cow in quantization_preprocess (#9061) 2026-05-15 18:32:44 -04:00
Luis Cossío 757a168167 make quantized_vector_size method static (#9060) 2026-05-15 18:31:23 -04:00
Luis Cossío fe36998514 Propagate S to ImmutableIdTracker (#9047) 2026-05-15 11:47:53 +02:00
ee739aff79 [UIO] Introduce Populate enum (#8946)
* introduce `Populate` enum

* fix: apply CodeRabbit auto-fixes

Fixed 6 file(s) based on 6 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>

* fix coderabbit fix

* Use from rather than into

* add `Auto` variant

* fix rebase

* fix rebase again

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Co-authored-by: timvisee <tim@visee.me>
2026-05-14 14:49:09 -04:00
Luis Cossío bc44640216 uring only for linux (#9046) 2026-05-14 12:41:21 -04:00
Luis Cossío 6599f545da [UIO] Additional UniversalRead/Write usage simplifications (#8961)
* bytemuck::Pod already implies 'static

* no supertraits

* regions gaps with TypedStorage

* StoredBitSlice with TypedStorage

* bytemuck for PostingsHeader

* bytemuck for TrackerHeader

* bytemuck for MmapRange

* bytemuck for stored_point_to_values::Header
2026-05-08 20:07:03 +02:00
8aaeb96698 [gridstore, UIO] Simplify OptionalPointer (#8945)
* derive bytemuck::Pod on `OptionalPointer`, get rid of legacy transmute

* remove one layer of Option in `get_raw`

* keep `UniversalRead<u8>` bound, do bytemuck conversion at call site (#8953)

Drop the `+ UniversalRead<OptionalPointer>` / `+ UniversalWrite<OptionalPointer>`
trait bounds added in the previous two commits. Reads and writes of
`OptionalPointer` and `TrackerHeader` now go through `bytemuck::from_bytes` /
`bytemuck::bytes_of` on the existing `u8` byte slices instead.

This keeps the unsafe-transmute removal but avoids the turbofish noise
(`UniversalWrite::<u8>::flusher(&self.storage)`, `<S as UniversalRead<u8>>::open`,
…) that two `T`s on `S` forced everywhere.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* extra refactoring after #8955

* explicit zeroed instantiation

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 20:05:15 +02:00
Luis Cossío 951fbabf9d use UniversalReadFileOps::exists for status file (#8929) 2026-05-08 13:54:20 +02:00
dcbbdeba8e [UIO] Genericize ChunkedVectors.status (#8928)
* genericize ChunkedVectors.status, remove `Sized` bound

* check exists with `UniversalReadFileOps`

* Inline UioChunkedVectors bound, drop the alias (#8952)

The empty trait + blanket impl was a stable-Rust trait-alias workaround
that hid a fairly short bound (UniversalWrite<T> + UniversalWrite<Status>
+ Send + 'static) at the cost of an indirection readers had to mentally
unwind. Spelling it out at the three sites that need it is shorter overall
and immediately tells the reader what is required.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 13:51:48 +02:00
Luis Cossío 0957f61072 match exhaustively on match variants (#8947) 2026-05-07 19:46:38 +02:00
Luis Cossío 449381bca8 [UIO] Generic Roaring/Bitvec flags (#8896)
* propagate to BufferedDynamicFlags

* use duplicate for tests

* propagate to Bitvec/Roaring flags

* propagate to RoaringFlags

* fixup! propagate to BufferedDynamicFlags

* propagate to BitvecFlags
2026-05-05 11:20:28 -04:00
Luis Cossío fb051280a4 Properly handle O_DIRECT in io-uring (#8833)
* handle o_direct with custom buffer

* make separate impl

* use correct inner offset

* align buffer

* codespell

* review fixes

* use o_direct in tests

* clippy

* fix simple read impl

* simpler to_vec()

* use router function

* change todo comment
2026-05-05 11:07:36 -04:00
Luis Cossío c1ba01ba39 [UIO] Generic dynamic flags (#8893)
* rename status

* impl simple StoredStruct

* use StoredStruct in `status`

* rename to `DynamicStoredFlags`

* Propagate `S` generic

* codespell nit
2026-05-05 10:46:10 -04:00
Luis Cossío 658d952103 cfg linux imports (#8829) 2026-04-28 22:00:35 +02:00
Luis Cossío 96c3bfa160 [UIO] Dynamic mmap flags (#8760) 2026-04-21 22:57:18 -04:00
Luis Cossío 5dc27660e5 [UIO, gridstore] generic Bitmask storage (#8501)
* [AI + manual] generalize BitmaskGaps storage

* [AI + manual] use StoredBitSlice in Bitmask

* use MmapFile as default storage

* rename to read_all

* duplicate import
2026-04-21 10:07:39 -04:00
Luis Cossío d8042fc697 [UIO] Migrate numeric index (#8641)
* [manual + AI] migrate `pairs` field, reimplement iterator

Co-authored by Claude

* [AI] no custom iterator, read whole range

* better bounds
2026-04-16 23:59:57 -04:00
Luis Cossío a9345a7ee7 [UIO] Explicit padding for numeric point (#8668)
* derive Pod for Point<T>

* remove clones on Copy type

* fix annoying clippy lint

* serde skip padding

* extract point into a new file

* assert aligment
2026-04-16 21:32:29 -04:00
Luis Cossío 3a0591a218 fix remaining clippy lint (#8703) 2026-04-17 00:47:05 +02:00
Luis Cossío ab49dbd188 [UIO] BufferedUpdateBitSlice (#8679)
* rename

* migrate `MmapBitsliceBufferedUpdateWrapper` -> `BufferedUpdateBitSlice`
2026-04-14 17:03:16 -04:00
b1e9c9a9df [UIO] migrate SliceBufferedUpdateWrapper (#8518)
* migrate SliceBufferedUpdateWrapper

* fix compressed versions creation

* @xzfc's review improvements

Co-authored-by: xzfc <5121426+xzfc@users.noreply.github.com>

* fix rebase

* Drop usage of `TypedStorage`

---------

Co-authored-by: xzfc <5121426+xzfc@users.noreply.github.com>
Co-authored-by: xzfc <xzfcpw@gmail.com>
2026-04-08 13:09:55 -04:00
Luis Cossío b1d13b9c09 Misc clippy fixes (#8624) 2026-04-07 19:58:22 -04:00
Luis Cossío fa8b441454 Allow shorter reads in IoUring (#8466)
* use assume_init_vec

* allow shorter reads at EOF

* add prevent_caching openoption, allow short read dynamically

* codespell

* fix rebase
2026-03-26 11:56:22 -03:00
Luis Cossío 3af9349e83 impl populate for CachedSlice (#8462)
* impl populate

* nits
2026-03-25 13:59:02 -03:00
Luis Cossíoandxzfc 7f106ce397 impl UniversalRead for local disk cache (#8368)
* checkout from `ssd-cache-wip`

* impl UniversalRead for CachedFile

* use `CachedSlice` for `UniversalRead` implementation

* block exhaustion test

* fix block exhaustion error

* fix alignment on owned path

* merge CachedFile into CachedSlice

* propagate io errors

* self-review

- log warning if long wait
- Option for RequestState
- clippy

* handle coderabbit's comments

* fix num read bytes check

* don't allocate twice for cache misses

* not for windows, sorry

* no more dead code

* use atomic for file id

* update cache controller description

* rebase fixes

* Self: Sized

* Use imports

* Remove with_global (unused)

* Add TODO

* move common::disk_cache -> universal_io::disk_cache

---------

Co-authored-by: xzfc <xzfcpw@gmail.com>
2026-03-25 11:39:26 -03:00
ad8334928d Use UniversalIo for MmapBitSlice (#8339)
* feat(universal_io): add storage-agnostic BitSliceStorage with read/write support`

Add BitSliceStorage<S> generic over
UniversalRead<u64>/UniversalWrite<u64>,
providing bit-level read and write operations over u64-element storage.

Read operations (S: UniversalRead<u64>):
- read_all: returns Cow<BitSlice> (zero-copy for mmap, owned for others)
- get_bit: single bit read via u64 element fetch
- read_bit_range: arbitrary bit range read

Write operations (S: UniversalWrite<u64>):
- set_bit / replace_bit: single bit write (skips write if unchanged)
- write_bit_range: arbitrary bit range write from BitSlice source
- fill_bit_range: fill range with a value
- set_bits_batch: batch individual bit updates coalesced by element
- flusher: flush underlying storage

* refactor: replace MmapBitSlice with BitSliceStorage in MmapBitSliceBufferedUpdateWrapper

Migrate all deleted-flag bitslice storage from the legacy MmapBitSlice
(Deref-based mmap wrapper) to BitSliceStorage<MmapUniversal<u64>>
(storage-agnostic universal IO backend).

Updated consumers:
- MmapMapIndex
- MmapNumericIndex
- MmapGeoMapIndex
- MmapInvertedIndex (fulltext)
- ImmutableIdTracker
- Benchmark

Additionally:
- Add BitSliceStorage::create(path, num_bits) to encapsulate
  file creation + sizing + open (eliminates duplicated size math
  across 5 call sites)
- Add MmapBitSliceStorage type alias for
BitSliceStorage<MmapUniversal<u64>>
- Add count_ones() convenience method
- Use set_bits_batch() in wrapper flusher and all build paths
  instead of per-bit set_bit() loops (coalesces u64 read-modify-writes)
- Fix silent error swallowing in wrapper get(): log + debug_assert
  on I/O errors instead of .ok().flatten()
- Remove dead bitmap_mmap_size function from immutable_id_tracker

* use bitvec's approach for offset

* less api

* misc improvements

* refactor write method

* move to segment crate

* handle creation of file outside of StoredBitSlice logic

* fix codespell

* document bitwise calculations

* coalesce more updates into a single write, batch all writes

* use native `extend_from_bitslice` instead of iterating.

* clarity refactor

* clippyyy

* use `u64` as BitStore everywhere

* assume iterator is sorted

* only use chunk_by for generating runs

* fix update wrapper flusher

* review fixes

* larger set bits batch test

* remove reintroduced file

* oops, fix new test

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: generall <andrey@vasnetsov.com>
2026-03-19 12:26:47 -03:00
Luis Cossío 1843dc1d6b make check_values_any process references directly (#8362) 2026-03-11 19:09:58 -03:00
Luis Cossío 9c6b23346d Rename to StoredPointToValues (#8302)
* rename trait

* rename MmapPointToValues -> StoredPointToValues

* fmt

* more explicit naming of trait functions
2026-03-09 11:56:56 +01:00
Luis CossíoandRoman Titov c7eadf49de Refactor PointToValues to use UniversalRead (#8298)
* refactor PointToValues to use UniversalRead

It includes a significant change to `MmapValue` trait to be able to
handle Cow reads, instead of just references.

* fix str parsing

* fix incorrect path

* use fallible casting

* clippy

* No eager allocation

this also makes it so that borrowed strs can keep happening :heart-eyes:

* Lifetime cleanup

---------

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2026-03-06 16:11:13 -03:00
Luis Cossíoandgenerall a7e78730a6 [gridstore] simplify page range calculation (#8285)
* simplify page range calculation

* smol fix

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2026-03-03 16:17:03 -03:00
Luis Cossío abbe6bf5a9 Allow indexing_threshold=null to disable indexing (#1702)
* feat: allow indexing_threshold=null to disable indexing

* fix: continue refactor

* amend: continue refactor

* amend: restore docstring

* update openapi.json

* test: add sanity test

* test: refactor test
2023-04-15 00:03:13 +02:00
Luis Cossío 7af32ec2b7 feat: [http] alias with_vector <-> with_vectors (#1697) 2023-04-11 18:19:40 +02:00
Luis CossíoandAndrey Vasnetsov d6dd8c8738 [WIP] Include startup date in telemetry (#1676)
* feat: add boot time to telemetry

* refactor: rename boot -> startup

* review fixes

* update openapi

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-04-11 00:35:24 +02:00
Luis CossíoandAndrey Vasnetsov 139d3eb1e2 Include "last_responded" in telemetry (#1668)
* feat: include "last_queried" in /telemetry

* fix: anonymize responses in the WebApiTelemetry and GrpcTelemetry Anonymize impls

* fix: anonymize the last_queried field

* fix: use YYYY/MM/DD hh:mm:ss format on 'last_queried'

* tests: add and fix telemetry test

* refactor: rename last_queried -> last_responded

* cargo fmt

* update openapi models

* refactor: rename last_request_time -> last_response_date

* tests: update test

* review changes

* add chrono to schemars

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-04-10 20:20:00 +02:00
Luis CossíoandAndrey Vasnetsov c15fec2a2a feat: add "any" to "match" statements (#1466)
* feat: add "any" to "match" statements

Adds support for using "any" to match on a list of different possible values

* enable proper counting in cardinality estimation

* fmt

* upd OpenAPI

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-02-15 11:11:20 +01:00
Luis Cossío fd4b0fe7d3 docs: update Github Flow link (#1421) 2023-02-02 14:52:17 +01:00