fix(ranking): honor comparison budget for rankings of 10 or fewer items - #811
Merged
RapidPoseidon merged 1 commit intoAug 12, 2026
Merged
Conversation
Rankings whose largest group has <= 10 datapoints switch to the full-permutation pair maker, which silently dropped both comparison_budget_per_ranking and random_comparisons_ratio: every unique pair was compared exactly responses_per_comparison times, so a 7-item ranking with a budget of 5000 collected only 21 responses. The full-permutation pair maker config carries no budget field, so the budget is now honored through the referee instead: the required responses per pair are comparison_budget_per_ranking // n_pairs (multiplied by responses_per_comparison), rounded down so the budget is never exceeded. When the budget is smaller than the number of pairs, every pair is still compared once and a warning is logged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Co-Authored-By: jason <71826032+corkillj@users.noreply.github.com>
Contributor
Author
|
Because the bug is in the SDK's own translation layer, not in the backend's behavior:
If we'd rather have a budget-aware full-permutation pair maker as a first-class backend concept (e.g. |
LinoGiger
approved these changes
Aug 12, 2026
RapidPoseidon
deleted the
fix(ranking)/honor-comparison-budget-for-small-rankings
branch
August 12, 2026 12:58
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.
Problem
create_ranking_job_definition(and the deprecatedcreate_ranking_order) silently ignorescomparison_budget_per_rankingandrandom_comparisons_ratiowhen the largest ranking group has 10 or fewer datapoints:MultiRankingWorkflowswitches to theFullPermutationPairMaker, which emits each unique pair exactly once withresponses_per_comparisonresponses.Real-world impact: a 7-logo ranking launched with
comparison_budget_per_ranking=5000(jobjob_1S0zegXPmIhA6E, workflowrwf_1S0zfTbMe700Bu) collected only C(7,2) = 21 responses instead of ~5000, with no warning of any kind.Fix
The
FullPermutationPairMakerConfigcontract has no budget field, so the budget is honored through the referee instead:comparison_budget_per_ranking // n_pairscomparisons (timesresponses_per_comparison), i.e. the budget is spread evenly over all unique pairs. Rounding is downward so the budget is never exceeded — the 7-logo example now yields 21 × 238 = 4998 responses.Docstrings and the ranking docs now spell out both behaviors, and
MultiRankingWorkflowhas unit tests covering the budget spread, theresponses_per_comparisonmultiplier, the below-coverage warning, and the online path.Verification
uv run pytest tests/rapidata_client/job— 18 passed (4 pre-existing failures intests/rapidata_client/audiencealso fail onmain, unrelated)uv run pyright src/rapidata/rapidata_client— 0 errorsuv run black --checkon touched files — clean🔗 Session: session-cdc00927
🤖 Generated with Claude Code