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
5 changes: 3 additions & 2 deletions app/nullius/standard/pages/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,11 @@ def _bench_page(b: dict) -> dict:
"attempts": (b.get("limits") or {}).get("attempts", ""),
"retries": (b.get("limits") or {}).get("retries", 0),
# what a unit's time limits and a conversation's length are when the recipe forces none
"timeouts": {"setup": run.DRIVER_SECONDS, "setup_agent": (b.get("limits") or {}).get("setup_seconds") or run.DRIVER_SECONDS, "image": run.IMAGE_SECONDS, "score": (b.get("limits") or {}).get("score_seconds") or run.DRIVER_SECONDS,
"timeouts": {"setup": (b.get("limits") or {}).get("setup_seconds") or run.DRIVER_SECONDS, "image": run.IMAGE_SECONDS, "score": (b.get("limits") or {}).get("score_seconds") or run.DRIVER_SECONDS,
"agent": (b.get("limits") or {}).get("turn_seconds") or run.TURN_SECONDS,
"turns": (b.get("limits") or {}).get("turns") or run.MAX_TURNS,
"catalogue": [k for k, f in (("agent", "turn_seconds"), ("turns", "turns"), ("score", "score_seconds")) if (b.get("limits") or {}).get(f)]},
"catalogue": [k for k, f in (("agent", "turn_seconds"), ("turns", "turns"), ("setup", "setup_seconds"), ("score", "score_seconds"))
if (b.get("limits") or {}).get(f)]},
"options": {n: {"label": o.get("label") or n.replace("_", " ").capitalize(), "summary": o["summary"], "datasets": o.get("datasets") or [],
"setups": o.get("setups") or ["yours"],
**({"values": o["values"]} if "values" in o else {"pattern": o["pattern"], "example": o.get("example")}), "default": o.get("default"), "about": o.get("about") or {}, "names": o.get("names") or {}, "needs": o.get("needs") or {}, "when": o.get("when") or {},
Expand Down
5 changes: 2 additions & 3 deletions app/nullius/standard/runner/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,12 @@ def setup_request(bench: dict, kind: str, attempt: Optional[int] = None) -> tupl
"""What a unit's ``setup`` is sent besides the unit and its folder, and how long it may take, for a unit that
``kind`` runs (agent, capability, control): ``attempt`` when the benchmark tells attempts apart
(``limits.attempts``), ``participant`` when its driver asks (``driver.participant``); the benchmark's
``limits.setup_seconds`` for an agent's unit,
``DRIVER_SECONDS`` for any other."""
``limits.setup_seconds``, else ``DRIVER_SECONDS``, whoever runs the unit: a control's setup stages what an agent's does."""
limits, drv = bench.get("limits") or {}, bench.get("driver") or {}
sent = {"attempt": attempt} if attempt and limits.get("attempts") else {}
if drv.get("participant"):
sent["participant"] = kind
return sent, (limits.get("setup_seconds") if kind == "agent" else None) or DRIVER_SECONDS
return sent, limits.get("setup_seconds") or DRIVER_SECONDS


def provider_endpoint(provider: str, env=os.environ) -> tuple:
Expand Down
5 changes: 1 addition & 4 deletions app/static/builder/command-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -995,10 +995,7 @@
// each field shows, greyed, the value used while it is empty; a task that declares its own keeps it
const m = s => String(+(s / 60).toFixed(2));
// [placeholder, declared]: the benchmark's or the agent's own reads as a value, Nullius's default stays grey
const setupSeconds = C.runsOf(rec).map(k => !['original', 'model'].includes(k) && !(b.controls || []).some(x => x.key === k) && b.family === 'agent' ? (d.setup_agent || d.setup) : d.setup);
const setup = setupSeconds.length && setupSeconds.some(s => s !== setupSeconds[0]) ? ['per setup', true]
: [m(setupSeconds[0] || d.setup), (setupSeconds[0] || d.setup) !== d.setup];
const def = {setup, image: [m(d.image), false], agent: agentDefault(rec, b), verify: ['per task', true], score: [m(d.score), (d.catalogue || []).includes('score')]};
const def = {setup: [m(d.setup), (d.catalogue || []).includes('setup')], image: [m(d.image), false], agent: agentDefault(rec, b), verify: ['per task', true], score: [m(d.score), (d.catalogue || []).includes('score')]};
const label = (k, l) => k === 'agent' ? 'Agent, whole ' + u.noun : l;
return '<div class="nb-sectionhead nb-sectionnext"><h2>Time limits</h2></div>'
+ C.STANDARD_PHASES.map(([k, l]) => minutesRow(k, label(k, l), t[k], def[k])).join('');
Expand Down
8 changes: 4 additions & 4 deletions app/tests/test_standard_driver_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ def test_setup_preserves_attempts_and_sends_only_requested_fields(self):
bench = dict(BENCH, driver=dict(BENCH["driver"], participant=True),
limits={"attempts": "A seed per attempt.", "setup_seconds": 1800})
self.assertEqual(run.setup_request(bench, kind, 2),
({"participant": kind, "attempt": 2}, 1800.0 if kind == "agent" else 600.0))
({"participant": kind, "attempt": 2}, 1800.0))
bench["driver"]["participant"] = False
self.assertEqual(run.setup_request(bench, kind, 2)[0], {"attempt": 2})

def test_the_leak_check_sets_up_a_control_with_the_original_bound(self):
def test_the_leak_check_sets_up_a_control_with_the_benchmarks_bound(self):
bench = dict(BENCH, driver=dict(BENCH["driver"], participant=True), limits={"setup_seconds": 1800})
with tempfile.TemporaryDirectory() as tmp:
proc = mock.Mock()
Expand All @@ -86,7 +86,7 @@ def test_the_leak_check_sets_up_a_control_with_the_original_bound(self):
driver.start.return_value = proc
prove.leak_check(driver, ["a"], "agent")
op, kw = proc.request.call_args_list[0].args[0], proc.request.call_args_list[0].kwargs
self.assertEqual((op, kw["timeout"], kw["participant"]), ("setup", 600.0, "control"))
self.assertEqual((op, kw["timeout"], kw["participant"]), ("setup", 1800.0, "control"))
proc.close.assert_called_once()


Expand Down Expand Up @@ -399,7 +399,7 @@ def test_the_setup_phase_takes_the_setup_limit(self):
control = definitions.control(dict(BENCH, controls=controls), "nop")
for other, limits, expected in ((self.fake_agent(), None, 600), (control, None, 600),
(self.fake_agent(), {"setup_seconds": 1800}, 1800),
(control, {"setup_seconds": 1800}, 600)):
(control, {"setup_seconds": 1800}, 1800)):
with self.subTest(kind=other["_kind"], limits=limits):
bench = dict(controls=controls, **({"limits": limits} if limits else {}))
got = self.env_setup_timeouts(other, **bench)
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Each phase of a unit has a time limit. `--timeout PHASE=SECONDS` (repeatable) fo

| Phase | Default | A unit past it |
| --- | --- | --- |
| `setup` | The benchmark's `limits.setup_seconds` for an agent's unit, else 600 s; an own image's `prepare` step its `seconds` | Environment setup error |
| `setup` | The benchmark's `limits.setup_seconds`, else 600 s; an own image's `prepare` step its `seconds` | Environment setup error |
| `image` | 3600 s: an own image's pull or build | Environment setup error |
| `agent` | The task's `agent_seconds`, else the Original setup's `turn_seconds`, else `limits.turn_seconds`, else 900 s: the agent's whole work on the unit, every turn of a conversation and the simulated user's between them; each add and each recall of a capability (its reader has `limits.turn_seconds`); an Original setup's answerer; the oracle | Agent timeout; scored where the benchmark [scores the cut](#a-unit-cut-at-a-limit) |
| `verify` | The verify step's `seconds`, else the agent's default | Verifier error |
Expand Down
2 changes: 1 addition & 1 deletion docs/standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ An `answer` or `score` error that begins `EnvironmentSetupError: `, `VerifierErr
| `leaderboard` | `{says, simulator?, judge?, bench_options?, repeat?}`: what the upstream's leaderboard fixes besides the ranked model, from its own submission rules - the user simulator's and judge's models, the benchmark's options it sets and the fewest attempts per unit. The builder then offers **Like the leaderboard** |
| `limits.turns` | At most this many agent turns in a conversation (default 20; `cli run --max-turns` forces another) |
| `limits.turn_seconds` | The agent's whole work on a unit, every turn of a conversation included (default 900; a task's `agent_seconds`, a setup's own `turn_seconds` or `cli run --timeout agent=` before it) |
| `limits.setup_seconds` | How long `setup` may take, in seconds, for a unit an agent runs; every other unit keeps 600; `cli run --timeout setup=` forces either. A driver's own bound still applies |
| `limits.setup_seconds` | How long `setup` may take, in seconds, for every unit, a control's too (default 600; `cli run --timeout setup=` forces another). A driver's own bound still applies |
| `limits.score_seconds` | How long `score` may take (default 600; `cli run --timeout score=` before it) |
| `limits.call_seconds` | How long the relay waits for one model call's reply (default 900). A benchmark whose agent waits longer for a call sets it above that agent's own wait, so the agent's client, not the relay, ends a long call |
| `driver.participant` | `true`: `setup` is also sent `participant`, the kind of what runs the unit, for a driver that starts something only an agent uses |
Expand Down