Datasets:
File size: 8,884 Bytes
7e108d6 9282707 7e108d6 9282707 9243302 9282707 9243302 9282707 9243302 9282707 9243302 9282707 9243302 9282707 | 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 | ---
license: other
license_name: other
license_link: LICENSE
task_categories:
- feature-extraction
tags:
- code
- software-engineering
- issue-localization
- code-graph
- swe-bench
pretty_name: SpIDER-Bench
configs:
- config_name: instances
default: true
data_files:
- split: train
path: data/instances/*.parquet
- config_name: nodes
data_files:
- split: swe_bench_verified
path: data/nodes/SWE-bench_Verified/*.parquet
- split: swe_polybench_python
path: data/nodes/SWE-PolyBench/python/*.parquet
- split: swe_polybench_java
path: data/nodes/SWE-PolyBench/java/*.parquet
- split: swe_polybench_javascript
path: data/nodes/SWE-PolyBench/javascript/*.parquet
- split: swe_polybench_typescript
path: data/nodes/SWE-PolyBench/typescript/*.parquet
- split: multi_swe_bench_java
path: data/nodes/Multi-SWE-bench/java/*.parquet
- split: multi_swe_bench_javascript
path: data/nodes/Multi-SWE-bench/javascript/*.parquet
- split: multi_swe_bench_typescript
path: data/nodes/Multi-SWE-bench/typescript/*.parquet
- config_name: edges
data_files:
- split: swe_bench_verified
path: data/edges/SWE-bench_Verified/*.parquet
- split: swe_polybench_python
path: data/edges/SWE-PolyBench/python/*.parquet
- split: swe_polybench_java
path: data/edges/SWE-PolyBench/java/*.parquet
- split: swe_polybench_javascript
path: data/edges/SWE-PolyBench/javascript/*.parquet
- split: swe_polybench_typescript
path: data/edges/SWE-PolyBench/typescript/*.parquet
- split: multi_swe_bench_java
path: data/edges/Multi-SWE-bench/java/*.parquet
- split: multi_swe_bench_javascript
path: data/edges/Multi-SWE-bench/javascript/*.parquet
- split: multi_swe_bench_typescript
path: data/edges/Multi-SWE-bench/typescript/*.parquet
---
# SpIDER-Bench
Repository dependency graphs for software issue localization — the graph data behind
**SpIDER: Spatially Informed Dense Embedding Retrieval for Software Issue Localization**
([arXiv:2512.16956](https://arxiv.org/abs/2512.16956)).
Each benchmark instance gets one directed multigraph of its repository at the commit the
issue was filed against. Nodes are directories, files, classes and functions carrying
their source; edges are `contains` / `imports` / `inherits` / `invokes` relations between
them. SpIDER uses these graphs to expand a dense-retrieval ranking along the code's own
structure.
**3,297 graphs · 44,877,941 nodes · 671,599,117 edges**
across three benchmarks and four languages.
## Configurations
Three configs: **`instances`** (default, one row per graph), **`nodes`** and **`edges`**.
`nodes` and `edges` each carry the same eight splits, one per benchmark+language:
| split | benchmark | language | instances | nodes | edges |
|---|---|---|---:|---:|---:|
| `swe_bench_verified` | SWE-bench_Verified | python | 500 | 12,999,151 | 99,582,491 |
| `swe_polybench_python` | SWE-PolyBench | python | 199 | 5,170,664 | 138,146,408 |
| `swe_polybench_java` | SWE-PolyBench | java | 165 | 5,006,348 | 161,950,563 |
| `swe_polybench_javascript` | SWE-PolyBench | javascript | 1,017 | 4,294,419 | 13,443,888 |
| `swe_polybench_typescript` | SWE-PolyBench | typescript | 708 | 12,619,220 | 230,184,168 |
| `multi_swe_bench_java` | Multi-SWE-bench | java | 128 | 1,484,356 | 19,295,528 |
| `multi_swe_bench_javascript` | Multi-SWE-bench | javascript | 356 | 2,326,250 | 6,922,775 |
| `multi_swe_bench_typescript` | Multi-SWE-bench | typescript | 224 | 977,533 | 2,073,296 |
`nodes` and `edges` are separate configs rather than two splits of one, because
`datasets` casts every split in a config to a single schema and node rows and edge rows
have different columns.
## Loading
```python
from datasets import load_dataset
# the summary table: one row per instance
inst = load_dataset("AmazonScience/SpIDER-Bench", "instances", split="train")
# the graph tables for one benchmark+language
nodes = load_dataset("AmazonScience/SpIDER-Bench", "nodes", split="swe_polybench_python")
edges = load_dataset("AmazonScience/SpIDER-Bench", "edges", split="swe_polybench_python")
```
Graphs are stored relationally rather than one-row-per-graph because a single instance
reaches hundreds of MB — too large for a parquet row or the viewer.
## Rebuilding the graphs
The reference implementation consumes `networkx.MultiDiGraph` pickles. The SpIDER code
release ships `scripts/materialize_graphs.py`, which rebuilds them and downloads only the
shards it needs:
```bash
python scripts/materialize_graphs.py --out data/SpIDER-Bench
python scripts/materialize_graphs.py --out data/SpIDER-Bench --subset SWE-PolyBench/python
```
To rebuild one graph directly:
```python
import json, networkx as nx, pyarrow.parquet as pq
NODE_COLS = ["type", "code", "start_line", "end_line", "package", "imports",
"method_name", "class_name", "parent_type", "is_prototype_method"]
EDGE_COLS = ["type", "alias", "module"]
def rebuild(node_rows, edge_rows):
g = nx.MultiDiGraph()
for r in sorted(node_rows, key=lambda r: r["node_ord"]):
g.add_node(r["node_id"], **attrs(r, NODE_COLS))
for r in sorted(edge_rows, key=lambda r: r["edge_ord"]):
g.add_edge(r["src"], r["dst"], key=r["edge_key"], **attrs(r, EDGE_COLS))
return g
def attrs(row, cols):
if not row["attr_order"]:
return {}
extra = json.loads(row["extra_attrs"]) if row["extra_attrs"] else {}
return {k: extra[k] if k in extra else row[k] for k in row["attr_order"].split(",")}
```
## Schema
### `instances`
| column | type | meaning |
|---|---|---|
| `instance_id` | string | benchmark instance id, globally unique across configs |
| `benchmark` | string | `SWE-bench_Verified`, `SWE-PolyBench`, `Multi-SWE-bench` |
| `language` | string | `python`, `java`, `javascript`, `typescript` |
| `repo` | string | `owner/name` |
| `num_nodes`, `num_edges` | int32 | graph size |
| `n_nodes_<type>`, `n_edges_<type>` | int32 | per-type counts |
| `nodes_shard`, `edges_shard` | string | parquet files holding this instance |
| `graph_attrs` | string | graph-level attributes as JSON, null when none |
### `nodes`
| column | type | meaning |
|---|---|---|
| `instance_id` | string | joins to `instances` |
| `node_ord` | int32 | insertion order — **rebuild in this order** |
| `node_id` | string | `path/to/file.py`, `…:Class`, `…:Class.method` |
| `type` | string | `annotation`, `class`, `directory`, `enum`, `file`, `function`, `interface`, `method` |
| `code` | string | source text of the node |
| `start_line`, `end_line` | int32 | 1-based line span in the file |
| `package` | string | java only |
| `imports` | list<struct<type, module, alias>> | javascript / typescript only |
| `method_name`, `class_name`, `parent_type` | string | typescript only |
| `is_prototype_method` | bool | typescript only |
| `attr_order` | string | comma-joined original attribute keys, in order |
| `extra_attrs` | string | JSON for anything outside the typed columns, null when none |
### `edges`
| column | type | meaning |
|---|---|---|
| `instance_id` | string | joins to `instances` |
| `edge_ord` | int32 | insertion order — **rebuild in this order** |
| `src`, `dst` | string | node ids |
| `edge_key` | int32 | parallel-edge key (`MultiDiGraph`) |
| `type` | string | `contains`, `imports`, `inherits`, `invokes` |
| `alias` | string | import alias, where one applies |
| `module` | string | imported module, javascript / typescript |
| `attr_order`, `extra_attrs` | string | as above |
### Why `attr_order` and `*_ord`
Attribute sets differ by language and, within a language, between node kinds — a java node
carries `package`, a directory node carries only `type`. Parquet null cannot distinguish
*attribute absent* from *attribute present with value `None`*, and both occur here. So
`attr_order` records exactly which keys the original dict held and in what order, and it is
what a faithful rebuild iterates. `node_ord` / `edge_ord` preserve networkx insertion order,
which SpIDER's BFS tie-breaks depend on.
Round-tripping every graph in this release through
`networkx.utils.graphs_equal` against the original pickles passes for all
3,297, including node order, edge order and per-node attribute key order.
## Citation
```bibtex
@article{chaudhari2024spider,
title={SpIDER: Spatially Informed Dense Embedding Retrieval for Software Issue Localization},
author={Chaudhari, Shravan and Jacob, Rahul Thomas and Goswami, Mononito and Cao, Jiajun and Rashid, Shihab and Bock, Christian},
journal={arXiv preprint arXiv:2512.16956},
year={2024}
}
```
## License
See `LICENSE` and `notice.md`. This repository contains code segments under multiple
licenses (MIT, Apache 2.0, BSD, GPL and others) and is adapted from the listed open-source
projects; your use must comply with the relevant segments' licenses.
|