Discover private tests by directory (part 5)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- tasks/task_098/tests/grader.py +110 -0
- tasks/task_099/tests/Dockerfile +3 -0
- tasks/task_099/tests/docker-compose.yaml +7 -0
- tasks/task_099/tests/grader.py +110 -0
- tasks/task_100/tests/Dockerfile +3 -0
- tasks/task_100/tests/docker-compose.yaml +7 -0
- tasks/task_100/tests/grader.py +110 -0
- tasks/task_101/tests/Dockerfile +3 -0
- tasks/task_101/tests/docker-compose.yaml +7 -0
- tasks/task_101/tests/grader.py +110 -0
- tasks/task_102/tests/Dockerfile +3 -0
- tasks/task_102/tests/docker-compose.yaml +7 -0
- tasks/task_102/tests/grader.py +110 -0
- tasks/task_103/tests/Dockerfile +3 -0
- tasks/task_103/tests/docker-compose.yaml +7 -0
- tasks/task_103/tests/grader.py +110 -0
- tasks/task_104/tests/Dockerfile +3 -0
- tasks/task_104/tests/docker-compose.yaml +7 -0
- tasks/task_104/tests/grader.py +110 -0
- tasks/task_105/tests/Dockerfile +3 -0
- tasks/task_105/tests/docker-compose.yaml +7 -0
- tasks/task_105/tests/grader.py +110 -0
- tasks/task_106/tests/Dockerfile +3 -0
- tasks/task_106/tests/docker-compose.yaml +7 -0
- tasks/task_106/tests/grader.py +110 -0
- tasks/task_107/tests/Dockerfile +3 -0
- tasks/task_107/tests/docker-compose.yaml +7 -0
- tasks/task_107/tests/grader.py +110 -0
- tasks/task_108/tests/Dockerfile +3 -0
- tasks/task_108/tests/docker-compose.yaml +7 -0
- tasks/task_108/tests/grader.py +110 -0
- tasks/task_109/tests/Dockerfile +3 -0
- tasks/task_109/tests/docker-compose.yaml +7 -0
- tasks/task_109/tests/grader.py +110 -0
- tasks/task_110/tests/Dockerfile +3 -0
- tasks/task_110/tests/docker-compose.yaml +7 -0
- tasks/task_110/tests/grader.py +110 -0
- tasks/task_111/tests/Dockerfile +3 -0
- tasks/task_111/tests/docker-compose.yaml +7 -0
- tasks/task_111/tests/grader.py +110 -0
- tasks/task_112/tests/Dockerfile +3 -0
- tasks/task_112/tests/docker-compose.yaml +7 -0
- tasks/task_112/tests/grader.py +110 -0
- tasks/task_113/tests/Dockerfile +3 -0
- tasks/task_113/tests/docker-compose.yaml +7 -0
- tasks/task_113/tests/grader.py +110 -0
- tasks/task_114/tests/Dockerfile +3 -0
- tasks/task_114/tests/docker-compose.yaml +7 -0
- tasks/task_114/tests/grader.py +110 -0
- tasks/task_115/tests/Dockerfile +3 -0
tasks/task_098/tests/grader.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
from __future__ import annotations
|
| 3 |
+
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
import subprocess
|
| 7 |
+
import sys
|
| 8 |
+
import xml.etree.ElementTree as ET
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
TASK_ID = "task_098"
|
| 13 |
+
TASK_ROOT = Path("/app") / TASK_ID
|
| 14 |
+
LOG_ROOT = Path("/logs/verifier")
|
| 15 |
+
LOG_ROOT.mkdir(parents=True, exist_ok=True)
|
| 16 |
+
env = os.environ.copy()
|
| 17 |
+
env.update(
|
| 18 |
+
{
|
| 19 |
+
"SCI_BENCH_TASK_ID": TASK_ID,
|
| 20 |
+
"SCI_BENCH_TASK_DIR": str(TASK_ROOT),
|
| 21 |
+
"PYTHONPATH": f"{TASK_ROOT}:{TASK_ROOT / 'source'}",
|
| 22 |
+
}
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def execute(command: list[str], cwd: Path) -> subprocess.CompletedProcess[str]:
|
| 27 |
+
return subprocess.run(
|
| 28 |
+
command,
|
| 29 |
+
cwd=cwd,
|
| 30 |
+
env=env,
|
| 31 |
+
text=True,
|
| 32 |
+
stdout=subprocess.PIPE,
|
| 33 |
+
stderr=subprocess.STDOUT,
|
| 34 |
+
check=False,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
public = execute([sys.executable, "reproduce.py"], TASK_ROOT)
|
| 39 |
+
junit = LOG_ROOT / "junit.xml"
|
| 40 |
+
# Private tests are a task-owned directory. Their filenames are intentionally
|
| 41 |
+
# unconstrained; pytest discovers every supported test module recursively.
|
| 42 |
+
private = execute(
|
| 43 |
+
[
|
| 44 |
+
sys.executable,
|
| 45 |
+
"-m",
|
| 46 |
+
"pytest",
|
| 47 |
+
"-q",
|
| 48 |
+
f"--junitxml={junit}",
|
| 49 |
+
"/tests/private_tests",
|
| 50 |
+
],
|
| 51 |
+
TASK_ROOT,
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
private_total = private_passed = private_failed = 0
|
| 55 |
+
if junit.is_file():
|
| 56 |
+
root = ET.parse(junit).getroot()
|
| 57 |
+
suites = [root] if root.tag == "testsuite" else root.findall(".//testsuite")
|
| 58 |
+
private_total = sum(int(suite.attrib.get("tests", "0")) for suite in suites)
|
| 59 |
+
private_failed = sum(
|
| 60 |
+
int(suite.attrib.get("failures", "0"))
|
| 61 |
+
+ int(suite.attrib.get("errors", "0"))
|
| 62 |
+
for suite in suites
|
| 63 |
+
)
|
| 64 |
+
private_passed = max(private_total - private_failed, 0)
|
| 65 |
+
|
| 66 |
+
reward = int(public.returncode == 0 and private.returncode == 0)
|
| 67 |
+
summary = {
|
| 68 |
+
"reward": reward,
|
| 69 |
+
"task_id": TASK_ID,
|
| 70 |
+
"public": {
|
| 71 |
+
"passed": int(public.returncode == 0),
|
| 72 |
+
"collected": 1,
|
| 73 |
+
"return_code": public.returncode,
|
| 74 |
+
},
|
| 75 |
+
"private": {
|
| 76 |
+
"passed": private_passed,
|
| 77 |
+
"collected": private_total,
|
| 78 |
+
"failed": private_failed,
|
| 79 |
+
"return_code": private.returncode,
|
| 80 |
+
},
|
| 81 |
+
}
|
| 82 |
+
(LOG_ROOT / "reward.json").write_text(json.dumps(summary, indent=2) + "\n")
|
| 83 |
+
(LOG_ROOT / "reward.txt").write_text(f"{reward:.1f}\n")
|
| 84 |
+
(LOG_ROOT / "ctrf.json").write_text(
|
| 85 |
+
json.dumps(
|
| 86 |
+
{
|
| 87 |
+
"reportFormat": "CTRF",
|
| 88 |
+
"specVersion": "0.0.0",
|
| 89 |
+
"results": {
|
| 90 |
+
"summary": {
|
| 91 |
+
"tests": private_total,
|
| 92 |
+
"passed": private_passed,
|
| 93 |
+
"failed": private_failed,
|
| 94 |
+
},
|
| 95 |
+
"tests": [],
|
| 96 |
+
},
|
| 97 |
+
},
|
| 98 |
+
indent=2,
|
| 99 |
+
)
|
| 100 |
+
+ "\n"
|
| 101 |
+
)
|
| 102 |
+
combined = (
|
| 103 |
+
"== public ==\n"
|
| 104 |
+
+ (public.stdout or "")
|
| 105 |
+
+ "\n== private ==\n"
|
| 106 |
+
+ (private.stdout or "")
|
| 107 |
+
)
|
| 108 |
+
(LOG_ROOT / "test-stdout.txt").write_text(combined)
|
| 109 |
+
(LOG_ROOT / "run.log").write_text(combined)
|
| 110 |
+
print(json.dumps(summary, sort_keys=True))
|
tasks/task_099/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-099:v0.1.1@sha256:bbdc0225f7b4fd0b619b748d21fa7fd6086680e450f009335605b4227ce23ab0
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-099:v0.1.1@sha256:bbdc0225f7b4fd0b619b748d21fa7fd6086680e450f009335605b4227ce23ab0
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_099/tests/docker-compose.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
services:
|
| 2 |
+
main:
|
| 3 |
+
volumes:
|
| 4 |
+
- type: bind
|
| 5 |
+
source: ./grader.py
|
| 6 |
+
target: /tests/grader.py
|
| 7 |
+
read_only: true
|
tasks/task_099/tests/grader.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
from __future__ import annotations
|
| 3 |
+
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
import subprocess
|
| 7 |
+
import sys
|
| 8 |
+
import xml.etree.ElementTree as ET
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
TASK_ID = "task_099"
|
| 13 |
+
TASK_ROOT = Path("/app") / TASK_ID
|
| 14 |
+
LOG_ROOT = Path("/logs/verifier")
|
| 15 |
+
LOG_ROOT.mkdir(parents=True, exist_ok=True)
|
| 16 |
+
env = os.environ.copy()
|
| 17 |
+
env.update(
|
| 18 |
+
{
|
| 19 |
+
"SCI_BENCH_TASK_ID": TASK_ID,
|
| 20 |
+
"SCI_BENCH_TASK_DIR": str(TASK_ROOT),
|
| 21 |
+
"PYTHONPATH": f"{TASK_ROOT}:{TASK_ROOT / 'source'}",
|
| 22 |
+
}
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def execute(command: list[str], cwd: Path) -> subprocess.CompletedProcess[str]:
|
| 27 |
+
return subprocess.run(
|
| 28 |
+
command,
|
| 29 |
+
cwd=cwd,
|
| 30 |
+
env=env,
|
| 31 |
+
text=True,
|
| 32 |
+
stdout=subprocess.PIPE,
|
| 33 |
+
stderr=subprocess.STDOUT,
|
| 34 |
+
check=False,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
public = execute([sys.executable, "reproduce.py"], TASK_ROOT)
|
| 39 |
+
junit = LOG_ROOT / "junit.xml"
|
| 40 |
+
# Private tests are a task-owned directory. Their filenames are intentionally
|
| 41 |
+
# unconstrained; pytest discovers every supported test module recursively.
|
| 42 |
+
private = execute(
|
| 43 |
+
[
|
| 44 |
+
sys.executable,
|
| 45 |
+
"-m",
|
| 46 |
+
"pytest",
|
| 47 |
+
"-q",
|
| 48 |
+
f"--junitxml={junit}",
|
| 49 |
+
"/tests/private_tests",
|
| 50 |
+
],
|
| 51 |
+
TASK_ROOT,
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
private_total = private_passed = private_failed = 0
|
| 55 |
+
if junit.is_file():
|
| 56 |
+
root = ET.parse(junit).getroot()
|
| 57 |
+
suites = [root] if root.tag == "testsuite" else root.findall(".//testsuite")
|
| 58 |
+
private_total = sum(int(suite.attrib.get("tests", "0")) for suite in suites)
|
| 59 |
+
private_failed = sum(
|
| 60 |
+
int(suite.attrib.get("failures", "0"))
|
| 61 |
+
+ int(suite.attrib.get("errors", "0"))
|
| 62 |
+
for suite in suites
|
| 63 |
+
)
|
| 64 |
+
private_passed = max(private_total - private_failed, 0)
|
| 65 |
+
|
| 66 |
+
reward = int(public.returncode == 0 and private.returncode == 0)
|
| 67 |
+
summary = {
|
| 68 |
+
"reward": reward,
|
| 69 |
+
"task_id": TASK_ID,
|
| 70 |
+
"public": {
|
| 71 |
+
"passed": int(public.returncode == 0),
|
| 72 |
+
"collected": 1,
|
| 73 |
+
"return_code": public.returncode,
|
| 74 |
+
},
|
| 75 |
+
"private": {
|
| 76 |
+
"passed": private_passed,
|
| 77 |
+
"collected": private_total,
|
| 78 |
+
"failed": private_failed,
|
| 79 |
+
"return_code": private.returncode,
|
| 80 |
+
},
|
| 81 |
+
}
|
| 82 |
+
(LOG_ROOT / "reward.json").write_text(json.dumps(summary, indent=2) + "\n")
|
| 83 |
+
(LOG_ROOT / "reward.txt").write_text(f"{reward:.1f}\n")
|
| 84 |
+
(LOG_ROOT / "ctrf.json").write_text(
|
| 85 |
+
json.dumps(
|
| 86 |
+
{
|
| 87 |
+
"reportFormat": "CTRF",
|
| 88 |
+
"specVersion": "0.0.0",
|
| 89 |
+
"results": {
|
| 90 |
+
"summary": {
|
| 91 |
+
"tests": private_total,
|
| 92 |
+
"passed": private_passed,
|
| 93 |
+
"failed": private_failed,
|
| 94 |
+
},
|
| 95 |
+
"tests": [],
|
| 96 |
+
},
|
| 97 |
+
},
|
| 98 |
+
indent=2,
|
| 99 |
+
)
|
| 100 |
+
+ "\n"
|
| 101 |
+
)
|
| 102 |
+
combined = (
|
| 103 |
+
"== public ==\n"
|
| 104 |
+
+ (public.stdout or "")
|
| 105 |
+
+ "\n== private ==\n"
|
| 106 |
+
+ (private.stdout or "")
|
| 107 |
+
)
|
| 108 |
+
(LOG_ROOT / "test-stdout.txt").write_text(combined)
|
| 109 |
+
(LOG_ROOT / "run.log").write_text(combined)
|
| 110 |
+
print(json.dumps(summary, sort_keys=True))
|
tasks/task_100/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-100:v0.1.1@sha256:f31d5844bc55cf997b84e2518c2a71c0daf1c09292fca7285fb42348787489b6
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-100:v0.1.1@sha256:f31d5844bc55cf997b84e2518c2a71c0daf1c09292fca7285fb42348787489b6
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_100/tests/docker-compose.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
services:
|
| 2 |
+
main:
|
| 3 |
+
volumes:
|
| 4 |
+
- type: bind
|
| 5 |
+
source: ./grader.py
|
| 6 |
+
target: /tests/grader.py
|
| 7 |
+
read_only: true
|
tasks/task_100/tests/grader.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
from __future__ import annotations
|
| 3 |
+
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
import subprocess
|
| 7 |
+
import sys
|
| 8 |
+
import xml.etree.ElementTree as ET
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
TASK_ID = "task_100"
|
| 13 |
+
TASK_ROOT = Path("/app") / TASK_ID
|
| 14 |
+
LOG_ROOT = Path("/logs/verifier")
|
| 15 |
+
LOG_ROOT.mkdir(parents=True, exist_ok=True)
|
| 16 |
+
env = os.environ.copy()
|
| 17 |
+
env.update(
|
| 18 |
+
{
|
| 19 |
+
"SCI_BENCH_TASK_ID": TASK_ID,
|
| 20 |
+
"SCI_BENCH_TASK_DIR": str(TASK_ROOT),
|
| 21 |
+
"PYTHONPATH": f"{TASK_ROOT}:{TASK_ROOT / 'source'}",
|
| 22 |
+
}
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def execute(command: list[str], cwd: Path) -> subprocess.CompletedProcess[str]:
|
| 27 |
+
return subprocess.run(
|
| 28 |
+
command,
|
| 29 |
+
cwd=cwd,
|
| 30 |
+
env=env,
|
| 31 |
+
text=True,
|
| 32 |
+
stdout=subprocess.PIPE,
|
| 33 |
+
stderr=subprocess.STDOUT,
|
| 34 |
+
check=False,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
public = execute([sys.executable, "reproduce.py"], TASK_ROOT)
|
| 39 |
+
junit = LOG_ROOT / "junit.xml"
|
| 40 |
+
# Private tests are a task-owned directory. Their filenames are intentionally
|
| 41 |
+
# unconstrained; pytest discovers every supported test module recursively.
|
| 42 |
+
private = execute(
|
| 43 |
+
[
|
| 44 |
+
sys.executable,
|
| 45 |
+
"-m",
|
| 46 |
+
"pytest",
|
| 47 |
+
"-q",
|
| 48 |
+
f"--junitxml={junit}",
|
| 49 |
+
"/tests/private_tests",
|
| 50 |
+
],
|
| 51 |
+
TASK_ROOT,
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
private_total = private_passed = private_failed = 0
|
| 55 |
+
if junit.is_file():
|
| 56 |
+
root = ET.parse(junit).getroot()
|
| 57 |
+
suites = [root] if root.tag == "testsuite" else root.findall(".//testsuite")
|
| 58 |
+
private_total = sum(int(suite.attrib.get("tests", "0")) for suite in suites)
|
| 59 |
+
private_failed = sum(
|
| 60 |
+
int(suite.attrib.get("failures", "0"))
|
| 61 |
+
+ int(suite.attrib.get("errors", "0"))
|
| 62 |
+
for suite in suites
|
| 63 |
+
)
|
| 64 |
+
private_passed = max(private_total - private_failed, 0)
|
| 65 |
+
|
| 66 |
+
reward = int(public.returncode == 0 and private.returncode == 0)
|
| 67 |
+
summary = {
|
| 68 |
+
"reward": reward,
|
| 69 |
+
"task_id": TASK_ID,
|
| 70 |
+
"public": {
|
| 71 |
+
"passed": int(public.returncode == 0),
|
| 72 |
+
"collected": 1,
|
| 73 |
+
"return_code": public.returncode,
|
| 74 |
+
},
|
| 75 |
+
"private": {
|
| 76 |
+
"passed": private_passed,
|
| 77 |
+
"collected": private_total,
|
| 78 |
+
"failed": private_failed,
|
| 79 |
+
"return_code": private.returncode,
|
| 80 |
+
},
|
| 81 |
+
}
|
| 82 |
+
(LOG_ROOT / "reward.json").write_text(json.dumps(summary, indent=2) + "\n")
|
| 83 |
+
(LOG_ROOT / "reward.txt").write_text(f"{reward:.1f}\n")
|
| 84 |
+
(LOG_ROOT / "ctrf.json").write_text(
|
| 85 |
+
json.dumps(
|
| 86 |
+
{
|
| 87 |
+
"reportFormat": "CTRF",
|
| 88 |
+
"specVersion": "0.0.0",
|
| 89 |
+
"results": {
|
| 90 |
+
"summary": {
|
| 91 |
+
"tests": private_total,
|
| 92 |
+
"passed": private_passed,
|
| 93 |
+
"failed": private_failed,
|
| 94 |
+
},
|
| 95 |
+
"tests": [],
|
| 96 |
+
},
|
| 97 |
+
},
|
| 98 |
+
indent=2,
|
| 99 |
+
)
|
| 100 |
+
+ "\n"
|
| 101 |
+
)
|
| 102 |
+
combined = (
|
| 103 |
+
"== public ==\n"
|
| 104 |
+
+ (public.stdout or "")
|
| 105 |
+
+ "\n== private ==\n"
|
| 106 |
+
+ (private.stdout or "")
|
| 107 |
+
)
|
| 108 |
+
(LOG_ROOT / "test-stdout.txt").write_text(combined)
|
| 109 |
+
(LOG_ROOT / "run.log").write_text(combined)
|
| 110 |
+
print(json.dumps(summary, sort_keys=True))
|
tasks/task_101/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-101:v0.1.1@sha256:351e46f543c558cf41d5ac880353cee71632002cae6f9fabe07c543b9ae9e63e
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-101:v0.1.1@sha256:351e46f543c558cf41d5ac880353cee71632002cae6f9fabe07c543b9ae9e63e
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_101/tests/docker-compose.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
services:
|
| 2 |
+
main:
|
| 3 |
+
volumes:
|
| 4 |
+
- type: bind
|
| 5 |
+
source: ./grader.py
|
| 6 |
+
target: /tests/grader.py
|
| 7 |
+
read_only: true
|
tasks/task_101/tests/grader.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
from __future__ import annotations
|
| 3 |
+
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
import subprocess
|
| 7 |
+
import sys
|
| 8 |
+
import xml.etree.ElementTree as ET
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
TASK_ID = "task_101"
|
| 13 |
+
TASK_ROOT = Path("/app") / TASK_ID
|
| 14 |
+
LOG_ROOT = Path("/logs/verifier")
|
| 15 |
+
LOG_ROOT.mkdir(parents=True, exist_ok=True)
|
| 16 |
+
env = os.environ.copy()
|
| 17 |
+
env.update(
|
| 18 |
+
{
|
| 19 |
+
"SCI_BENCH_TASK_ID": TASK_ID,
|
| 20 |
+
"SCI_BENCH_TASK_DIR": str(TASK_ROOT),
|
| 21 |
+
"PYTHONPATH": f"{TASK_ROOT}:{TASK_ROOT / 'source'}",
|
| 22 |
+
}
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def execute(command: list[str], cwd: Path) -> subprocess.CompletedProcess[str]:
|
| 27 |
+
return subprocess.run(
|
| 28 |
+
command,
|
| 29 |
+
cwd=cwd,
|
| 30 |
+
env=env,
|
| 31 |
+
text=True,
|
| 32 |
+
stdout=subprocess.PIPE,
|
| 33 |
+
stderr=subprocess.STDOUT,
|
| 34 |
+
check=False,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
public = execute([sys.executable, "reproduce.py"], TASK_ROOT)
|
| 39 |
+
junit = LOG_ROOT / "junit.xml"
|
| 40 |
+
# Private tests are a task-owned directory. Their filenames are intentionally
|
| 41 |
+
# unconstrained; pytest discovers every supported test module recursively.
|
| 42 |
+
private = execute(
|
| 43 |
+
[
|
| 44 |
+
sys.executable,
|
| 45 |
+
"-m",
|
| 46 |
+
"pytest",
|
| 47 |
+
"-q",
|
| 48 |
+
f"--junitxml={junit}",
|
| 49 |
+
"/tests/private_tests",
|
| 50 |
+
],
|
| 51 |
+
TASK_ROOT,
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
private_total = private_passed = private_failed = 0
|
| 55 |
+
if junit.is_file():
|
| 56 |
+
root = ET.parse(junit).getroot()
|
| 57 |
+
suites = [root] if root.tag == "testsuite" else root.findall(".//testsuite")
|
| 58 |
+
private_total = sum(int(suite.attrib.get("tests", "0")) for suite in suites)
|
| 59 |
+
private_failed = sum(
|
| 60 |
+
int(suite.attrib.get("failures", "0"))
|
| 61 |
+
+ int(suite.attrib.get("errors", "0"))
|
| 62 |
+
for suite in suites
|
| 63 |
+
)
|
| 64 |
+
private_passed = max(private_total - private_failed, 0)
|
| 65 |
+
|
| 66 |
+
reward = int(public.returncode == 0 and private.returncode == 0)
|
| 67 |
+
summary = {
|
| 68 |
+
"reward": reward,
|
| 69 |
+
"task_id": TASK_ID,
|
| 70 |
+
"public": {
|
| 71 |
+
"passed": int(public.returncode == 0),
|
| 72 |
+
"collected": 1,
|
| 73 |
+
"return_code": public.returncode,
|
| 74 |
+
},
|
| 75 |
+
"private": {
|
| 76 |
+
"passed": private_passed,
|
| 77 |
+
"collected": private_total,
|
| 78 |
+
"failed": private_failed,
|
| 79 |
+
"return_code": private.returncode,
|
| 80 |
+
},
|
| 81 |
+
}
|
| 82 |
+
(LOG_ROOT / "reward.json").write_text(json.dumps(summary, indent=2) + "\n")
|
| 83 |
+
(LOG_ROOT / "reward.txt").write_text(f"{reward:.1f}\n")
|
| 84 |
+
(LOG_ROOT / "ctrf.json").write_text(
|
| 85 |
+
json.dumps(
|
| 86 |
+
{
|
| 87 |
+
"reportFormat": "CTRF",
|
| 88 |
+
"specVersion": "0.0.0",
|
| 89 |
+
"results": {
|
| 90 |
+
"summary": {
|
| 91 |
+
"tests": private_total,
|
| 92 |
+
"passed": private_passed,
|
| 93 |
+
"failed": private_failed,
|
| 94 |
+
},
|
| 95 |
+
"tests": [],
|
| 96 |
+
},
|
| 97 |
+
},
|
| 98 |
+
indent=2,
|
| 99 |
+
)
|
| 100 |
+
+ "\n"
|
| 101 |
+
)
|
| 102 |
+
combined = (
|
| 103 |
+
"== public ==\n"
|
| 104 |
+
+ (public.stdout or "")
|
| 105 |
+
+ "\n== private ==\n"
|
| 106 |
+
+ (private.stdout or "")
|
| 107 |
+
)
|
| 108 |
+
(LOG_ROOT / "test-stdout.txt").write_text(combined)
|
| 109 |
+
(LOG_ROOT / "run.log").write_text(combined)
|
| 110 |
+
print(json.dumps(summary, sort_keys=True))
|
tasks/task_102/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-102:v0.1.1@sha256:adaf1de19b5892112a68f14183079fe298592287c6744d336bcc08997b95b336
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-102:v0.1.1@sha256:adaf1de19b5892112a68f14183079fe298592287c6744d336bcc08997b95b336
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_102/tests/docker-compose.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
services:
|
| 2 |
+
main:
|
| 3 |
+
volumes:
|
| 4 |
+
- type: bind
|
| 5 |
+
source: ./grader.py
|
| 6 |
+
target: /tests/grader.py
|
| 7 |
+
read_only: true
|
tasks/task_102/tests/grader.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
from __future__ import annotations
|
| 3 |
+
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
import subprocess
|
| 7 |
+
import sys
|
| 8 |
+
import xml.etree.ElementTree as ET
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
TASK_ID = "task_102"
|
| 13 |
+
TASK_ROOT = Path("/app") / TASK_ID
|
| 14 |
+
LOG_ROOT = Path("/logs/verifier")
|
| 15 |
+
LOG_ROOT.mkdir(parents=True, exist_ok=True)
|
| 16 |
+
env = os.environ.copy()
|
| 17 |
+
env.update(
|
| 18 |
+
{
|
| 19 |
+
"SCI_BENCH_TASK_ID": TASK_ID,
|
| 20 |
+
"SCI_BENCH_TASK_DIR": str(TASK_ROOT),
|
| 21 |
+
"PYTHONPATH": f"{TASK_ROOT}:{TASK_ROOT / 'source'}",
|
| 22 |
+
}
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def execute(command: list[str], cwd: Path) -> subprocess.CompletedProcess[str]:
|
| 27 |
+
return subprocess.run(
|
| 28 |
+
command,
|
| 29 |
+
cwd=cwd,
|
| 30 |
+
env=env,
|
| 31 |
+
text=True,
|
| 32 |
+
stdout=subprocess.PIPE,
|
| 33 |
+
stderr=subprocess.STDOUT,
|
| 34 |
+
check=False,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
public = execute([sys.executable, "reproduce.py"], TASK_ROOT)
|
| 39 |
+
junit = LOG_ROOT / "junit.xml"
|
| 40 |
+
# Private tests are a task-owned directory. Their filenames are intentionally
|
| 41 |
+
# unconstrained; pytest discovers every supported test module recursively.
|
| 42 |
+
private = execute(
|
| 43 |
+
[
|
| 44 |
+
sys.executable,
|
| 45 |
+
"-m",
|
| 46 |
+
"pytest",
|
| 47 |
+
"-q",
|
| 48 |
+
f"--junitxml={junit}",
|
| 49 |
+
"/tests/private_tests",
|
| 50 |
+
],
|
| 51 |
+
TASK_ROOT,
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
private_total = private_passed = private_failed = 0
|
| 55 |
+
if junit.is_file():
|
| 56 |
+
root = ET.parse(junit).getroot()
|
| 57 |
+
suites = [root] if root.tag == "testsuite" else root.findall(".//testsuite")
|
| 58 |
+
private_total = sum(int(suite.attrib.get("tests", "0")) for suite in suites)
|
| 59 |
+
private_failed = sum(
|
| 60 |
+
int(suite.attrib.get("failures", "0"))
|
| 61 |
+
+ int(suite.attrib.get("errors", "0"))
|
| 62 |
+
for suite in suites
|
| 63 |
+
)
|
| 64 |
+
private_passed = max(private_total - private_failed, 0)
|
| 65 |
+
|
| 66 |
+
reward = int(public.returncode == 0 and private.returncode == 0)
|
| 67 |
+
summary = {
|
| 68 |
+
"reward": reward,
|
| 69 |
+
"task_id": TASK_ID,
|
| 70 |
+
"public": {
|
| 71 |
+
"passed": int(public.returncode == 0),
|
| 72 |
+
"collected": 1,
|
| 73 |
+
"return_code": public.returncode,
|
| 74 |
+
},
|
| 75 |
+
"private": {
|
| 76 |
+
"passed": private_passed,
|
| 77 |
+
"collected": private_total,
|
| 78 |
+
"failed": private_failed,
|
| 79 |
+
"return_code": private.returncode,
|
| 80 |
+
},
|
| 81 |
+
}
|
| 82 |
+
(LOG_ROOT / "reward.json").write_text(json.dumps(summary, indent=2) + "\n")
|
| 83 |
+
(LOG_ROOT / "reward.txt").write_text(f"{reward:.1f}\n")
|
| 84 |
+
(LOG_ROOT / "ctrf.json").write_text(
|
| 85 |
+
json.dumps(
|
| 86 |
+
{
|
| 87 |
+
"reportFormat": "CTRF",
|
| 88 |
+
"specVersion": "0.0.0",
|
| 89 |
+
"results": {
|
| 90 |
+
"summary": {
|
| 91 |
+
"tests": private_total,
|
| 92 |
+
"passed": private_passed,
|
| 93 |
+
"failed": private_failed,
|
| 94 |
+
},
|
| 95 |
+
"tests": [],
|
| 96 |
+
},
|
| 97 |
+
},
|
| 98 |
+
indent=2,
|
| 99 |
+
)
|
| 100 |
+
+ "\n"
|
| 101 |
+
)
|
| 102 |
+
combined = (
|
| 103 |
+
"== public ==\n"
|
| 104 |
+
+ (public.stdout or "")
|
| 105 |
+
+ "\n== private ==\n"
|
| 106 |
+
+ (private.stdout or "")
|
| 107 |
+
)
|
| 108 |
+
(LOG_ROOT / "test-stdout.txt").write_text(combined)
|
| 109 |
+
(LOG_ROOT / "run.log").write_text(combined)
|
| 110 |
+
print(json.dumps(summary, sort_keys=True))
|
tasks/task_103/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-103:v0.1.1@sha256:f5aee22839b572d8edf7c7884c1473cca47f07ee681bd11309ad3fd71d26c6dc
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-103:v0.1.1@sha256:f5aee22839b572d8edf7c7884c1473cca47f07ee681bd11309ad3fd71d26c6dc
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_103/tests/docker-compose.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
services:
|
| 2 |
+
main:
|
| 3 |
+
volumes:
|
| 4 |
+
- type: bind
|
| 5 |
+
source: ./grader.py
|
| 6 |
+
target: /tests/grader.py
|
| 7 |
+
read_only: true
|
tasks/task_103/tests/grader.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
from __future__ import annotations
|
| 3 |
+
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
import subprocess
|
| 7 |
+
import sys
|
| 8 |
+
import xml.etree.ElementTree as ET
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
TASK_ID = "task_103"
|
| 13 |
+
TASK_ROOT = Path("/app") / TASK_ID
|
| 14 |
+
LOG_ROOT = Path("/logs/verifier")
|
| 15 |
+
LOG_ROOT.mkdir(parents=True, exist_ok=True)
|
| 16 |
+
env = os.environ.copy()
|
| 17 |
+
env.update(
|
| 18 |
+
{
|
| 19 |
+
"SCI_BENCH_TASK_ID": TASK_ID,
|
| 20 |
+
"SCI_BENCH_TASK_DIR": str(TASK_ROOT),
|
| 21 |
+
"PYTHONPATH": f"{TASK_ROOT}:{TASK_ROOT / 'source'}",
|
| 22 |
+
}
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def execute(command: list[str], cwd: Path) -> subprocess.CompletedProcess[str]:
|
| 27 |
+
return subprocess.run(
|
| 28 |
+
command,
|
| 29 |
+
cwd=cwd,
|
| 30 |
+
env=env,
|
| 31 |
+
text=True,
|
| 32 |
+
stdout=subprocess.PIPE,
|
| 33 |
+
stderr=subprocess.STDOUT,
|
| 34 |
+
check=False,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
public = execute([sys.executable, "reproduce.py"], TASK_ROOT)
|
| 39 |
+
junit = LOG_ROOT / "junit.xml"
|
| 40 |
+
# Private tests are a task-owned directory. Their filenames are intentionally
|
| 41 |
+
# unconstrained; pytest discovers every supported test module recursively.
|
| 42 |
+
private = execute(
|
| 43 |
+
[
|
| 44 |
+
sys.executable,
|
| 45 |
+
"-m",
|
| 46 |
+
"pytest",
|
| 47 |
+
"-q",
|
| 48 |
+
f"--junitxml={junit}",
|
| 49 |
+
"/tests/private_tests",
|
| 50 |
+
],
|
| 51 |
+
TASK_ROOT,
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
private_total = private_passed = private_failed = 0
|
| 55 |
+
if junit.is_file():
|
| 56 |
+
root = ET.parse(junit).getroot()
|
| 57 |
+
suites = [root] if root.tag == "testsuite" else root.findall(".//testsuite")
|
| 58 |
+
private_total = sum(int(suite.attrib.get("tests", "0")) for suite in suites)
|
| 59 |
+
private_failed = sum(
|
| 60 |
+
int(suite.attrib.get("failures", "0"))
|
| 61 |
+
+ int(suite.attrib.get("errors", "0"))
|
| 62 |
+
for suite in suites
|
| 63 |
+
)
|
| 64 |
+
private_passed = max(private_total - private_failed, 0)
|
| 65 |
+
|
| 66 |
+
reward = int(public.returncode == 0 and private.returncode == 0)
|
| 67 |
+
summary = {
|
| 68 |
+
"reward": reward,
|
| 69 |
+
"task_id": TASK_ID,
|
| 70 |
+
"public": {
|
| 71 |
+
"passed": int(public.returncode == 0),
|
| 72 |
+
"collected": 1,
|
| 73 |
+
"return_code": public.returncode,
|
| 74 |
+
},
|
| 75 |
+
"private": {
|
| 76 |
+
"passed": private_passed,
|
| 77 |
+
"collected": private_total,
|
| 78 |
+
"failed": private_failed,
|
| 79 |
+
"return_code": private.returncode,
|
| 80 |
+
},
|
| 81 |
+
}
|
| 82 |
+
(LOG_ROOT / "reward.json").write_text(json.dumps(summary, indent=2) + "\n")
|
| 83 |
+
(LOG_ROOT / "reward.txt").write_text(f"{reward:.1f}\n")
|
| 84 |
+
(LOG_ROOT / "ctrf.json").write_text(
|
| 85 |
+
json.dumps(
|
| 86 |
+
{
|
| 87 |
+
"reportFormat": "CTRF",
|
| 88 |
+
"specVersion": "0.0.0",
|
| 89 |
+
"results": {
|
| 90 |
+
"summary": {
|
| 91 |
+
"tests": private_total,
|
| 92 |
+
"passed": private_passed,
|
| 93 |
+
"failed": private_failed,
|
| 94 |
+
},
|
| 95 |
+
"tests": [],
|
| 96 |
+
},
|
| 97 |
+
},
|
| 98 |
+
indent=2,
|
| 99 |
+
)
|
| 100 |
+
+ "\n"
|
| 101 |
+
)
|
| 102 |
+
combined = (
|
| 103 |
+
"== public ==\n"
|
| 104 |
+
+ (public.stdout or "")
|
| 105 |
+
+ "\n== private ==\n"
|
| 106 |
+
+ (private.stdout or "")
|
| 107 |
+
)
|
| 108 |
+
(LOG_ROOT / "test-stdout.txt").write_text(combined)
|
| 109 |
+
(LOG_ROOT / "run.log").write_text(combined)
|
| 110 |
+
print(json.dumps(summary, sort_keys=True))
|
tasks/task_104/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-104:v0.1.1@sha256:4e3e0fbde6106146ebadaecb511695588c4e06dec6a71b0bfac4c8de994bd2bc
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-104:v0.1.1@sha256:4e3e0fbde6106146ebadaecb511695588c4e06dec6a71b0bfac4c8de994bd2bc
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_104/tests/docker-compose.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
services:
|
| 2 |
+
main:
|
| 3 |
+
volumes:
|
| 4 |
+
- type: bind
|
| 5 |
+
source: ./grader.py
|
| 6 |
+
target: /tests/grader.py
|
| 7 |
+
read_only: true
|
tasks/task_104/tests/grader.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
from __future__ import annotations
|
| 3 |
+
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
import subprocess
|
| 7 |
+
import sys
|
| 8 |
+
import xml.etree.ElementTree as ET
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
TASK_ID = "task_104"
|
| 13 |
+
TASK_ROOT = Path("/app") / TASK_ID
|
| 14 |
+
LOG_ROOT = Path("/logs/verifier")
|
| 15 |
+
LOG_ROOT.mkdir(parents=True, exist_ok=True)
|
| 16 |
+
env = os.environ.copy()
|
| 17 |
+
env.update(
|
| 18 |
+
{
|
| 19 |
+
"SCI_BENCH_TASK_ID": TASK_ID,
|
| 20 |
+
"SCI_BENCH_TASK_DIR": str(TASK_ROOT),
|
| 21 |
+
"PYTHONPATH": f"{TASK_ROOT}:{TASK_ROOT / 'source'}",
|
| 22 |
+
}
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def execute(command: list[str], cwd: Path) -> subprocess.CompletedProcess[str]:
|
| 27 |
+
return subprocess.run(
|
| 28 |
+
command,
|
| 29 |
+
cwd=cwd,
|
| 30 |
+
env=env,
|
| 31 |
+
text=True,
|
| 32 |
+
stdout=subprocess.PIPE,
|
| 33 |
+
stderr=subprocess.STDOUT,
|
| 34 |
+
check=False,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
public = execute([sys.executable, "reproduce.py"], TASK_ROOT)
|
| 39 |
+
junit = LOG_ROOT / "junit.xml"
|
| 40 |
+
# Private tests are a task-owned directory. Their filenames are intentionally
|
| 41 |
+
# unconstrained; pytest discovers every supported test module recursively.
|
| 42 |
+
private = execute(
|
| 43 |
+
[
|
| 44 |
+
sys.executable,
|
| 45 |
+
"-m",
|
| 46 |
+
"pytest",
|
| 47 |
+
"-q",
|
| 48 |
+
f"--junitxml={junit}",
|
| 49 |
+
"/tests/private_tests",
|
| 50 |
+
],
|
| 51 |
+
TASK_ROOT,
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
private_total = private_passed = private_failed = 0
|
| 55 |
+
if junit.is_file():
|
| 56 |
+
root = ET.parse(junit).getroot()
|
| 57 |
+
suites = [root] if root.tag == "testsuite" else root.findall(".//testsuite")
|
| 58 |
+
private_total = sum(int(suite.attrib.get("tests", "0")) for suite in suites)
|
| 59 |
+
private_failed = sum(
|
| 60 |
+
int(suite.attrib.get("failures", "0"))
|
| 61 |
+
+ int(suite.attrib.get("errors", "0"))
|
| 62 |
+
for suite in suites
|
| 63 |
+
)
|
| 64 |
+
private_passed = max(private_total - private_failed, 0)
|
| 65 |
+
|
| 66 |
+
reward = int(public.returncode == 0 and private.returncode == 0)
|
| 67 |
+
summary = {
|
| 68 |
+
"reward": reward,
|
| 69 |
+
"task_id": TASK_ID,
|
| 70 |
+
"public": {
|
| 71 |
+
"passed": int(public.returncode == 0),
|
| 72 |
+
"collected": 1,
|
| 73 |
+
"return_code": public.returncode,
|
| 74 |
+
},
|
| 75 |
+
"private": {
|
| 76 |
+
"passed": private_passed,
|
| 77 |
+
"collected": private_total,
|
| 78 |
+
"failed": private_failed,
|
| 79 |
+
"return_code": private.returncode,
|
| 80 |
+
},
|
| 81 |
+
}
|
| 82 |
+
(LOG_ROOT / "reward.json").write_text(json.dumps(summary, indent=2) + "\n")
|
| 83 |
+
(LOG_ROOT / "reward.txt").write_text(f"{reward:.1f}\n")
|
| 84 |
+
(LOG_ROOT / "ctrf.json").write_text(
|
| 85 |
+
json.dumps(
|
| 86 |
+
{
|
| 87 |
+
"reportFormat": "CTRF",
|
| 88 |
+
"specVersion": "0.0.0",
|
| 89 |
+
"results": {
|
| 90 |
+
"summary": {
|
| 91 |
+
"tests": private_total,
|
| 92 |
+
"passed": private_passed,
|
| 93 |
+
"failed": private_failed,
|
| 94 |
+
},
|
| 95 |
+
"tests": [],
|
| 96 |
+
},
|
| 97 |
+
},
|
| 98 |
+
indent=2,
|
| 99 |
+
)
|
| 100 |
+
+ "\n"
|
| 101 |
+
)
|
| 102 |
+
combined = (
|
| 103 |
+
"== public ==\n"
|
| 104 |
+
+ (public.stdout or "")
|
| 105 |
+
+ "\n== private ==\n"
|
| 106 |
+
+ (private.stdout or "")
|
| 107 |
+
)
|
| 108 |
+
(LOG_ROOT / "test-stdout.txt").write_text(combined)
|
| 109 |
+
(LOG_ROOT / "run.log").write_text(combined)
|
| 110 |
+
print(json.dumps(summary, sort_keys=True))
|
tasks/task_105/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-cpp-task-105:v0.1.1@sha256:4e96032a9972da65b1146cc41f8332bda8b16276b7ebf50db8287d5d7a434a96
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-cpp-task-105:v0.1.1@sha256:4e96032a9972da65b1146cc41f8332bda8b16276b7ebf50db8287d5d7a434a96
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_105/tests/docker-compose.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
services:
|
| 2 |
+
main:
|
| 3 |
+
volumes:
|
| 4 |
+
- type: bind
|
| 5 |
+
source: ./grader.py
|
| 6 |
+
target: /tests/grader.py
|
| 7 |
+
read_only: true
|
tasks/task_105/tests/grader.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
from __future__ import annotations
|
| 3 |
+
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
import subprocess
|
| 7 |
+
import sys
|
| 8 |
+
import xml.etree.ElementTree as ET
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
TASK_ID = "task_105"
|
| 13 |
+
TASK_ROOT = Path("/app") / TASK_ID
|
| 14 |
+
LOG_ROOT = Path("/logs/verifier")
|
| 15 |
+
LOG_ROOT.mkdir(parents=True, exist_ok=True)
|
| 16 |
+
env = os.environ.copy()
|
| 17 |
+
env.update(
|
| 18 |
+
{
|
| 19 |
+
"SCI_BENCH_TASK_ID": TASK_ID,
|
| 20 |
+
"SCI_BENCH_TASK_DIR": str(TASK_ROOT),
|
| 21 |
+
"PYTHONPATH": f"{TASK_ROOT}:{TASK_ROOT / 'source'}",
|
| 22 |
+
}
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def execute(command: list[str], cwd: Path) -> subprocess.CompletedProcess[str]:
|
| 27 |
+
return subprocess.run(
|
| 28 |
+
command,
|
| 29 |
+
cwd=cwd,
|
| 30 |
+
env=env,
|
| 31 |
+
text=True,
|
| 32 |
+
stdout=subprocess.PIPE,
|
| 33 |
+
stderr=subprocess.STDOUT,
|
| 34 |
+
check=False,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
public = execute([sys.executable, "reproduce.py"], TASK_ROOT)
|
| 39 |
+
junit = LOG_ROOT / "junit.xml"
|
| 40 |
+
# Private tests are a task-owned directory. Their filenames are intentionally
|
| 41 |
+
# unconstrained; pytest discovers every supported test module recursively.
|
| 42 |
+
private = execute(
|
| 43 |
+
[
|
| 44 |
+
sys.executable,
|
| 45 |
+
"-m",
|
| 46 |
+
"pytest",
|
| 47 |
+
"-q",
|
| 48 |
+
f"--junitxml={junit}",
|
| 49 |
+
"/tests/private_tests",
|
| 50 |
+
],
|
| 51 |
+
TASK_ROOT,
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
private_total = private_passed = private_failed = 0
|
| 55 |
+
if junit.is_file():
|
| 56 |
+
root = ET.parse(junit).getroot()
|
| 57 |
+
suites = [root] if root.tag == "testsuite" else root.findall(".//testsuite")
|
| 58 |
+
private_total = sum(int(suite.attrib.get("tests", "0")) for suite in suites)
|
| 59 |
+
private_failed = sum(
|
| 60 |
+
int(suite.attrib.get("failures", "0"))
|
| 61 |
+
+ int(suite.attrib.get("errors", "0"))
|
| 62 |
+
for suite in suites
|
| 63 |
+
)
|
| 64 |
+
private_passed = max(private_total - private_failed, 0)
|
| 65 |
+
|
| 66 |
+
reward = int(public.returncode == 0 and private.returncode == 0)
|
| 67 |
+
summary = {
|
| 68 |
+
"reward": reward,
|
| 69 |
+
"task_id": TASK_ID,
|
| 70 |
+
"public": {
|
| 71 |
+
"passed": int(public.returncode == 0),
|
| 72 |
+
"collected": 1,
|
| 73 |
+
"return_code": public.returncode,
|
| 74 |
+
},
|
| 75 |
+
"private": {
|
| 76 |
+
"passed": private_passed,
|
| 77 |
+
"collected": private_total,
|
| 78 |
+
"failed": private_failed,
|
| 79 |
+
"return_code": private.returncode,
|
| 80 |
+
},
|
| 81 |
+
}
|
| 82 |
+
(LOG_ROOT / "reward.json").write_text(json.dumps(summary, indent=2) + "\n")
|
| 83 |
+
(LOG_ROOT / "reward.txt").write_text(f"{reward:.1f}\n")
|
| 84 |
+
(LOG_ROOT / "ctrf.json").write_text(
|
| 85 |
+
json.dumps(
|
| 86 |
+
{
|
| 87 |
+
"reportFormat": "CTRF",
|
| 88 |
+
"specVersion": "0.0.0",
|
| 89 |
+
"results": {
|
| 90 |
+
"summary": {
|
| 91 |
+
"tests": private_total,
|
| 92 |
+
"passed": private_passed,
|
| 93 |
+
"failed": private_failed,
|
| 94 |
+
},
|
| 95 |
+
"tests": [],
|
| 96 |
+
},
|
| 97 |
+
},
|
| 98 |
+
indent=2,
|
| 99 |
+
)
|
| 100 |
+
+ "\n"
|
| 101 |
+
)
|
| 102 |
+
combined = (
|
| 103 |
+
"== public ==\n"
|
| 104 |
+
+ (public.stdout or "")
|
| 105 |
+
+ "\n== private ==\n"
|
| 106 |
+
+ (private.stdout or "")
|
| 107 |
+
)
|
| 108 |
+
(LOG_ROOT / "test-stdout.txt").write_text(combined)
|
| 109 |
+
(LOG_ROOT / "run.log").write_text(combined)
|
| 110 |
+
print(json.dumps(summary, sort_keys=True))
|
tasks/task_106/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-106:v0.1.1@sha256:2c7ddddb4e5595efd5421461fffab8a15fd94618104523a27a6f3bbba6e71a26
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-106:v0.1.1@sha256:2c7ddddb4e5595efd5421461fffab8a15fd94618104523a27a6f3bbba6e71a26
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_106/tests/docker-compose.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
services:
|
| 2 |
+
main:
|
| 3 |
+
volumes:
|
| 4 |
+
- type: bind
|
| 5 |
+
source: ./grader.py
|
| 6 |
+
target: /tests/grader.py
|
| 7 |
+
read_only: true
|
tasks/task_106/tests/grader.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
from __future__ import annotations
|
| 3 |
+
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
import subprocess
|
| 7 |
+
import sys
|
| 8 |
+
import xml.etree.ElementTree as ET
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
TASK_ID = "task_106"
|
| 13 |
+
TASK_ROOT = Path("/app") / TASK_ID
|
| 14 |
+
LOG_ROOT = Path("/logs/verifier")
|
| 15 |
+
LOG_ROOT.mkdir(parents=True, exist_ok=True)
|
| 16 |
+
env = os.environ.copy()
|
| 17 |
+
env.update(
|
| 18 |
+
{
|
| 19 |
+
"SCI_BENCH_TASK_ID": TASK_ID,
|
| 20 |
+
"SCI_BENCH_TASK_DIR": str(TASK_ROOT),
|
| 21 |
+
"PYTHONPATH": f"{TASK_ROOT}:{TASK_ROOT / 'source'}",
|
| 22 |
+
}
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def execute(command: list[str], cwd: Path) -> subprocess.CompletedProcess[str]:
|
| 27 |
+
return subprocess.run(
|
| 28 |
+
command,
|
| 29 |
+
cwd=cwd,
|
| 30 |
+
env=env,
|
| 31 |
+
text=True,
|
| 32 |
+
stdout=subprocess.PIPE,
|
| 33 |
+
stderr=subprocess.STDOUT,
|
| 34 |
+
check=False,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
public = execute([sys.executable, "reproduce.py"], TASK_ROOT)
|
| 39 |
+
junit = LOG_ROOT / "junit.xml"
|
| 40 |
+
# Private tests are a task-owned directory. Their filenames are intentionally
|
| 41 |
+
# unconstrained; pytest discovers every supported test module recursively.
|
| 42 |
+
private = execute(
|
| 43 |
+
[
|
| 44 |
+
sys.executable,
|
| 45 |
+
"-m",
|
| 46 |
+
"pytest",
|
| 47 |
+
"-q",
|
| 48 |
+
f"--junitxml={junit}",
|
| 49 |
+
"/tests/private_tests",
|
| 50 |
+
],
|
| 51 |
+
TASK_ROOT,
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
private_total = private_passed = private_failed = 0
|
| 55 |
+
if junit.is_file():
|
| 56 |
+
root = ET.parse(junit).getroot()
|
| 57 |
+
suites = [root] if root.tag == "testsuite" else root.findall(".//testsuite")
|
| 58 |
+
private_total = sum(int(suite.attrib.get("tests", "0")) for suite in suites)
|
| 59 |
+
private_failed = sum(
|
| 60 |
+
int(suite.attrib.get("failures", "0"))
|
| 61 |
+
+ int(suite.attrib.get("errors", "0"))
|
| 62 |
+
for suite in suites
|
| 63 |
+
)
|
| 64 |
+
private_passed = max(private_total - private_failed, 0)
|
| 65 |
+
|
| 66 |
+
reward = int(public.returncode == 0 and private.returncode == 0)
|
| 67 |
+
summary = {
|
| 68 |
+
"reward": reward,
|
| 69 |
+
"task_id": TASK_ID,
|
| 70 |
+
"public": {
|
| 71 |
+
"passed": int(public.returncode == 0),
|
| 72 |
+
"collected": 1,
|
| 73 |
+
"return_code": public.returncode,
|
| 74 |
+
},
|
| 75 |
+
"private": {
|
| 76 |
+
"passed": private_passed,
|
| 77 |
+
"collected": private_total,
|
| 78 |
+
"failed": private_failed,
|
| 79 |
+
"return_code": private.returncode,
|
| 80 |
+
},
|
| 81 |
+
}
|
| 82 |
+
(LOG_ROOT / "reward.json").write_text(json.dumps(summary, indent=2) + "\n")
|
| 83 |
+
(LOG_ROOT / "reward.txt").write_text(f"{reward:.1f}\n")
|
| 84 |
+
(LOG_ROOT / "ctrf.json").write_text(
|
| 85 |
+
json.dumps(
|
| 86 |
+
{
|
| 87 |
+
"reportFormat": "CTRF",
|
| 88 |
+
"specVersion": "0.0.0",
|
| 89 |
+
"results": {
|
| 90 |
+
"summary": {
|
| 91 |
+
"tests": private_total,
|
| 92 |
+
"passed": private_passed,
|
| 93 |
+
"failed": private_failed,
|
| 94 |
+
},
|
| 95 |
+
"tests": [],
|
| 96 |
+
},
|
| 97 |
+
},
|
| 98 |
+
indent=2,
|
| 99 |
+
)
|
| 100 |
+
+ "\n"
|
| 101 |
+
)
|
| 102 |
+
combined = (
|
| 103 |
+
"== public ==\n"
|
| 104 |
+
+ (public.stdout or "")
|
| 105 |
+
+ "\n== private ==\n"
|
| 106 |
+
+ (private.stdout or "")
|
| 107 |
+
)
|
| 108 |
+
(LOG_ROOT / "test-stdout.txt").write_text(combined)
|
| 109 |
+
(LOG_ROOT / "run.log").write_text(combined)
|
| 110 |
+
print(json.dumps(summary, sort_keys=True))
|
tasks/task_107/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-107:v0.1.1@sha256:1a5c67f1817c05b93066b554f6b83f498f73f1b610ee8ea13507c0b475e96bfd
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-107:v0.1.1@sha256:1a5c67f1817c05b93066b554f6b83f498f73f1b610ee8ea13507c0b475e96bfd
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_107/tests/docker-compose.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
services:
|
| 2 |
+
main:
|
| 3 |
+
volumes:
|
| 4 |
+
- type: bind
|
| 5 |
+
source: ./grader.py
|
| 6 |
+
target: /tests/grader.py
|
| 7 |
+
read_only: true
|
tasks/task_107/tests/grader.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
from __future__ import annotations
|
| 3 |
+
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
import subprocess
|
| 7 |
+
import sys
|
| 8 |
+
import xml.etree.ElementTree as ET
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
TASK_ID = "task_107"
|
| 13 |
+
TASK_ROOT = Path("/app") / TASK_ID
|
| 14 |
+
LOG_ROOT = Path("/logs/verifier")
|
| 15 |
+
LOG_ROOT.mkdir(parents=True, exist_ok=True)
|
| 16 |
+
env = os.environ.copy()
|
| 17 |
+
env.update(
|
| 18 |
+
{
|
| 19 |
+
"SCI_BENCH_TASK_ID": TASK_ID,
|
| 20 |
+
"SCI_BENCH_TASK_DIR": str(TASK_ROOT),
|
| 21 |
+
"PYTHONPATH": f"{TASK_ROOT}:{TASK_ROOT / 'source'}",
|
| 22 |
+
}
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def execute(command: list[str], cwd: Path) -> subprocess.CompletedProcess[str]:
|
| 27 |
+
return subprocess.run(
|
| 28 |
+
command,
|
| 29 |
+
cwd=cwd,
|
| 30 |
+
env=env,
|
| 31 |
+
text=True,
|
| 32 |
+
stdout=subprocess.PIPE,
|
| 33 |
+
stderr=subprocess.STDOUT,
|
| 34 |
+
check=False,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
public = execute([sys.executable, "reproduce.py"], TASK_ROOT)
|
| 39 |
+
junit = LOG_ROOT / "junit.xml"
|
| 40 |
+
# Private tests are a task-owned directory. Their filenames are intentionally
|
| 41 |
+
# unconstrained; pytest discovers every supported test module recursively.
|
| 42 |
+
private = execute(
|
| 43 |
+
[
|
| 44 |
+
sys.executable,
|
| 45 |
+
"-m",
|
| 46 |
+
"pytest",
|
| 47 |
+
"-q",
|
| 48 |
+
f"--junitxml={junit}",
|
| 49 |
+
"/tests/private_tests",
|
| 50 |
+
],
|
| 51 |
+
TASK_ROOT,
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
private_total = private_passed = private_failed = 0
|
| 55 |
+
if junit.is_file():
|
| 56 |
+
root = ET.parse(junit).getroot()
|
| 57 |
+
suites = [root] if root.tag == "testsuite" else root.findall(".//testsuite")
|
| 58 |
+
private_total = sum(int(suite.attrib.get("tests", "0")) for suite in suites)
|
| 59 |
+
private_failed = sum(
|
| 60 |
+
int(suite.attrib.get("failures", "0"))
|
| 61 |
+
+ int(suite.attrib.get("errors", "0"))
|
| 62 |
+
for suite in suites
|
| 63 |
+
)
|
| 64 |
+
private_passed = max(private_total - private_failed, 0)
|
| 65 |
+
|
| 66 |
+
reward = int(public.returncode == 0 and private.returncode == 0)
|
| 67 |
+
summary = {
|
| 68 |
+
"reward": reward,
|
| 69 |
+
"task_id": TASK_ID,
|
| 70 |
+
"public": {
|
| 71 |
+
"passed": int(public.returncode == 0),
|
| 72 |
+
"collected": 1,
|
| 73 |
+
"return_code": public.returncode,
|
| 74 |
+
},
|
| 75 |
+
"private": {
|
| 76 |
+
"passed": private_passed,
|
| 77 |
+
"collected": private_total,
|
| 78 |
+
"failed": private_failed,
|
| 79 |
+
"return_code": private.returncode,
|
| 80 |
+
},
|
| 81 |
+
}
|
| 82 |
+
(LOG_ROOT / "reward.json").write_text(json.dumps(summary, indent=2) + "\n")
|
| 83 |
+
(LOG_ROOT / "reward.txt").write_text(f"{reward:.1f}\n")
|
| 84 |
+
(LOG_ROOT / "ctrf.json").write_text(
|
| 85 |
+
json.dumps(
|
| 86 |
+
{
|
| 87 |
+
"reportFormat": "CTRF",
|
| 88 |
+
"specVersion": "0.0.0",
|
| 89 |
+
"results": {
|
| 90 |
+
"summary": {
|
| 91 |
+
"tests": private_total,
|
| 92 |
+
"passed": private_passed,
|
| 93 |
+
"failed": private_failed,
|
| 94 |
+
},
|
| 95 |
+
"tests": [],
|
| 96 |
+
},
|
| 97 |
+
},
|
| 98 |
+
indent=2,
|
| 99 |
+
)
|
| 100 |
+
+ "\n"
|
| 101 |
+
)
|
| 102 |
+
combined = (
|
| 103 |
+
"== public ==\n"
|
| 104 |
+
+ (public.stdout or "")
|
| 105 |
+
+ "\n== private ==\n"
|
| 106 |
+
+ (private.stdout or "")
|
| 107 |
+
)
|
| 108 |
+
(LOG_ROOT / "test-stdout.txt").write_text(combined)
|
| 109 |
+
(LOG_ROOT / "run.log").write_text(combined)
|
| 110 |
+
print(json.dumps(summary, sort_keys=True))
|
tasks/task_108/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-108:v0.1.1@sha256:8db765c589aa1c821ac3e5cde3dc2f13dadf41c35132bda6e7ee121254e8f73a
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-108:v0.1.1@sha256:8db765c589aa1c821ac3e5cde3dc2f13dadf41c35132bda6e7ee121254e8f73a
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_108/tests/docker-compose.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
services:
|
| 2 |
+
main:
|
| 3 |
+
volumes:
|
| 4 |
+
- type: bind
|
| 5 |
+
source: ./grader.py
|
| 6 |
+
target: /tests/grader.py
|
| 7 |
+
read_only: true
|
tasks/task_108/tests/grader.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
from __future__ import annotations
|
| 3 |
+
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
import subprocess
|
| 7 |
+
import sys
|
| 8 |
+
import xml.etree.ElementTree as ET
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
TASK_ID = "task_108"
|
| 13 |
+
TASK_ROOT = Path("/app") / TASK_ID
|
| 14 |
+
LOG_ROOT = Path("/logs/verifier")
|
| 15 |
+
LOG_ROOT.mkdir(parents=True, exist_ok=True)
|
| 16 |
+
env = os.environ.copy()
|
| 17 |
+
env.update(
|
| 18 |
+
{
|
| 19 |
+
"SCI_BENCH_TASK_ID": TASK_ID,
|
| 20 |
+
"SCI_BENCH_TASK_DIR": str(TASK_ROOT),
|
| 21 |
+
"PYTHONPATH": f"{TASK_ROOT}:{TASK_ROOT / 'source'}",
|
| 22 |
+
}
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def execute(command: list[str], cwd: Path) -> subprocess.CompletedProcess[str]:
|
| 27 |
+
return subprocess.run(
|
| 28 |
+
command,
|
| 29 |
+
cwd=cwd,
|
| 30 |
+
env=env,
|
| 31 |
+
text=True,
|
| 32 |
+
stdout=subprocess.PIPE,
|
| 33 |
+
stderr=subprocess.STDOUT,
|
| 34 |
+
check=False,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
public = execute([sys.executable, "reproduce.py"], TASK_ROOT)
|
| 39 |
+
junit = LOG_ROOT / "junit.xml"
|
| 40 |
+
# Private tests are a task-owned directory. Their filenames are intentionally
|
| 41 |
+
# unconstrained; pytest discovers every supported test module recursively.
|
| 42 |
+
private = execute(
|
| 43 |
+
[
|
| 44 |
+
sys.executable,
|
| 45 |
+
"-m",
|
| 46 |
+
"pytest",
|
| 47 |
+
"-q",
|
| 48 |
+
f"--junitxml={junit}",
|
| 49 |
+
"/tests/private_tests",
|
| 50 |
+
],
|
| 51 |
+
TASK_ROOT,
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
private_total = private_passed = private_failed = 0
|
| 55 |
+
if junit.is_file():
|
| 56 |
+
root = ET.parse(junit).getroot()
|
| 57 |
+
suites = [root] if root.tag == "testsuite" else root.findall(".//testsuite")
|
| 58 |
+
private_total = sum(int(suite.attrib.get("tests", "0")) for suite in suites)
|
| 59 |
+
private_failed = sum(
|
| 60 |
+
int(suite.attrib.get("failures", "0"))
|
| 61 |
+
+ int(suite.attrib.get("errors", "0"))
|
| 62 |
+
for suite in suites
|
| 63 |
+
)
|
| 64 |
+
private_passed = max(private_total - private_failed, 0)
|
| 65 |
+
|
| 66 |
+
reward = int(public.returncode == 0 and private.returncode == 0)
|
| 67 |
+
summary = {
|
| 68 |
+
"reward": reward,
|
| 69 |
+
"task_id": TASK_ID,
|
| 70 |
+
"public": {
|
| 71 |
+
"passed": int(public.returncode == 0),
|
| 72 |
+
"collected": 1,
|
| 73 |
+
"return_code": public.returncode,
|
| 74 |
+
},
|
| 75 |
+
"private": {
|
| 76 |
+
"passed": private_passed,
|
| 77 |
+
"collected": private_total,
|
| 78 |
+
"failed": private_failed,
|
| 79 |
+
"return_code": private.returncode,
|
| 80 |
+
},
|
| 81 |
+
}
|
| 82 |
+
(LOG_ROOT / "reward.json").write_text(json.dumps(summary, indent=2) + "\n")
|
| 83 |
+
(LOG_ROOT / "reward.txt").write_text(f"{reward:.1f}\n")
|
| 84 |
+
(LOG_ROOT / "ctrf.json").write_text(
|
| 85 |
+
json.dumps(
|
| 86 |
+
{
|
| 87 |
+
"reportFormat": "CTRF",
|
| 88 |
+
"specVersion": "0.0.0",
|
| 89 |
+
"results": {
|
| 90 |
+
"summary": {
|
| 91 |
+
"tests": private_total,
|
| 92 |
+
"passed": private_passed,
|
| 93 |
+
"failed": private_failed,
|
| 94 |
+
},
|
| 95 |
+
"tests": [],
|
| 96 |
+
},
|
| 97 |
+
},
|
| 98 |
+
indent=2,
|
| 99 |
+
)
|
| 100 |
+
+ "\n"
|
| 101 |
+
)
|
| 102 |
+
combined = (
|
| 103 |
+
"== public ==\n"
|
| 104 |
+
+ (public.stdout or "")
|
| 105 |
+
+ "\n== private ==\n"
|
| 106 |
+
+ (private.stdout or "")
|
| 107 |
+
)
|
| 108 |
+
(LOG_ROOT / "test-stdout.txt").write_text(combined)
|
| 109 |
+
(LOG_ROOT / "run.log").write_text(combined)
|
| 110 |
+
print(json.dumps(summary, sort_keys=True))
|
tasks/task_109/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-109:v0.1.1@sha256:b8c2d6a3e9d319f7cb3294afe63976c1bad693e90e7d01980eb7c0c4720cb545
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-109:v0.1.1@sha256:b8c2d6a3e9d319f7cb3294afe63976c1bad693e90e7d01980eb7c0c4720cb545
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_109/tests/docker-compose.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
services:
|
| 2 |
+
main:
|
| 3 |
+
volumes:
|
| 4 |
+
- type: bind
|
| 5 |
+
source: ./grader.py
|
| 6 |
+
target: /tests/grader.py
|
| 7 |
+
read_only: true
|
tasks/task_109/tests/grader.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
from __future__ import annotations
|
| 3 |
+
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
import subprocess
|
| 7 |
+
import sys
|
| 8 |
+
import xml.etree.ElementTree as ET
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
TASK_ID = "task_109"
|
| 13 |
+
TASK_ROOT = Path("/app") / TASK_ID
|
| 14 |
+
LOG_ROOT = Path("/logs/verifier")
|
| 15 |
+
LOG_ROOT.mkdir(parents=True, exist_ok=True)
|
| 16 |
+
env = os.environ.copy()
|
| 17 |
+
env.update(
|
| 18 |
+
{
|
| 19 |
+
"SCI_BENCH_TASK_ID": TASK_ID,
|
| 20 |
+
"SCI_BENCH_TASK_DIR": str(TASK_ROOT),
|
| 21 |
+
"PYTHONPATH": f"{TASK_ROOT}:{TASK_ROOT / 'source'}",
|
| 22 |
+
}
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def execute(command: list[str], cwd: Path) -> subprocess.CompletedProcess[str]:
|
| 27 |
+
return subprocess.run(
|
| 28 |
+
command,
|
| 29 |
+
cwd=cwd,
|
| 30 |
+
env=env,
|
| 31 |
+
text=True,
|
| 32 |
+
stdout=subprocess.PIPE,
|
| 33 |
+
stderr=subprocess.STDOUT,
|
| 34 |
+
check=False,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
public = execute([sys.executable, "reproduce.py"], TASK_ROOT)
|
| 39 |
+
junit = LOG_ROOT / "junit.xml"
|
| 40 |
+
# Private tests are a task-owned directory. Their filenames are intentionally
|
| 41 |
+
# unconstrained; pytest discovers every supported test module recursively.
|
| 42 |
+
private = execute(
|
| 43 |
+
[
|
| 44 |
+
sys.executable,
|
| 45 |
+
"-m",
|
| 46 |
+
"pytest",
|
| 47 |
+
"-q",
|
| 48 |
+
f"--junitxml={junit}",
|
| 49 |
+
"/tests/private_tests",
|
| 50 |
+
],
|
| 51 |
+
TASK_ROOT,
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
private_total = private_passed = private_failed = 0
|
| 55 |
+
if junit.is_file():
|
| 56 |
+
root = ET.parse(junit).getroot()
|
| 57 |
+
suites = [root] if root.tag == "testsuite" else root.findall(".//testsuite")
|
| 58 |
+
private_total = sum(int(suite.attrib.get("tests", "0")) for suite in suites)
|
| 59 |
+
private_failed = sum(
|
| 60 |
+
int(suite.attrib.get("failures", "0"))
|
| 61 |
+
+ int(suite.attrib.get("errors", "0"))
|
| 62 |
+
for suite in suites
|
| 63 |
+
)
|
| 64 |
+
private_passed = max(private_total - private_failed, 0)
|
| 65 |
+
|
| 66 |
+
reward = int(public.returncode == 0 and private.returncode == 0)
|
| 67 |
+
summary = {
|
| 68 |
+
"reward": reward,
|
| 69 |
+
"task_id": TASK_ID,
|
| 70 |
+
"public": {
|
| 71 |
+
"passed": int(public.returncode == 0),
|
| 72 |
+
"collected": 1,
|
| 73 |
+
"return_code": public.returncode,
|
| 74 |
+
},
|
| 75 |
+
"private": {
|
| 76 |
+
"passed": private_passed,
|
| 77 |
+
"collected": private_total,
|
| 78 |
+
"failed": private_failed,
|
| 79 |
+
"return_code": private.returncode,
|
| 80 |
+
},
|
| 81 |
+
}
|
| 82 |
+
(LOG_ROOT / "reward.json").write_text(json.dumps(summary, indent=2) + "\n")
|
| 83 |
+
(LOG_ROOT / "reward.txt").write_text(f"{reward:.1f}\n")
|
| 84 |
+
(LOG_ROOT / "ctrf.json").write_text(
|
| 85 |
+
json.dumps(
|
| 86 |
+
{
|
| 87 |
+
"reportFormat": "CTRF",
|
| 88 |
+
"specVersion": "0.0.0",
|
| 89 |
+
"results": {
|
| 90 |
+
"summary": {
|
| 91 |
+
"tests": private_total,
|
| 92 |
+
"passed": private_passed,
|
| 93 |
+
"failed": private_failed,
|
| 94 |
+
},
|
| 95 |
+
"tests": [],
|
| 96 |
+
},
|
| 97 |
+
},
|
| 98 |
+
indent=2,
|
| 99 |
+
)
|
| 100 |
+
+ "\n"
|
| 101 |
+
)
|
| 102 |
+
combined = (
|
| 103 |
+
"== public ==\n"
|
| 104 |
+
+ (public.stdout or "")
|
| 105 |
+
+ "\n== private ==\n"
|
| 106 |
+
+ (private.stdout or "")
|
| 107 |
+
)
|
| 108 |
+
(LOG_ROOT / "test-stdout.txt").write_text(combined)
|
| 109 |
+
(LOG_ROOT / "run.log").write_text(combined)
|
| 110 |
+
print(json.dumps(summary, sort_keys=True))
|
tasks/task_110/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-110:v0.1.1@sha256:c0a222690f44ab8ca6aebb45094ece6132c681a7e907f912ab730803fb3f2f34
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-110:v0.1.1@sha256:c0a222690f44ab8ca6aebb45094ece6132c681a7e907f912ab730803fb3f2f34
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_110/tests/docker-compose.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
services:
|
| 2 |
+
main:
|
| 3 |
+
volumes:
|
| 4 |
+
- type: bind
|
| 5 |
+
source: ./grader.py
|
| 6 |
+
target: /tests/grader.py
|
| 7 |
+
read_only: true
|
tasks/task_110/tests/grader.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
from __future__ import annotations
|
| 3 |
+
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
import subprocess
|
| 7 |
+
import sys
|
| 8 |
+
import xml.etree.ElementTree as ET
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
TASK_ID = "task_110"
|
| 13 |
+
TASK_ROOT = Path("/app") / TASK_ID
|
| 14 |
+
LOG_ROOT = Path("/logs/verifier")
|
| 15 |
+
LOG_ROOT.mkdir(parents=True, exist_ok=True)
|
| 16 |
+
env = os.environ.copy()
|
| 17 |
+
env.update(
|
| 18 |
+
{
|
| 19 |
+
"SCI_BENCH_TASK_ID": TASK_ID,
|
| 20 |
+
"SCI_BENCH_TASK_DIR": str(TASK_ROOT),
|
| 21 |
+
"PYTHONPATH": f"{TASK_ROOT}:{TASK_ROOT / 'source'}",
|
| 22 |
+
}
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def execute(command: list[str], cwd: Path) -> subprocess.CompletedProcess[str]:
|
| 27 |
+
return subprocess.run(
|
| 28 |
+
command,
|
| 29 |
+
cwd=cwd,
|
| 30 |
+
env=env,
|
| 31 |
+
text=True,
|
| 32 |
+
stdout=subprocess.PIPE,
|
| 33 |
+
stderr=subprocess.STDOUT,
|
| 34 |
+
check=False,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
public = execute([sys.executable, "reproduce.py"], TASK_ROOT)
|
| 39 |
+
junit = LOG_ROOT / "junit.xml"
|
| 40 |
+
# Private tests are a task-owned directory. Their filenames are intentionally
|
| 41 |
+
# unconstrained; pytest discovers every supported test module recursively.
|
| 42 |
+
private = execute(
|
| 43 |
+
[
|
| 44 |
+
sys.executable,
|
| 45 |
+
"-m",
|
| 46 |
+
"pytest",
|
| 47 |
+
"-q",
|
| 48 |
+
f"--junitxml={junit}",
|
| 49 |
+
"/tests/private_tests",
|
| 50 |
+
],
|
| 51 |
+
TASK_ROOT,
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
private_total = private_passed = private_failed = 0
|
| 55 |
+
if junit.is_file():
|
| 56 |
+
root = ET.parse(junit).getroot()
|
| 57 |
+
suites = [root] if root.tag == "testsuite" else root.findall(".//testsuite")
|
| 58 |
+
private_total = sum(int(suite.attrib.get("tests", "0")) for suite in suites)
|
| 59 |
+
private_failed = sum(
|
| 60 |
+
int(suite.attrib.get("failures", "0"))
|
| 61 |
+
+ int(suite.attrib.get("errors", "0"))
|
| 62 |
+
for suite in suites
|
| 63 |
+
)
|
| 64 |
+
private_passed = max(private_total - private_failed, 0)
|
| 65 |
+
|
| 66 |
+
reward = int(public.returncode == 0 and private.returncode == 0)
|
| 67 |
+
summary = {
|
| 68 |
+
"reward": reward,
|
| 69 |
+
"task_id": TASK_ID,
|
| 70 |
+
"public": {
|
| 71 |
+
"passed": int(public.returncode == 0),
|
| 72 |
+
"collected": 1,
|
| 73 |
+
"return_code": public.returncode,
|
| 74 |
+
},
|
| 75 |
+
"private": {
|
| 76 |
+
"passed": private_passed,
|
| 77 |
+
"collected": private_total,
|
| 78 |
+
"failed": private_failed,
|
| 79 |
+
"return_code": private.returncode,
|
| 80 |
+
},
|
| 81 |
+
}
|
| 82 |
+
(LOG_ROOT / "reward.json").write_text(json.dumps(summary, indent=2) + "\n")
|
| 83 |
+
(LOG_ROOT / "reward.txt").write_text(f"{reward:.1f}\n")
|
| 84 |
+
(LOG_ROOT / "ctrf.json").write_text(
|
| 85 |
+
json.dumps(
|
| 86 |
+
{
|
| 87 |
+
"reportFormat": "CTRF",
|
| 88 |
+
"specVersion": "0.0.0",
|
| 89 |
+
"results": {
|
| 90 |
+
"summary": {
|
| 91 |
+
"tests": private_total,
|
| 92 |
+
"passed": private_passed,
|
| 93 |
+
"failed": private_failed,
|
| 94 |
+
},
|
| 95 |
+
"tests": [],
|
| 96 |
+
},
|
| 97 |
+
},
|
| 98 |
+
indent=2,
|
| 99 |
+
)
|
| 100 |
+
+ "\n"
|
| 101 |
+
)
|
| 102 |
+
combined = (
|
| 103 |
+
"== public ==\n"
|
| 104 |
+
+ (public.stdout or "")
|
| 105 |
+
+ "\n== private ==\n"
|
| 106 |
+
+ (private.stdout or "")
|
| 107 |
+
)
|
| 108 |
+
(LOG_ROOT / "test-stdout.txt").write_text(combined)
|
| 109 |
+
(LOG_ROOT / "run.log").write_text(combined)
|
| 110 |
+
print(json.dumps(summary, sort_keys=True))
|
tasks/task_111/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-111:v0.1.1@sha256:d1f89ef44d00ba6a6d86fbd9c38160846d3925cfd06982d4d11f745c2e43d4e6
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-111:v0.1.1@sha256:d1f89ef44d00ba6a6d86fbd9c38160846d3925cfd06982d4d11f745c2e43d4e6
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_111/tests/docker-compose.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
services:
|
| 2 |
+
main:
|
| 3 |
+
volumes:
|
| 4 |
+
- type: bind
|
| 5 |
+
source: ./grader.py
|
| 6 |
+
target: /tests/grader.py
|
| 7 |
+
read_only: true
|
tasks/task_111/tests/grader.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
from __future__ import annotations
|
| 3 |
+
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
import subprocess
|
| 7 |
+
import sys
|
| 8 |
+
import xml.etree.ElementTree as ET
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
TASK_ID = "task_111"
|
| 13 |
+
TASK_ROOT = Path("/app") / TASK_ID
|
| 14 |
+
LOG_ROOT = Path("/logs/verifier")
|
| 15 |
+
LOG_ROOT.mkdir(parents=True, exist_ok=True)
|
| 16 |
+
env = os.environ.copy()
|
| 17 |
+
env.update(
|
| 18 |
+
{
|
| 19 |
+
"SCI_BENCH_TASK_ID": TASK_ID,
|
| 20 |
+
"SCI_BENCH_TASK_DIR": str(TASK_ROOT),
|
| 21 |
+
"PYTHONPATH": f"{TASK_ROOT}:{TASK_ROOT / 'source'}",
|
| 22 |
+
}
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def execute(command: list[str], cwd: Path) -> subprocess.CompletedProcess[str]:
|
| 27 |
+
return subprocess.run(
|
| 28 |
+
command,
|
| 29 |
+
cwd=cwd,
|
| 30 |
+
env=env,
|
| 31 |
+
text=True,
|
| 32 |
+
stdout=subprocess.PIPE,
|
| 33 |
+
stderr=subprocess.STDOUT,
|
| 34 |
+
check=False,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
public = execute([sys.executable, "reproduce.py"], TASK_ROOT)
|
| 39 |
+
junit = LOG_ROOT / "junit.xml"
|
| 40 |
+
# Private tests are a task-owned directory. Their filenames are intentionally
|
| 41 |
+
# unconstrained; pytest discovers every supported test module recursively.
|
| 42 |
+
private = execute(
|
| 43 |
+
[
|
| 44 |
+
sys.executable,
|
| 45 |
+
"-m",
|
| 46 |
+
"pytest",
|
| 47 |
+
"-q",
|
| 48 |
+
f"--junitxml={junit}",
|
| 49 |
+
"/tests/private_tests",
|
| 50 |
+
],
|
| 51 |
+
TASK_ROOT,
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
private_total = private_passed = private_failed = 0
|
| 55 |
+
if junit.is_file():
|
| 56 |
+
root = ET.parse(junit).getroot()
|
| 57 |
+
suites = [root] if root.tag == "testsuite" else root.findall(".//testsuite")
|
| 58 |
+
private_total = sum(int(suite.attrib.get("tests", "0")) for suite in suites)
|
| 59 |
+
private_failed = sum(
|
| 60 |
+
int(suite.attrib.get("failures", "0"))
|
| 61 |
+
+ int(suite.attrib.get("errors", "0"))
|
| 62 |
+
for suite in suites
|
| 63 |
+
)
|
| 64 |
+
private_passed = max(private_total - private_failed, 0)
|
| 65 |
+
|
| 66 |
+
reward = int(public.returncode == 0 and private.returncode == 0)
|
| 67 |
+
summary = {
|
| 68 |
+
"reward": reward,
|
| 69 |
+
"task_id": TASK_ID,
|
| 70 |
+
"public": {
|
| 71 |
+
"passed": int(public.returncode == 0),
|
| 72 |
+
"collected": 1,
|
| 73 |
+
"return_code": public.returncode,
|
| 74 |
+
},
|
| 75 |
+
"private": {
|
| 76 |
+
"passed": private_passed,
|
| 77 |
+
"collected": private_total,
|
| 78 |
+
"failed": private_failed,
|
| 79 |
+
"return_code": private.returncode,
|
| 80 |
+
},
|
| 81 |
+
}
|
| 82 |
+
(LOG_ROOT / "reward.json").write_text(json.dumps(summary, indent=2) + "\n")
|
| 83 |
+
(LOG_ROOT / "reward.txt").write_text(f"{reward:.1f}\n")
|
| 84 |
+
(LOG_ROOT / "ctrf.json").write_text(
|
| 85 |
+
json.dumps(
|
| 86 |
+
{
|
| 87 |
+
"reportFormat": "CTRF",
|
| 88 |
+
"specVersion": "0.0.0",
|
| 89 |
+
"results": {
|
| 90 |
+
"summary": {
|
| 91 |
+
"tests": private_total,
|
| 92 |
+
"passed": private_passed,
|
| 93 |
+
"failed": private_failed,
|
| 94 |
+
},
|
| 95 |
+
"tests": [],
|
| 96 |
+
},
|
| 97 |
+
},
|
| 98 |
+
indent=2,
|
| 99 |
+
)
|
| 100 |
+
+ "\n"
|
| 101 |
+
)
|
| 102 |
+
combined = (
|
| 103 |
+
"== public ==\n"
|
| 104 |
+
+ (public.stdout or "")
|
| 105 |
+
+ "\n== private ==\n"
|
| 106 |
+
+ (private.stdout or "")
|
| 107 |
+
)
|
| 108 |
+
(LOG_ROOT / "test-stdout.txt").write_text(combined)
|
| 109 |
+
(LOG_ROOT / "run.log").write_text(combined)
|
| 110 |
+
print(json.dumps(summary, sort_keys=True))
|
tasks/task_112/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-112:v0.1.1@sha256:ef1e5aac750fc5146793f1e1410b13fb6219a12acac82405f51cbb34194c4cee
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-112:v0.1.1@sha256:ef1e5aac750fc5146793f1e1410b13fb6219a12acac82405f51cbb34194c4cee
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_112/tests/docker-compose.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
services:
|
| 2 |
+
main:
|
| 3 |
+
volumes:
|
| 4 |
+
- type: bind
|
| 5 |
+
source: ./grader.py
|
| 6 |
+
target: /tests/grader.py
|
| 7 |
+
read_only: true
|
tasks/task_112/tests/grader.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
from __future__ import annotations
|
| 3 |
+
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
import subprocess
|
| 7 |
+
import sys
|
| 8 |
+
import xml.etree.ElementTree as ET
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
TASK_ID = "task_112"
|
| 13 |
+
TASK_ROOT = Path("/app") / TASK_ID
|
| 14 |
+
LOG_ROOT = Path("/logs/verifier")
|
| 15 |
+
LOG_ROOT.mkdir(parents=True, exist_ok=True)
|
| 16 |
+
env = os.environ.copy()
|
| 17 |
+
env.update(
|
| 18 |
+
{
|
| 19 |
+
"SCI_BENCH_TASK_ID": TASK_ID,
|
| 20 |
+
"SCI_BENCH_TASK_DIR": str(TASK_ROOT),
|
| 21 |
+
"PYTHONPATH": f"{TASK_ROOT}:{TASK_ROOT / 'source'}",
|
| 22 |
+
}
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def execute(command: list[str], cwd: Path) -> subprocess.CompletedProcess[str]:
|
| 27 |
+
return subprocess.run(
|
| 28 |
+
command,
|
| 29 |
+
cwd=cwd,
|
| 30 |
+
env=env,
|
| 31 |
+
text=True,
|
| 32 |
+
stdout=subprocess.PIPE,
|
| 33 |
+
stderr=subprocess.STDOUT,
|
| 34 |
+
check=False,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
public = execute([sys.executable, "reproduce.py"], TASK_ROOT)
|
| 39 |
+
junit = LOG_ROOT / "junit.xml"
|
| 40 |
+
# Private tests are a task-owned directory. Their filenames are intentionally
|
| 41 |
+
# unconstrained; pytest discovers every supported test module recursively.
|
| 42 |
+
private = execute(
|
| 43 |
+
[
|
| 44 |
+
sys.executable,
|
| 45 |
+
"-m",
|
| 46 |
+
"pytest",
|
| 47 |
+
"-q",
|
| 48 |
+
f"--junitxml={junit}",
|
| 49 |
+
"/tests/private_tests",
|
| 50 |
+
],
|
| 51 |
+
TASK_ROOT,
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
private_total = private_passed = private_failed = 0
|
| 55 |
+
if junit.is_file():
|
| 56 |
+
root = ET.parse(junit).getroot()
|
| 57 |
+
suites = [root] if root.tag == "testsuite" else root.findall(".//testsuite")
|
| 58 |
+
private_total = sum(int(suite.attrib.get("tests", "0")) for suite in suites)
|
| 59 |
+
private_failed = sum(
|
| 60 |
+
int(suite.attrib.get("failures", "0"))
|
| 61 |
+
+ int(suite.attrib.get("errors", "0"))
|
| 62 |
+
for suite in suites
|
| 63 |
+
)
|
| 64 |
+
private_passed = max(private_total - private_failed, 0)
|
| 65 |
+
|
| 66 |
+
reward = int(public.returncode == 0 and private.returncode == 0)
|
| 67 |
+
summary = {
|
| 68 |
+
"reward": reward,
|
| 69 |
+
"task_id": TASK_ID,
|
| 70 |
+
"public": {
|
| 71 |
+
"passed": int(public.returncode == 0),
|
| 72 |
+
"collected": 1,
|
| 73 |
+
"return_code": public.returncode,
|
| 74 |
+
},
|
| 75 |
+
"private": {
|
| 76 |
+
"passed": private_passed,
|
| 77 |
+
"collected": private_total,
|
| 78 |
+
"failed": private_failed,
|
| 79 |
+
"return_code": private.returncode,
|
| 80 |
+
},
|
| 81 |
+
}
|
| 82 |
+
(LOG_ROOT / "reward.json").write_text(json.dumps(summary, indent=2) + "\n")
|
| 83 |
+
(LOG_ROOT / "reward.txt").write_text(f"{reward:.1f}\n")
|
| 84 |
+
(LOG_ROOT / "ctrf.json").write_text(
|
| 85 |
+
json.dumps(
|
| 86 |
+
{
|
| 87 |
+
"reportFormat": "CTRF",
|
| 88 |
+
"specVersion": "0.0.0",
|
| 89 |
+
"results": {
|
| 90 |
+
"summary": {
|
| 91 |
+
"tests": private_total,
|
| 92 |
+
"passed": private_passed,
|
| 93 |
+
"failed": private_failed,
|
| 94 |
+
},
|
| 95 |
+
"tests": [],
|
| 96 |
+
},
|
| 97 |
+
},
|
| 98 |
+
indent=2,
|
| 99 |
+
)
|
| 100 |
+
+ "\n"
|
| 101 |
+
)
|
| 102 |
+
combined = (
|
| 103 |
+
"== public ==\n"
|
| 104 |
+
+ (public.stdout or "")
|
| 105 |
+
+ "\n== private ==\n"
|
| 106 |
+
+ (private.stdout or "")
|
| 107 |
+
)
|
| 108 |
+
(LOG_ROOT / "test-stdout.txt").write_text(combined)
|
| 109 |
+
(LOG_ROOT / "run.log").write_text(combined)
|
| 110 |
+
print(json.dumps(summary, sort_keys=True))
|
tasks/task_113/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-113:v0.1.1@sha256:5ace611a3ae59ae06d6bb2a4b4de17b1c38f57bf50a1f5096e8c6947dce5d758
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-113:v0.1.1@sha256:5ace611a3ae59ae06d6bb2a4b4de17b1c38f57bf50a1f5096e8c6947dce5d758
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_113/tests/docker-compose.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
services:
|
| 2 |
+
main:
|
| 3 |
+
volumes:
|
| 4 |
+
- type: bind
|
| 5 |
+
source: ./grader.py
|
| 6 |
+
target: /tests/grader.py
|
| 7 |
+
read_only: true
|
tasks/task_113/tests/grader.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
from __future__ import annotations
|
| 3 |
+
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
import subprocess
|
| 7 |
+
import sys
|
| 8 |
+
import xml.etree.ElementTree as ET
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
TASK_ID = "task_113"
|
| 13 |
+
TASK_ROOT = Path("/app") / TASK_ID
|
| 14 |
+
LOG_ROOT = Path("/logs/verifier")
|
| 15 |
+
LOG_ROOT.mkdir(parents=True, exist_ok=True)
|
| 16 |
+
env = os.environ.copy()
|
| 17 |
+
env.update(
|
| 18 |
+
{
|
| 19 |
+
"SCI_BENCH_TASK_ID": TASK_ID,
|
| 20 |
+
"SCI_BENCH_TASK_DIR": str(TASK_ROOT),
|
| 21 |
+
"PYTHONPATH": f"{TASK_ROOT}:{TASK_ROOT / 'source'}",
|
| 22 |
+
}
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def execute(command: list[str], cwd: Path) -> subprocess.CompletedProcess[str]:
|
| 27 |
+
return subprocess.run(
|
| 28 |
+
command,
|
| 29 |
+
cwd=cwd,
|
| 30 |
+
env=env,
|
| 31 |
+
text=True,
|
| 32 |
+
stdout=subprocess.PIPE,
|
| 33 |
+
stderr=subprocess.STDOUT,
|
| 34 |
+
check=False,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
public = execute([sys.executable, "reproduce.py"], TASK_ROOT)
|
| 39 |
+
junit = LOG_ROOT / "junit.xml"
|
| 40 |
+
# Private tests are a task-owned directory. Their filenames are intentionally
|
| 41 |
+
# unconstrained; pytest discovers every supported test module recursively.
|
| 42 |
+
private = execute(
|
| 43 |
+
[
|
| 44 |
+
sys.executable,
|
| 45 |
+
"-m",
|
| 46 |
+
"pytest",
|
| 47 |
+
"-q",
|
| 48 |
+
f"--junitxml={junit}",
|
| 49 |
+
"/tests/private_tests",
|
| 50 |
+
],
|
| 51 |
+
TASK_ROOT,
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
private_total = private_passed = private_failed = 0
|
| 55 |
+
if junit.is_file():
|
| 56 |
+
root = ET.parse(junit).getroot()
|
| 57 |
+
suites = [root] if root.tag == "testsuite" else root.findall(".//testsuite")
|
| 58 |
+
private_total = sum(int(suite.attrib.get("tests", "0")) for suite in suites)
|
| 59 |
+
private_failed = sum(
|
| 60 |
+
int(suite.attrib.get("failures", "0"))
|
| 61 |
+
+ int(suite.attrib.get("errors", "0"))
|
| 62 |
+
for suite in suites
|
| 63 |
+
)
|
| 64 |
+
private_passed = max(private_total - private_failed, 0)
|
| 65 |
+
|
| 66 |
+
reward = int(public.returncode == 0 and private.returncode == 0)
|
| 67 |
+
summary = {
|
| 68 |
+
"reward": reward,
|
| 69 |
+
"task_id": TASK_ID,
|
| 70 |
+
"public": {
|
| 71 |
+
"passed": int(public.returncode == 0),
|
| 72 |
+
"collected": 1,
|
| 73 |
+
"return_code": public.returncode,
|
| 74 |
+
},
|
| 75 |
+
"private": {
|
| 76 |
+
"passed": private_passed,
|
| 77 |
+
"collected": private_total,
|
| 78 |
+
"failed": private_failed,
|
| 79 |
+
"return_code": private.returncode,
|
| 80 |
+
},
|
| 81 |
+
}
|
| 82 |
+
(LOG_ROOT / "reward.json").write_text(json.dumps(summary, indent=2) + "\n")
|
| 83 |
+
(LOG_ROOT / "reward.txt").write_text(f"{reward:.1f}\n")
|
| 84 |
+
(LOG_ROOT / "ctrf.json").write_text(
|
| 85 |
+
json.dumps(
|
| 86 |
+
{
|
| 87 |
+
"reportFormat": "CTRF",
|
| 88 |
+
"specVersion": "0.0.0",
|
| 89 |
+
"results": {
|
| 90 |
+
"summary": {
|
| 91 |
+
"tests": private_total,
|
| 92 |
+
"passed": private_passed,
|
| 93 |
+
"failed": private_failed,
|
| 94 |
+
},
|
| 95 |
+
"tests": [],
|
| 96 |
+
},
|
| 97 |
+
},
|
| 98 |
+
indent=2,
|
| 99 |
+
)
|
| 100 |
+
+ "\n"
|
| 101 |
+
)
|
| 102 |
+
combined = (
|
| 103 |
+
"== public ==\n"
|
| 104 |
+
+ (public.stdout or "")
|
| 105 |
+
+ "\n== private ==\n"
|
| 106 |
+
+ (private.stdout or "")
|
| 107 |
+
)
|
| 108 |
+
(LOG_ROOT / "test-stdout.txt").write_text(combined)
|
| 109 |
+
(LOG_ROOT / "run.log").write_text(combined)
|
| 110 |
+
print(json.dumps(summary, sort_keys=True))
|
tasks/task_114/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-114:v0.1.1@sha256:61dde7a057773f55e54e42b3806cbfa9f958e12bd722fd4b267e630c84e7e6fa
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-114:v0.1.1@sha256:61dde7a057773f55e54e42b3806cbfa9f958e12bd722fd4b267e630c84e7e6fa
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_114/tests/docker-compose.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
services:
|
| 2 |
+
main:
|
| 3 |
+
volumes:
|
| 4 |
+
- type: bind
|
| 5 |
+
source: ./grader.py
|
| 6 |
+
target: /tests/grader.py
|
| 7 |
+
read_only: true
|
tasks/task_114/tests/grader.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
from __future__ import annotations
|
| 3 |
+
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
import subprocess
|
| 7 |
+
import sys
|
| 8 |
+
import xml.etree.ElementTree as ET
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
TASK_ID = "task_114"
|
| 13 |
+
TASK_ROOT = Path("/app") / TASK_ID
|
| 14 |
+
LOG_ROOT = Path("/logs/verifier")
|
| 15 |
+
LOG_ROOT.mkdir(parents=True, exist_ok=True)
|
| 16 |
+
env = os.environ.copy()
|
| 17 |
+
env.update(
|
| 18 |
+
{
|
| 19 |
+
"SCI_BENCH_TASK_ID": TASK_ID,
|
| 20 |
+
"SCI_BENCH_TASK_DIR": str(TASK_ROOT),
|
| 21 |
+
"PYTHONPATH": f"{TASK_ROOT}:{TASK_ROOT / 'source'}",
|
| 22 |
+
}
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def execute(command: list[str], cwd: Path) -> subprocess.CompletedProcess[str]:
|
| 27 |
+
return subprocess.run(
|
| 28 |
+
command,
|
| 29 |
+
cwd=cwd,
|
| 30 |
+
env=env,
|
| 31 |
+
text=True,
|
| 32 |
+
stdout=subprocess.PIPE,
|
| 33 |
+
stderr=subprocess.STDOUT,
|
| 34 |
+
check=False,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
public = execute([sys.executable, "reproduce.py"], TASK_ROOT)
|
| 39 |
+
junit = LOG_ROOT / "junit.xml"
|
| 40 |
+
# Private tests are a task-owned directory. Their filenames are intentionally
|
| 41 |
+
# unconstrained; pytest discovers every supported test module recursively.
|
| 42 |
+
private = execute(
|
| 43 |
+
[
|
| 44 |
+
sys.executable,
|
| 45 |
+
"-m",
|
| 46 |
+
"pytest",
|
| 47 |
+
"-q",
|
| 48 |
+
f"--junitxml={junit}",
|
| 49 |
+
"/tests/private_tests",
|
| 50 |
+
],
|
| 51 |
+
TASK_ROOT,
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
private_total = private_passed = private_failed = 0
|
| 55 |
+
if junit.is_file():
|
| 56 |
+
root = ET.parse(junit).getroot()
|
| 57 |
+
suites = [root] if root.tag == "testsuite" else root.findall(".//testsuite")
|
| 58 |
+
private_total = sum(int(suite.attrib.get("tests", "0")) for suite in suites)
|
| 59 |
+
private_failed = sum(
|
| 60 |
+
int(suite.attrib.get("failures", "0"))
|
| 61 |
+
+ int(suite.attrib.get("errors", "0"))
|
| 62 |
+
for suite in suites
|
| 63 |
+
)
|
| 64 |
+
private_passed = max(private_total - private_failed, 0)
|
| 65 |
+
|
| 66 |
+
reward = int(public.returncode == 0 and private.returncode == 0)
|
| 67 |
+
summary = {
|
| 68 |
+
"reward": reward,
|
| 69 |
+
"task_id": TASK_ID,
|
| 70 |
+
"public": {
|
| 71 |
+
"passed": int(public.returncode == 0),
|
| 72 |
+
"collected": 1,
|
| 73 |
+
"return_code": public.returncode,
|
| 74 |
+
},
|
| 75 |
+
"private": {
|
| 76 |
+
"passed": private_passed,
|
| 77 |
+
"collected": private_total,
|
| 78 |
+
"failed": private_failed,
|
| 79 |
+
"return_code": private.returncode,
|
| 80 |
+
},
|
| 81 |
+
}
|
| 82 |
+
(LOG_ROOT / "reward.json").write_text(json.dumps(summary, indent=2) + "\n")
|
| 83 |
+
(LOG_ROOT / "reward.txt").write_text(f"{reward:.1f}\n")
|
| 84 |
+
(LOG_ROOT / "ctrf.json").write_text(
|
| 85 |
+
json.dumps(
|
| 86 |
+
{
|
| 87 |
+
"reportFormat": "CTRF",
|
| 88 |
+
"specVersion": "0.0.0",
|
| 89 |
+
"results": {
|
| 90 |
+
"summary": {
|
| 91 |
+
"tests": private_total,
|
| 92 |
+
"passed": private_passed,
|
| 93 |
+
"failed": private_failed,
|
| 94 |
+
},
|
| 95 |
+
"tests": [],
|
| 96 |
+
},
|
| 97 |
+
},
|
| 98 |
+
indent=2,
|
| 99 |
+
)
|
| 100 |
+
+ "\n"
|
| 101 |
+
)
|
| 102 |
+
combined = (
|
| 103 |
+
"== public ==\n"
|
| 104 |
+
+ (public.stdout or "")
|
| 105 |
+
+ "\n== private ==\n"
|
| 106 |
+
+ (private.stdout or "")
|
| 107 |
+
)
|
| 108 |
+
(LOG_ROOT / "test-stdout.txt").write_text(combined)
|
| 109 |
+
(LOG_ROOT / "run.log").write_text(combined)
|
| 110 |
+
print(json.dumps(summary, sort_keys=True))
|
tasks/task_115/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-115:v0.1.1@sha256:1b16ce929f12ec92e01fef2775b3ab0d9d96346c3b1a8362ab9559fecc4871f0
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-115:v0.1.1@sha256:1b16ce929f12ec92e01fef2775b3ab0d9d96346c3b1a8362ab9559fecc4871f0
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|