diff --git a/app/nullius/standard/pages/recipe.py b/app/nullius/standard/pages/recipe.py
index b6266a3e..addc6ad7 100644
--- a/app/nullius/standard/pages/recipe.py
+++ b/app/nullius/standard/pages/recipe.py
@@ -775,7 +775,7 @@ def pinned(p: dict) -> Dict[str, List[str]]:
add("model", f"Served by: no job of this recipe calls {roles[role]}; leave it empty.")
if errors:
return out
- nouns = (b.get("units") or {}).get("nouns", "units")
+ nouns = bench_nouns = (b.get("units") or {}).get("nouns", "units") # a dataset's count is always the benchmark's
if picks and all(p.get("setup") for p in picks): # only setups: a unit is theirs (a conversation)
nouns = picks[0]["o"]["units"]["nouns"]
each = [None if picks and all(p.get("setup") for p in picks) else x.get("units") for x in dss] # a setup's count is not the dataset's
@@ -895,7 +895,7 @@ def row(p: dict) -> list:
out["review"] = [[STEP["benchmark"], "Benchmark", f"{b['label']} · needs {', '.join(b['needs'])}"],
[STEP["runner"], "Runner", "Nullius"],
[STEP["dataset"], "Datasets" if many else "Dataset",
- ", ".join(f"{x.get('label') or x['id']}" + (f" · {x['units']} {nouns}" if x.get("units") else "") for x in dss)],
+ ", ".join(f"{x.get('label') or x['id']}" + (f" · {x['units']} {bench_nouns}" if x.get("units") else "") for x in dss)],
*[[STEP["limits" if (b.get("options") or {})[k].get("limit") else "dataset" if (b.get("options") or {})[k].get("step") else "agent"], (b.get("options") or {})[k].get("label") or k.replace("_", " ").capitalize(),
_shown((b.get("options") or {})[k], v, per_ds[next(x["id"] for x in dss if per_ds[x["id"]].get(k) == v)]) + ("" if k in chosen_opts else " (its default)") + f" · {', '.join(x['id'] for x in dss if per_ds[x['id']].get(k) == v)}"]
for k, v in {k: v for vals in per_ds.values() for k, v in vals.items()}.items()
diff --git a/app/static/builder/command-builder.js b/app/static/builder/command-builder.js
index a8438d2e..db4e983f 100644
--- a/app/static/builder/command-builder.js
+++ b/app/static/builder/command-builder.js
@@ -715,7 +715,7 @@
if (step === S.dataset)
return `
Which datasets?
`
+ `${b.datasets.map(x => tile({attr: 'std-dataset', key: x.id, on: C.datasetsOf(rec).includes(x.id), title: x.label,
- tip: x.summary || '', meta: x.units ? x.units + ' ' + u.nouns : '',
+ tip: x.summary || '', meta: x.units ? x.units + ' ' + (b.units || {nouns: 'units'}).nouns : '', // a dataset's count is the benchmark's, whoever runs it
foot: (x.controls || []).map(c => controlChip(c)).join('') + checkChip('stable', (x.proofs || {}).units, (x.failed || {}).units, 'the same ids twice, each unique')
+ ((b.controls || []).some(c => c.key === 'oracle') ? checkChip('no leak', (x.proofs || {}).leak, (x.failed || {}).leak, 'nothing of the reference shows before the run') : '')})).join('')}
`
+ benchOptions(rec, b, 'dataset') + credentialWarnings(b, b.datasets.filter(x => C.datasetsOf(rec).includes(x.id)));
diff --git a/app/tests/test_standard_setups.py b/app/tests/test_standard_setups.py
index 26b60ec1..823310e0 100644
--- a/app/tests/test_standard_setups.py
+++ b/app/tests/test_standard_setups.py
@@ -311,6 +311,17 @@ def test_one_original_participant_uses_the_selected_model_scope(self):
self.assertIn("run locomo model --model vendor/their-model", custom["script"])
self.assertTrue(self.compiled(others=["original"], model="")["errors"])
+ def test_locomo_dataset_counts_questions_when_only_its_original_runs(self):
+ out = recipe.compile({"version": 1, "harness": "standard", "name": "locomo-experiment", "title": "LoCoMo",
+ "benchmark": "locomo", "datasets": ["locomo10"], "others": ["original"],
+ "model_choice": "any", "provider": "openai", "model": "gpt-4-turbo", "limit": "",
+ "concurrency": "", "unsandboxed": False, "where": "local", "backend": "local", "options": {}})
+ self.assertEqual(out["errors"], [])
+ rows = {r[1]: r[2] for r in out["review"]}
+ self.assertNotIn("1540 conversations", rows["Dataset"])
+ self.assertEqual(rows["Dataset"], "LoCoMo-10 · 1540 questions")
+ self.assertEqual(rows["Scope"].split()[:2], ["all", "conversations"]) # the setup's own unit, with no count of its own
+
def test_paper_filter_also_applies_to_a_memory_capability(self):
out = self.compiled(others=["mem0"], model_choice="paper", model="gpt-3.5-turbo-16k")
self.assertEqual(out["errors"], [])
diff --git a/app/ui_tests/test_builder_dataset_cards.py b/app/ui_tests/test_builder_dataset_cards.py
new file mode 100644
index 00000000..e2bf051f
--- /dev/null
+++ b/app/ui_tests/test_builder_dataset_cards.py
@@ -0,0 +1,35 @@
+"""The Dataset step's cards as the page draws them: a dataset's count in the benchmark's own unit."""
+import json
+import re
+import subprocess
+import unittest
+
+from ui_tests.builder_support import APP, CompilerCase
+
+
+class DatasetCards(CompilerCase):
+ def draw(self, benchmark, others):
+ """The Dataset step of ``benchmark`` with ``others`` chosen, and the Limits step's unit:
+ standardForm cut from the page script, its other steps' helpers stubbed."""
+ page = (APP / "static/builder/command-builder.js").read_text(encoding="utf-8")
+ cut = lambda start, end: page[page.index(start):page.index(end, page.index(start))]
+ line = lambda name: re.search(r"^ const %s = .*$" % name, page, re.M).group(0) + "\n"
+ program = ("const C=require(" + json.dumps(str(APP / "static/builder/command-builder-core.js")) + ")(" + json.dumps(self.schema) + ");\n"
+ + "const S=C.STEP;let step=S.dataset;const controlChip=()=>'',checkChip=()=>'',benchOptions=()=>'',credentialWarnings=()=>'';\n"
+ + line("esc") + cut(" const unitsOf = ", " // the first clause") + cut(" const tile = t =>", " // The grids drawn by the server")
+ + cut(" function standardForm(", " function benchLimits(")
+ + "const r=C.createStandard(" + json.dumps(benchmark) + ");r.others=" + json.dumps(others) + ";"
+ + "process.stdout.write(JSON.stringify({html:standardForm(r),limits:unitsOf(r).nouns}));")
+ return json.loads(subprocess.run([self.node, "-"], input=program, check=True, capture_output=True, text=True).stdout)
+
+ def test_locomo10_counts_questions_whatever_runs(self):
+ for others in (["original"], ["mem0"], ["original", "mem0"], ["nop"]):
+ with self.subTest(others=others):
+ got = self.draw("locomo", others)
+ self.assertIn("1540 questions", got["html"])
+ self.assertNotIn("1540 conversations", got["html"])
+ self.assertEqual(self.draw("locomo", ["original"])["limits"], "conversations") # the Limits step counts the setup's own
+
+
+if __name__ == "__main__":
+ unittest.main()