Skip to content

Repository files navigation

CodeScaleBench

Hugging Face DatasetPaperLicense: Apache 2.0

CodeScaleBench measures how external code-retrieval tooling changes what an AI coding agent produces, on realistic developer tasks in large, enterprise-scale codebases. Retrieval is a controlled variable: the same agent and model run on each task with the source available locally and with it reachable only through a retrieval server, and the paired difference is the reported quantity.

  • Dataset:sgjarmak/CodeScaleBench on Hugging Face — the 370-task problem layer (instruction, repo, base commit, metadata; repository contents and verifiers are materialized by the eval kit).
  • Reproduce the published results:git clone --branch v1-mixed371 https://github.com/sourcegraph/CodeScaleBench.git yields the exact 370-task analysis set, the frozen suite definition, and the result snapshot.

This repository contains:

  • 370 benchmark tasks (csb-v1-mixed371) — the analysis set behind the published results, spanning software-lifecycle and organization-scale work across more than forty repositories and nine languages
  • Auditable result snapshots with per-task traces, scores, timing, and cost (runs/snapshots/)
  • The eval kit — the Harbor-based harness, deterministic gated verifiers, and metrics/reporting pipelines for running and scoring submissions
  • Task indexes by complexity, language, repo size, and multi-repository scope (benchmarks/indexes/)

The corpus is under active curation: the default branch tracks the evolving maintained set, while csb-v1-mixed371 is the frozen set the paper reports, retained under a tag. Cite the suite id with any result.

Tasks are executed via the Harbor runner with the Claude Code agent harness.


Results

Official results are available as frozen, auditable snapshots in runs/snapshots/.

SnapshotTasksModelConfigsMean Reward
csb-v1-mixed371--haiku45--030326371Haiku 4.5Baseline, Sourcegraph MCP0.536 / 0.565

Each snapshot includes:

  • browse.html — Interactive results browser (open in any web browser)
  • SNAPSHOT.json — Machine-readable manifest
  • export/traces/ — Per-task result metadata, reward scores, agent instructions
  • export/summary/ — Aggregate scores, timing, cost breakdowns

Full agent trajectories are available as compressed archives in the corresponding GitHub Release.

Baseline vs MCP side-by-side browser

docs/analysis/compare/ contains a pre-rendered gallery of side-by-side compare pages — for every task where Sourcegraph MCP outperformed the local-filesystem baseline, the full agent tool-call sequence on both sides is laid out in two columns (search queries, file reads, edits, bash commands, conversation events).

To browse it on any machine:

git clone --branch public --single-branch \
https://github.com/sourcegraph/CodeScaleBench.git
cd CodeScaleBench
python3 -m http.server 8000 -d docs/analysis/compare
# then open http://localhost:8000

The committed snapshot is the top 20 MCP wins by reward delta plus a full manifest of all 59 wins (wins_manifest.json). To regenerate the rest locally from your own runs/analysis/<suite>/<model>/{baseline,mcp}/ trees:

python3 scripts/analysis/browse_compare.py \
--threshold 0.20 --render-all --out browse/compare

The generator has no external dependencies (Python stdlib only). See docs/analysis/compare/README.md for pairing rules, filter semantics, and source-run requirements.


Benchmark Suites

Suite definitions in benchmarks/suites/ specify exactly which tasks are in each benchmark version:

SuiteTasksDescription
csb-v1-mixed371371Initial report: mixed verifiers, 151 SDLC + 220 org tasks
csb-v2-dual264264Canonical: all dual-verifier tasks
csb-v2-full-validated275Complete: all validated tasks including Daytona-excluded

