Repository navigation
Mapping instances/results onto EvalPort's TestCase/ResultSet schema (portable interchange) #53
Replies: 2 comments
|
Thanks for the detailed proposal. We definitely welcome this integration and would be happy to review a PR. For input=instance.get("problem_statement", "")Please implement both conversion directions, Please add a short section introducing EvalPort at the end of The primary targets should be the schemas used by The current rebuild_cmd = "" # dynamic languages like python do not require re-build/re-compile
test_cmd = (
"cat > run_test.sh <<'CC_PROMPT'\n"
+ " ; ".join(instance.get("test_cmds", []))
+ "\nCC_PROMPT\n"
+ "bash run_test.sh > testlog.out 2>&1"
)
print_cmd = "cat testlog.out"
log_parser = r'''
from enum import Enum
def parse_log_pytest(log: str, test_spec: "TestSpec") -> dict[str, str]:
"""
Copied from SWE-bench/swebench/harness/constants/__init__.py.
"""
class TestStatus(Enum):
FAILED = "FAILED"
PASSED = "PASSED"
SKIPPED = "SKIPPED"
ERROR = "ERROR"
XFAIL = "XFAIL"
test_status_map = {}
for line in log.split("\n"):
if any(line.startswith(status.value) for status in TestStatus):
if line.startswith(TestStatus.FAILED.value):
line = line.replace(" - ", " ")
test_case = line.split()
if len(test_case) <= 1:
continue
test_status_map[test_case[1]] = test_case[0]
return test_status_map
def parser(log: str) -> dict[str, str]:
mapping = parse_log_pytest(log, None)
for test, status in mapping.items():
if "pass" in status.lower():
mapping[test] = "pass"
elif "skip" in status.lower():
mapping[test] = "skip"
else:
mapping[test] = "fail"
return mapping
'''Users should follow the newer MultiLang/Windows schema. Compatibility with the old Python dataset is optional, but you are welcome to include it using the approach above. Please include round-trip tests and validate the generated documents with EvalPort's actual schema validator. Also, if a |
|
Thanks for the detailed answer — locking in everything you specified:
I'll open the PR once this is built and tested against real instance/report data from both the MultiLang/Windows harness and, where feasible, the legacy Python path — thanks for giving me a concrete target instead of a vague "sounds good." — Sahi |
Uh oh!
There was an error while loading. Please reload this page.
Hi — I maintain EvalPort, an open interchange format (JSON Schema + Python/TS SDKs) for portable LLM eval datasets:
TestCase/Graderin,Result/ResultSet/GraderResultout. I went throughevaluation/evaluation.pyandevaluation/validation.pyonmain(not thepython-onlyNeurIPS branch — I noticed those two diverge on purpose, and the multi-language/Windows harness onmainis the one I'm mapping against) to work out a concrete, non-lossy mapping, rather than propose something generic.What the harness actually produces, read straight from the two files:
instance_id,docker_image,rebuild_cmds/test_cmds/print_cmds(lists, joined with;),test_patch,patch/pred_patch,log_parser(falls back to legacyparser),PASS_TO_PASS/FAIL_TO_PASS(lists of test names),created_at.evaluation.py's per-instancereport:{instance_id, resolved: bool, PASS_TO_PASS: {success: [...], failure: [...]}, FAIL_TO_PASS: {success: [...], failure: [...]}}.evaluation.py's aggregateresults.json:submitted/success/failure/error/incompletecounts plus the corresponding*_idslists.validation.py'sValidationResult: addspre_patch_status/post_patch_status(per-testpass/fail/skipmaps) alongside the samePASS_TO_PASS/FAIL_TO_PASS.Proposed mapping (verified against
schema/testcase.json,schema/grader.json,schema/resultset.jsonin EvalPort, not just the dataclasses):TestCase.id=instance_id.TestCase.metadata["swebench_live"]carriesdocker_image,rebuild_cmds,test_cmds,print_cmds,test_patch,log_parser,PASS_TO_PASS,FAIL_TO_PASS,created_atverbatim, so a consumer can round-trip back to somethingevaluation.pycan re-run. (inputwould carry the task/issue text — I didn't assert a field name for that since it's not touched by either file I read; happy to fill it in against the actual HF dataset schema if this is worth pursuing.)TestCase.graders= a single{"id": "swebench_live_harness", "type": "custom", "params": {"handler": "swe-bench-live:docker-harness"}}. It has to becustom— grading here means spinning updocker_image, applyingtest_patch, runningrebuild_cmds/test_cmds, and parsingprint_cmdsoutput withlog_parser, which is out-of-band execution, not something the in-processcodegrader (Python/JS sandbox pergrader.json) can represent honestly.Result.passed=report["resolved"].Result.grader_results= twoGraderResults,pass_to_pass(score =len(success)/len(PASS_TO_PASS),passed= no regressions) andfail_to_pass(score =len(success)/len(FAIL_TO_PASS),passed= full resolution) — this keeps the real regression/resolution distinction instead of collapsing to one boolean, andreasoncan carry the actual failing test names for debugging.ResultSet.summary={total: submitted, passed: success, failed: failure}fromresults.json;error/incomplete(whichsummaryhas no dedicated slot for) go toResultSet.metadata["swebench_live"]["aggregate"]verbatim.For precedent on the "wrap out-of-band execution as a
customgrader, preserve the tool's native shape verbatim under a namespacedmetadatakey, don't fabricate a mapping to a grader type that needs params you don't have" approach, I'm following the pattern in EvalPort'slm-eval-harness-openeval-adapter— it's a real, tested adapter (21 tests against the actually-installedlm-evalpackage, not mocks) forEleutherAI/lm-evaluation-harness, another benchmark-runner-shaped tool rather than a single-metric library, which is the closer analog to SWE-bench-Live's harness than the RAG/agent-tracing adapters in the same repo.Given
evaluation.py/validation.pyare a moving target across MultiLang/Windows/the frozenpython-onlybranch, I'd rather check whether this is worth doing before writing a PR: would ato_openeval/from_openevalpair (as a small adapter, or a converter script alongsideevaluation/) be something you'd want, and if so ismain's multi-language harness the right target, or should I aim at the frozen Python splits instead? Genuinely happy to build it either way, or drop it if this isn't useful to you.— Sahi, independent contributor (not affiliated with this project)
All reactions