Tejaswiniprabhakaran19 commited on
Commit
9169315
·
verified ·
1 Parent(s): 59cf95e

PatchPilot patch-generation dataset

Browse files
Files changed (6) hide show
  1. README.md +75 -0
  2. dataset_stats.json +63 -0
  3. leakage_check.json +96 -0
  4. test.jsonl.gz +3 -0
  5. train.jsonl.gz +3 -0
  6. val.jsonl.gz +3 -0
README.md ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ task_categories: [text-generation]
4
+ tags: [program-repair, code, swe-bench, sft, patchpilot]
5
+ ---
6
+ # PatchPilot patch-generation dataset
7
+
8
+ Supervised fine-tuning chats for PatchPilot's patch generator (A2). Each chat is exactly the
9
+ prompt PatchPilot's agent sends to its model, followed by the developers' real fix written in the
10
+ agent's SEARCH/REPLACE edit format.
11
+
12
+ ## Source
13
+
14
+ Built by `scripts/build_patchgen_data.py` (seed 42) from the **SWE-bench training split**
15
+ (`princeton-nlp/SWE-bench`, train) and the gold files' contents from `princeton-nlp/SWE-bench_oracle`.
16
+ The same seeded selection (at most 400 instances per repository) and the same repository-level
17
+ train/validation/test splits as the localization dataset are used.
18
+
19
+ ## Leakage check
20
+
21
+ The training split's 35 repositories are disjoint from SWE-bench Lite's 12. `scripts/check_leakage.py`
22
+ found zero overlap with all 300 SWE-bench Lite test instances on repository, instance id,
23
+ normalised issue text and normalised gold patch (`results/leakage_check.json`).
24
+
25
+ ## Construction
26
+
27
+ 1. **Filter (same shape as SWE-bench Lite's own selection):** the gold patch edits exactly one
28
+ existing non-test Python file, in at most three hunks. Larger multi-file fixes are skipped.
29
+ 2. **Target:** each hunk becomes a SEARCH/REPLACE block. If the original lines are not unique in
30
+ the file, real neighbouring lines are added until they are. Applying the blocks is checked to
31
+ give exactly the same file as `git apply` of the gold patch; examples that fail are skipped.
32
+ 3. **Prompt:** the agent's system prompt; a user turn with the issue text (max 3,000 characters),
33
+ the tests added by the fix (max 1,500 characters) and the gold file with line numbers, whole if
34
+ at most 150 lines, otherwise windows of 15 lines around each edit.
35
+ 4. **Length:** user + assistant at most 10,000 characters (about 2,800 Gemma tokens).
36
+
37
+ ## Size
38
+
39
+ From `results/patchgen/dataset_stats.json`:
40
+
41
+ | Split | Chats |
42
+ |---|---|
43
+ | train | 3,063 |
44
+ | val | 494 |
45
+ | test | 580 |
46
+
47
+ Of the 8,867 selected training-split instances, 4,137 became chats. Skipped: 4,113 not
48
+ SWE-bench-Lite-shaped (more than one file or more than three hunks), 235 too long, 197 with no
49
+ existing non-test Python file edited, 101 absent from `SWE-bench_oracle`, 78 whose diff could not
50
+ be turned into unique SEARCH/REPLACE blocks that reproduce `git apply`, and 6 whose edited file was
51
+ missing from the oracle text. User + assistant length: median 5,207 characters, maximum 9,995.
52
+ The splits use the same repositories as the localization dataset.
53
+
54
+ ## Format
55
+
56
+ `{train,val,test}.jsonl.gz`, one chat per line:
57
+
58
+ ```json
59
+ {"instance_id": "...", "repo": "owner/name", "split": "train", "files": ["pkg/mod.py"],
60
+ "messages": [{"role": "system", "content": "..."},
61
+ {"role": "user", "content": "## Bug report ..."},
62
+ {"role": "assistant", "content": "Fix:\n\npkg/mod.py\n<<<<<<< SEARCH\n..."}]}
63
+ ```
64
+
65
+ ## Limitations
66
+
67
+ - The context shows the gold file around the edit, so the model learns to fix given good
68
+ localization; at run time it sees the agent's localized files, which may be wrong.
69
+ - The tests are shown as the test patch, not as the failing test output the agent sees at run time.
70
+ - Only small, single-file fixes; the developers' fix is one correct answer among possibly many.
71
+
72
+ ## Licence
73
+
74
+ Derived from SWE-bench (MIT). The underlying code belongs to the respective open-source projects
75
+ under their own licences.
dataset_stats.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "source": [
3
+ "princeton-nlp/SWE-bench",
4
+ "princeton-nlp/SWE-bench_oracle"
5
+ ],
6
+ "seed": 42,
7
+ "per_repo_cap": 400,
8
+ "selected_instances": 8867,
9
+ "examples": {
10
+ "train": 3063,
11
+ "test": 580,
12
+ "val": 494
13
+ },
14
+ "skipped": {
15
+ "not_lite_like": 4113,
16
+ "no_oracle": 101,
17
+ "too_long": 235,
18
+ "no_python_source_edit": 197,
19
+ "not_convertible": 78,
20
+ "missing_source": 6
21
+ },
22
+ "user_plus_assistant_chars": {
23
+ "median": 5207,
24
+ "max": 9995
25
+ },
26
+ "repo_split": {
27
+ "conda/conda": "test",
28
+ "explosion/spaCy": "test",
29
+ "apache/airflow": "test",
30
+ "mesonbuild/meson": "test",
31
+ "tiangolo/fastapi": "val",
32
+ "open-mmlab/mmdetection": "val",
33
+ "scipy/scipy": "val",
34
+ "huggingface/transformers": "val",
35
+ "pypa/pip": "val",
36
+ "pantsbuild/pants": "train",
37
+ "google/jax": "train",
38
+ "dagster-io/dagster": "train",
39
+ "docker/compose": "train",
40
+ "python/typeshed": "train",
41
+ "conan-io/conan": "train",
42
+ "kubeflow/pipelines": "train",
43
+ "tensorflow/models": "train",
44
+ "apache/mxnet": "train",
45
+ "pyca/cryptography": "train",
46
+ "DataDog/integrations-core": "train",
47
+ "wagtail/wagtail": "train",
48
+ "gitpython-developers/GitPython": "train",
49
+ "jupyterlab/jupyterlab": "train",
50
+ "Lightning-AI/lightning": "train",
51
+ "twisted/twisted": "train",
52
+ "ray-project/ray": "train",
53
+ "numpy/numpy": "train",
54
+ "PrefectHQ/prefect": "train",
55
+ "pandas-dev/pandas": "train",
56
+ "Qiskit/qiskit": "train",
57
+ "ytdl-org/youtube-dl": "train",
58
+ "googleapis/google-cloud-python": "train",
59
+ "ipython/ipython": "train",
60
+ "JohnSnowLabs/spark-nlp": "train",
61
+ "celery/celery": "train"
62
+ }
63
+ }
leakage_check.json ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "train_source": "princeton-nlp/SWE-bench",
3
+ "train_instances_checked": 8867,
4
+ "train_repos": [
5
+ "DataDog/integrations-core",
6
+ "JohnSnowLabs/spark-nlp",
7
+ "Lightning-AI/lightning",
8
+ "PrefectHQ/prefect",
9
+ "Qiskit/qiskit",
10
+ "apache/airflow",
11
+ "apache/mxnet",
12
+ "celery/celery",
13
+ "conan-io/conan",
14
+ "conda/conda",
15
+ "dagster-io/dagster",
16
+ "docker/compose",
17
+ "explosion/spaCy",
18
+ "gitpython-developers/GitPython",
19
+ "google/jax",
20
+ "googleapis/google-cloud-python",
21
+ "huggingface/transformers",
22
+ "ipython/ipython",
23
+ "jupyterlab/jupyterlab",
24
+ "kubeflow/pipelines",
25
+ "mesonbuild/meson",
26
+ "numpy/numpy",
27
+ "open-mmlab/mmdetection",
28
+ "pandas-dev/pandas",
29
+ "pantsbuild/pants",
30
+ "pyca/cryptography",
31
+ "pypa/pip",
32
+ "python/typeshed",
33
+ "ray-project/ray",
34
+ "scipy/scipy",
35
+ "tensorflow/models",
36
+ "tiangolo/fastapi",
37
+ "twisted/twisted",
38
+ "wagtail/wagtail",
39
+ "ytdl-org/youtube-dl"
40
+ ],
41
+ "all_train_split_instances_checked": 19008,
42
+ "eval_source": "princeton-nlp/SWE-bench_Lite",
43
+ "eval_instances_checked": 300,
44
+ "eval_repos": [
45
+ "astropy/astropy",
46
+ "django/django",
47
+ "matplotlib/matplotlib",
48
+ "mwaskom/seaborn",
49
+ "pallets/flask",
50
+ "psf/requests",
51
+ "pydata/xarray",
52
+ "pylint-dev/pylint",
53
+ "pytest-dev/pytest",
54
+ "scikit-learn/scikit-learn",
55
+ "sphinx-doc/sphinx",
56
+ "sympy/sympy"
57
+ ],
58
+ "eval_subset_instances": 50,
59
+ "selected_train_vs_eval": {
60
+ "repo": {
61
+ "overlapping_eval_instances": 0,
62
+ "examples": []
63
+ },
64
+ "instance_id": {
65
+ "overlapping_eval_instances": 0,
66
+ "examples": []
67
+ },
68
+ "issue_text": {
69
+ "overlapping_eval_instances": 0,
70
+ "examples": []
71
+ },
72
+ "gold_patch": {
73
+ "overlapping_eval_instances": 0,
74
+ "examples": []
75
+ }
76
+ },
77
+ "full_train_split_vs_eval": {
78
+ "repo": {
79
+ "overlapping_eval_instances": 0,
80
+ "examples": []
81
+ },
82
+ "instance_id": {
83
+ "overlapping_eval_instances": 0,
84
+ "examples": []
85
+ },
86
+ "issue_text": {
87
+ "overlapping_eval_instances": 0,
88
+ "examples": []
89
+ },
90
+ "gold_patch": {
91
+ "overlapping_eval_instances": 0,
92
+ "examples": []
93
+ }
94
+ },
95
+ "leak_free": true
96
+ }
test.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7d328feb0c34c133c0ef6c2095bf783a092e0882f70966abb3d96d29238a160b
3
+ size 824841
train.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:47ae221ac41da451f045cee9bb11b2c95bdb9b6474c6ff99c3d5b5de157cccf7
3
+ size 3898484
val.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:187251a5b2eff4b3c7c3c58267b6b36fa34c2ec8354b7cf0d2d129166ce5254b
3
+ size 683832