Task indexes in benchmarks/indexes/ provide views by:

  • Complexity — scored by repo size, repo count, GT files, difficulty
  • Language — 13 languages (Go, C++, Java, Python, Rust, C#, JS, TS, ...)
  • Repo size — small (<100MB) through xlarge (>5GB)
  • Multi-repo — 136 multi-repo tasks across 28 repo sets

Task Taxonomy

All tasks represent realistic developer work in large, often multi-repo, enterprise codebases. Tasks are organized by developer work type.

Work TypeTasksDescriptionRepo Scope
crossrepo47Cross-repo navigation, dependency tracing, org-wide discovery18 single, 9 dual, 20 multi
understand44Codebase comprehension, architecture, onboarding, domain knowledge36 single, 4 dual, 4 multi
refactor43Code transformation, migration, dependency updates26 single, 2 dual, 15 multi
security39Security review, vulnerability remediation, compliance audit26 single, 2 dual, 11 multi
feature34Feature implementation, org-wide feature work24 single, 2 dual, 8 multi
debug26Debugging, root cause analysis, incident triage15 single, 8 dual, 3 multi
fix19Bug repair from issue reports19 single
test12Test generation, code review, QA12 single
document11API docs, architecture docs, migration guides10 single, 1 dual
Total275186 single, 28 dual, 61 multi

Evaluation Configurations

Tasks are evaluated across multiple MCP configurations to measure the impact of external code retrieval tools:

ConfigCode AccessMCP Tools
baseline-local-directFull local codeNone (built-in tools only)
mcp-remote-directRemote only (Sourcegraph)keyword_search, nls_search, read_file, find_references, go_to_definition, ...
augment-local-directFull local codeAugment Context Engine (codebase-retrieval)
github-remote-directRemote only (GitHub API)search_code, get_file_contents, get_repository_tree, ...

Repository Structure

benchmarks/
suites/ # Versioned benchmark suite definitions (JSON)
indexes/ # Task indexes by complexity, language, repo size, multi-repo
tasks/ # 275 task definitions across 20 suite directories
csb_sdlc_feature/ # Feature implementation (23 tasks)
csb_sdlc_fix/ # Bug repair (19 tasks)
csb_org_migration/ # Framework migration (25 tasks)
... # (20 suites total)
runs/
snapshots/ # Frozen, auditable result snapshots
{snapshot_id}/
SNAPSHOT.json # Manifest: suite, model, configs, aggregates
browse.html # Interactive results browser
export/ # Sanitized traces for public consumption
scripts/ # Metrics extraction, evaluation, and operational tooling
publishing/ # Snapshot creation, verification, export
evaluation/ # IR metrics, retrieval analysis, judge pipelines
csb_metrics/ # Python package: models, extractors, discovery
docs/
technical_reports/ # Published technical reports
official_results/ # Pointer to runs/snapshots/

Quickstart

git clone https://github.com/sourcegraph/CodeScaleBench.git
cd CodeScaleBench
# Browse benchmark suites
cat benchmarks/suites/csb-v2-dual264.json | python3 -m json.tool | head -20
# Explore task indexes
cat benchmarks/indexes/by-complexity.json | python3 -m json.tool | head -30
# Open results browser
open runs/snapshots/csb-v1-mixed371--haiku45--030326/browse.html

Running benchmarks (requires Harbor)

# Pre-flight checks
python3 scripts/infra/check_infra.py
# Run canonical suite
./configs/harnesses/run_selected_tasks.sh \
--suite-file benchmarks/suites/csb-v2-dual264.json

Quality Assurance

CodeScaleBench includes a multi-stage QA pipeline:

PhaseScriptPurpose
Pre-flightscripts/authoring/validate_tasks_preflight.pyTask integrity checks
Calibration triadscripts/authoring/calibrate_task.pyNull/golden/adversarial gates on the artifact verifier
Infra checkscripts/infra/check_infra.pyOAuth tokens, Docker, disk
Post-runscripts/authoring/validate_task_run.pyScoring anomalies, MCP usage
Snapshot verifyscripts/publishing/verify_snapshot.pySymlink integrity, completeness

Calibration triad (upstream push gate)

Before a task is pushed to the public sourcegraph/CodeScaleBench mirror, its artifact verifier must pass three calibration gates:

  • null — empty answer scores ≤ 0.1
  • golden — canonical oracle_answer.json (or synthesized perfect input) scores ≥ 0.9
  • adversarial — keyword dump with empty structured arrays scores ≤ 0.5

The triad gates the upstream push, not the public corpus's existence. Failing tasks are not removed; per-cluster fix beads are filed in CSB scope and resolved independently. See docs/qa/calibration_run_2026_04_30.md for the most recent corpus run and cluster breakdown.


License

See LICENSE.

About

No description, website, or topics provided.

Resources

Stars

32 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages