Repository navigation
[MOD-16055] Remove unused Rust FFI exports - #11785
Conversation
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
203817d to
fa73884
Compare
733bb17 to
7ba9606
Compare
fa73884 to
315cc7c
Compare
7ba9606 to
7c68d8a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #11785 +/- ##
==========================================
+ Coverage 83.81% 83.92% +0.10%
==========================================
Files 651 672 +21
Lines 85792 86306 +514
Branches 40037 40748 +711
==========================================
+ Hits 71908 72430 +522
+ Misses 13520 13504 -16
- Partials 364 372 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
7c68d8a to
ffccfe8
Compare
315cc7c to
faba382
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
ffccfe8 to
7342444
Compare
faba382 to
62e9592
Compare
7342444 to
6522146
Compare
1e802eb to
0a70eea
Compare
6522146 to
0a544f5
Compare
Now that query node evaluation is done in Rust, nothing calls these constructors from C, C++ tests or Rust: - NewGeoRangeIterator - NewInvIndIterator_MissingQuery - NewInvIndIterator_WildcardQuery - NewMetricIteratorSortedByScore - NewOptionalIterator - NewUnsortedIdListIterator - NewWildcardIterator
Nothing calls these anymore: - query_eval_ffi: queryNeedsOffsets, scorerNeedsOffsets - query_term_ffi: Term_Free (terms are owned and dropped by Rust) - triemap_ffi: TrieMap_IterateRange - inverted_index_ffi: GcScanDelta_LastBlockIdx, IndexBlock_LastId, IndexReader_Flags, IndexReader_HasMulti, IndexReader_IsIndex, IndexReader_NeedsRevalidation, IndexReader_NumericFilter, IndexReader_NumEstimated, IndexReader_Reset, IndexReader_SkipTo, InvertedIndex_GcMarker, InvertedIndex_GcMarkerInc, InvertedIndex_NumEntries Drop them together with what only they needed: the Term_Free test mocks, the TrieMap_IterateRange FFI test, the unused C TrieMapRangeCallback typedef and the query_types dependency of query_eval_ffi.
0a544f5 to
509076e
Compare
|
JonasKruckenberg
left a comment
There was a problem hiding this comment.
hell yeah, love deleting
Master moved tag node evaluation into Rust (MOD-14886, RediSearch#11206), deleting the C tag evaluator that `Query_EvalTagLexRangeNode` and `tagRangeIterCb` lived alongside, and removed `TrieMap_IterateRange` as an unused FFI export (MOD-16055, RediSearch#11785). So the C evaluator this branch added had no home and its only FFI dependency was gone. Rather than reinstate the FFI, the walk moves to Rust next to the prefix and wildcard expansions it mirrors. `trie_rs` kept the Rust range iterator; only the C-facing wrapper went away, so `eval_lex_range` reads the bounds from the node, normalizes each one, and walks `TrieMap::range_iter` straight from `query_eval::nodes::tag`. That also drops the parts of this branch that only existed to reach the trie from C: `TagIndex_IterateRangeValues`, `TagIndex_GetIteratorFromTrieMapValue` and its cpptest, the `TrieMapRangeCallback` typedef, and the triemap_ffi range module, header entry and test. `src/tag_index.{c,h}`, `test_cpp_tagindex.cpp` and the whole `triemap_ffi` crate are now identical to master again. Two details the port had to carry over rather than inherit: - Bound normalization. `tag_strtolower` is gone, and `RSTokenMut::normalize_tag` replaced it for tokens. A bound is a plain string, not a token, so `normalize_bound` applies the same two passes, `string_utils::tag::unescape` then `tolower_bytes` unless the field is CASESENSITIVE. Reading through `CStr::to_bytes` keeps the up-to-NUL truncation the C path had. - No deadline is installed on the range walk. A pattern walk visits keys it does not match, so it needs one; a range descent yields only matching keys, so the expansion cap bounds the work and the pipeline owns the deadline, as for every other node. The conflict in the generated `parser.c` is resolved by regenerating it from the merged `parser.y`; Lemon reports 0 conflicts. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_019EcxECuDqmECKPNVsNfXKb



Describe the changes in the pull request
Term_Free,TrieMap_IterateRangeand several inverted index accessors) no longer have any caller in C, C++ tests or Rust.Stacked on #11206.
Which additional issues this PR fixes
Main objects this PR modified
iterators_ffi: drops the unused iterator constructors (geo range, missing, wildcard, optional, unsorted id list, metric sorted by score).inverted_index_ffi: drops unusedIndexReader_*,IndexBlock_LastId, GC marker and entry count accessors.query_eval_ffi/query_term_ffi/triemap_ffi: dropqueryNeedsOffsets,scorerNeedsOffsets,Term_FreeandTrieMap_IterateRange.Mark if applicable
Release Notes