Datasets:
The dataset viewer should be available soon. Please retry later.
CoReDD Bench
Can a reviewer find the defective lines in a change before it is merged? CoReDD Bench turns that question into a measurement by reconstructing labels from later corrections, auditing their error, and propagating the uncertainty into the metrics.
CoReDD Bench ships the labels, the uncertainty model, and the evaluation code. The repository histories and public GitHub review context these were reconstructed from are preserved separately in CoReDD Corpus.
What CoReDD Bench measures
A detector receives a proposed change as it stood before integration and marks the lines it considers defective. CoReDD Bench scores those marks against the lines in that change that caused a later correction.
The setting is ex ante. A detector sees the change and its review context as they stood before integration. What came after is label evidence, not input.
Every case is a change that was defective and was later corrected, so the question is where the defect sits, not whether the change has one. That defect was present the moment the code was written. Corrections that became necessary only because a dependency or an environment changed later are excluded, since nothing in the reviewed change could have revealed them.
The six repositories were selected for observable review and integration workflows, not as a sample of code review practice. Results hold within that scope. The cohort they were drawn from is described in data/cohort.jsonl.
Label reconstruction
The labels are estimates derived from the repository history, not annotated ground truth. For every correction observed after integration, agents search the commit history for the change that introduced the defect and mark the lines within it that caused the correction.
Reconstruction is stochastic and imperfect. A manual audit by a single annotator checks a sample of the reconstructed labels, asking for each case whether the change is corrective, whether the traced change is the origin, and whether the marked lines are complete. The resulting error rates ship as posterior distributions in data/noise.json.
Every reported score therefore carries an interval, and both come from the same Monte Carlo run: each draw perturbs the released labels at the audited rates and scores the metric against them. The point value is the mean over the draws, the interval the spread between their 2.5th and 97.5th percentiles. A wide interval means a comparison does not survive the label error, not that the measurement failed.
The width of that interval is the benchmark's resolution κ, the smallest difference in true performance it can distinguish under its label error. A reported gap below κ does not separate two detectors. Because the interval widens with detector skill, κ depends on where on the quality scale it is read: at node granularity it stays below 0.04 for F1 up to an AUC of 0.9 and reaches 0.12 in the worst case.
Protocol
For each case a submission holds zero or more locations on changed lines, each given as a path, a line number, and the side of the diff it refers to. An empty submission states that no defective line was found, and a case left out entirely is treated the same way.
Canonical diffs
The unified diffs distributed with CoReDD Corpus are the canonical benchmark inputs, and prediction coordinates must be read from them. They were generated with libgit2 using the Myers algorithm and the configuration that produced the released labels.
- copy detection, including copies from unmodified files
- rename detection, including renames from rewritten files
- thresholds of
50for copies, renames, and renames from rewrites - a rename limit of
1000
Regenerating a diff with another implementation or algorithm can align repeated or ambiguous lines differently and produce incompatible coordinates. A regenerated diff must use the configuration above.
Information cutoff
Each case records a cutoff, the latest point in time a detector may draw on. It may use the canonical diff, the repository state before the change, the proposed code on the after side, and PR, issue, comment, and review events timestamped strictly earlier than that point. Everything recorded later is evidence the labels were built from and must not reach the detector.
Timestamp filtering alone is not sufficient. PR and issue head snapshots carry mutable fields that describe the final state, and the corpus rules for excluding them apply here as well.
Valid prediction locations
Predictions are restricted to changed Python lines in the canonical diff. A deleted line is addressed by its path and line number on the base side, an added line by its path and line number on the after side. Line numbering starts at one.
Context lines, files outside the canonical diff, and files not written in Python lie outside the prediction domain.
Scoring
Submitted lines are projected to the syntax nodes of the canonical diff, the same projection that built the labels. A node counts as predicted defective when at least one submitted line maps to it, and every other node in the published candidate set counts as predicted not defective. Candidates do not need to produce syntax nodes themselves.
Nodes are compared by the exact identity of their spans rather than by containment. Several lines projecting to the same span yield one node prediction, which for scored submissions keeps the highest line score.
By default the metric runs once over the candidate nodes of every case pooled into one population, so a case whose defective nodes a perturbation draw removes stays in as negatives. Metrics reported per case, such as MRR, run over each case separately instead and are averaged equally across cases; a case where the metric is undefined is dropped from that average.
Quickstart
Install the benchmark package.
hf download witrin/coredd-bench \
--repo-type dataset \
--local-dir coredd-bench
python -m pip install ./coredd-bench
Projecting submitted lines to syntax nodes needs the source at the recorded commits, so the repository histories are unpacked next.
hf download witrin/coredd-corpus \
--repo-type dataset \
--local-dir coredd-corpus
for archive in coredd-corpus/repositories/*/*.tar.gz; do
target="${archive%.tar.gz}"
mkdir -p "$target"
tar -xzf "$archive" -C "$target" --strip-components=1
done
Six bare repositories end up under coredd-corpus/repositories, one directory per owner. The archives can be removed once unpacked.
Then load the benchmark and pass the lines a detector marked. Each key identifies a case, and the projection to syntax nodes and the Monte Carlo perturbation happen internally.
from sklearn.metrics import f1_score
from coredd import Benchmark, Line
benchmark = Benchmark.load(
repositories="coredd-corpus/repositories",
labels="coredd-bench/data/labels.jsonl",
noise="coredd-bench/data/noise.json",
)
predictions = {
Benchmark.key(
"OpenJobDescription/openjd-model-for-python",
1,
"4f2c8a1d9b3e7c05a6f14d8b2e93c07a5d1f6b48",
"9d5e3b7a1c48f02d6b9e5a3c71f84d0b2e6a9c35",
): [
Line(
path="src/openjd/model/_errors.py",
line=13,
side="after",
),
],
Benchmark.key(
"microsoft/Olive",
127,
"b83f1a06d27c5e94a1b8f03d62e7c48a95d10f3b",
"0c74e9b2a58d316f7c02b4e8d95a13f6c8b027ad",
): [],
}
result = benchmark.evaluate(predictions, metric=f1_score)
print(result)
Any classification metric following metric(y_true, y_pred) can be passed directly. Ranking metrics need a score on each Line and one of the marked metrics in coredd.metrics, for example coredd.metrics.mrr. Passing pooled=False switches from the pooled population to the per-case average, the form MRR is reported in.
Reference
data/
labels.jsonl
noise.json
audits.jsonl
cohort.jsonl
src/coredd/
tests/
Evaluation reads two of these. The benchmark cases and their reconstructed labels live in data/labels.jsonl, and the posterior parameters of the label error rates, one set per confidence stratum, in data/noise.json. The observations the rates were derived from are kept in data/audits.jsonl, and the repository cohort the benchmark was drawn from is described in data/cohort.jsonl. Projection, perturbation, and metrics are implemented in src/coredd/.
Case record
Each line of labels.jsonl describes one reviewed pull request together with the candidate nodes a prediction is scored over. Shown here with two of its six nodes.
{
"repository": "microsoft/Olive",
"pr": 2229,
"cutoff": "2025-10-28T22:53:55+00:00",
"nodes": [
{
"path": "olive/passes/onnx/onnx_dag.py",
"start": [388, 8],
"end": [403, 9],
"type": "block",
"base": "3a9384bffab55b9a44cb39d4b4d8463dbe030225",
"after": "f1544e86d73fe3ed4b93a99dd8611a4e70233e49",
"bin": 2
},
{
"path": "olive/passes/onnx/quantization.py",
"start": [1, 0],
"end": [745, 0],
"type": "module",
"base": "3a9384bffab55b9a44cb39d4b4d8463dbe030225",
"after": "f1544e86d73fe3ed4b93a99dd8611a4e70233e49",
"bin": 2,
"provenance": [
{"side": "after", "line": 255, "corrections": [2241]},
{"side": "after", "line": 256, "corrections": [2241]}
]
}
]
}
The pull request is identified by repository and pr, where the former matches the directories under coredd-corpus/repositories. Its cutoff is the latest point in time a detector may draw on.
Candidate nodes are listed under nodes. Each is addressed by its path together with start and end, both a line and column pair, while type names the syntax construct it spans. The commits the canonical diff was taken between are recorded per node as base and after.
Nodes the reconstruction marked defective carry provenance, which is absent everywhere else. It holds the lines that carried the defect and, for each of them, the corrections that later touched it. The confidence stratum a node falls into is given by bin, the same stratification the error rates in noise.json are reported over.
Audit record
Each line of audits.jsonl records one audited case. Retained are the repository and the relevant commits, an anonymized annotator identifier, the classificationthe audit reached together with the confidence attached to it, and any lines theannotator selected with the nodes they project to.
Audit records are released for transparency and secondary analysis. Evaluation does not read them, since the rates derived from them already enter through noise.json.
Cohort record
The six benchmark repositories are a stratified sample from a cohort of 65 repositories; each line of cohort.jsonl describes one of them.
The cohort is the survivor set of a construction funnel over active Python repositories on GitHub. Platform events yield 9,345 candidates, of which repository selection retains 1,090, integration branch reconstruction 812, review discipline profiling 130, and integration gate enforcement 65. From these, two repositories per discussion-rate stratum were drawn as the audit sample. The funnel restricts the observable population as follows.
| Aspect | Restriction |
|---|---|
| Platform | GitHub only |
| Language | Python only |
| Communication | English only |
| Activity interval | June to September 2025 |
| Review threshold | eligibility score ≥ 0.75 |
| Minimum history | ≥ 100 merged pull requests |
| Branch instability | ≤ 2 integration branch segments |
| Review discipline | stationary review probability (tolerance 0.01, onset within the first tenth) |
| Bypass threshold | bypass share < 0.05 |
{
"repository": "OpenJobDescription/openjd-model-for-python",
"organization": "OpenJobDescription",
"review": {"score": 0.8569, "low": 0.4344, "high": 0.9025, "coverage": 1.0},
"stationarity": {"onset": 0.0, "kind": "stationary"},
"bypass": {"share": 0.0196, "attributed": 200, "bypassed": 4, "picked": 0, "ambiguous": 0},
"merges": {"total": 137, "rate": 4.2812},
"reviewers": {"total": 28, "rate": 5.3929},
"scale": {"sloc": 19584, "core": 6, "age": 32},
"participation": {"share": 0.2409, "stratum": "low", "sampled": true}
}
Each record pairs the scores the funnel filtered on with the descriptive metrics of the repository.
review— the eligibility score of repository selection, a Wilson score over the reviewed merges of the observation window with its interval bounds, and the full-history share of merged pull requests reviewed by a user other than the author (coverage).stationarity— the fitted review-probability profile:onsetis the earliest fraction of the history after which it varies by at most the tolerance;kindisstationaryorstationary tail.bypass— the share of trunk commits that entered without a merged pull request, over the commits whose attribution is decided, with the class counts behind it.merges,reviewers— full-history totals with per-month rates: merged pull requests per month, and the mean number of distinct reviewers active per month.scale— Python source lines at the released head, the core contributors (the smallest set of commit authors covering 80% of trunk commits), and the history age in months.participation— the discussion rate (merged pull requests with a comment by another user before close), its stratum under the cuts at 0.32 and 0.48, and whether the repository entered the audit sample.
Cohort records are released for transparency and secondary analysis, in particular of the scope the results hold within. Evaluation does not read them.
Related resource
CoReDD Corpus holds the frozen repository histories and the timestamped GitHub review context the benchmark was built from and is evaluated against.
License
CoReDD Bench is released under CC BY 4.0. This covers the labels, the uncertainty model, the audit records, the documentation, and the evaluation software.
Third-party source material is not part of this release. It is distributed with CoReDD Corpus under its own terms.
- Downloads last month
- 39