BUG: Overlapping scorer-evaluation globs duplicate CSVs and change accuracy
Los mantenedores suelen responder en 2 días
@its-amann ya está trabajando en esto.
Desde el 21/10/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Empieza en pyrit/score/scorer_evaluation/scorer_evaluator.py, en run_evaluation_async(), y sigue cómo los patrones de human_labeled_datasets_files seleccionan archivos CSV. Añade cobertura de regresión para patrones que se solapan y se repiten, conservando los archivos distintos que tienen las mismas cadenas de versión; verifica que ambas configuraciones evalúen dos respuestas con una precisión de 0.5.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 4.6k
- Forks
- 962
- Merge medio
- 2 d 13 h
- PR fusionados (30 d)
- 417
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/PyRIT
-
BUG: AzureBlobStorageTarget returns a URL with // when the container URL ends with a slashPosiblemente ocupada @ShivamSharma43 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
-
BUG: OpenAIImageTarget uploads edited images under a generated local path instead of their file namePosiblemente ocupada @ShivamSharma43 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 2 días
-
BUG: PathTraversalOutputScorer misses canonical Windows target windows/win.ini and IIS web.configPosiblemente ocupada @Kaap10 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
-
BUG: XXEOutputScorer misses direct external DTD references and Java netdoc: / gopher: URI schemesPosiblemente ocupada @Kaap10 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
BUG: StaticPromptInjectionScorer misses modern LLM chat template tokens (Meta Llama 3+, Google Gemma, Microsoft Phi-3/4)Posiblemente ocupada @Kaap10 la tomó hoy. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 2 días
Todos los issues de microsoft/PyRIT
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
AstrBotDevs/AstrBot#10720 ·
Los mantenedores suelen responder en 1 día
-
fix(xiaomi): curated picker list still offers six ids that return 400 (plan-limited vs retired)Abiertocause/upstream comp/cli P2 provider/other tool/file type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NousResearch/hermes-agent#143900 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
WLAN-Pi/wlanpi-profiler#341 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día