Add comment-efficiency metrics to perturbation benchmark#84
Open
jingxuangu wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds budget-aware comment-efficiency metrics to the perturbation benchmark scoring pipeline.
The current benchmark primarily reports seeded-error recall. This is useful, but it does not distinguish concise reviewers from noisy reviewers that find the same number of injected errors by producing many more comments.
This PR preserves the existing detection semantics:
why_wrongIt records the first comment index that detects each perturbation and adds:
n_detected_at_1,n_detected_at_3,n_detected_at_5,n_detected_at_10recall_at_1,recall_at_3,recall_at_5,recall_at_10comments_per_detected_errordetected_per_commentThese are comment-efficiency metrics, not true precision metrics, because unmatched comments may still identify real non-injected issues.
Testing
python -m pytest tests/test_perturbation_score.py -qpython -m py_compile benchmarks/perturbation/score.py benchmarks/perturbation/models.py benchmarks/perturbation/generate_report.py src/reviewer/cli.py tests/test_perturbation_score.pyBoth passed locally.
Notes
I attempted a full local
score,reportsmoke run, but the checked-in perturbation configs appear to use an older pipeline schema and the repo does not include prepared/reviewed artifacts for the current unified runner. This appears unrelated to the scoring metric changes.