Portable result export: to_openeval()/from_openeval() for EvalInstance/EvalOutput?

Aperta
#776 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
python
Ambito
tooling

Direzione di ricerca

Inizia leggendo benchmarks/utils/models.py e CONTRIBUTING.md, quindi esamina la specifica EvalPort collegata e i percorsi esistenti per l’output dei benchmark. Conferma con i maintainer se è desiderata un’utilità interna al repository o un adapter separato prima di definire conversioni in entrambe le direzioni. Il lavoro è completo quando sono stati concordati l’ambito e la mappatura dei formati, seguiti dalla validazione e dai test per l’interfaccia accettata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

Would to_openeval() / from_openeval() helpers for this repo's EvalInstance / EvalOutput models be useful, so runs from any of the ~20 benchmark harnesses here (SWE-Bench, GAIA, Harbor/TerminalBench, Commit0, etc.) could be exported into a portable, framework-agnostic result format?

Context

I looked through benchmarks/utils/models.py and CONTRIBUTING.md — this repo already has a clean, shared shape across every benchmark folder:

  • EvalInstance(id: str, data: dict[str, Any]) — the per-task input, produced by every benchmark's prepare_instances().
  • EvalOutput(instance_id, attempt, test_result: dict[str, Any], instruction, metadata: EvalMetadata, history: list[Event], metrics: Metrics, error, instance, runtime_runs) — the per-task result, produced by evaluate_instance() and written out by every eval_infer.py.
  • EvalMetadata(llm, dataset, dataset_split, max_iterations, eval_output_dir, critic, workspace_type, ...) — the run-level config.

That's a real, shared, installable schema (not per-benchmark ad hoc JSON), which is exactly the situation EvalPort (spec: https://github.com/adhabnr-ux/evalport/blob/main/spec/SPEC.md) is meant for: a small JSON-Schema-defined format for portable eval test cases and result sets, with a Python SDK (evalport-sdk on PyPI, openeval.validate.validate_suite() / validate_result_set()) and 35+ community adapter packages (example: autogen-openeval-adapter).

What I'm proposing

Not a change to the harness itself — just two small, optional conversion functions (could live in benchmarks/utils/ or as a separate benchmarks-openeval-adapter package, whichever this repo prefers):

# sketch — field names taken from benchmarks/utils/models.py
from benchmarks.utils.models import EvalInstance, EvalOutput

def to_openeval_case(instance: EvalInstance, suite_id: str) -> dict:
    """EvalInstance -> an EvalPort testcase.json-shaped record."""
    return {
        "case_id": instance.id,
        "suite_id": suite_id,
        "input": instance.data,
    }

def to_openeval_result(output: EvalOutput, suite_id: str) -> dict:
    """EvalOutput -> an EvalPort resultset.json-shaped record."""
    return {
        "suite_id": suite_id,
        "case_id": output.instance_id,
        "attempt": output.attempt,
        "raw_result": output.test_result,
        "error": output.error,
        "cost_usd": getattr(output.metrics, "accumulated_cost", None)
        if output.metrics
        else None,
    }

with the reverse direction (from_openeval_case → EvalInstance) letting an external OpenEval-format suite be dropped straight into prepare_instances().

Why this might be worth it for this repo specifically: with 20+ benchmark integrations already normalized to EvalInstance/EvalOutput, this would be the cheapest path to (a) comparing results across benchmarks and external tools in one place, and (b) letting other eval tooling consume benchmarks/ output without hand-writing a parser per benchmark.

Happy to put together a draft PR (either inside this repo under benchmarks/utils/, or as a standalone adapter package under evalport's adapters/) if this is a direction the maintainers are interested in — or to hear that it isn't a good fit given where the harness is headed.

Lingua principale
Python
Stelle
134
Fork
97
Merge medio
8g 23h
PR unite (30g)
2

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenHands/benchmarks

Tutte le issue di OpenHands/benchmarks

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.