WillHeld commited on
Commit
867d7e3
·
verified ·
1 Parent(s): bfee29f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +110 -91
README.md CHANGED
@@ -1,101 +1,100 @@
1
  ---
2
  license: cc-by-4.0
3
  language:
4
- - en
5
  size_categories:
6
- - n>1T
7
  task_categories:
8
- - text-generation
9
  source_datasets:
10
- - nebius/SWE-rebench-V2
11
- pretty_name: SWE-rebench V2 CodeWorldModeling Traces
12
  tags:
13
- - code
14
- - execution-traces
15
- - swe-rebench
16
- - marin
17
  ---
18
 
19
  # SWE-rebench V2 — CodeWorldModeling Traces
20
 
21
- > **This is a derived dataset.** Every record is produced from an instance of
22
- > [`nebius/SWE-rebench-V2`](https://huggingface.co/datasets/nebius/SWE-rebench-V2).
23
- > It is **governed by the SWE-rebench V2 license** see [License](#license)
24
- > below including the requirement to respect each source repository's own
25
- > license.
26
 
27
- Line-by-line Python execution traces for the test suites of SWE-rebench V2
28
- instances, captured by running each instance's tests under a tracer inside
29
- Nebius ConTree sandboxes.
30
 
31
- Each instance comes with a fix patch. The pipeline traces two kinds of tests:
 
 
32
 
33
- - **Fix-verifying tests** (`affected=True`) — tests that fail before the fix
34
- patch and pass after it. These are the tests that demonstrate the bug and its
35
- fix. Such a row is traced *twice*: once before the patch (the failing run) and
36
- once after (the passing run).
37
- - **Regression-suite tests** (`affected=False`) — the rest of the repository's
38
- existing test suite ("broad phase"), each traced once at the fixed revision.
39
 
40
- Each row is one ``(instance_id, test_id)`` trace.
 
41
 
42
- ## Schema
 
 
 
43
 
44
- Trace shards under `data/`:
 
 
45
 
46
- | column | type | notes |
47
- | --- | --- | --- |
48
- | `instance_id` | string | SWE-rebench-V2 row id |
49
- | `test_id` | string | pytest node id |
50
- | `affected` | bool | `True` = fix-verifying test (fails before the patch, passes after); `False` = regression-suite test traced once at the fixed revision |
51
- | `text` | string | plain-text test source + line-by-line execution trace (see below) |
52
 
53
- Sentinel rows from instances that failed before any trace was captured are
54
- excluded.
55
 
56
- ## Reading a trace
 
57
 
58
- The `text` of a regression-suite row (`affected=False`) is the test source
59
- followed by a single trace:
60
 
61
- ```
62
  <test source>
63
 
64
  # --- trace ---
65
  <line-by-line execution trace>
66
  ```
67
 
68
- A fix-verifying row (`affected=True`) carries the test source, the trace from
69
- *before* the fix, the fix patch itself, and the trace from *after* the fix:
70
 
71
- ```
72
  <test source>
73
 
74
  # --- pre-patch trace ---
75
  <line-by-line execution trace, before the fix>
76
 
77
  # --- patch ---
78
- <the fix patch, in `git diff` form>
79
 
80
  # --- post-patch trace ---
81
  <line-by-line execution trace, after the fix>
82
  ```
83
 
84
- A trace replays execution one source line at a time. Inline `#` comments record
85
- runtime state:
 
86
 
87
- | comment | meaning |
88
- | --- | --- |
89
- | `# === file::function (line N) ===` | execution entered this function frame |
90
- | `# ENTER: arg=value, ...` | argument values at the call |
91
- | `# branch=if:True` / `:False` | which way a conditional went |
92
- | `name = expr # name=value` | value bound by an assignment (right-margin) |
93
- | `# RETURN from function: value` | the frame's return value |
94
- | `# EXCEPTION in function: ...` | an exception raised in the frame |
95
 
96
- ### Example — a regression-suite trace (`affected=False`)
97
 
98
- Source file `mathx.py`:
 
99
 
100
  ```python
101
  def clamp(value, low, high):
@@ -106,9 +105,10 @@ def clamp(value, low, high):
106
  return value
107
  ```
108
 
109
- Test `test_clamp_within_range` and its trace:
 
110
 
111
- ```
112
  def test_clamp_within_range():
113
  assert clamp(5, 0, 10) == 5
114
 
@@ -126,13 +126,18 @@ def clamp(value, low, high):
126
  # RETURN from clamp: 5
127
  ```
128
 
129
- ### Example a fix-verifying trace (`affected=True`)
 
130
 
131
- The buggy `clamp` returns `low` instead of `high` when `value` is above the
132
- range, so `test_clamp_above_range` fails. The fix patch corrects it. The
133
- pre-patch trace shows the failure, the post-patch trace shows it passing:
134
 
135
- ```
 
 
 
 
 
 
136
  def test_clamp_above_range():
137
  assert clamp(99, 0, 10) == 10
138
 
@@ -174,14 +179,27 @@ def clamp(value, low, high):
174
  # RETURN from clamp: 10
175
  ```
176
 
177
- ## Joining the per-instance license
178
 
179
- `metadata/licenses.parquet` is a companion file mapping `instance_id` ->
180
- `license` (the source repository's license at the instance commit). It is kept
181
- separate so the multi-GB trace shards do not carry a redundant per-row string.
182
- Join it on `instance_id` to attach the license to any trace row.
183
 
184
- With `datasets`:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
 
186
  ```python
187
  from datasets import load_dataset
@@ -195,12 +213,13 @@ license_by_instance = dict(zip(licenses["instance_id"], licenses["license"]))
195
  traces = traces.map(lambda row: {"license": license_by_instance[row["instance_id"]]})
196
  ```
197
 
198
- With pandas:
199
 
200
  ```python
201
  import pandas as pd
202
 
203
  base = "hf://datasets/marin-community/swe-rebench-v2-CodeWorldModeling"
 
204
  traces = pd.read_parquet(f"{base}/data")
205
  licenses = pd.read_parquet(f"{base}/metadata/licenses.parquet")
206
  traces = traces.merge(licenses, on="instance_id", how="left")
@@ -208,9 +227,11 @@ traces = traces.merge(licenses, on="instance_id", how="left")
208
 
209
  ## Provenance
210
 
211
- - **Source dataset**: [`nebius/SWE-rebench-V2`](https://huggingface.co/datasets/nebius/SWE-rebench-V2)
212
- - **Generator**: [`experiments/swe_rebench_trace/contree_pipeline.py`](https://github.com/marin-community/marin/blob/main/experiments/swe_rebench_trace/contree_pipeline.py)
213
- in [marin-community/marin](https://github.com/marin-community/marin).
 
 
214
 
215
  ## License
216
 
@@ -221,36 +242,34 @@ This dataset is derived from SWE-rebench V2 and inherits its license terms:
221
  > particular instance is based. To facilitate this, the license of each
222
  > repository at the time of the commit is provided for every instance.
223
 
224
- The per-instance source-repository license is provided in the companion file
225
- `metadata/licenses.parquet` (join on `instance_id`). When using or
226
- redistributing these traces, honor the license of the originating repository
227
- for each instance.
228
 
229
  ## Citation
230
 
231
- Please cite both this dataset and the source dataset it derives from.
232
 
233
- This dataset:
234
 
235
  ```bibtex
236
  @misc{marincommunity2026swerebenchcodeworldmodeling,
237
- title={SWE-rebench V2 CodeWorldModeling Traces},
238
- author={Marin Community},
239
- year={2026},
240
- howpublished={\url{https://huggingface.co/datasets/marin-community/swe-rebench-v2-CodeWorldModeling}},
241
  }
242
  ```
243
 
244
- Source dataset:
245
 
246
  ```bibtex
247
  @misc{badertdinov2026swerebenchv2languageagnosticswe,
248
- title={SWE-rebench V2: Language-Agnostic SWE Task Collection at Scale},
249
- author={Ibragim Badertdinov and Maksim Nekrashevich and Anton Shevtsov and Alexander Golubev},
250
- year={2026},
251
- eprint={2602.23866},
252
- archivePrefix={arXiv},
253
- primaryClass={cs.SE},
254
- url={https://arxiv.org/abs/2602.23866},
255
  }
256
- ```
 
1
  ---
2
  license: cc-by-4.0
3
  language:
4
+ - en
5
  size_categories:
6
+ - 100B<n<1T
7
  task_categories:
8
+ - text-generation
9
  source_datasets:
10
+ - nebius/SWE-rebench-V2
11
+ pretty_name: SWE-rebench V2 Code World Modeling Traces
12
  tags:
13
+ - code
14
+ - execution-traces
15
+ - swe-rebench
16
+ - marin
17
  ---
18
 
19
  # SWE-rebench V2 — CodeWorldModeling Traces
20
 
21
+ This dataset turns SWE-rebench V2 software-engineering tasks into execution-trace
22
+ training examples. For each traced test, it records the test source together with
23
+ a line-by-line account of how the relevant Python code executed: which functions
24
+ were entered, what arguments were passed, which branches were taken, what values
25
+ were assigned, what returned, and where exceptions occurred.
26
 
27
+ The goal is to make the runtime behavior behind SWE-style bug fixes explicit.
28
+ Instead of seeing only a repository, a failing test, and a patch, a model or
29
+ researcher can inspect how the program behaved before and after the fix.
30
 
31
+ > **Derived dataset.** Every record is produced from an instance of
32
+ > [`nebius/SWE-rebench-V2`](https://huggingface.co/datasets/nebius/SWE-rebench-V2).
33
+ > See [License](#license) for licensing details.
34
 
35
+ ## What is included
 
 
 
 
 
36
 
37
+ Each SWE-rebench V2 instance contains a bug-fixing patch and a set of tests. This
38
+ dataset traces those tests in two ways.
39
 
40
+ For tests that directly verify the fix, the dataset captures the story of the bug:
41
+ the test fails before the patch, the patch is applied, and the same test passes
42
+ afterward. These rows have `affected=True`. Their `text` field contains the test
43
+ source, the pre-patch trace, the patch itself, and the post-patch trace.
44
 
45
+ For the rest of the repository's test suite, the dataset captures normal
46
+ regression behavior at the fixed revision. These rows have `affected=False`.
47
+ Their `text` field contains the test source followed by a single execution trace.
48
 
49
+ Each row corresponds to one `(instance_id, test_id)` pair. Rows for instances
50
+ that failed before any trace could be captured are excluded.
 
 
 
 
51
 
52
+ ## How to read a row
 
53
 
54
+ The central field is `text`. It is designed to be readable as plain text: first
55
+ the test, then the trace material associated with that test.
56
 
57
+ For a regression-suite row (`affected=False`), the format is:
 
58
 
59
+ ```text
60
  <test source>
61
 
62
  # --- trace ---
63
  <line-by-line execution trace>
64
  ```
65
 
66
+ For a fix-verifying row (`affected=True`), the format is:
 
67
 
68
+ ```text
69
  <test source>
70
 
71
  # --- pre-patch trace ---
72
  <line-by-line execution trace, before the fix>
73
 
74
  # --- patch ---
75
+ <the fix patch, in git diff form>
76
 
77
  # --- post-patch trace ---
78
  <line-by-line execution trace, after the fix>
79
  ```
80
 
81
+ Within a trace, comments on the right-hand side or on standalone lines describe
82
+ runtime state. For example, the trace records function entry, argument values,
83
+ branch outcomes, assignments, return values, and exceptions.
84
 
85
+ | Trace annotation | Meaning |
86
+ | ---------------------------------------- | ----------------------------------------------------------------- |
87
+ | `# === file::function (line N) ===` | Execution entered this function frame. |
88
+ | `# ENTER: arg=value, ...` | Function argument values at call time. |
89
+ | `# branch=if:True` / `# branch=if:False` | Which branch a conditional took. |
90
+ | `name = expr # name=value` | Value bound by an assignment, recorded as a right-margin comment. |
91
+ | `# RETURN from function: value` | Function return value. |
92
+ | `# EXCEPTION in function: ...` | Exception raised in the frame. |
93
 
94
+ ## Example: regression behavior
95
 
96
+ A regression-suite trace shows how a passing test executes at the fixed revision.
97
+ Consider this simple source file:
98
 
99
  ```python
100
  def clamp(value, low, high):
 
105
  return value
106
  ```
107
 
108
+ A test that exercises the in-range case appears together with its execution
109
+ trace:
110
 
111
+ ```text
112
  def test_clamp_within_range():
113
  assert clamp(5, 0, 10) == 5
114
 
 
126
  # RETURN from clamp: 5
127
  ```
128
 
129
+ The trace shows that `clamp` was called with `value=5`, that neither conditional
130
+ branch was taken, and that the function returned `5`.
131
 
132
+ ## Example: bug and fix behavior
 
 
133
 
134
+ A fix-verifying trace shows the same test before and after the patch. In the
135
+ example below, the buggy implementation returns `low` instead of `high` when the
136
+ input is above the allowed range. The pre-patch trace exposes the failing
137
+ behavior, the patch corrects the implementation, and the post-patch trace shows
138
+ the corrected return value.
139
+
140
+ ```text
141
  def test_clamp_above_range():
142
  assert clamp(99, 0, 10) == 10
143
 
 
179
  # RETURN from clamp: 10
180
  ```
181
 
182
+ ## Dataset fields
183
 
184
+ Trace shards are stored under `data/`.
 
 
 
185
 
186
+ | Column | Type | Description |
187
+ | ------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
188
+ | `instance_id` | string | SWE-rebench V2 row identifier. |
189
+ | `test_id` | string | Pytest node identifier. |
190
+ | `affected` | bool | Whether the test is fix-verifying. `True` means the test fails before the patch and passes after it. `False` means the test is part of the broader regression suite and is traced once at the fixed revision. |
191
+ | `text` | string | Test source and trace material in plain text. |
192
+
193
+ ## Loading per-instance licenses
194
+
195
+ The companion file `metadata/licenses.parquet` maps each `instance_id` to the
196
+ license of the corresponding source repository. It is stored separately so the
197
+ multi-GB trace shards do not repeat a per-instance license string on every row.
198
+
199
+ Join this file on `instance_id` when you need license metadata attached to trace
200
+ rows.
201
+
202
+ ### Using `datasets`
203
 
204
  ```python
205
  from datasets import load_dataset
 
213
  traces = traces.map(lambda row: {"license": license_by_instance[row["instance_id"]]})
214
  ```
215
 
216
+ ### Using pandas
217
 
218
  ```python
219
  import pandas as pd
220
 
221
  base = "hf://datasets/marin-community/swe-rebench-v2-CodeWorldModeling"
222
+
223
  traces = pd.read_parquet(f"{base}/data")
224
  licenses = pd.read_parquet(f"{base}/metadata/licenses.parquet")
225
  traces = traces.merge(licenses, on="instance_id", how="left")
 
227
 
228
  ## Provenance
229
 
230
+ The traces are derived from [`nebius/SWE-rebench-V2`](https://huggingface.co/datasets/nebius/SWE-rebench-V2).
231
+ They were generated with
232
+ [`experiments/swe_rebench_trace/contree_pipeline.py`](https://github.com/marin-community/marin/blob/main/experiments/swe_rebench_trace/contree_pipeline.py)
233
+ in [`marin-community/marin`](https://github.com/marin-community/marin), by
234
+ running tests under a tracer inside Nebius ConTree sandboxes.
235
 
236
  ## License
237
 
 
242
  > particular instance is based. To facilitate this, the license of each
243
  > repository at the time of the commit is provided for every instance.
244
 
245
+ Per-instance source-repository licenses are provided in
246
+ `metadata/licenses.parquet` and can be joined on `instance_id`.
 
 
247
 
248
  ## Citation
249
 
250
+ Please cite both this dataset and the source dataset from which it is derived.
251
 
252
+ ### This dataset
253
 
254
  ```bibtex
255
  @misc{marincommunity2026swerebenchcodeworldmodeling,
256
+ title = {SWE-rebench V2 CodeWorldModeling Traces},
257
+ author = {Marin Community},
258
+ year = {2026},
259
+ howpublished = {\url{https://huggingface.co/datasets/marin-community/swe-rebench-v2-CodeWorldModeling}},
260
  }
261
  ```
262
 
263
+ ### Source dataset
264
 
265
  ```bibtex
266
  @misc{badertdinov2026swerebenchv2languageagnosticswe,
267
+ title = {SWE-rebench V2: Language-Agnostic SWE Task Collection at Scale},
268
+ author = {Ibragim Badertdinov and Maksim Nekrashevich and Anton Shevtsov and Alexander Golubev},
269
+ year = {2026},
270
+ eprint = {2602.23866},
271
+ archivePrefix = {arXiv},
272
+ primaryClass = {cs.SE},
273
+ url = {https://arxiv.org/abs/2602.23866},
274
  }
275
+ ```