Skip to content

feat: add a subsampled swe-bench-pro variant (33/66/66) for optimizer runs - #62

Open
shehabyasser-scale wants to merge 1 commit into
mainfrom
feat/swe-bench-pro-subsample
Open

feat: add a subsampled swe-bench-pro variant (33/66/66) for optimizer runs#62
shehabyasser-scale wants to merge 1 commit into
mainfrom
feat/swe-bench-pro-subsample

Conversation

@shehabyasser-scale

@shehabyasser-scale shehabyasser-scale commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Making swe-bench-pro affordable for an optimizer loop, and keep using deepseek.

This is additive. The canonical baseline/build.yaml and its 146/292/293 split are byte-unchanged. This adds a second config beside them, so both can be run.

baseline/build.yaml         146/292/293   gpt-4o        untouched
baseline/build.sample.yaml   33/66/66     deepseek      new
partitions/sample/*.json                                new

Why a variant

Each case builds a real repository and runs its test suite. The full-split held-out baseline alone cost ~7.8h of wall clock for three rounds, and an optimizer evaluates candidates many times over. 33/66/66 matches gaia and browsecomp-plus, the suite's tightest split.

The sample is nested

--sample computes the canonical split first, unchanged, then narrows each partition within itself, so partitions/sample/test.json is a strict subset of partitions/test.json.

This is the load-bearing detail, and I got it wrong first. A flat re-split at the smaller size moves instances between partitions: my initial version produced a "held-out" test set with zero overlap with the real one, silently drawn from what had been dev and validation. Nesting prevents that, and buys a second thing: the baseline needed no re-measuring.

n reward ±sd
canonical test partition 293 0.2940 0.0082
sampled test partition 66 0.2923 0.0332

baseline_reward: 0.2923 is the same K=3 trials recomputed over the 66 sampled cases. The recomputation reproduces 0.2940 ±0.0082 exactly on the full set first, which is what validates it. The point estimate barely moves; the spread widens fourfold because n falls 293 → 66, which matters when reading a candidate's margin over that floor.

Caveat, recorded in the file: those trials targeted qwen-3.6-27b, while the variant targets deepseek-v4-flash. So 0.2923 is provisional until a K=3 deepseek pass over the 66 replaces it. That costs ~1.8h at max_concurrency: 24 (calibrated from the real 879-trial run: 131.3h serial, 24 effective slots, ideal 5.47h vs actual 7.8h = 1.43x overhead).

What the variant carries that the canonical config lacks

All places where swe-bench-pro is the lone holdout in the suite: deepseek-v4-flash (prefixed-only, since agents strip just openai/ before the gateway matches exactly), max_concurrency: 24, 4x case budgets (132/264), case_timeout == task_agent_timeout at 3000 so the multiplier is 1.0, score_baseline: false with the baseline pinned, and n_attempts: 3 / mean on the test target.

Two pre-existing inconsistencies, deliberately left alone

Both are in the canonical build.yaml. I did not change them, since this PR is meant to be additive, but they are worth separate one-line fixes:

  • case_timeout_seconds: 1800 against task_agent_timeout_seconds: 3000 implies a 0.6 multiplier, but the pinned 0.294 was measured at 1.0: all 879 sampled trial configs record agent_timeout_multiplier=1.0. The config value is wrong, not the measurement.
  • model: gpt-4o, but the 0.294 baseline was measured against qwen-3.6-27b.

Also, swe-bench-pro is the only benchmark still using score_baseline: true, so it re-measures the seed on every run rather than pinning it.

Verification

  • Canonical partitions, manifest and build.yaml show no diff against pr3
  • Canonical --check passes; --sample regenerates byte-identically
  • Every sampled partition is a strict subset of its canonical counterpart; all 11 repos appear in each
  • Both configs compile side by side: full → 146/292/293, gpt-4o, 1800; sample → 33/66/66, deepseek, 3000, baseline_reward 0.2923, budgets 132/264, n_attempts: 3 / mean on the test backend only
  • pytest tests/test_v05_benchmark_configs.py: 13 passed, 6 skipped

Not yet verified: no trial has been executed against the sampled split. An end-to-end optimizer run on it is in flight and I will report the result here. Everything above is config-level correctness.

Note for the optimizer-model axis

The preflight from #59 caught something that affects more than this PR: gpt-5.3-codex has no /responses deployment on the LiteLLM proxy (/chat/completions → 200, /responses → 404 DeploymentNotFound). The codex agent is Responses-native, so any optimizer run using it as the optimizer model fails after setup. gpt-5.6-sol and gpt-4.1 serve both routes; the variant's producer default is now gpt-5.6-sol.

Rebased onto the re-pinned base (2026-07-28)

pr3-harness-bench absorbed pr2-add-vero (merge ed55bc7) and re-pinned all five held-out baselines (44a852e), which collided with this branch in CONFIGURATION.md. Rebased as one commit on ed55bc7; both sides of each hunk are kept:

  • Per-benchmark table: upstream's re-pinned numbers (gaia 0.621, officeqa 0.341, swe-atlas-qna 0.068, tau3 0.732, browsecomp-plus 0.462) with this branch's swe-bench-pro column appended to every row. Verified all 19 rows have identical cell counts.
  • Prose: upstream's two new paragraphs (why the five went stale; gaia/tau3 noise) are kept ahead of this branch's footnote, so still sits next to .

Added a third documented inconsistency. swe-bench-pro is the one benchmark the re-pin did not cover, and its staleness is the strongest case of exactly what upstream's new note describes: the pinned 0.294 was measured on a different agent than the one in the tree. The qwen-era agent used Chat Completions with an explicit local messages list and edited files on 571 of 879 cases; the committed seed is Responses-only, delegates its conversation to previous_response_id, and over 66 sampled cases called write_file/apply_patch/submit zero times for 0.0000. Documented rather than silently repaired, with a pointer to scripts/rescore_candidate.py --seed.

pytest tests/test_v05_benchmark_configs.py: 13 passed, 6 skipped.

Greptile Summary

This PR adds a cost-effective 33/66/66 subsampled variant of swe-bench-pro alongside the unchanged canonical 146/292/293 config, making it practical for optimizer loops. The sample is correctly nested — each sampled partition is a strict subset of its canonical counterpart — so no instance can migrate between partitions and the existing per-case trial data can be reused to derive the provisional baseline reward of 0.2923.

  • baseline/build.sample.yaml introduces the new optimizer config: fireworks_ai/deepseek-v4-flash, max_concurrency: 24, case_timeout_seconds == task_agent_timeout_seconds = 3000 (1.0 multiplier), score_baseline: false with a pinned baseline, and n_attempts: 3 / mean on the held-out test target only.
  • scripts/partition_swe_bench_pro.py gains a --sample flag and a _subsample helper that stratifies within partitions; --tasks-dir is now optional when a manifest is already committed.
  • CONFIGURATION.md gains the swe-bench-pro column and a detailed prose section documenting the two-config design and three pre-existing inconsistencies in the canonical config; one stray extra separator cell was introduced in an unrelated table (see inline comment).

Confidence Score: 5/5

Safe to merge — the canonical config and partition files are byte-unchanged, and the new sample variant is purely additive.

The canonical split is untouched. The new config, partition JSON files, and script additions are self-contained and internally consistent. The nested-sampling logic in _subsample correctly enforces the partition subset guarantee. The only issue found is a stray separator cell in a documentation table that doesn't affect runtime behavior.

Files Needing Attention: No files require special attention beyond the minor Markdown formatting fix in CONFIGURATION.md.

Important Files Changed

Filename Overview
harness-engineering-bench/CONFIGURATION.md Adds swe-bench-pro column to the per-benchmark table and appends a detailed prose section explaining the two-config design and three known inconsistencies; contains a stray extra separator cell in the unrelated rate-limit table.
harness-engineering-bench/swe-bench-pro/baseline/build.sample.yaml New optimizer-friendly config: 33/66/66 sample split, deepseek-v4-flash, case_timeout==task_agent_timeout at 3000 (1.0 multiplier), score_baseline: false with provisional baseline_reward 0.2923, n_attempts: 3 / mean on test target only.
harness-engineering-bench/swe-bench-pro/scripts/partition_swe_bench_pro.py Adds --sample flag and _subsample/_render_sample/_tasks_from_manifest helpers; makes --tasks-dir optional when a manifest exists; sampling is correctly nested inside the canonical split to prevent cross-partition leakage.
harness-engineering-bench/swe-bench-pro/partitions/sample/test.json 66-instance held-out test partition; all 11 repos represented, strict subset of the canonical test.json as intended.
harness-engineering-bench/swe-bench-pro/partitions/sample/development.json 33-instance development partition; strict subset of canonical development.json.
harness-engineering-bench/swe-bench-pro/partitions/sample/validation.json 66-instance validation partition; strict subset of canonical validation.json.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[partition_swe_bench_pro.py] --> B{--tasks-dir given?}
    B -- yes --> C[_read_tasks from disk]
    B -- no --> D[_tasks_from_manifest\nfrom partitions/manifest.json]
    C --> E[_allocate\n731 tasks → 146/292/293]
    D --> E
    E --> F{--sample flag?}
    F -- no --> G[_render\nwrites manifest.json\n+ 3 partition files]
    G --> H[(partitions/\ndevelopment.json\nvalidation.json\ntest.json\nmanifest.json)]
    F -- yes --> I[_subsample\nnarrows inside each partition\n146→33 / 292→66 / 293→66]
    I --> J[_render_sample\nwrites 3 partition files only\nmanifest is shared]
    J --> K[(partitions/sample/\ndevelopment.json\nvalidation.json\ntest.json)]
    H --> L[build.yaml\n146/292/293 gpt-4o]
    K --> M[build.sample.yaml\n33/66/66 deepseek]
Loading

Reviews (5): Last reviewed commit: "feat: add a subsampled swe-bench-pro var..." | Re-trigger Greptile

@shehabyasser-scale
shehabyasser-scale force-pushed the feat/swe-bench-pro-subsample branch 2 times, most recently from 7ce8a89 to 00cb4fc Compare July 28, 2026 05:09
@shehabyasser-scale shehabyasser-scale changed the title feat: subsample swe-bench-pro to 33/66/66 and put it on deepseek feat: add a subsampled swe-bench-pro variant (33/66/66) for optimizer runs Jul 28, 2026
@shehabyasser-scale
shehabyasser-scale force-pushed the feat/swe-bench-pro-subsample branch from 00cb4fc to 72bb132 Compare July 28, 2026 14:41
… runs

Additive only. The canonical baseline/build.yaml and its 146/292/293 split are
byte-unchanged; this adds a second config beside them.

Why: the full split is unaffordable for an optimizer loop. Each case builds a
real repository and runs its test suite, so the full-split held-out baseline
alone cost ~7.8h of wall clock for three rounds, and an optimizer evaluates
candidates many times over. 33/66/66 matches gaia and browsecomp-plus, the
suite's tightest split, which is the right reference for its most expensive
benchmark.

The sample is NESTED, which is the load-bearing detail. `--sample` computes the
canonical split first, unchanged, then narrows each partition within itself, so
partitions/sample/test.json is a strict subset of partitions/test.json. Two
things follow. No instance can migrate from test into development: a flat
re-split at the smaller size does move them, and the first version of this
change produced a "held-out" set with zero overlap with the real one, silently
drawn from what had been dev and validation. And the baseline needed no
re-measuring.

  baseline_reward: 0.2923 over the 66 sampled cases, recomputed from the very
  same K=3 trials that produced the canonical 0.2940 +-0.0082. The
  recomputation reproduces 0.2940 +-0.0082 exactly on the full set first, which
  is what validates it. The point estimate barely moves; the spread widens to
  +-0.0332 because n falls 293 -> 66.

  CAVEAT recorded in the file: those trials targeted qwen-3.6-27b while the
  variant targets deepseek-v4-flash, so 0.2923 is provisional until a K=3
  deepseek pass over the 66 replaces it (~1.8h at max_concurrency 24).

Repository stratification and sha256 ordering are unchanged and apply within
each partition, so all 11 upstream repos appear in every sampled partition. The
sample shares the canonical manifest rather than duplicating it: it pins the
same 731 refs and the build loader reads only names from it, so a second copy
would just be a second thing to keep in sync. `--tasks-dir` is now optional,
since the manifest already records every name and stratum.

The variant also carries the settings the canonical config is missing relative
to its siblings: deepseek-v4-flash (prefixed-only, because agents strip just
`openai/` before the gateway matches exactly), max_concurrency 24, 4x case
budgets (132/264), case_timeout equal to task_agent_timeout at 3000 so the
multiplier is 1.0, score_baseline false with the baseline pinned, and
n_attempts 3 / mean on the test target.

CONFIGURATION.md gains the swe-bench-pro column it never had, describing the
canonical config, plus a footnote covering the variant and two pre-existing
inconsistencies in the canonical file that are deliberately left alone here:
case_timeout_seconds 1800 implies a 0.6 multiplier though the pinned 0.294 was
measured at 1.0 (all 879 sampled trial configs say so), and model: gpt-4o though
that baseline was measured against qwen-3.6-27b.

Verified: canonical partitions, manifest and build.yaml show no diff against
pr3; canonical --check passes; --sample regenerates byte-identically; every
sampled partition is a strict subset of its canonical counterpart; both configs
compile side by side (full -> 146/292/293, gpt-4o, 1800; sample -> 33/66/66,
deepseek, 3000, baseline 0.2923, budgets 132/264, n_attempts 3/mean on test
only); 13 passed, 6 skipped in test_v05_benchmark_configs.py.
@shehabyasser-scale
shehabyasser-scale force-pushed the feat/swe-bench-pro-subsample branch from 72bb132 to 3dc2122 Compare July 29, 2026 02:56
@shehabyasser-scale
shehabyasser-scale changed the base branch from pr3-harness-bench to main July 29, 2026 02:56
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.

1 participant