Skip to content

Commit ff59dfd

Browse files
committed
feat(standard): retry an attempt that fails on the infrastructure or the agent, with --retries beside --attempts
Merges #146 and rebuilds this change in its words. An attempt is one run of a unit, counted whatever its result: --attempts K, the older --repeat K still read. A retry runs an attempt again after a failure a further try may mend, by Harbor's retry rule (a rate limit, a provider, network or setup error, an agent crash, an output-length or verifier error; never a timeout, a refusal, a wrong model or key, a missing secret, a usage limit, the spending cap, a stop, or a task the agent failed): --retries N, 0 by default, so the single re-run of a rate-limited unit now needs --retries 1. Earlier tries are kept in retried/<trial>.try-N, the kept trial records its retries (standard.retries) and the config records retries. The builder says Attempts per task and Retries per attempt for both runners, and a Harbor recipe's retries default to 0. A retried attempt says so on the run page, the trial page, All attempts and the live board, and the progress counts every try. The driver protocol, the catalogue and the recipe formats keep main's words.
2 parents 61d7f49 + 8ec9680 commit ff59dfd

68 files changed

Lines changed: 676 additions & 739 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ and its resources. The source layout stays under `app/`.
4747
- `app/nullius/` — its backend, one package per purpose: `runs/` (reading one
4848
Harbor job tree: `parse`, `classify`, `live`, `artifacts`,
4949
`feasibility`, `launches`, `verifier` - a verifier's report read by its
50-
benchmark's report block - `repeats`, a task's repeats in one job with
50+
benchmark's report block - `attempts`, a task's attempts in one job with
5151
their pass count and pass@k, and the `cli`), `traces/` (`trace`, `trajectory`,
5252
`conversation`, `charts`, `behavior`, `otel`), `compare/` (`comparison` and its `cli`),
5353
`catalogue/` (`catalog`, which loads one folder per benchmark
@@ -62,7 +62,7 @@ and its resources. The source layout stays under `app/`.
6262
`feed`: the live feed any Harbor writes, from its own trial hooks),
6363
`importers/` (`atif` ATIF, `otel` OpenTelemetry, and the `cli`), `judge/` (`questions`, `state`, `client`, `store`, `batch`, `reconcile`, `lanes`),
6464
`standard/` (the Nullius standard, `docs/standard.md`: `ports`, `names` (capability vocabulary and legacy aliases), `definitions` (with an agent's or capability's versions), `match`,
65-
`jsonl`, `acp`, `cancellation` (interruptible protocol waits), `relay`, `ledger` (a run's spending cap), `attempts` (what a repeat is tried again after, and how many times), `pins` (image digests checked against registry tags), `install`, `run`, `container` (the container backend), `setup_container` (an Original setup's driver and its Linux dependencies in Docker), `forward` (a licence server's one door from it, or a benchmark's MCP server's), `web_services` (HTTP fixtures a driver's setup declares, each behind a unit-local Docker door), `mcp_machine` and `mcp_bridge` (a benchmark's MCP server run on the machine, in its driver's environment, and the agent's bridge to it), `network_requirements` (an environment's declared public web access: the schema and the connectivity check), `hostreq` (what a benchmark's options need of the machine its driver runs on: the check and the install) and `egress` (an own image's check's proxy to public addresses), `job`, `conform`, `fidelity` (ACP against the agent's own CLI), `prove` (a benchmark's controls and proofs), `shard` and `merge` (one run over many machines), `recipe` (the builder's standard recipe), `howto` (the How to add steps) and the `cli`; its
65+
`jsonl`, `acp`, `cancellation` (interruptible protocol waits), `relay`, `ledger` (a run's spending cap), `retries` (what an attempt is tried again after, and how many times), `pins` (image digests checked against registry tags), `install`, `run`, `container` (the container backend), `setup_container` (an Original setup's driver and its Linux dependencies in Docker), `forward` (a licence server's one door from it, or a benchmark's MCP server's), `web_services` (HTTP fixtures a driver's setup declares, each behind a unit-local Docker door), `mcp_machine` and `mcp_bridge` (a benchmark's MCP server run on the machine, in its driver's environment, and the agent's bridge to it), `network_requirements` (an environment's declared public web access: the schema and the connectivity check), `hostreq` (what a benchmark's options need of the machine its driver runs on: the check and the install) and `egress` (an own image's check's proxy to public addresses), `job`, `conform`, `fidelity` (ACP against the agent's own CLI), `prove` (a benchmark's controls and proofs), `shard` and `merge` (one run over many machines), `recipe` (the builder's standard recipe), `howto` (the How to add steps) and the `cli`; its
6666
`payload` snapshots the running backend and effective catalogue for a remote host;
6767
conformance kits under `standard/kits/`, each a benchmark: a `driver` and, for the
6868
tools kit, an MCP server `mcp_kit`) - the definitions it reads are in the catalogue:

‎app/nullius/catalogue/benchmarks/gaia/benchmark.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"Accept GAIA's access conditions on Hugging Face, then add a token in Settings → Data providers. Do not redistribute its questions or answers in a crawlable form.",
1414
"Levels 1, 2 and 3 (53, 86 and 26 questions) split the 165 validation questions.",
1515
"The authors' scorer gets the text after the last FINAL ANSWER: marker, or the whole reply without one.",
16-
"Original is the paper's no-tools API baseline; choose an agent for files and web research. The paper ran it 3 times: 3 repeats per question."
16+
"Original is the paper's no-tools API baseline; choose an agent for files and web research. The paper ran it 3 times: 3 attempts per question."
1717
],
1818
"upstream_limitations": [
1919
"The 301 test questions have private answers and are excluded from local scoring.",

‎app/nullius/catalogue/benchmarks/gsm8k/benchmark.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"origin": "official",
1111
"limitations": [
1212
"The prompt asking for the '#### <number>' line is Nullius's wording. The paper's models were fine-tuned to write it.",
13-
"The paper's trained verifier, which picks the best of several answers, is not reproduced. Several repeats per problem report pass@k instead."
13+
"The paper's trained verifier, which picks the best of several answers, is not reproduced. Several attempts per problem report pass@k instead."
1414
],
1515
"datasets": [
1616
{

‎app/nullius/catalogue/benchmarks/humaneval/benchmark.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
"citation": "@article{chen2021codex,\n title={Evaluating Large Language Models Trained on Code},\n author={Chen, Mark and Tworek, Jerry and Jun, Heewoo and Yuan, Qiming and Pinto, Henrique Ponde de Oliveira and Kaplan, Jared and others},\n journal={arXiv preprint arXiv:2107.03374},\n year={2021}\n}",
3232
"citation_source": "https://github.com/openai/human-eval",
3333
"good_to_know": [
34-
"One repeat per problem gives pass@1. With n repeats per problem, the run reports pass@1 to pass@n. The paper sampled 200."
34+
"One attempt per problem gives pass@1. With n attempts per problem, the run reports pass@1 to pass@n. The paper sampled 200."
3535
]
3636
}

‎app/nullius/catalogue/benchmarks/humaneval/upstream-settings.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
"setting": "--k",
1212
"values": "1,10,100",
1313
"default": "1,10,100",
14-
"nullius": "fixed:pass@1 to pass@n with n the run's repeats (cli run --repeat n, the builder's Repeats per problem) - the job's result.json reports it, 1 - C(n-c, k)/C(n, k) as estimate_pass_at_k reads it; one repeat by default, pass@1"
14+
"nullius": "fixed:pass@1 to pass@n with n the run's attempts (cli run --repeat n, the builder's Attempts per problem) - the job's result.json reports it, 1 - C(n-c, k)/C(n, k) as estimate_pass_at_k reads it; one attempt by default, pass@1"
1515
},
1616
{
1717
"entry": "README",
1818
"setting": "num_samples_per_task",
1919
"values": "200",
2020
"default": "200",
21-
"nullius": "fixed:the run's repeats (--repeat), 1 by default - 200 agent runs per problem are offered, never assumed"
21+
"nullius": "fixed:the run's attempts (--repeat), 1 by default - 200 agent runs per problem are offered, never assumed"
2222
},
2323
{
2424
"entry": "evaluate_functional_correctness",

‎app/nullius/catalogue/benchmarks/longmemeval/driver.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def summary_tokenizer(dir):
285285
return root
286286

287287

288-
def answer(unit, dir, setup, model, base_url, key, judge=None, simulator=None, repeat=None):
288+
def answer(unit, dir, setup, model, base_url, key, judge=None, simulator=None, attempt=None):
289289
up = os.environ["NULLIUS_UPSTREAM"]
290290
retriever = _opt("retriever", "full-history-session")
291291
reading = _opt("reading", "con")

‎app/nullius/catalogue/benchmarks/tau3-bench/benchmark.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"Scores depend on the simulated user's and the evaluator's models: keep both fixed when comparing.",
1414
"Conversations run in the upstream's own runner, release v1.0.1, at its defaults: 200 steps, 10 tool errors, seed 300.",
1515
"Original is the upstream's own agent with your model, as in a leaderboard submission.",
16-
"Several repeats per task report pass^k, as the leaderboard's 4 trials do. Each repeat is a new conversation.",
16+
"Several attempts per task report pass^k, as the leaderboard's 4 trials do. Each attempt is a new conversation.",
1717
"A task whose retries all fail is an infrastructure error, not a score.",
1818
"A tool call after the conversation has ended returns an error. An agent that keeps calling until its time runs out is not scored."
1919
],

‎app/nullius/catalogue/benchmarks/tau3-bench/driver.py‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
this driver, with a ``TextRunConfig`` at the upstream's defaults (max
2828
steps, max errors, no timeout, one trial, its seed 300, three
2929
retries, its user simulator). It draws the trial's seed from the
30-
base seed as it does for every run: the unit's first repeat is
31-
trial 0 of a one-trial run, its repeat N (``--repeat``) trial N-1
30+
base seed as it does for every run: the unit's first attempt is
31+
trial 0 of a one-trial run, its attempt N (``--repeat``) trial N-1
3232
at the seed run_tasks draws for that trial (``trial``), and each
33-
repeat is its ``run_single_task``: an ``Orchestrator`` built by its
33+
attempt is its ``run_single_task``: an ``Orchestrator`` built by its
3434
``build_text_orchestrator`` at that seed, run by its
3535
``run_simulation``; an attempt that raises is made again by its
3636
``run_with_retry``, and after the last the runner records
@@ -273,15 +273,15 @@ def answer(self, call_id, text, error):
273273
reply(text, error)
274274

