SpIDER-Bench / README.md
cbock90's picture
Upload folder using huggingface_hub (#1)
fab910b
|
Raw
History Blame Contribute Delete
8.88 kB
metadata
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).

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

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:

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:

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

@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.