Skip to content

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

Merged
s2x merged 2 commits into
mainfrom
feat/issue-102-reranker-edge-case-tests
Jul 7, 2026
Merged

test: add reranker edge case coverage for RRF and Weighted re-rankers (closes #102)#160
s2x merged 2 commits into
mainfrom
feat/issue-102-reranker-edge-case-tests

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)
  • Updated test_reranker_in_query.phpt — SKIPIF uses method_exists for native extension compat
  • Updated CHANGELOG.md under ### Tests

Testing

  • All 7 new reranker edge case tests pass
  • Pre-existing reranker tests (test_rerankers, test_reranker_in_query, test_weighted_reranker_validation) pass
  • Each test uses try-finally with uniqid() temp directory and cleanup
  • No test database leftovers

Piotr Hałas 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
@s2x s2x self-assigned this Jul 7, 2026
@s2x
s2x merged commit 0158e3a into main Jul 7, 2026
3 checks passed
@s2x
s2x deleted the feat/issue-102-reranker-edge-case-tests branch July 7, 2026 11:44
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