275275
# -- the conversation: the upstream's batch runner, on the one task, in a thread
276-
def start(self, cfg, task, repeat=None):
276+
def start(self, cfg, task, attempt=None):
277277
self.config = cfg
278-
self.thread = threading.Thread(target=self._run, args=(cfg, task, repeat), daemon=True)
278+
self.thread = threading.Thread(target=self._run, args=(cfg, task, attempt), daemon=True)
279279
self.thread.start()
280280

281-
def _run(self, cfg, task, repeat):
281+
def _run(self, cfg, task, attempt):
282282
_CURRENT[0] = self
283283
try:
284-
self.result = trial(cfg, task, repeat)
284+
self.result = trial(cfg, task, attempt)
285285
except BaseException as e: # the runner raised (the unit was left): no SimulationRun
286286
self.error = e
287287
with self.lock:
@@ -330,22 +330,22 @@ def close(self):
330330
shutil.rmtree(self.dir, ignore_errors=True)
331331

332332

333-
def trial_seed(base, repeat):
334-
"""The seed the upstream's batch runner gives trial ``repeat - 1``: run_tasks draws one per trial
333+
def trial_seed(base, attempt):
334+
"""The seed the upstream's batch runner gives trial ``attempt - 1``: run_tasks draws one per trial
335335
from its base seed (batch.py, "Seed management": ``random.seed(config.seed)``, then
336336
``random.randint(0, 1000000)`` for each trial in order) - the same draws, from a generator of
337337
their own so nothing else's randomness moves."""
338338
r = random.Random(base)
339-
return [r.randint(0, 1000000) for _ in range(repeat)][-1]
339+
return [r.randint(0, 1000000) for _ in range(attempt)][-1]
340340

341341

342-
def trial(cfg, t, repeat=None):
343-
"""One unit's run: trial ``repeat - 1`` of the upstream's batch runner on the unit's task. The first
344-
repeat is run_tasks itself (a one-trial run: trial 0 at its seed), as every run was before repeats;
342+
def trial(cfg, t, attempt=None):
343+
"""One unit's run: trial ``attempt - 1`` of the upstream's batch runner on the unit's task. The first
344+
attempt is run_tasks itself (a one-trial run: trial 0 at its seed), as every run was before attempts;
345345
a later one is what run_tasks does for that trial of a run of as many (its ``_run_tracked``): its
346346
run_single_task at the trial's seed, made again by its run_with_retry, which records
347347
INFRASTRUCTURE_ERROR after the last retry."""
348-
n = int(repeat or 1)
348+
n = int(attempt or 1)
349349
if n <= 1:
350350
return run_tasks(cfg, [t], evaluation_type=EvaluationType.ALL).simulations[0]
351351
seed = trial_seed(cfg.seed, n)
@@ -467,7 +467,7 @@ def units(dataset, setup=None):
467467
return {"units": [u for u, t in tasks().items() if keep is None or keep(t)]}
468468

469469

470-
def setup(unit, dir, repeat=None):
470+
def setup(unit, dir, attempt=None):
471471
t = task(unit)
472472
_leave() # one unit at a time: an earlier one left unfinished is ended
473473
env = environment(t)
@@ -479,17 +479,17 @@ def setup(unit, dir, repeat=None):
479479
**({"TAU_RETRIEVAL": retrieval()} if retrieval() else {})}}]}
480480

481481

482-
def turn(unit, dir, transcript, simulator=None, judge=None, repeat=None):
482+
def turn(unit, dir, transcript, simulator=None, judge=None, attempt=None):
483483
"""The user's next message, or done. With nothing said yet, the upstream's
484484
Orchestrator starts: its first agent message, then the user's answer - in
485-
trial ``repeat - 1`` of the upstream's batch runner (``trial``)."""
485+
trial ``attempt - 1`` of the upstream's batch runner (``trial``)."""
486486
st, t = _state(unit), task(unit)
487487
c = st["conversation"]
488488
if not transcript:
489489
if not simulator:
490490
raise ValueError("the user is played by a model, and none was given")
491491
use_judge(t, judge, st)
492-
c.start(run_config(agent=AGENT, **user_config(simulator)), t, repeat)
492+
c.start(run_config(agent=AGENT, **user_config(simulator)), t, attempt)
493493
return c.next()
494494
if c.thread is None:
495495
raise ValueError("the conversation was not started: the first turn has an empty transcript")
@@ -499,7 +499,7 @@ def turn(unit, dir, transcript, simulator=None, judge=None, repeat=None):
499499
return c.next()
500500

