Skip to content

test: add reranker edge case coverage for RRF and Weighted re-rankers (closes #102)#156

Closed
s2x wants to merge 0 commit into
mainfrom
test/issue-102-reranker-edge-cases
Closed

test: add reranker edge case coverage for RRF and Weighted re-rankers (closes #102)#156
s2x wants to merge 0 commit into
mainfrom
test/issue-102-reranker-edge-cases

Conversation

@s2x

@s2x s2x commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Description

Closes #102

Changes

  • Added 7 .phpt test files for reranker edge cases:
    • test_reranker_rrf_empty.phpt — empty query results, null values, non-ZVecDoc elements
    • test_reranker_weighted_zero_range.phpt — zero-range normalization guard (all scores identical)
    • test_reranker_weighted_float_min_bug.phpt — PHP_FLOAT_MIN initialization bug detection
    • test_reranker_weighted_l2_metric.phpt — L2 metric normalization (lower distance = higher score)
    • test_reranker_weighted_negative_scores.phpt — negative IP score normalization
    • test_reranker_rrf_custom_rank_constant.phpt — custom rank constant effect on combined scores
    • test_reranker_weighted_empty_weights.phpt — empty weights edge cases (constructor + setter)
  • Added test_reranker_in_query.phpt — integration test for queryWithReranker() with RRF
  • Fixed 4 test EXPECT sections: EXPECTF vs EXPECT usage, format specifiers
  • Fixed PHP_FLOAT_MIN bug detection logic in test_reranker_weighted_float_min_bug.phpt
  • Updated CHANGELOG.md with TEST-004 entry

Testing

  • All 9 reranker .phpt tests pass (100%)
  • Each test uses try-finally with uniqid() temp directory and cleanup
  • Code review via subagent passed (all issues addressed)

Code Review

  • Passed subagent code review
  • All review comments addressed (4 issues fixed)

@s2x s2x self-assigned this Jul 7, 2026
@s2x s2x closed this Jul 8, 2026
@s2x
s2x force-pushed the test/issue-102-reranker-edge-cases branch from 38b5928 to 179eac1 Compare July 8, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TEST-004: Rerankers — Missing Edge Case Coverage

1 participant