Kevin589981 commited on
Commit
154594a
·
verified ·
1 Parent(s): 57c8796

Discover private tests by directory (part 2)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. tasks/task_027/tests/Dockerfile +3 -0
  2. tasks/task_027/tests/docker-compose.yaml +7 -0
  3. tasks/task_027/tests/grader.py +110 -0
  4. tasks/task_028/tests/Dockerfile +3 -0
  5. tasks/task_028/tests/docker-compose.yaml +7 -0
  6. tasks/task_028/tests/grader.py +110 -0
  7. tasks/task_029/tests/Dockerfile +3 -0
  8. tasks/task_029/tests/docker-compose.yaml +7 -0
  9. tasks/task_029/tests/grader.py +110 -0
  10. tasks/task_030/tests/Dockerfile +3 -0
  11. tasks/task_030/tests/docker-compose.yaml +7 -0
  12. tasks/task_030/tests/grader.py +110 -0
  13. tasks/task_031/tests/Dockerfile +3 -0
  14. tasks/task_031/tests/docker-compose.yaml +7 -0
  15. tasks/task_031/tests/grader.py +110 -0
  16. tasks/task_032/tests/Dockerfile +3 -0
  17. tasks/task_032/tests/docker-compose.yaml +7 -0
  18. tasks/task_032/tests/grader.py +110 -0
  19. tasks/task_033/tests/Dockerfile +3 -0
  20. tasks/task_033/tests/docker-compose.yaml +7 -0
  21. tasks/task_033/tests/grader.py +110 -0
  22. tasks/task_034/tests/Dockerfile +3 -0
  23. tasks/task_034/tests/docker-compose.yaml +7 -0
  24. tasks/task_034/tests/grader.py +110 -0
  25. tasks/task_035/tests/Dockerfile +3 -0
  26. tasks/task_035/tests/docker-compose.yaml +7 -0
  27. tasks/task_035/tests/grader.py +110 -0
  28. tasks/task_036/tests/Dockerfile +3 -0
  29. tasks/task_036/tests/docker-compose.yaml +7 -0
  30. tasks/task_036/tests/grader.py +110 -0
  31. tasks/task_037/tests/Dockerfile +3 -0
  32. tasks/task_037/tests/docker-compose.yaml +7 -0
  33. tasks/task_037/tests/grader.py +110 -0
  34. tasks/task_038/tests/Dockerfile +3 -0
  35. tasks/task_038/tests/docker-compose.yaml +7 -0
  36. tasks/task_038/tests/grader.py +110 -0
  37. tasks/task_039/tests/Dockerfile +3 -0
  38. tasks/task_039/tests/docker-compose.yaml +7 -0
  39. tasks/task_039/tests/grader.py +110 -0
  40. tasks/task_040/tests/Dockerfile +3 -0
  41. tasks/task_040/tests/docker-compose.yaml +7 -0
  42. tasks/task_040/tests/grader.py +110 -0
  43. tasks/task_041/tests/Dockerfile +3 -0
  44. tasks/task_041/tests/docker-compose.yaml +7 -0
  45. tasks/task_041/tests/grader.py +110 -0
  46. tasks/task_042/tests/Dockerfile +3 -0
  47. tasks/task_042/tests/docker-compose.yaml +7 -0
  48. tasks/task_042/tests/grader.py +110 -0
  49. tasks/task_043/tests/Dockerfile +3 -0
  50. tasks/task_043/tests/docker-compose.yaml +7 -0
tasks/task_027/tests/Dockerfile CHANGED
@@ -1,2 +1,5 @@
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-027:v0.1.1@sha256:7553e8b9d60ddba9b86ee74d4f200929dfaed195b79a7e29efa3713f93e5a656
2
  FROM ${VERIFIER_IMAGE}
 
 
 
 
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-027:v0.1.1@sha256:7553e8b9d60ddba9b86ee74d4f200929dfaed195b79a7e29efa3713f93e5a656
2
  FROM ${VERIFIER_IMAGE}
3
+
4
+ COPY grader.py /tests/grader.py
5
+ RUN chmod 755 /tests/grader.py
tasks/task_027/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_027/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_027"
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_028/tests/Dockerfile CHANGED
@@ -1,2 +1,5 @@
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-028:v0.1.1@sha256:4c4ec965b94251ab9b163fe1294a4e863dc5a2b0a005dabb51dbaa5a5d6c95fe
2
  FROM ${VERIFIER_IMAGE}
 
 
 
 
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-028:v0.1.1@sha256:4c4ec965b94251ab9b163fe1294a4e863dc5a2b0a005dabb51dbaa5a5d6c95fe
2
  FROM ${VERIFIER_IMAGE}
