Skip to content

qingpingmo/GREPO

Repository files navigation

Fork me on GitHub


Markdownify
GREPO

GREPO :A BENCHMARK FOR GRAPH NEURAL NETWORKS ON REPOSITORY-LEVEL BUG LOCALIZATION

PKU MuLab License Status

Dataset on ModelScope GREPO Leaderboard GREPO arXiv Paper

ResourcesEnvironmentData SetupQuickstart0-shot SettingsIncluded Baseline CodeLicense

pipeline

This repository is the official code implementation for the paper "GREPO: A Benchmark for Graph Neural Networks on Repository-Level Bug Localization".

Resources

It includes:

  • GNN_Joint_Train/joint_train_arrange.py: GNN reranker (function/file localization)
  • GNN_Joint_Train/bugloc_*.py: modular implementation behind the reranker (data/query/subgraph/trainer)
  • GNN_Joint_Train/train_get_issue_conditioned_temporal_retriever.py: issue-conditioned temporal retriever (GETv2)
  • third_party/DyGLib and third_party/CRAFT: vendored temporal baselines (no extra clone required)
  • dataset_build/: optional reference pipeline for building GREPO-style dataset artifacts

It intentionally excludes paper draft artifacts and run dumps.

Repository Layout

  • GNN_Joint_Train/: training/evaluation entrypoints
  • third_party/: vendored baseline implementations
  • dataset_build/: optional dataset build pipeline (crawler/graph build/feature construction)
  • tasks/: small utilities used by the dataset pipeline (e.g., patch parsing)
  • assets/: images used in docs
  • tools/: utility scripts
  • configs/repos/: canonical repo splits (86-train, eval9, scaling subsets)
  • configs/paths.example.env: local data path template
  • examples/commands/: runnable command templates
  • scripts/data/: dataset download/extract/bootstrap entrypoints
  • release/: release notes, file index, reproducibility checklist

See release/FILE_INDEX.md for a file-level map.

1) 📦 Environment

conda env create -f repognn_environment.yaml
conda activate repognn

2) 🎨 Data Setup

This repository does not bundle large GREPO data files.

Use one of the entrypoint scripts:

# Option A: from a remote URL
bash scripts/data/download_grepo_data.sh --url <DATASET_URL> --output_dir <DATA_DIR> --extract

# Option B: from a local zip/tar file
bash scripts/data/prepare_from_local_archive.sh --archive <LOCAL_DATA_ARCHIVE> --output_dir <DATA_DIR>

Then create your local path file:

cp configs/paths.example.env configs/paths.env
# edit configs/paths.env with your machine paths
bash scripts/data/verify_data_layout.sh

Details: release/DATASET.md.

Optional: Dataset Construction Pipeline

This branch includes a reference implementation of our dataset construction pipeline under dataset_build/ (crawler + graph build + feature/anchor construction).

See dataset_build/README.md for usage and notes.

3) 🚀 Quickstart

3.1 Train GETv2 + dump candidates

bash examples/commands/01_train_getv2_and_dump.sh

The script prints GETv2 run completed: <run_dir> on success. The dumped candidates are under:

export TEMP_CAND_DIR="<run_dir>/dumped_candidates"

3.2 Train core-changed reranker

bash examples/commands/02_train_reranker_corechange5.sh

3.3 Evaluate a trained checkpoint

bash examples/commands/03_eval_checkpoint.sh

3.4 Run scaling suite (10/20/40/77)

bash examples/commands/04_scaling_suite.sh

4) ⭐️ 0-shot Settings

Two commonly used settings:

  • reranker 0-shot: add --joint_exclude_test_repos_from_train in joint_train_arrange.py
  • strict end-to-end 0-shot: additionally add --exclude_eval_repos_from_train in GETv2 training/dump

Tip: examples/commands/01_train_getv2_and_dump.sh supports strict 0-shot via: GET_EXCLUDE_EVAL_REPOS_FROM_TRAIN=1 bash examples/commands/01_train_getv2_and_dump.sh

5) ⭐️ Included Baseline Code

Vendored temporal backbone code is included under third_party/:

  • DyGLib models: TGAT, DyRep, TGN-style memory model, GraphMixer, DyGFormer, etc.
  • CRAFT-side models: CRAFT, TGAT, CAWN, TCL, GraphMixer, DyGFormer, EdgeBank, etc.

📜 License

See LICENSE and third-party license files under third_party/.

About

This repository is the official code implementation for the paper "GREPO: A Benchmark for Graph Neural Networks on Repository-Level Bug Localization".

Resources

License

Stars

5 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors