BUG: Overlapping scorer-evaluation globs duplicate CSVs and change accuracy
Maintainer thường phản hồi trong vòng 2 ngày
@its-amann đang làm issue này rồi.
Từ ngày 21/10/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Bắt đầu tại pyrit/score/scorer_evaluation/scorer_evaluator.py, ở run_evaluation_async(), và theo dõi cách các mẫu human_labeled_datasets_files chọn các tệp CSV. Bổ sung kiểm thử hồi quy cho các mẫu chồng lấp và lặp lại, đồng thời giữ nguyên các tệp riêng biệt có chuỗi phiên bản giống nhau; xác minh cả hai cấu hình đều đánh giá hai phản hồi với độ chính xác 0.5.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
Overlapping human_labeled_datasets_files patterns load the same CSV more than once in run_evaluation_async(), changing sample weights and reported accuracy. For the same two files and deterministic scorer, adding an already-matched filename changes accuracy from 0.5 to 0.6667.
Steps/Code to Reproduce
No model API or external dataset needed. Only the dataset root is redirected; loading, scoring, and metrics use the real implementations.
import asyncio
from pathlib import Path
from tempfile import TemporaryDirectory
from unittest.mock import patch
from pyrit.memory import CentralMemory, SQLiteMemory
from pyrit.score import RegistryUpdateBehavior, SubStringScorer
from pyrit.score.scorer_evaluation import scorer_evaluator as se
async def run_async(root: Path) -> None:
try:
with patch.object(se, "SCORER_EVALS_PATH", root):
for patterns in (["*.csv"], ["*.csv", "a.csv"]):
evaluator = se.ObjectiveScorerEvaluator(SubStringScorer(substring="marker"))
result = await evaluator.run_evaluation_async(
dataset_files=se.ScorerEvalDatasetFiles(
human_labeled_datasets_files=patterns, result_file="unused.jsonl"
),
num_scorer_trials=1,
update_registry_behavior=RegistryUpdateBehavior.NEVER_UPDATE,
)
print(patterns, result.num_responses, round(float(result.accuracy), 4))
finally:
await CentralMemory.get_memory_instance().dispose_engine_async()
with TemporaryDirectory() as directory:
root = Path(directory)
for name, label in [("a.csv", 1), ("b.csv", 0)]:
(root / name).write_text(
"# dataset_version=1.0\nassistant_response,objective,human_score\n"
f"marker,Synthetic objective,{label}\n",
encoding="utf-8",
)
CentralMemory.set_memory_instance(SQLiteMemory(db_path=":memory:", silent=True))
asyncio.run(run_async(root))
Expected Results
Both configurations evaluate the same two responses, with accuracy 0.5.
Actual Results
['*.csv'] 2 0.5
['*.csv', 'a.csv'] 3 0.6667
Would deduplicating matched paths before loading be appropriate? I'd keep distinct files with equal version strings intact and add regression tests for overlapping and repeated patterns. I'd like to take this if you mark it ready for contribution; I'll wait for triage before preparing a PR.
Versions
macOS ARM64, Python 3.12.13, PyRIT 1.2.0.dev0 (ac196e57, main), numpy 2.4.6, pandas 3.0.6, scipy 1.17.1. Dependencies installed with uv sync --locked --no-dev.
AI-assisted investigation; the reproduction above was executed locally against unmodified source.
- Ngôn ngữ chính
- Python
- Star
- 4.6k
- Fork
- 962
- Merge trung bình
- 2 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 398
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/PyRIT
-
BUG: MarkdownInjectionScorer misses shortcut-reference images with path-based exfiltration, and raw HTML <img>Có thể đã có người làm @aatif101 đã nhận 2 ngày trước. Đang mởBug: triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
microsoft/PyRIT#3343 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
BUG: OpenAITTSTarget accepts any speed, so an out-of-range value is only sent to the API on every requestCó thể đã có người làm @ShivamSharma43 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 2 ngày
-
BUG: KeywordSelectionStrategy accepts a negative context, so SelectiveTextConverter duplicates or truncates the promptCó thể đã có người làm @ShivamSharma43 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 2 ngày
-
BUG: PackageHallucinationScorer flags Rust std paths, type names and hyphenated crates as hallucinatedCó thể đã có người làm @nniiovoo đã nhận hôm nay. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 2 ngày
-
BUG: LetterBijectionConverter accepts a negative fixed_size and then leaves the prompt unchangedCó thể đã có người làm @ShivamSharma43 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của microsoft/PyRIT
Issue tương tự
-
comp/tools P2 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NousResearch/hermes-agent#142908 · 1 bình luận ·
-
[oblt-aw][autodoc] Fix malformed headings in new Buildkite docs pagesCó thể đã có người làm @github-actions đã nhận hôm nay. Đang mởdocumentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: fileUploadMatrix.test.ts URL case does a real DNS lookup and fails offlineCó thể đã có người làm @r2jaff đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ComposioHQ/composio#5054 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
pytorch/tensordict#3286 ·
Maintainer thường phản hồi trong vòng 1 ngày