fix(swebench): sample the pilot across each repo's id range, not its head - #312
Merged
Merged
Conversation
…head
The pilot's job is to predict a 250-task full run from 50 tasks. The first version could not:
it allocated per repo correctly but then took `ids[:n]` — the HEAD of each repo's slice — and
the full tier is sorted by instance id. SWE-bench ids track upstream PR numbers, so that drew
almost entirely from the oldest issues.
Measured, on a 0=first / 1=last scale, the picks' mean relative position was 0.08:
repo full id-range pilot BEFORE pilot AFTER
django 9296-17084 10554-11880 9296-16819
sympy 11618-24443 11618-13647 11618-24443
scikit-learn 10844-26194 10844-12682 10844-26194
matplotlib 13989-26342 13989-21568 13989-26342
mean relative position 0.08 -> 0.50
I had described that selection as "stratified" without qualifying it, which overstated what it
was: proportional across repos but systematically skewed by age within them.
Now the picks are spread evenly across each repo's ordering, so the whole id range is
represented. Still fully deterministic — no RNG — so the file stays reproducible and diffable.
Also promotes the generator from a throwaway to ci/benchmarks/swebench/utils/make_pilot.py
(alongside the existing select_candidates.py), so the tier can be regenerated and reviewed
rather than regenerated by hand. It asserts its own invariants: exact size, unique ids, and
every id present in the full tier.
Unchanged and deliberate: the floor of 1 per repo, which tilts django to ~38% against full's
~46%. That is the price of guaranteeing no repo's toolchain can hide from the pilot.
NB this fixes representativeness of the SAMPLE, not of the statistic: at n=50 and p~0.8 the 95%
interval is about ±0.11, against ±0.05 at n=250. The pilot predicts cost and runtime well
(tasks are independent, so both scale linearly); it gives only a ballpark for reward.
Signed-off-by: Eran Raichstein <eran.raichstein@gmail.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
❌ Automatic Labeling Failed An error occurred while trying to automatically label this pull request. Please check the workflow logs for details and add labels manually. |
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.
The pilot's purpose is to predict a 250-task full run from 50 tasks. The first version couldn't: it allocated per repo correctly, then took
ids[:n]— the head of each repo's slice. The full tier is sorted by instance id, and SWE-bench ids track upstream PR numbers, so it drew almost entirely from the oldest issues.Measured on a 0=first / 1=last scale, the picks' mean relative position was 0.08:
mean relative position 0.08 → 0.50
I had called that selection "stratified" without qualifying it, which overstated it — proportional across repos, but systematically age-skewed within them.
Picks are now spread evenly across each repo's ordering. Still fully deterministic (no RNG), so the file stays reproducible and reviewable in a diff.
Also
Promotes the generator from a throwaway to
ci/benchmarks/swebench/utils/make_pilot.py, beside the existingselect_candidates.py. It asserts its own invariants: exact size, unique ids, every id present in the full tier.Deliberately unchanged
The floor of 1 per repo, which tilts django to ~38% against full's ~46%. That's the price of guaranteeing no repo's build/test toolchain can hide from the pilot.
Scope of the fix
This fixes representativeness of the sample, not of the statistic. At n=50, p≈0.8 the 95% interval is ~±0.11 versus ~±0.05 at n=250. The pilot predicts cost and runtime well — tasks are independent, so both scale linearly — but gives only a ballpark for reward.
🤖 Generated with Claude Code