How ldcye/swe-bench works
SWE-bench is a benchmark toolkit: it collects and publishes software-issue tasks, builds their reproducible Docker environments, and evaluates model patches against tests. The principal user flow is selecting a dataset and predictions (or gold patches), preparing images, running each task in containers, grading test logs, and saving a report; users may then package and publish results. Separate capabilities support inference and training-data preparation. Relationships below use README workflows and SOURCE INDEX references; unsampled implementation details are represented only where documented.
Main entry points: run_evaluation.py Evaluation runner · submit.py Submission commands · cli.py Command interface · prepare_images.py Image preparation
Components 28
Task data
- Dataset commands
swebench/cli/dataset.py - Task collection
swebench/collect/get_tasks_pipeline.py - Task repository
swebench/task/repo.py - Task validation
swebench/task/checks.py - Dataset and image publishing
swebench/task/publish.py
Image building
- Image commands
swebench/cli/images.py - Image preparation
swebench/image_builder/prepare_images.py - Image specifications
swebench/image_builder/image_spec.py - Docker image builds
swebench/image_builder/docker_build.py - Docker registry
Evaluation
- Evaluation commands
swebench/cli/evaluate.py - Evaluation runner
swebench/harness/run_evaluation.py - Docker containers
- Test grading
swebench/harness/grading.py - Language log parsers
swebench/harness/log_parsers - Run reports
swebench/harness/reporting.py
Inference and data
- Inference commands
swebench/cli/infer.py - Model inference
swebench/inference/run_api.py - Training data preparation
swebench/inference/make_datasets
Results and submission
- Submission commands
swebench/cli/submit.py - Package evaluation run
swebench/submit/package.py - Publish submission
swebench/submit/publish.py - Register leaderboard entry
swebench/submit/register.py - Verify submission
swebench/submit/verify.py
Other components
- Benchmark user
- Command interface
swebench/cli/cli.py - GitHub repositories
- Hugging Face datasets
Connections 36
- Benchmark user → Command interface: runs commands
- Command interface → Evaluation commands: starts evaluation
- Command interface → Image commands: manages images
- Command interface → Inference commands: starts inference
- Command interface → Submission commands: submits results
- Benchmark user → Dataset commands: checks task repo
- Task collection → Task repository: creates tasks
swebench/collect/get_tasks_pipeline.py - Dataset commands → Task validation: validates repo
- Dataset and image publishing → Task validation: checks repo
swebench/task/publish.py - Dataset and image publishing → Task repository: reads tasks
swebench/task/publish.py - Dataset and image publishing → Hugging Face datasets: publishes datasets
swebench/task/publish.py - Image commands → Image preparation: builds images
swebench/cli/images.py - Image preparation → Task repository: selects tasks
swebench/image_builder/prepare_images.py - Image preparation → Image specifications: creates specs
swebench/image_builder/prepare_images.py - Image preparation → Docker image builds: builds specs
swebench/image_builder/prepare_images.py - Docker image builds → Docker registry: pushes images
- Evaluation commands → Evaluation runner: runs evaluation
- Evaluation runner → Docker containers: runs task tests
- Evaluation runner → Task repository: loads task data
swebench/harness/run_evaluation.py - Evaluation runner → Image preparation: prepares images
swebench/harness/run_evaluation.py - Evaluation runner → Test grading: grades logs
swebench/harness/run_evaluation.py - Test grading → Language log parsers: parses test output
swebench/harness/grading.py - Evaluation runner → Run reports: writes reports
swebench/harness/run_evaluation.py - Inference commands → Model inference: generates predictions
- Benchmark user → Training data preparation: prepares training data
- Submission commands → Package evaluation run: packages run
swebench/cli/submit.py - Package evaluation run → Test grading: re-grades results
swebench/submit/package.py - Submission commands → Publish submission: publishes artifacts
swebench/cli/submit.py - Publish submission → Package evaluation run: reads package
swebench/submit/publish.py - Publish submission → GitHub repositories: pushes artifacts
swebench/submit/publish.py - Submission commands → Register leaderboard entry: registers entry
swebench/cli/submit.py - Register leaderboard entry → Package evaluation run: reads package
swebench/submit/register.py - Register leaderboard entry → GitHub repositories: updates entry
swebench/submit/register.py - Submission commands → Verify submission: checks submission
swebench/cli/submit.py - Verify submission → Package evaluation run: checks artifacts
swebench/submit/verify.py - Submission commands → Hugging Face datasets: uploads eval results