This directory adapts the MultiFixer repair loop to the SEC-bench C++200 cve split.
The implementation intentionally skips the original paper's first two phases for this supplemental experiment:
- no BugAnalyzer phase;
- no context-construction phase beyond local oracle-location context;
- oracle locations are extracted from developer patches, but only file/range metadata is used;
- developer added lines are not placed in prompts.
The SEC-bench version makes the scheduling contribution explicit.
dataset.pyextracts oracle hunk locations from SEC-bench developer patches.docker_backend.pyreads vulnerable source files from SEC-bench Docker images and runs the official evaluator.relations.pybuilds a hunk relation graph using lightweight C/C++ static analysis:prerequisitesymmetric_fixingchange_propagationshared_stateco_locatedfailure_relevanceconflict_risk
- An optional LLM pass validates or adds semantic relation edges.
scheduler.pychooses the next hunk with a rule score over the relation graph; the LLM is only used as a top-k tie breaker.- Multiple Proposers generate hunk replacements at different temperatures.
- Candidate selection first computes agreement/similarity/pattern metrics, then asks the Coordinator to choose using those metrics.
- After all hunks are repaired, replacements are synthesized into one git patch and refined against SEC-bench evaluator feedback.
The 65 multi-hunk SEC-bench CVEs are stored locally in:
secbench_multifixer_data/secbench_cve200_multihunk65.csv
secbench_multifixer_data/secbench_cve200_multihunk65.jsonl
Summary:
65 / 200 standard patches are multi-hunk.
31 / 65 multi-hunk patches are also multi-file.
ssh 5880 source ~/miniconda3/etc/profile.d/conda.sh conda activate secb cd /path/to/Multi-Hunk-APR
List the 65 instances:
python -m secbench_multifixer.cli list
Analyze hunk relations only:
python -m secbench_multifixer.cli analyze \ --instance-id njs.cve-2022-32414 \ --output-dir result/secbench_multifixer_analyze
Run repair for one instance:
python -m secbench_multifixer.cli repair \ --instance-id njs.cve-2022-32414 \ --output-dir result/secbench_multifixer \ --coordinator-model qwen3.7-max \ --proposer-model qwen3.7-max \ --refine-model qwen3.7-max \ --proposer-num 3 \ --max-steps 20 \ --refine-iterations 20 \ --python python
Use --no-relation-llm --no-scheduler-llm to run a static-only scheduler ablation.