Commit Graph
3752 Commits
Author SHA1 Message Date
Paul Masurel 0d51009797 Fixing regression 2026-09-30 18:35:19 +02:00
Paul Masurel 020cfa5392 Clippy 2026-09-29 22:22:01 +02:00
Paul Masurel 5934cc8982 CR comments 2026-09-29 22:05:18 +02:00
Paul Masurel 9888678628 Changing the way aggregation access their value.
They now get values via a ValueSource abstraction.
The aggregation collector also gets the possibility to
register ValueSourceProvider describing value columns that are computed
on the fly.

Finally, segment aggregation that require a full column
now manipulates a Arc<dyn ColumnValue> directly.
2026-09-29 19:33:59 +02:00
Paul MasurelandPaul Masurel 507e1760aa Minor refactor of the cardinality aggregation. (#3120)
The Str path and the non string path are very different.
This PR isolates them as different segment aggregation collector.

Co-authored-by: Paul Masurel <paul.masurel@datadoghq.com>
2026-09-22 10:47:49 +02:00
Paul Masurel b91a405ee9 Make aggregation request-data types crate-internal (#3110)
Hiding the per segment *AggReqData members

FilterAggReqData::reqandMultiTermsAggReqData::sub_aggregations` were dead code so they were removed.
2026-09-18 07:27:01 +02:00
Paul MasurelandPaul Masurel 20d7f72f2c Addressing -0.0 problem in SafeF64 (#3109)
Co-authored-by: Paul Masurel <paul.masurel@datadoghq.com>
2026-09-17 12:29:31 +02:00
Paul Masurel 1496f58963 Added jitexpr compilation cache (#3107)
* Added jitexpr compilation cache
* Added jitexpr to the CI test matrix
2026-09-17 10:34:15 +02:00
Pascal Seitz 1680885e68 Report active RamDirectory writers as existing 2026-09-16 23:39:47 +08:00
Pascal Seitz e56587f3df Rename memory usage tracker finish to release 2026-09-16 23:39:47 +08:00
Pascal Seitz dfe904667e Minimize unrelated changes 2026-09-16 23:39:47 +08:00
Pascal Seitz a9d3f1a026 Run nightly fmt 2026-09-16 23:39:47 +08:00
Pascal Seitz bbc1b9e1d1 Restore TerminatingWrite API 2026-09-16 23:39:47 +08:00
Pascal Seitz 1c8a4801b3 Shrink RamDirectory files before storing 2026-09-16 23:39:47 +08:00
Pascal Seitz 2ab4fb80f0 Buffer RamDirectory writes
Use the standard BufWriter capacity to avoid forwarding every small write
directly to the underlying VecWriter.
2026-09-16 23:39:47 +08:00
Pascal Seitz e46d44c388 Finalize mmap writers in directory tests
Use finish instead of flush before reading completed files and clarify
when file data is synchronized.
2026-09-16 23:39:47 +08:00
Pascal Seitz f2a106df1c Prevent concurrent RamDirectory writers
Reserve paths when writers are opened and release reservations when
writers finish or drop.
2026-09-16 23:39:47 +08:00
Pascal Seitz 98d91f0436 Remove intermediate flush from directory contract
Intermediate writes are an implementation detail. From Tantivy side we only decide when a file is finished. This change is done to remove flush overhead for VecWriter. On finalization we just move the Vec to the directory.

Rename TerminatingWrite to FinishableWrite to reflect these semantics.
2026-09-16 23:39:47 +08:00
Pascal Seitz b06d8e9a04 Track active RamDirectory writer memory
Include VecWriter allocations in total_mem_usage so callers can account
for memory before writers are flushed or terminated.
2026-09-16 23:39:47 +08:00
Pascal Seitz 54b82e582f Report unsupported whitespace as a syntax error 2026-09-16 22:53:35 +08:00
Pascal SeitzandOleksii Syniakov 34edbf7821 Fix query parser panics on malformed input
Treat a fieldless exists leaf as match-all and make the lenient set parser
stop when parsing no longer consumes input. Add public QueryParser proptests
covering both regressions.

Findings and original fixes by Oleksii Syniakov in osyniakov/tantivy#4.

Co-authored-by: Oleksii Syniakov <1282756+osyniakov@users.noreply.github.com>
2026-09-16 22:53:35 +08:00
Paul Masurel 94a116f103 (Calculated fields) Add feature-gated JIT expression document predicate (#3081) 2026-09-15 16:28:53 +02:00
Paul MasurelandPaul Masurel 99043285f9 Set jitexpr license to MIT (#3101)
Add MIT license metadata to the jitexpr crate manifest, matching
tantivy and the other workspace subcrates, and include a copy of
the MIT license text.

Co-authored-by: Paul Masurel <paul.masurel@datadoghq.com>
2026-09-14 15:08:55 +02:00
Paul MasurelandPaul Masurel 4abd98fa19 Bump coverage nightly pin to satisfy cranelift MSRV (#3094)
The coverage job pinned nightly-2025-12-01, which is rustc 1.93. Since
`--all-features --workspace` pulls in jitexpr -> cranelift 0.134.4, and
those crates declare rust-version = "1.94.0", cargo refused to build:

    error: rustc 1.93.1 is not supported by the following packages:
      cranelift@0.134.4 requires rustc 1.94.0

Bump the pin to nightly-2026-08-31 (1.100.0-nightly), which builds
jitexpr cleanly.

Co-authored-by: Paul Masurel <paul.masurel@datadoghq.com>
2026-09-11 09:32:00 +02:00
Paul MasurelandPaul Masurel 3bad51518a Fix clippy warnings in test code (#3091)
Silence the 7 warnings reported by `cargo clippy --all --tests`:

- Replace manual `% n == 0` parity checks with `is_multiple_of`
  (`manual_is_multiple_of`) in index_writer, doc_predicate_query and
  seek_danger tests. `is_multiple_of` is stable for unsigned integers as
  of 1.87, which matches the crate MSRV.
- Prefix the intentionally unused `other_segment_meta` binding with an
  underscore. The binding is kept rather than dropped because the
  inventory only tracks live `SegmentMeta`s, so dropping it would
  invalidate the `inventory.all()` assertion in the same test.

No behavior change.

Co-authored-by: Paul Masurel <paul.masurel@datadoghq.com>
2026-09-10 21:26:45 +02:00
Paul Masurel 0c0530eeb4 Free JITModule executable memory when CompiledFn is dropped (#3090)
JITModule never releases its executable allocation on drop; the only
way to reclaim it is the consuming, unsafe JITModule::free_memory.
CompiledFn previously stored the module in a plain field, so every
compiled expression's executable memory leaked for the remainder of
the process once the CompiledFn was dropped.

Wrap the module in ManuallyDrop and add an explicit Drop impl for
CompiledFn that calls free_memory. This is safe because CompiledFn is
only ever constructed behind an Arc and never exposes its entry point
or other raw pointers into the module outside &self-bounded calls, so
drop only runs once no call into the module can be in flight or happen
afterward.

Verified empirically: 200k compile+drop cycles peaked at ~3.3 GB RSS
before this fix and ~6 MB after.
2026-09-10 21:22:01 +02:00
dependabot[bot] dd0bc23360 Update zstd requirement from 0.13 to 0.14 (#3085)
Updates the requirements on [zstd](https://github.com/gyscos/zstd-rs) to permit the latest version.
- [Release notes](https://github.com/gyscos/zstd-rs/releases)
- [Commits](https://github.com/gyscos/zstd-rs/compare/v0.13.0...v0.14.0)

---
updated-dependencies:
- dependency-name: zstd
  dependency-version: 0.14.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-10 18:36:24 +02:00
Paul Masurel 5a82f19f5d (Calculated fields) Implements more functions (#3083)
* Add remaining expression functions

Currently experimental (!)
2026-09-10 18:35:51 +02:00
Paul Masurel f8ec38fd9f (Calculated fields) Add JIT expression framework with ADD, IS_NULL, and REGEXP_EXTRACT (#3078)
Add JIT expression framework with ADD, IS_NULL, and REGEXP_EXTRACT
2026-09-10 15:30:02 +02:00
Pascal Seitz bc8a21cf12 Document 0.26.2 bugfixes and mark 0.26 as released 2026-09-08 23:36:16 +08:00
PSeitz-dd 9d10bf1c6c Merge pull request #3088 from PSeitz/check_seek_danger_panic
fix: disable buffered union seek_danger override
2026-09-08 17:05:24 +02:00
Pascal Seitz 66ff8466d5 fix: disable buffered union seek_danger override
Use the default seek-based implementation until the optimized path can handle invalid child states safely. A child miss followed by another child hit previously allowed refill to consume an unaligned scorer.

Add shared seek_danger contract proptests, a regression for #3086, and a source inventory guard for future overrides.
2026-09-08 16:34:05 +02:00
pascal 780395c1db improve BufferedUnionScorer::advance 2026-09-08 18:12:08 +08:00
pascal 6929bae13f fix union performance regression 2026-09-08 18:12:08 +08:00
Paul MasurelandPaul Masurel 1020eba2b9 Expose segment file listing on IndexMeta (#3080)
Co-authored-by: Paul Masurel <paul.masurel@datadoghq.com>
2026-09-07 13:55:06 +02:00
Pascal Seitz 906fb8ef87 update comment 2026-09-07 18:26:37 +08:00
Pascal Seitz b586087392 fmt 2026-09-07 18:26:37 +08:00
Pascal Seitz ed1287a07f Preserve intermediate aggregation wire compatibility
Serialize vector-backed term entries as a map so Quickwit nodes running
different versions can exchange Postcard aggregation results. Add a legacy
fixture covering nested terms and histogram aggregations.
2026-09-07 18:26:37 +08:00
Pascal Seitz 921e98c63c Make count tie pruning deterministic at segment level 2026-09-07 18:26:37 +08:00
Pascal Seitz af2e6fac49 Remove equality from intermediate aggregation results 2026-09-07 18:26:37 +08:00
Pascal Seitz 71c7b78f32 Preserve term aggregation semantics during optimized merges
Merge normalized floating-point buckets and their sub-aggregations, and use
the final key ordering to resolve count ties while pruning results.
2026-09-07 18:26:37 +08:00
Pascal Seitz afe1666d6f Make aggregation key ordering total
Use total floating-point ordering for aggregation keys so ordering is
consistent with bitwise equality for NaNs and signed zero. This also
removes fallible key comparisons from term aggregation sorting.
2026-09-07 18:26:37 +08:00
Pascal Seitz 44a403d446 faster term agg merges 2026-09-07 18:26:37 +08:00
Pascal Seitz 797543f3ca add agg bench with 100 segments 2026-09-07 18:26:37 +08:00
Paul Masurel 1ae2da1859 Add DocPredicateQuery and a generic FunctionPredicate implementation (#3072)
* Add DocPredicateQuery and a generic FunctionPredicate implementation

Introduces the DocPredicate/SegmentDocPredicate abstraction and
DocPredicateQuery, a query that walks a segment's documents by
repeatedly evaluating a per-segment predicate (with a scorer_danger
fast path for boolean intersections). FunctionPredicate is a first,
generic implementation built from a plain per-segment factory
function, with no dependency on fast fields or any other segment
data structure.

* CR comments

* Better explain
2026-09-05 18:54:32 +02:00
Paul MasurelandPaul Masurel b5d8deb80c Fix fractional JSON range bounds on integer columns (#3074)
Co-authored-by: Paul Masurel <paul.masurel@datadoghq.com>
2026-09-04 18:54:07 +02:00
Paul MasurelandPaul Masurel 79eedf4a81 Added the capacity to build scorer and seek_danger in a joint manner. (#3070)
* Added the capacity to build scorer and seek_danger in a joint manner.

* Added some partial support of scorer_danger for PhraseWeight

* Bugfix following CR

* CR: introducing OccurWeights

* CR comment

---------

Co-authored-by: Paul Masurel <paul.masurel@datadoghq.com>
2026-09-03 14:07:38 +02:00
Paul MasurelandPaul Masurel ed6a90e840 Minor change: removing BooleanWeight::new as it is quite the footgun (#3071)
BooleanWeight::new just default min_should_match to 1.
This is misleading because I think someone who passes a single must clause would expect the result
to match that clause.

Due to min_should_match, it actually returns nothing.

Co-authored-by: Paul Masurel <paul.masurel@datadoghq.com>
2026-09-02 13:47:51 +02:00
Pascal Seitz c3b91b617a use next_doc in mixed type columns
Remove full and empty variants from exists docsets
Simplify exists docset advancement
fix size hint in exist query
2026-09-02 14:14:45 +08:00
Pascal Seitz 271635b5a6 Use default seek behavior for exists docsets 2026-09-02 14:14:45 +08:00