Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"On Nullius, the agent can reach only its model, so it cannot run the tests of the 26 instances that download their test runner. The tests get internet access after the agent ends.",
"mini-SWE-agent runs here with its general prompt and no step or cost limit of its own. The leaderboard runs it with its SWE-bench prompt, 250 steps, 3 USD per instance and internet access.",
"On Nullius, the recorded patch is all that differs from the base commit, including what the image's build left there: an agent that changes nothing can still show a patch.",
"On Nullius, axios__axios-5085 cannot be resolved: one of its tests calls a public service through axios, and the tests' proxy refuses that request.",
"SWE-agent, the paper's agent, is not offered: it needs a python command in the instance's image, which 42 of the 300 images have.",
"Only instances of apache/druid, fmtlib/fmt, gin-gonic/gin, preactjs/preact, reactivex/rxjava and vuejs/core have been run through Nullius."
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
pnpm and yarn that corepack fetched, under root's home, where the
tests find them; the agent's home is the run's, so it is told where
they are.
``JVM_PROXY``: the check's way out is a proxy named in
``HTTPS_PROXY``, which the JVM does not read; the check tells it,
since an instance's tests may download what runs them (Maven's
test runner).
score - the harness's own grading (``swebench.harness.grading.get_eval_report``)
of the patch and eval script's output: resolved when a patch exists,
every FAIL_TO_PASS test passes and every PASS_TO_PASS test still passes. Its report is kept
Expand Down Expand Up @@ -51,11 +47,6 @@
RESULTS = "/tmp/nullius-swebench-verifier"
# What the images keep under root's home, where the tests find it: an agent's home is the run's, not root's.
AGENT_ENV = {"GOPATH": "/root/go", "GOCACHE": "/root/.cache/go-build", "COREPACK_HOME": "/root/.cache/node/corepack"}
# The check's proxy as the JVM takes one: its proxy properties, and Maven's resolver told to read them.
JVM_PROXY = ('if [ -n "${HTTPS_PROXY:-}" ]; then p="${HTTPS_PROXY#*://}"; p="${p%/}"; '
'export JAVA_TOOL_OPTIONS="${JAVA_TOOL_OPTIONS:+$JAVA_TOOL_OPTIONS }'
'-Dhttp.proxyHost=${p%:*} -Dhttp.proxyPort=${p##*:} -Dhttps.proxyHost=${p%:*} -Dhttps.proxyPort=${p##*:} '
'-Daether.connector.http.useSystemProperties=true"; fi')

