File size: 7,966 Bytes
21b4bb7 515d954 21b4bb7 515d954 21b4bb7 515d954 aec7ddd 515d954 21b4bb7 515d954 21b4bb7 aec7ddd 21b4bb7 515d954 aec7ddd 515d954 21b4bb7 515d954 49f9e89 515d954 49f9e89 515d954 21b4bb7 515d954 21b4bb7 515d954 e7b4db7 515d954 21b4bb7 515d954 21b4bb7 515d954 49f9e89 515d954 49f9e89 515d954 49f9e89 515d954 49f9e89 515d954 49f9e89 515d954 49f9e89 515d954 49f9e89 515d954 49f9e89 515d954 49f9e89 515d954 49f9e89 515d954 49f9e89 515d954 49f9e89 515d954 49f9e89 515d954 867d7e3 515d954 49f9e89 515d954 49f9e89 515d954 49f9e89 515d954 867d7e3 515d954 867d7e3 515d954 e7b4db7 515d954 e7b4db7 21b4bb7 515d954 aec7ddd 515d954 aec7ddd 515d954 de29583 515d954 de29583 515d954 de29583 515d954 aec7ddd 515d954 aec7ddd 515d954 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | ---
license: cc-by-4.0
language:
- en
size_categories:
- n>1T
task_categories:
- text-generation
source_datasets:
- nebius/SWE-rebench-V2
pretty_name: SWE-rebench V2 CodeWorldModeling Traces
tags:
- code
- execution-traces
- swe-rebench
- marin
---
# SWE-rebench V2 — CodeWorldModeling Traces
> **This is a derived dataset.** Every record is produced from an instance of
> [`nebius/SWE-rebench-V2`](https://huggingface.co/datasets/nebius/SWE-rebench-V2).
> It is **governed by the SWE-rebench V2 license** — see [License](#license)
> below — including the requirement to respect each source repository's own
> license.
Line-by-line Python execution traces for the test suites of SWE-rebench V2
instances, captured by running each instance's tests under a tracer inside
Nebius ConTree sandboxes.
Each instance comes with a fix patch. The pipeline traces two kinds of tests:
- **Fix-verifying tests** (`affected=True`) — tests that fail before the fix
patch and pass after it. These are the tests that demonstrate the bug and its
fix. Such a row is traced *twice*: once before the patch (the failing run) and
once after (the passing run).
- **Regression-suite tests** (`affected=False`) — the rest of the repository's
existing test suite ("broad phase"), each traced once at the fixed revision.
Each row is one ``(instance_id, test_id)`` trace.
## Schema
Trace shards under `data/`:
| column | type | notes |
| --- | --- | --- |
| `instance_id` | string | SWE-rebench-V2 row id |
| `test_id` | string | pytest node id |
| `affected` | bool | `True` = fix-verifying test (fails before the patch, passes after); `False` = regression-suite test traced once at the fixed revision |
| `text` | string | plain-text test source + line-by-line execution trace (see below) |
Sentinel rows from instances that failed before any trace was captured are
excluded.
## Reading a trace
The `text` of a regression-suite row (`affected=False`) is the test source
followed by a single trace:
```
<test source>
# --- trace ---
<line-by-line execution trace>
```
A fix-verifying row (`affected=True`) carries the test source, the trace from
*before* the fix, the fix patch itself, and the trace from *after* the fix:
```
<test source>
# --- pre-patch trace ---
<line-by-line execution trace, before the fix>
# --- patch ---
<the fix patch, in `git diff` form>
# --- post-patch trace ---
<line-by-line execution trace, after the fix>
```
A trace replays execution one source line at a time. Inline `#` comments record
runtime state:
| comment | meaning |
| --- | --- |
| `# === file::function (line N) ===` | execution entered this function frame |
| `# ENTER: arg=value, ...` | argument values at the call |
| `# branch=if:True` / `:False` | which way a conditional went |
| `name = expr # name=value` | value bound by an assignment (right-margin) |
| `# RETURN from function: value` | the frame's return value |
| `# EXCEPTION in function: ...` | an exception raised in the frame |
### Example — a regression-suite trace (`affected=False`)
Source file `mathx.py`:
```python
def clamp(value, low, high):
if value < low:
return low
if value > high:
return high
return value
```
Test `test_clamp_within_range` and its trace:
```
def test_clamp_within_range():
assert clamp(5, 0, 10) == 5
# --- trace ---
# === tests/test_mathx.py::test_clamp_within_range (line 1) ===
def test_clamp_within_range():
assert clamp(5, 0, 10) == 5
# === mathx.py::clamp (line 1) ===
def clamp(value, low, high):
# ENTER: value=5, low=0, high=10
if value < low: # branch=if:False
if value > high: # branch=if:False
return value
# RETURN from clamp: 5
```
### Example — a fix-verifying trace (`affected=True`)
The buggy `clamp` returns `low` instead of `high` when `value` is above the
range, so `test_clamp_above_range` fails. The fix patch corrects it. The
pre-patch trace shows the failure, the post-patch trace shows it passing:
```
def test_clamp_above_range():
assert clamp(99, 0, 10) == 10
# --- pre-patch trace ---
# === tests/test_mathx.py::test_clamp_above_range (line 1) ===
def test_clamp_above_range():
assert clamp(99, 0, 10) == 10
# === mathx.py::clamp (line 1) ===
def clamp(value, low, high):
# ENTER: value=99, low=0, high=10
if value < low: # branch=if:False
if value > high: # branch=if:True
return low
# RETURN from clamp: 0
# EXCEPTION in test_clamp_above_range: AssertionError: assert 0 == 10
# --- patch ---
diff --git a/mathx.py b/mathx.py
--- a/mathx.py
+++ b/mathx.py
@@ -3,5 +3,5 @@ def clamp(value, low, high):
if value > high:
- return low
+ return high
return value
# --- post-patch trace ---
# === tests/test_mathx.py::test_clamp_above_range (line 1) ===
def test_clamp_above_range():
assert clamp(99, 0, 10) == 10
# === mathx.py::clamp (line 1) ===
def clamp(value, low, high):
# ENTER: value=99, low=0, high=10
if value < low: # branch=if:False
if value > high: # branch=if:True
return high
# RETURN from clamp: 10
```
## Joining the per-instance license
`metadata/licenses.parquet` is a companion file mapping `instance_id` ->
`license` (the source repository's license at the instance commit). It is kept
separate so the multi-GB trace shards do not carry a redundant per-row string.
Join it on `instance_id` to attach the license to any trace row.
With `datasets`:
```python
from datasets import load_dataset
REPO = "marin-community/swe-rebench-v2-CodeWorldModeling"
traces = load_dataset(REPO, split="train")
licenses = load_dataset(REPO, data_files="metadata/licenses.parquet", split="train")
license_by_instance = dict(zip(licenses["instance_id"], licenses["license"]))
traces = traces.map(lambda row: {"license": license_by_instance[row["instance_id"]]})
```
With pandas:
```python
import pandas as pd
base = "hf://datasets/marin-community/swe-rebench-v2-CodeWorldModeling"
traces = pd.read_parquet(f"{base}/data")
licenses = pd.read_parquet(f"{base}/metadata/licenses.parquet")
traces = traces.merge(licenses, on="instance_id", how="left")
```
## Provenance
- **Source dataset**: [`nebius/SWE-rebench-V2`](https://huggingface.co/datasets/nebius/SWE-rebench-V2)
- **Generator**: [`experiments/swe_rebench_trace/contree_pipeline.py`](https://github.com/marin-community/marin/blob/main/experiments/swe_rebench_trace/contree_pipeline.py)
in [marin-community/marin](https://github.com/marin-community/marin).
## License
This dataset is derived from SWE-rebench V2 and inherits its license terms:
> The dataset is licensed under the Creative Commons Attribution 4.0 license.
> However, please respect the license of each specific repository on which a
> particular instance is based. To facilitate this, the license of each
> repository at the time of the commit is provided for every instance.
The per-instance source-repository license is provided in the companion file
`metadata/licenses.parquet` (join on `instance_id`). When using or
redistributing these traces, honor the license of the originating repository
for each instance.
## Citation
Please cite both this dataset and the source dataset it derives from.
This dataset:
```bibtex
@misc{marincommunity2026swerebenchcodeworldmodeling,
title={SWE-rebench V2 CodeWorldModeling Traces},
author={Marin Community},
year={2026},
howpublished={\url{https://huggingface.co/datasets/marin-community/swe-rebench-v2-CodeWorldModeling}},
}
```
Source dataset:
```bibtex
@misc{badertdinov2026swerebenchv2languageagnosticswe,
title={SWE-rebench V2: Language-Agnostic SWE Task Collection at Scale},
author={Ibragim Badertdinov and Maksim Nekrashevich and Anton Shevtsov and Alexander Golubev},
year={2026},
eprint={2602.23866},
archivePrefix={arXiv},
primaryClass={cs.SE},
url={https://arxiv.org/abs/2602.23866},
}
```
|