[8.4] MOD-12223: Fix BM25STD underflow wraparound#7256
Merged
redisearch-backport-pull-request[bot] merged 1 commit into8.4from Nov 9, 2025
Merged
[8.4] MOD-12223: Fix BM25STD underflow wraparound#7256redisearch-backport-pull-request[bot] merged 1 commit into8.4from
redisearch-backport-pull-request[bot] merged 1 commit into8.4from
Conversation
* Fix BM25STD underflow wraparound * Fix comment * Fix documentation and tweak test * Address review * Remove old test * Skip cluster on expiration test * Fix leak in test (cherry picked from commit d95056f)
raz-mon
approved these changes
Nov 9, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.4 #7256 +/- ##
==========================================
- Coverage 85.66% 85.63% -0.04%
==========================================
Files 326 326
Lines 50942 50943 +1
Branches 10921 10921
==========================================
- Hits 43638 43623 -15
- Misses 7138 7154 +16
Partials 166 166
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport of #7223 to
8.4.Note
Prevent underflow in BM25STD IDF calculation and add a targeted test; adjust test skips and remove an obsolete scorer test.
totalDocsinCalculateIDF_BM25toMAX(totalDocs, termDocs)to avoid underflow in IDF (src/iterators/inverted_index_iterator.c).testBM25STDUnderflowto validate stable BM25STD scoring under stale inverted-index entries (tests/pytests/test_scorers.py).testScoreReplacefromtests/pytests/test_scorers.py.testLazyTextFieldExpirationto also skip in cluster mode (tests/pytests/test_expire.py).Written by Cursor Bugbot for commit 6f45d46. This will update automatically on new commits. Configure here.