with open(os.path.join(HERE, "images.json")) as f:
IMAGES = json.load(f)
Expand Down Expand Up @@ -94,7 +85,7 @@ def setup(unit, dir):
r = row(unit)
capture = (f"cd {WORKDIR} && git add -A && "
f"git diff --cached --binary --no-ext-diff --no-textconv {shlex.quote(r['base_commit'])} -- "
f"> {RESULTS}/model.patch && {JVM_PROXY} && exec /bin/bash /eval.sh")
f"> {RESULTS}/model.patch && exec /bin/bash /eval.sh")
return {"prompt": r["problem_statement"], "environment": "task", "image": {"pull": IMAGES[unit]}, "workdir": WORKDIR,
"env": AGENT_ENV,
"verify": {"write": {"/eval.sh": make_test_spec(r).eval_script}, "run": ["/bin/bash", "-c", capture],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
],
"origin": "official",
"good_to_know": [
"The reward is the authors’ re-grade: the captured patch replayed in a fresh image. The in-container score is kept beside it, with both test outputs.",
"Agents work with no internet and their web tools off, as the authors' locked protocol requires. Its commands use high reasoning effort: set the same to compare.",
"Each task gives the agent 50 minutes. A task cut there is still scored on what the agent changed, except with mini-swe-agent.",
"V2 scores do not compare with v1 numbers: 89 tasks were dropped, 529 statements rewritten and the tests revised.",
Expand All @@ -21,7 +22,6 @@
"The authors' capture of the agent's diff compares the repository with HEAD: it misses what an agent commits and includes files an image left untracked."
],
"limitations": [
"The tests run in the container the agent worked in. The authors' authoritative score re-grades the agent's diff on a fresh image; Nullius keeps the diff as verifier/model.patch and does not re-grade.",
"mini-swe-agent runs mini's own config with no cost limit, where the protocol's file adds high effort, a named model class and its own error template; a task cut at 50 minutes is its timeout and not scored, where the protocol grades its diff.",
"The tests reach the internet through an HTTP and HTTPS proxy to public addresses, where the protocol gives them open access.",
"Tasks of element-web, navidrome, openlibrary, teleport, tutanota, vuls and webclients have not been run through Nullius."
Expand Down
51 changes: 35 additions & 16 deletions app/nullius/catalogue/benchmarks/swe-bench-pro/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@
authors' prebuilt image, pulled by the digest its tag had when pinned here,
``images.json``, with the memory and CPUs its task.toml asks for); its own agent
timeout (``agent_seconds``, task.toml's agent.timeout_sec); and its check
(``verify``): once the agent has ended and what it left running is stopped,
``tests/`` is copied to ``/tests`` and the check runs in the task's container: the
locked protocol's own capture of the agent's diff (``v2/tooling``: the repository
against HEAD, kept as ``model.patch``), a reward file left before the tests
removed, as Harbor's verifier does, then ``test.sh``, with the way out task.toml
gives the verifier, its results collected from ``/logs/verifier``. The tests reach
the container only then; nothing is written into the workspace.
score - the reward test.sh wrote, read from what the check collected
(``verify``): the upstream's capture runs in the agent's container; test.sh runs
there for the in-place score, then the upstream replay commands apply only the
captured patch in a fresh container of the same image and limits. test.sh runs
again there for the authoritative score.
score - the fresh reward test.sh wrote; the in-place reward is kept in detail.in_place
oracle - the reference control: ``solution/`` copied to ``/solution`` and ``solve.sh`` run in
the task's container, as the agent would have worked

Expand Down Expand Up @@ -73,6 +70,21 @@ def capture() -> str:
return _capture


def replay() -> str:
"""The pinned replay agent's literal commands, without importing its Harbor dependencies."""
with open(os.path.join(os.environ["NULLIUS_UPSTREAM"], "v2", "tooling", "patch_replay.py")) as f:
tree = ast.parse(f.read())
cls = next(n for n in tree.body if isinstance(n, ast.ClassDef) and n.name == "PatchReplayAgent")
method = next(n for n in cls.body if isinstance(n, ast.AsyncFunctionDef) and n.name == "run")
commands = [ast.literal_eval(k.value) for n in ast.walk(method)
if isinstance(n, ast.Call) and isinstance(n.func, ast.Attribute)
and isinstance(n.func.value, ast.Name) and n.func.value.id == "environment" and n.func.attr == "exec"
for k in n.keywords if k.arg == "command"]
if len(commands) != 2 or not all(isinstance(c, str) for c in commands):
raise ValueError("patch_replay.py: two literal environment commands were expected")
return "; ".join(commands)


def task(unit):
"""The task's folder in the upstream and its task.toml."""
if unit not in IMAGES:
Expand Down Expand Up @@ -132,15 +144,18 @@ def setup(unit, dir):
if env.get("cpus"):
image["cpus"] = env["cpus"]
agent = (t.get("agent") or {}).get("timeout_sec")
# the capture first, then test.sh whatever the capture did; a reward left before the tests is removed, as
# Harbor's verifier removes both files before it runs a task's tests: only what test.sh writes is read
check = (f"{capture()}; cp {CAPTURED} {LOGS}/model.patch; rm -f -- {LOGS}/reward.txt {LOGS}/reward.json; "
"exec bash /tests/test.sh")
check = f"rm -f -- {LOGS}/reward.txt {LOGS}/reward.json; exec bash /tests/test.sh"
common = {"copy": {f"{TASKS}/{unit}/tests": "/tests"}, "collect": LOGS,
"seconds": verifier.get("timeout_sec") or 3000,
"network": verifier.get("network_mode") == "public"}
# Missing or empty patches apply nothing, exactly as PatchReplayAgent does.
apply = (f"cp {CAPTURED} {LOGS}/model.patch; "
f"if [ -s {CAPTURED} ]; then cp {CAPTURED} /tmp/replay.patch; {replay()}; fi; {check}")
return {"prompt": prompt, "environment": "task", "image": image,
**({"agent_seconds": int(agent)} if agent else {}), # the task's own budget, not the run's
"verify": {"copy": {f"{TASKS}/{unit}/tests": "/tests"}, "run": ["bash", "-c", check], "collect": LOGS,
"seconds": verifier.get("timeout_sec") or 3000,
"network": verifier.get("network_mode") == "public"}}
**({"agent_seconds": int(agent)} if agent else {}),
"verify": {**common, "run": ["bash", "-c", apply],
"capture": {"run": ["bash", "-c", capture()], "collect": os.path.dirname(CAPTURED), "seconds": 300},
"in_place": {**common, "run": ["bash", "-c", check]}}}


def score(unit, dir, transcript, answer, verified=None):
Expand All @@ -154,6 +169,10 @@ def score(unit, dir, transcript, answer, verified=None):
except (OSError, ValueError):
detail["why"] = "test.sh wrote no reward"
reward = 0.0
if verified.get("timed_out"):
reward = 0.0
if verified.get("in_place"):
detail["in_place"] = score(unit, dir, transcript, answer, verified=verified["in_place"])
return {"reward": 1.0 if reward >= 1.0 else 0.0, "passed": reward >= 1.0, "detail": detail}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"schema": "nullius.benchmark/v1",
"key": "swe-bench-pro",
"label": "SWE-bench Pro",
"summary": "Each task is a pull request's description and the authors' container for it, the repository at its base commit in /app; the agent implements the change there with no way out but its model, and the task's own tests, run there once it has ended, say whether every required test passes.",
"summary": "Each task is a pull request's description and the authors' container for it, the repository at its base commit in /app; the agent implements the change there with no way out but its model, and the task's own tests, run in a fresh image with its captured patch, say whether every required test passes.",
"family": "agent",
"needs": [
"agent.workspace/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
{"entry": "harbor run -p v2/tasks", "setting": "the 50 minutes: Harbor's agent timeout for Claude Code, an in-sandbox timeout of agent.timeout_sec less 60 s for mini-swe-agent and Codex; the partial diff is still graded", "values": "", "default": "3000, 2940",
"nullius": "fixed:3000 s - the task's agent.timeout_sec is the agent's limit; a task cut there is still scored (limits.scored_cuts) for an agent run over ACP; one started as a command (mini-swe-agent) ends as its timeout, unscored; said in the limitations"},
{"entry": "harbor run -p v2/tasks", "setting": "the locked agents' capture of the diff: its own 300 s, a failure ignored", "values": "", "default": "300",
"nullius": "fixed:within the check's limit - the capture is the check's first step, its time counted in the check's 3000 s; a failure does not stop the tests"},
"nullius": "fixed:300 s - the upstream capture command runs before either check; a timed-out capture is a verifier error"},
{"entry": "harbor run -p v2/tasks", "setting": "Harbor's verifier removes /logs/verifier/reward.txt and reward.json before a task's tests (Harbor 0.25 and later)", "values": "", "default": "",
"nullius": "fixed:the same - the check removes both before test.sh, so only a reward the tests wrote is read"},
{"entry": "harbor run -p v2/tasks", "setting": "-a patch_replay:PatchReplayAgent -m replay --ak source_job, --ak patch_name (the diff applied to a fresh image and graded again: the authoritative score)", "values": "", "default": "",
"nullius": "not offered - the standard runs a task's check in the container the agent worked in; the captured diff is kept as verifier/model.patch; said in the limitations"},
"nullius": "fixed:the authoritative reward - the upstream replay commands apply the captured patch in a fresh image before test.sh; both checks are kept"},
{"entry": "harbor run -p v2/tasks", "setting": "-a host_mini_swe:HostMiniSweAgent (--ak step_limit, cost_limit, command_timeout, cwd, deterministic_outputs_file)", "values": "", "default": "",
"nullius": "not offered - mini-swe-agent's loop kept outside a sandbox with no network at all; the standard's agents work in the container and reach their model through the relay"},
{"entry": "harbor run -p v2/tasks", "setting": "-e (modal, docker), -n (trials at once)", "values": "", "default": "modal, 50",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@
"Most tests download package lists and uv within their time limit, 360 seconds for 164 tasks: on a slow connection they can time out."
],
"limitations": [
"optimize-product-search-query and retrieve-vault-root-token are left out: their image starts a service from its ENTRYPOINT, which Nullius replaces and Harbor keeps.",
"Nullius gives public internet access to 23 tasks, those whose reference solution downloads something, during the agent or reference solution. The other 175 keep only their model route; Harbor gives it to every task.",
"On Nullius, the tests get internet access after the agent ends. What the agent left running is stopped first, except in the 12 tasks whose tests need it.",
"fix-jni-unsatisfiedlinkerror-path cannot pass on Nullius: its tests download a Maven plugin, and Maven ignores the proxy variables that are the tests' only way out.",
"The 195 tasks that build on the authors' registry have not been run through Nullius."
"Nullius gives public internet access to 23 tasks, those whose reference solution downloads something, during the agent or reference solution. The other 177 keep only their model route; Harbor gives it to every task.",
"On Nullius, the tests get internet access after the agent ends. What the agent left running is stopped first, except in the 14 tasks whose tests need it.",
"The 197 tasks that build on the authors' registry have not been run through Nullius."
],
"datasets": [
{
Expand Down
15 changes: 6 additions & 9 deletions app/nullius/catalogue/benchmarks/terminal-bench-pro/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

units - the dataset's tasks: one that builds fast from a public base image
and downloads nothing (``small``), or every task folder of the
upstream but the two whose image this runner cannot start as
published (``full``)
upstream (``full``)
describe - the task's id as its title, its instruction as its text, and its
task.toml's metadata difficulty and category as categories
setup - the task's instruction as the prompt; its own image (``image``: its
Expand Down Expand Up @@ -41,10 +40,8 @@
# the checks of the other two (bash-ddos-traffic-analyzer, train-fraud-detection-model) download their test runner.
SMALL = ["python-prime-http-server"]

# Tasks whose image starts the task's service from its ENTRYPOINT (a database, a secrets server). The
# unit's container is kept alive by a command of the run's in place of the image's entrypoint, so the
# service would never start: they are left out.
LEFT_OUT = {"optimize-product-search-query", "retrieve-vault-root-token"}
# These images start the task's service before exec'ing their command.
ENTRYPOINT = {"optimize-product-search-query", "retrieve-vault-root-token"}

# Tasks whose reference solution fetches something (a package manager, a download, a model or a dataset
# from a hub), from reading each solve.sh at the pinned commit. The benchmark grants them the internet,
Expand Down Expand Up @@ -86,7 +83,7 @@ def tasks():
"""Every task folder of the upstream this benchmark runs, by name."""
root = os.environ["NULLIUS_UPSTREAM"]
return sorted(d for d in os.listdir(root)
if d not in LEFT_OUT and os.path.isfile(os.path.join(root, d, "task.toml")))
if os.path.isfile(os.path.join(root, d, "task.toml")))


def listed(dataset):
Expand Down Expand Up @@ -126,7 +123,7 @@ def setup(unit, dir):
with open(os.path.join(here, "instruction.md")) as f:
prompt = f.read().strip()
env = t.get("environment") or {}
image = {"build": f"{unit}/environment"}
image = {"build": f"{unit}/environment", **({"keep_entrypoint": True} if unit in ENTRYPOINT else {})}
if env.get("memory_mb"):
image["memory_mb"] = env["memory_mb"]
if env.get("cpus"):
Expand All @@ -137,7 +134,7 @@ def setup(unit, dir):
**({"agent_seconds": agent} if agent else {}), # the task's own agent timeout, not the run's
"verify": {"copy": {f"{unit}/tests": "/tests"}, "run": CHECK, "collect": LOGS,
"seconds": (t.get("verifier") or {}).get("timeout_sec") or 600, "network": True,
**({"keep_processes": True} if unit in KEEP_PROCESSES else {})}}
**({"keep_processes": True} if unit in KEEP_PROCESSES | ENTRYPOINT else {})}}


