Update README.md
Browse files
README.md
CHANGED
|
@@ -45,3 +45,74 @@ configs:
|
|
| 45 |
- split: test
|
| 46 |
path: data/test-*
|
| 47 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
- split: test
|
| 46 |
path: data/test-*
|
| 47 |
---
|
| 48 |
+
|
| 49 |
+
# Diff-XYZ
|
| 50 |
+
|
| 51 |
+
Diff-XYZ contains 1,000 real-world code edits sampled and filtered from
|
| 52 |
+
the [CommitPackFT](https://huggingface.co/datasets/bigcode/commitpackft) dataset.
|
| 53 |
+
Each example provides three components: the original file contents (`old_code`), the modified contents (`new_code`), and
|
| 54 |
+
multiple diff representations (`udiff`, `udiff-h`, `udiff-l`, and `search-replace`).
|
| 55 |
+
|
| 56 |
+
These formats enable evaluation of LLM capabilities on three code editing tasks:
|
| 57 |
+
|
| 58 |
+
- **Apply**: Given old code and diff, generate new code
|
| 59 |
+
- **Anti-Apply**: Given new code and diff, generate old code
|
| 60 |
+
- **Diff-Generation**: Given old and new code, generate the diff
|
| 61 |
+
|
| 62 |
+
## How it's built
|
| 63 |
+
|
| 64 |
+
Examples were systematically filtered from CommitPackFT to ensure high quality:
|
| 65 |
+
|
| 66 |
+
- **Scope**: Single-file changes only, excluding binary files, vendor directories, and generated code
|
| 67 |
+
- **Quality**: Removed trivial changes (whitespace-only) and likely test files
|
| 68 |
+
- **Size**: Required 40+ lines in at least one version of the code (old or new); excluded very large files (1000+ lines)
|
| 69 |
+
- **Sampling**:
|
| 70 |
+
- Target 50/50 split between single-hunk and multi-hunk edits (hunks counted via `@@` markers in the unified diff).
|
| 71 |
+
- Within each hunk group, stratify by change size (lines added + removed) using the 40th/80th percentiles of that
|
| 72 |
+
group, targeting ≈40% small, 40% medium, 20% large.
|
| 73 |
+
- Cap examples to ≤5 per repository per language.
|
| 74 |
+
|
| 75 |
+
## Dataset Statistics
|
| 76 |
+
|
| 77 |
+
- **Total examples:** 1,000
|
| 78 |
+
- **Languages:** Python (200), JavaScript (200), Java (200), Kotlin (200), Rust (200)
|
| 79 |
+
|
| 80 |
+
**Hunks:**
|
| 81 |
+
|
| 82 |
+
- **1 hunk:** 500 (50.0%)
|
| 83 |
+
- **2+ hunks:** 500 (50.0%)
|
| 84 |
+
|
| 85 |
+
**Change size (added + removed), stratified within hunk groups:**
|
| 86 |
+
|
| 87 |
+
- **Small** (≤40th pct): 424 (42.4%)
|
| 88 |
+
- **Medium** (40th–80th): 388 (38.8%)
|
| 89 |
+
- **Large** (>80th): 188 (18.8%)
|
| 90 |
+
|
| 91 |
+
**Change type:**
|
| 92 |
+
|
| 93 |
+
- **Mixed** (additions + deletions): 815 (81.5%)
|
| 94 |
+
- **Add-only:** 163 (16.3%)
|
| 95 |
+
- **Delete-only:** 22 (2.2%)
|
| 96 |
+
|
| 97 |
+
**Repository diversity:** 891 unique repositories.
|
| 98 |
+
|
| 99 |
+
## Schema
|
| 100 |
+
|
| 101 |
+
| Field | Type | Description |
|
| 102 |
+
|------------------|--------|------------------------------------------------------------------------|
|
| 103 |
+
| `repo` | string | Repository identifier (e.g., "owner/name") |
|
| 104 |
+
| `commit` | string | Commit SHA that produced the change |
|
| 105 |
+
| `path` | string | File path relative to repo root |
|
| 106 |
+
| `lang` | string | One of: `python`, `javascript`, `java`, `kotlin`, `rust` |
|
| 107 |
+
| `license` | string | SPDX license identifier of the repo |
|
| 108 |
+
| `message` | string | Original commit message |
|
| 109 |
+
| `old_code` | string | Complete file contents before change |
|
| 110 |
+
| `new_code` | string | Complete file contents after change |
|
| 111 |
+
| `n_added` | int | # of `+` lines (excluding headers) |
|
| 112 |
+
| `n_removed` | int | # of `-` lines (excluding headers) |
|
| 113 |
+
| `n_hunks` | int | # of `@@` (hunk) sections |
|
| 114 |
+
| `change_kind` | string | `add_only`, `del_only`, or `mixed` |
|
| 115 |
+
| `udiff` | string | Standard unified diff (1-line context, numeric hunk headers) |
|
| 116 |
+
| `udiff-h` | string | Unified diff with relaxed hunk headers written as `@@ ... @@` |
|
| 117 |
+
| `udiff-l` | string | Unified diff with explicit line markers: `ADD`, `DEL`, and `CON` |
|
| 118 |
+
| `search-replace` | string | Search/replace representation: pairs of `SEARCH`/`REPLACE` edit blocks |
|