--- 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: ``` # --- 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: ``` # --- pre-patch trace --- # --- patch --- # --- post-patch trace --- ``` 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}, } ```