How quanxiny/tc-sosp-code-clone-explanation works
TC-SOSP is a research codebase for evaluating task-conditioned semantic subgraph-pair explanations of code-clone predictions. The main workflow is a researcher invoking the CLI with a resolved experiment configuration; experiment runners load graph pairs and a predictor, generate explanations, and record faithfulness, stability, or transformation-truth measurements. Separate builders create alpha-renaming/dead-code truth and transformed negative-pair truth, while aggregation modules summarize study records. The graph follows documented capabilities and SOURCE INDEX references; unsampled implementation details and artifact wiring are not inferred.
Main entry points: explanation_runner.py Pair explainers · negative_pair_truth_runner.py Negative-pair evaluator · truth_explanation_runner.py Truth evaluator · contrastive_runner.py Graph-pair runner
Components 16
Experiment entry
- Research CLI
research_cli.py - Config resolver
scripts/configlib.py
Explanation evaluation
- Graph-pair runner
scripts/contrastive_runner.py - Pair explainers
scripts/explanation_runner.py - GCJ reproduction
patches/codegraph4ccdetector-overlay/reproduce_gcj.py - Batched GCJ runner
patches/codegraph4ccdetector-overlay/reproduce_gcj_batched.py
Truth construction
- Truth evaluator
scripts/truth_explanation_runner.py - Negative-pair evaluator
scripts/negative_pair_truth_runner.py - Transformation truth builder
scripts/build_transformation_explanation_truth.py - Negative truth builder
scripts/build_frozen_negative_pair_transformations.py - Transformation bundles
external_data/explanation_truth/codenet_transformations/sources/g000_01710738b6__alpha.java
Study analysis
- Optimal-study analysis
scripts/aggregate_optimal_subgraph_study.py - Seed analysis
scripts/aggregate_stochastic_explainer_seeds.py - Truth statistics
scripts/aggregate_explanation_truth_statistics.py - Study records
Other components
- Researcher
Connections 35
- Researcher → Research CLI: invokes
README.md - Research CLI → Config resolver: resolves
research_cli.py - Research CLI → Graph-pair runner: dispatches
research_cli.py - Research CLI → Pair explainers: dispatches
research_cli.py - Research CLI → Truth evaluator: dispatches
research_cli.py - Research CLI → Negative-pair evaluator: dispatches
research_cli.py - Graph-pair runner → Config resolver: uses
scripts/contrastive_runner.py - Graph-pair runner → GCJ reproduction: loads predictor
scripts/contrastive_runner.py - Graph-pair runner → Batched GCJ runner: loads predictor
scripts/contrastive_runner.py - Pair explainers → Config resolver: uses
scripts/explanation_runner.py - Pair explainers → Graph-pair runner: reuses graph model
scripts/explanation_runner.py - Pair explainers → GCJ reproduction: loads predictor
scripts/explanation_runner.py - Pair explainers → Batched GCJ runner: loads predictor
scripts/explanation_runner.py - Truth evaluator → Config resolver: uses
scripts/truth_explanation_runner.py - Truth evaluator → Graph-pair runner: reuses graph model
scripts/truth_explanation_runner.py - Truth evaluator → Pair explainers: calls explainers
scripts/truth_explanation_runner.py - Truth evaluator → Batched GCJ runner: loads predictor
scripts/truth_explanation_runner.py - Negative-pair evaluator → Config resolver: uses
scripts/negative_pair_truth_runner.py - Negative-pair evaluator → Graph-pair runner: reuses graph model
scripts/negative_pair_truth_runner.py - Negative-pair evaluator → Pair explainers: calls explainers
scripts/negative_pair_truth_runner.py - Negative-pair evaluator → Truth evaluator: reuses truth methods
scripts/negative_pair_truth_runner.py - Negative-pair evaluator → Batched GCJ runner: loads predictor
scripts/negative_pair_truth_runner.py - Transformation truth builder → Transformation bundles: creates bundle
- Negative truth builder → Transformation truth builder: reuses transformations
scripts/build_frozen_negative_pair_transformations.py - Truth evaluator → Transformation bundles: evaluates against
- Negative-pair evaluator → Transformation bundles: evaluates against
- Pair explainers → Study records: writes records
- Truth evaluator → Study records: writes records
- Negative-pair evaluator → Study records: writes records
- Optimal-study analysis → Pair explainers: reuses metrics
scripts/aggregate_optimal_subgraph_study.py - Optimal-study analysis → Study records: summarizes
- Seed analysis → Pair explainers: reuses metrics
scripts/aggregate_stochastic_explainer_seeds.py - Seed analysis → Truth statistics: uses statistics
scripts/aggregate_stochastic_explainer_seeds.py - Seed analysis → Study records: summarizes
- Truth statistics → Study records: summarizes
README.md