501501

502-
def answer(unit, dir, setup, model, base_url, key, simulator=None, judge=None, repeat=None):
502+
def answer(unit, dir, setup, model, base_url, key, simulator=None, judge=None, attempt=None):
503503
"""The original: the upstream's own agent (its --agent, the ``upstream_agent`` option: LLMAgent by
504504
default) asked as ``model`` through the unit's relay, at the upstream's agent arguments
505505
(temperature 0) or the run's ``agent_reasoning_effort``, as --agent-llm-args gives one; the
@@ -519,7 +519,7 @@ def answer(unit, dir, setup, model, base_url, key, simulator=None, judge=None, r
519519
cfg = run_config(agent=upstream_agent(), llm_agent=llm,
520520
llm_args_agent=dict(effort_args("agent_reasoning_effort") or config.DEFAULT_LLM_ARGS_AGENT, **at),
521521
**({"user": "dummy_user"} if solo else user_config(simulator)))
522-
st.update(original=trial(cfg, t, repeat), config=cfg)
522+
st.update(original=trial(cfg, t, attempt), config=cfg)
523523
said = [m.content for m in st["original"].messages if m.role == "assistant" and m.content]
524524
return {"answer": said[-1] if said else ""}
525525

‎app/nullius/catalogue/benchmarks/tau3-bench/standard.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
"limits": {
116116
"turn_seconds": 600,
117117
"turns": 100,
118-
"repeats": "The upstream's batch runner draws one seed per trial from its base seed 300 (run_tasks: random.seed(300), then randint(0, 1000000) per trial, in order) and gives it to the agent and the user simulator: repeat N of a unit is its trial N-1 at that seed, as --num-trials runs it, so --repeat 4 is the leaderboard's four trials and pass^k is computed as the upstream's metrics compute it."
118+
"attempts": "The upstream's batch runner draws one seed per trial from its base seed 300 (run_tasks: random.seed(300), then randint(0, 1000000) per trial, in order) and gives it to the agent and the user simulator: attempt N of a unit is its trial N-1 at that seed, as --num-trials runs it, so --repeat 4 is the leaderboard's four trials and pass^k is computed as the upstream's metrics compute it."
119119
},
120120
"setups": {
121121
"original": {

‎app/nullius/catalogue/benchmarks/tau3-bench/upstream-settings.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"setting": "--num-trials",
4747
"values": "an integer from 1",
4848
"default": "1 (DEFAULT_NUM_TRIALS)",
49-
"nullius": "fixed:1 trial per repeat - a run's --repeat K (the builder's Repeats per unit) runs each unit K times, repeat N being the upstream's trial N-1 at the seed run_tasks draws for it (limits.repeats); the job's result.json carries pass^k"
49+
"nullius": "fixed:1 trial per attempt - a run's --repeat K (the builder's Attempts per unit) runs each unit K times, attempt N being the upstream's trial N-1 at the seed run_tasks draws for it (limits.attempts); the job's result.json carries pass^k"
5050
},
5151
{
5252
"entry": "tau2 run (src/tau2/cli.py)",
@@ -606,7 +606,7 @@
606606
"setting": "trials (4 or more)",
607607
"values": "an integer",
608608
"default": "4",
609-
"nullius": "fixed:1 a unit's repeat - --repeat 4 runs the leaderboard's four trials (limits.repeats)"
609+
"nullius": "fixed:1 a unit's attempt - --repeat 4 runs the leaderboard's four trials (limits.attempts)"
610610
},
611611
{
612612
"entry": "docs/leaderboard-submission.md",

0 commit comments

Comments
 (0)