Skip to content

fix(swebench): sample the pilot across each repo's id range, not its head - #312

Merged
eranra merged 1 commit into
skillberry-ai:mainfrom
eranra:fix/pilot-sampling
Aug 9, 2026
Merged

fix(swebench): sample the pilot across each repo's id range, not its head#312
eranra merged 1 commit into
skillberry-ai:mainfrom
eranra:fix/pilot-sampling

Conversation

@eranra

@eranra eranra commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

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:

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 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 existing select_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

…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>
@eranra
eranra merged commit 8d08d80 into skillberry-ai:main Aug 9, 2026
1 check passed
@skillberry-bot

Copy link
Copy Markdown
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.

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.

2 participants