test: add reranker edge case coverage for RRF and Weighted re-rankers (closes #102)#160
Merged
Merged
Conversation
added 2 commits
July 7, 2026 08:57
…closes #102) - Add 7 .phpt test files for reranker edge cases: - Empty query results, null values, non-ZVecDoc elements - Zero-range normalization guard (all identical scores) - PHP_FLOAT_MIN initialization bug detection - L2 metric normalization (lower distance = higher score) - Negative IP score normalization - Custom rank constant effect on combined scores - Empty weights edge cases (constructor + setter) - Add test_reranker_in_query.phpt for queryWithReranker() integration - Fix 4 test EXPECT sections: EXPECTF vs EXPECT usage, format specifiers - Fix PHP_FLOAT_MIN bug detection logic in weighted_float_min_bug test
…-reranker-edge-case-tests
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
Closes #102
Changes
.phpttest files for reranker edge cases:test_reranker_rrf_empty.phpt— empty query results, null values, non-ZVecDoc elementstest_reranker_weighted_zero_range.phpt— zero-range normalization guard (all scores identical)test_reranker_weighted_float_min_bug.phpt— PHP_FLOAT_MIN initialization bug detectiontest_reranker_weighted_l2_metric.phpt— L2 metric normalization (lower distance = higher score)test_reranker_weighted_negative_scores.phpt— negative IP score normalizationtest_reranker_rrf_custom_rank_constant.phpt— custom rank constant effect on combined scorestest_reranker_weighted_empty_weights.phpt— empty weights edge cases (constructor + setter)test_reranker_in_query.phpt— SKIPIF uses method_exists for native extension compatCHANGELOG.mdunder### TestsTesting
try-finallywithuniqid()temp directory and cleanup