Benchmark: the seed is a git repository's first commit
The agent works in a clone, but benchmark workspaces were plain directories, so a model that starts with `git log` failed two commands in a row and was stopped as stuck within seconds (Flash-Next, 10 of 13 failures on 2026-10-24). The seed is now committed on main, locally and on the build VM, and how a workspace is set up is part of each task's hash, so earlier runs are reported as not comparable. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J5Utyfzw7gF7UhjRDEtjTk
This commit is contained in:
1 parent
3caf4aab69
commit
7a57cef9ff
2 files changed
+57
-2
No files matched your search
@@ -5,7 +5,8 @@ Each task is a directory under ``tasks/``:
|
||||
- ``task.yaml``: ``title``, ``plan`` (the approved milestone plan, written the
|
||||
way the driver restates them), and ``check`` (a shell command run
|
||||
in the workspace afterwards).
|
||||
- ``seed/``: the project the driver starts from.
|
||||
- ``seed/``: the project the driver starts from, committed as a git
|
||||
repository's first commit (``GIT_SEED``).
|
||||
- ``hidden/``: files the check needs, copied in only after the run, into
|
||||
``.bench_check/``. The driver never sees them.
|
||||
- ``solution/``: a reference solution, overlaid on the seed by the tests to
|
||||
@@ -28,6 +29,18 @@ if TYPE_CHECKING:
|
||||
TASKS_DIR = Path(__file__).parent / "tasks"
|
||||
CHECK_DIR = ".bench_check"
|
||||
|
||||
# The seed is committed as a git repository's first commit, as the agent's
|
||||
# own workspace is a clone: a model that starts with `git log` or `git
|
||||
# status` shouldn't fail where it would succeed in production.
|
||||
GIT_SEED = (
|
||||
"git init -q -b main && git add -A && "
|
||||
"git -c user.name=nisse-bench -c user.email=bench@nisse.invalid "
|
||||
"commit -q -m seed"
|
||||
)
|
||||
# How a workspace is set up, part of every task's hash: runs from before a
|
||||
# change here are not comparable with runs after it.
|
||||
SEED_SETUP = f"seed committed: {GIT_SEED}"
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Task:
|
||||
@@ -42,7 +55,7 @@ class Task:
|
||||
"""What the task is, so a changed task is never compared with runs of
|
||||
its earlier version. Covers everything the model or the check sees;
|
||||
not the reference solution."""
|
||||
digest = hashlib.sha256()
|
||||
digest = hashlib.sha256(SEED_SETUP.encode())
|
||||
for part in ("task.yaml", "seed", "hidden"):
|
||||
root = self.path / part
|
||||
files = [root] if root.is_file() else sorted(root.rglob("*"))
|
||||
@@ -54,6 +67,7 @@ class Task:
|
||||
|
||||
def seed_into(self, workspace: Path) -> None:
|
||||
shutil.copytree(self.path / "seed", workspace, dirs_exist_ok=True)
|
||||
subprocess.run(GIT_SEED, shell=True, cwd=workspace, check=True)
|
||||
|
||||
def apply_solution(self, workspace: Path) -> None:
|
||||
shutil.copytree(self.path / "solution", workspace, dirs_exist_ok=True)
|
||||
@@ -84,6 +98,9 @@ class Task:
|
||||
|
||||
def seed_workspace(self, workspace: "Workspace") -> None:
|
||||
workspace.upload_tree(self.path / "seed")
|
||||
result = workspace.host.execute(GIT_SEED, cwd=str(workspace.root), timeout_s=60)
|
||||
if result.exit_code != 0:
|
||||
raise RuntimeError(f"committing the seed failed: {result.stderr.strip()}")
|
||||
|
||||
def check_workspace(
|
||||
self, workspace: "Workspace", timeout_s: int = 300
|
||||
|
||||
Reference in new issue
Block a user