def score(unit, dir, transcript, answer, verified=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
},
{
"id": "full",
"label": "All 198 tasks",
"summary": "195 of them need the authors' registry and end in setup errors without it.",
"units": 198,
"label": "All 200 tasks",
"summary": "197 of them need the authors' registry and end in setup errors without it.",
"units": 200,
"environment": "task"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
{"entry": "environment/Dockerfile", "setting": "FROM", "values": "two images of the authors' registry (197 tasks), python:3.11-slim, python:3.13-slim", "default": "per task",
"nullius": "fixed:as published - no image is substituted; said in the limitations"},
{"entry": "environment/Dockerfile", "setting": "ENTRYPOINT, CMD", "values": "per task", "default": "per task",
"nullius": "fixed:replaced - the run keeps the container alive with a command of its own, where Harbor replaces the CMD alone; the two tasks whose ENTRYPOINT starts their service are left out"},
"nullius": "fixed:kept for service tasks - the two tasks whose ENTRYPOINT starts their service opt in to keeping it, with the keep-alive as CMD"},
{"entry": "README", "setting": "Submission of results by email", "values": "", "default": "",
"nullius": "not offered - a local run is not a leaderboard entry"}
]
2 changes: 1 addition & 1 deletion app/nullius/runs/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# The shape this module produces. A workspace caches parsed Jobs keyed on it,
# so bump it when a Trial or Job field is added, renamed or means something
# new — otherwise a cache written by the old parse is read back as current.
SCHEMA = "32"
SCHEMA = "33"

# What a rate-limit record in `agent/gateway.log` looks like. The agent's SDK
# retries a 429 below the harness, so a limit the run survived leaves nothing in result.json —
Expand Down
Loading