3
+
4
+ COPY grader.py /tests/grader.py
5
+ RUN chmod 755 /tests/grader.py
tasks/task_028/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_028/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_028"
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_029/tests/Dockerfile CHANGED
@@ -1,2 +1,5 @@
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-029:v0.1.1@sha256:bf60c02145e60447a42aa0e8205c11851bafae01fb38da1969c8ca9697ab119f
2
  FROM ${VERIFIER_IMAGE}
 
 
 
 
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-029:v0.1.1@sha256:bf60c02145e60447a42aa0e8205c11851bafae01fb38da1969c8ca9697ab119f
2
  FROM ${VERIFIER_IMAGE}
3
+
4
+ COPY grader.py /tests/grader.py
5
+ RUN chmod 755 /tests/grader.py
tasks/task_029/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_029/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_029"
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_030/tests/Dockerfile CHANGED
@@ -1,2 +1,5 @@
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-030:v0.1.1@sha256:a7a1ebc4f0d09c76072fd97d407d581348c92def2eb9cf4414cbca7a2d2175de
2
  FROM ${VERIFIER_IMAGE}
 
 
 
 
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-030:v0.1.1@sha256:a7a1ebc4f0d09c76072fd97d407d581348c92def2eb9cf4414cbca7a2d2175de
2
  FROM ${VERIFIER_IMAGE}
3
+
4
+ COPY grader.py /tests/grader.py
5
+ RUN chmod 755 /tests/grader.py
tasks/task_030/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_030/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_030"
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_031/tests/Dockerfile CHANGED
@@ -1,2 +1,5 @@
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-031:v0.1.1@sha256:76dd16524e2f8d46d8a4dc15f04b0c00d856be316fe9480271332ae20cac59f6
2
  FROM ${VERIFIER_IMAGE}
 
 
 
 
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-031:v0.1.1@sha256:76dd16524e2f8d46d8a4dc15f04b0c00d856be316fe9480271332ae20cac59f6
2
  FROM ${VERIFIER_IMAGE}
3
+
4
+ COPY grader.py /tests/grader.py
5
+ RUN chmod 755 /tests/grader.py
tasks/task_031/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_031/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_031"
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_032/tests/Dockerfile CHANGED
@@ -1,2 +1,5 @@
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-032:v0.1.1@sha256:c75faed022ffcf7321fcfc415227da35e38287acd1304c3cdf6fa487f6b8c2dd
2
  FROM ${VERIFIER_IMAGE}
 
 
 
 
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-032:v0.1.1@sha256:c75faed022ffcf7321fcfc415227da35e38287acd1304c3cdf6fa487f6b8c2dd
2
  FROM ${VERIFIER_IMAGE}
3
+
4
+ COPY grader.py /tests/grader.py
5
+ RUN chmod 755 /tests/grader.py
tasks/task_032/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_032/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_032"
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_033/tests/Dockerfile CHANGED
@@ -1,2 +1,5 @@
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-033:v0.1.1@sha256:6dc7b560ea513f6160f7c57f10d097acc966df297e37e71f466e132810369295
2
  FROM ${VERIFIER_IMAGE}
 
 
 
 
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-033:v0.1.1@sha256:6dc7b560ea513f6160f7c57f10d097acc966df297e37e71f466e132810369295
2
  FROM ${VERIFIER_IMAGE}
3
+
4
+ COPY grader.py /tests/grader.py
5
+ RUN chmod 755 /tests/grader.py
tasks/task_033/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_033/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_033"
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_034/tests/Dockerfile CHANGED
@@ -1,2 +1,5 @@
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-034:v0.1.1@sha256:05bcfc247e7ddf648bb2c176a6a51e0044fe3e262fb1520291c13384074fdaa7
2
  FROM ${VERIFIER_IMAGE}
 
 
 
 
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-034:v0.1.1@sha256:05bcfc247e7ddf648bb2c176a6a51e0044fe3e262fb1520291c13384074fdaa7
2
  FROM ${VERIFIER_IMAGE}
3
+
4
+ COPY grader.py /tests/grader.py
5
+ RUN chmod 755 /tests/grader.py
tasks/task_034/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_034/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_034"
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_035/tests/Dockerfile CHANGED
@@ -1,2 +1,5 @@
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-035:v0.1.1@sha256:3f5829a8aac0f18cc8716f569d96154613a115e082be984153eedf0e81afdc8a
2
  FROM ${VERIFIER_IMAGE}
 
 
 
 
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-035:v0.1.1@sha256:3f5829a8aac0f18cc8716f569d96154613a115e082be984153eedf0e81afdc8a
2
  FROM ${VERIFIER_IMAGE}
3
+
4
+ COPY grader.py /tests/grader.py
5
+ RUN chmod 755 /tests/grader.py
tasks/task_035/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_035/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_035"
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_036/tests/Dockerfile CHANGED
@@ -1,2 +1,5 @@
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-036:v0.1.1@sha256:97009f66b48e65e82d8e706d3e07eadded40d4918020554f7a9886708786dd69
2
  FROM ${VERIFIER_IMAGE}
 
 
 
 
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-036:v0.1.1@sha256:97009f66b48e65e82d8e706d3e07eadded40d4918020554f7a9886708786dd69
2
  FROM ${VERIFIER_IMAGE}
