Discover private tests by directory (part 4)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- tasks/task_073/tests/Dockerfile +3 -0
- tasks/task_073/tests/docker-compose.yaml +7 -0
- tasks/task_073/tests/grader.py +110 -0
- tasks/task_074/tests/Dockerfile +3 -0
- tasks/task_074/tests/docker-compose.yaml +7 -0
- tasks/task_074/tests/grader.py +110 -0
- tasks/task_075/tests/Dockerfile +3 -0
- tasks/task_075/tests/docker-compose.yaml +7 -0
- tasks/task_075/tests/grader.py +110 -0
- tasks/task_076/tests/Dockerfile +3 -0
- tasks/task_076/tests/docker-compose.yaml +7 -0
- tasks/task_076/tests/grader.py +110 -0
- tasks/task_077/tests/Dockerfile +3 -0
- tasks/task_077/tests/docker-compose.yaml +7 -0
- tasks/task_077/tests/grader.py +110 -0
- tasks/task_078/tests/Dockerfile +3 -0
- tasks/task_078/tests/docker-compose.yaml +7 -0
- tasks/task_078/tests/grader.py +110 -0
- tasks/task_079/tests/Dockerfile +3 -0
- tasks/task_079/tests/docker-compose.yaml +7 -0
- tasks/task_079/tests/grader.py +110 -0
- tasks/task_080/tests/Dockerfile +3 -0
- tasks/task_080/tests/docker-compose.yaml +7 -0
- tasks/task_080/tests/grader.py +110 -0
- tasks/task_081/tests/Dockerfile +3 -0
- tasks/task_081/tests/docker-compose.yaml +7 -0
- tasks/task_081/tests/grader.py +110 -0
- tasks/task_082/tests/Dockerfile +3 -0
- tasks/task_082/tests/docker-compose.yaml +7 -0
- tasks/task_082/tests/grader.py +110 -0
- tasks/task_083/tests/Dockerfile +3 -0
- tasks/task_083/tests/docker-compose.yaml +7 -0
- tasks/task_083/tests/grader.py +110 -0
- tasks/task_084/tests/Dockerfile +3 -0
- tasks/task_084/tests/docker-compose.yaml +7 -0
- tasks/task_084/tests/grader.py +110 -0
- tasks/task_085/tests/Dockerfile +3 -0
- tasks/task_085/tests/docker-compose.yaml +7 -0
- tasks/task_085/tests/grader.py +110 -0
- tasks/task_086/tests/Dockerfile +3 -0
- tasks/task_086/tests/docker-compose.yaml +7 -0
- tasks/task_086/tests/grader.py +110 -0
- tasks/task_087/tests/Dockerfile +3 -0
- tasks/task_087/tests/docker-compose.yaml +7 -0
- tasks/task_087/tests/grader.py +110 -0
- tasks/task_088/tests/Dockerfile +3 -0
- tasks/task_088/tests/docker-compose.yaml +7 -0
- tasks/task_088/tests/grader.py +110 -0
- tasks/task_089/tests/Dockerfile +3 -0
- tasks/task_089/tests/docker-compose.yaml +7 -0
tasks/task_073/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-073:v0.1.0@sha256:6041a2f1f781e1e02e908984c07c6de7a1e2edd67a3ce90529522ebc2e72aee8
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-073:v0.1.0@sha256:6041a2f1f781e1e02e908984c07c6de7a1e2edd67a3ce90529522ebc2e72aee8
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_073/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_073/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_073"
|
| 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_074/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-074:v0.1.0@sha256:874067a5199b4db19f575c074b7cd51c1eddf03f7aa13c97810ea2873c917d86
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-074:v0.1.0@sha256:874067a5199b4db19f575c074b7cd51c1eddf03f7aa13c97810ea2873c917d86
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_074/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_074/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_074"
|
| 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_075/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-c-task-075:v0.1.0@sha256:c50d05f06eee0035eb02e057017cbdbfae6a9855a900ac819bb90b937285a022
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-c-task-075:v0.1.0@sha256:c50d05f06eee0035eb02e057017cbdbfae6a9855a900ac819bb90b937285a022
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_075/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_075/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_075"
|
| 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_076/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-076:v0.1.0@sha256:c40da6ce2cafe0194e2d74ca0380587b696890713c163a17624a855c86247404
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-076:v0.1.0@sha256:c40da6ce2cafe0194e2d74ca0380587b696890713c163a17624a855c86247404
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_076/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_076/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_076"
|
| 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_077/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-077:v0.1.0@sha256:f9f3eb576dd41c94b0407e0a0395e1df75d6cad627be53a028bc995d4f66e633
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-077:v0.1.0@sha256:f9f3eb576dd41c94b0407e0a0395e1df75d6cad627be53a028bc995d4f66e633
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_077/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_077/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_077"
|
| 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_078/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-078:v0.1.0@sha256:9a64793e10d20c2c0b719ae87a72d795435b24f5efb8577071b693ec88b6f882
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-078:v0.1.0@sha256:9a64793e10d20c2c0b719ae87a72d795435b24f5efb8577071b693ec88b6f882
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_078/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_078/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_078"
|
| 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_079/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-079:v0.1.0@sha256:243dfa0eb24b77c5c08a9141b632177711d7f438177f0f737c0c2d453c14f7f4
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-079:v0.1.0@sha256:243dfa0eb24b77c5c08a9141b632177711d7f438177f0f737c0c2d453c14f7f4
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_079/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_079/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_079"
|
| 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_080/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-080:v0.1.0@sha256:0bd2b80b544ce97b0ecbab0c397a5d68014ee7cb2c3133be648db3d3ca0045ed
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-080:v0.1.0@sha256:0bd2b80b544ce97b0ecbab0c397a5d68014ee7cb2c3133be648db3d3ca0045ed
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_080/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_080/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_080"
|
| 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_081/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-081:v0.1.0@sha256:3a3f4428f0129a1302f743125649b4bea7445e57912bdd734ad3452389003efa
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-081:v0.1.0@sha256:3a3f4428f0129a1302f743125649b4bea7445e57912bdd734ad3452389003efa
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_081/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_081/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_081"
|
| 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_082/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-082:v0.1.0@sha256:a829af72c8e716a904d83a590a865d07a7b9a31a8d4b7083afbf90b6611a937c
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-082:v0.1.0@sha256:a829af72c8e716a904d83a590a865d07a7b9a31a8d4b7083afbf90b6611a937c
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_082/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_082/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_082"
|
| 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_083/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-083:v0.1.0@sha256:a1c0f1dabd6d4c334c815cb398eda399fbb8b7739b7b5ec60ea8abb1882b7727
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-083:v0.1.0@sha256:a1c0f1dabd6d4c334c815cb398eda399fbb8b7739b7b5ec60ea8abb1882b7727
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_083/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_083/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_083"
|
| 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_084/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-084:v0.1.0@sha256:8cbe4554c727f25c1584f79c48f574a3d08e1fcf6d3c4cb32df36a7d8482216a
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-084:v0.1.0@sha256:8cbe4554c727f25c1584f79c48f574a3d08e1fcf6d3c4cb32df36a7d8482216a
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_084/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_084/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_084"
|
| 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_085/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-fortran-task-085:v0.1.0@sha256:e68ac55c7cfb257756103351c305b97789d72f1e79203305d2aa7fa39e657eb1
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-fortran-task-085:v0.1.0@sha256:e68ac55c7cfb257756103351c305b97789d72f1e79203305d2aa7fa39e657eb1
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_085/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_085/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_085"
|
| 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_086/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-086:v0.1.0@sha256:fb47312ac7443db59115807334c5d2345e3a2fb7a8f83d89bc8bfb48f7ce4bac
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-086:v0.1.0@sha256:fb47312ac7443db59115807334c5d2345e3a2fb7a8f83d89bc8bfb48f7ce4bac
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_086/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_086/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_086"
|
| 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_087/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-087:v0.1.0@sha256:b1ce39c75913bccef5f09acfd2b989857c071fc64c7fdc0dbff092e14dc5270f
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-087:v0.1.0@sha256:b1ce39c75913bccef5f09acfd2b989857c071fc64c7fdc0dbff092e14dc5270f
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_087/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_087/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_087"
|
| 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_088/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-088:v0.1.0@sha256:9f8a00b079fb998f0672f57af8f75628dabc8582122a294f2b20cd304503ac6e
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-088:v0.1.0@sha256:9f8a00b079fb998f0672f57af8f75628dabc8582122a294f2b20cd304503ac6e
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_088/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_088/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_088"
|
| 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_089/tests/Dockerfile
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-089:v0.1.0@sha256:66ee7d7df906e3cad4e9d27664f1c6ea9bd6673ef36d5ddd61f5aaa75c88db60
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-089:v0.1.0@sha256:66ee7d7df906e3cad4e9d27664f1c6ea9bd6673ef36d5ddd61f5aaa75c88db60
|
| 2 |
FROM ${VERIFIER_IMAGE}
|
| 3 |
+
|
| 4 |
+
COPY grader.py /tests/grader.py
|
| 5 |
+
RUN chmod 755 /tests/grader.py
|
tasks/task_089/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
|