3
+
4
+ COPY grader.py /tests/grader.py
5
+ RUN chmod 755 /tests/grader.py
tasks/task_036/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_036/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_036"
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_037/tests/Dockerfile CHANGED
@@ -1,2 +1,5 @@
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-037:v0.1.1@sha256:c796741230bb4ab445d45895f095d69787bd4539b73918856d1ad79488bac7e3
2
  FROM ${VERIFIER_IMAGE}
 
 
 
 
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-037:v0.1.1@sha256:c796741230bb4ab445d45895f095d69787bd4539b73918856d1ad79488bac7e3
2
  FROM ${VERIFIER_IMAGE}
3
+
4
+ COPY grader.py /tests/grader.py
5
+ RUN chmod 755 /tests/grader.py
tasks/task_037/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_037/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_037"
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_038/tests/Dockerfile CHANGED
@@ -1,2 +1,5 @@
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-c-task-038:v0.1.1@sha256:4bb7c29ed433773c37de68bad0e425e75710b6709e0beec1b63f0f3691539643
2
  FROM ${VERIFIER_IMAGE}
 
 
 
 
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-c-task-038:v0.1.1@sha256:4bb7c29ed433773c37de68bad0e425e75710b6709e0beec1b63f0f3691539643
2
  FROM ${VERIFIER_IMAGE}
3
+
4
+ COPY grader.py /tests/grader.py
5
+ RUN chmod 755 /tests/grader.py
tasks/task_038/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_038/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_038"
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_039/tests/Dockerfile CHANGED
@@ -1,2 +1,5 @@
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-039:v0.1.1@sha256:1533cb3577d15acdc7fd3b1f755f8c4ec80fbb528b7bcb6bcf918c6559f20e4a
2
  FROM ${VERIFIER_IMAGE}
 
 
 
 
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-039:v0.1.1@sha256:1533cb3577d15acdc7fd3b1f755f8c4ec80fbb528b7bcb6bcf918c6559f20e4a
2
  FROM ${VERIFIER_IMAGE}
3
+
4
+ COPY grader.py /tests/grader.py
5
+ RUN chmod 755 /tests/grader.py
tasks/task_039/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_039/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_039"
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_040/tests/Dockerfile CHANGED
@@ -1,2 +1,5 @@
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-040:v0.1.1@sha256:65832254b48e4b1777a7d1d07680a2a870de87c697b47ff8d0c27a516f95ad46
2
  FROM ${VERIFIER_IMAGE}
 
 
 
 
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-040:v0.1.1@sha256:65832254b48e4b1777a7d1d07680a2a870de87c697b47ff8d0c27a516f95ad46
2
  FROM ${VERIFIER_IMAGE}
3
+
4
+ COPY grader.py /tests/grader.py
5
+ RUN chmod 755 /tests/grader.py
tasks/task_040/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_040/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_040"
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_041/tests/Dockerfile CHANGED
@@ -1,2 +1,5 @@
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-041:v0.1.1@sha256:89c3b061bcb5d19a2b28722e4c8a1a5c2435e8641d4cdc2f2ffbd565bc48ff10
2
  FROM ${VERIFIER_IMAGE}
 
 
 
 
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-041:v0.1.1@sha256:89c3b061bcb5d19a2b28722e4c8a1a5c2435e8641d4cdc2f2ffbd565bc48ff10
2
  FROM ${VERIFIER_IMAGE}
3
+
4
+ COPY grader.py /tests/grader.py
5
+ RUN chmod 755 /tests/grader.py
tasks/task_041/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_041/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_041"
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_042/tests/Dockerfile CHANGED
@@ -1,2 +1,5 @@
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-042:v0.1.1@sha256:2d3c7dba05b8ca04b80900872baa59a5f3bc42d765e80ed58aa917bf0126c512
2
  FROM ${VERIFIER_IMAGE}
 
 
 
 
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-042:v0.1.1@sha256:2d3c7dba05b8ca04b80900872baa59a5f3bc42d765e80ed58aa917bf0126c512
2
  FROM ${VERIFIER_IMAGE}
3
+
4
+ COPY grader.py /tests/grader.py
5
+ RUN chmod 755 /tests/grader.py
tasks/task_042/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_042/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_042"
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_043/tests/Dockerfile CHANGED
@@ -1,2 +1,5 @@
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-043:v0.1.1@sha256:84e2a692b8b83060583de8fca377a153136ba35bd01e40d4ff4e61fe116e2472
2
  FROM ${VERIFIER_IMAGE}
 
 
 
 
1
  ARG VERIFIER_IMAGE=docker.io/kevinxulearning/swe-bench-science-verifier-python-task-043:v0.1.1@sha256:84e2a692b8b83060583de8fca377a153136ba35bd01e40d4ff4e61fe116e2472
2
  FROM ${VERIFIER_IMAGE}
3
+
4
+ COPY grader.py /tests/grader.py
5
+ RUN chmod 755 /tests/grader.py
tasks/task_043/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