diff --git a/.github/workflows/scripts/README.md b/.github/workflows/scripts/README.md index 3d56d3cdd..09530a369 100644 --- a/.github/workflows/scripts/README.md +++ b/.github/workflows/scripts/README.md @@ -507,7 +507,11 @@ implausible row count) and hands the rows to the shared single-metric engine in identities in `backend/services/carbon_board_identities.py`; other names are auto-matched or handed to the release radar, and a board's `excluded` names (partial runs, non-standard setups) are skipped. The engine keeps one row per -catalog model and harness (the best upstream setting), adopts hand-imported +catalog model and harness (the best upstream setting); the three Artificial +Analysis boards set `effort_in_model_name` and keep one row per upstream name +with its effort setting, as their reviewed names do. A managed row whose model +name changes is renamed in place, found by the entry label in its methodology. +The engine adopts hand-imported rows for the same model, and never creates papers. A managed row whose upstream entry leaves the leaderboard is deleted (`_deleted`); a row carrying reviewer notes is kept and reported as `missing_upstream`. The three Artificial diff --git a/backend/services/carbon_board_syncs.py b/backend/services/carbon_board_syncs.py index 7abbb966d..6d31d1e51 100644 --- a/backend/services/carbon_board_syncs.py +++ b/backend/services/carbon_board_syncs.py @@ -744,6 +744,7 @@ def _fetching( url=CRITPT_URL, task_slug="scientific-reasoning", dataset_slug="critpt", + effort_in_model_name=True, retire_missing=False, metric="Accuracy", identities=IDENTITIES["critpt"], @@ -760,6 +761,7 @@ def _fetching( url=CRITPT_V2_URL, task_slug="scientific-reasoning", dataset_slug="critpt-v2", + effort_in_model_name=True, retire_missing=False, metric="Accuracy", identities=IDENTITIES["critpt-v2"], @@ -775,6 +777,7 @@ def _fetching( url=TERMINAL_BENCH_SCIENCE_URL, task_slug="scientific-reasoning", dataset_slug="terminal-bench-science-0-1", + effort_in_model_name=True, retire_missing=False, metric="Accuracy", identities=IDENTITIES["terminal-bench-science-0-1"], diff --git a/backend/services/leaderboard_model_matching_service.py b/backend/services/leaderboard_model_matching_service.py index 34fc3bb27..0e54f910d 100644 --- a/backend/services/leaderboard_model_matching_service.py +++ b/backend/services/leaderboard_model_matching_service.py @@ -54,6 +54,15 @@ class MatchedModel: ) +def catalog_name(name: str) -> str: + """The catalog model a leaderboard name denotes, without its effort setting. + + A matched model gets this name whether the full leaderboard name or only + its base resolved, so an alias recorded later never renames it. + """ + return _EFFORT_SUFFIX.sub("", name) + + _FAMILY_LABS = ( (re.compile(r"(?:claude|opus|sonnet|haiku)\b", re.I), "Anthropic"), (re.compile(r"(?:gpt|chatgpt|codex)\b|o\d+(?:\b|-)", re.I), "OpenAI"), @@ -161,19 +170,19 @@ def match(self, models: list[LeaderboardModel]) -> dict[str, MatchedModel]: self._alias_matches([name for name in names if name not in releases]) ) matched = { - name: MatchedModel(release.paper_id, name, release.is_open) + name: MatchedModel(release.paper_id, catalog_name(name), release.is_open) for name, release in releases.items() } for name in names: if name not in matched and (paper_id := announcing_paper_id(self.db, name)): hf_model_url = self._weights_url(paper_id, name) matched[name] = MatchedModel( - paper_id, name, hf_model_url is not None, hf_model_url + paper_id, catalog_name(name), hf_model_url is not None, hf_model_url ) bases = { name: base for name in names - if name not in matched and (base := _EFFORT_SUFFIX.sub("", name)) != name + if name not in matched and (base := catalog_name(name)) != name } if bases: base_matches = self.match( diff --git a/backend/services/live_leaderboard_sync.py b/backend/services/live_leaderboard_sync.py index c02cc19cd..816786e94 100644 --- a/backend/services/live_leaderboard_sync.py +++ b/backend/services/live_leaderboard_sync.py @@ -67,6 +67,10 @@ class LiveLeaderboard: Several boards may share a benchmark when each publishes its own metric (Physics-IQ Verified's I2V and V2V tracks): a board only reads and writes rows that carry its metric. + + An auto-matched entry is named after its catalog model, so the settings of + one model share a row; ``effort_in_model_name`` keeps the upstream name + with its effort setting instead, for boards whose reviewed names do. """ source: str @@ -81,6 +85,7 @@ class LiveLeaderboard: model_name_suffix: str = "" excluded: dict[str, str] = field(default_factory=dict) adopt_unmanaged: bool = True + effort_in_model_name: bool = False retire_missing: bool = True @property @@ -113,6 +118,7 @@ class LiveSyncStats: created: int = 0 changed: int = 0 adopted: int = 0 + renamed: int = 0 auto_matched: list[str] = field(default_factory=list) unreviewed: list[str] = field(default_factory=list) missing_papers: list[str] = field(default_factory=list) @@ -283,10 +289,13 @@ def sync( if (match := matched.get(entry.name)) is None: stats.unreviewed.append(entry.label) continue + model_name = ( + entry.name if board.effort_in_model_name else match.model_name + ) selected.append( ( match.paper_id, - match.model_name + board.model_name_suffix, + model_name + board.model_name_suffix, match.is_open, match.hf_model_url, entry, @@ -323,11 +332,14 @@ def sync( ] rows_by_identity: dict[tuple[int, str, str | None], Evaluation] = {} unmanaged_by_model: dict[tuple[int, str], Evaluation] = {} + managed_by_label: dict[tuple[int, str], Evaluation] = {} for row in rows: rows_by_identity.setdefault( (row.paper_id, row.model_name, row.harness), row ) - if not (row.methodology or "").startswith(board.managed_prefix): + if label := board.managed_label.match(row.methodology or ""): + managed_by_label.setdefault((row.paper_id, label["label"]), row) + elif not (row.methodology or "").startswith(board.managed_prefix): unmanaged_by_model.setdefault((row.paper_id, row.model_name), row) linked_paper_ids = { paper_id @@ -345,6 +357,13 @@ def sync( entry, ) in best.items(): row = rows_by_identity.get(key) + if row is None: + renamed = managed_by_label.get((paper_id, entry.label)) + if renamed is not None and id(renamed) not in published: + row = renamed + row.model_name = model_name + rows_by_identity[key] = row + stats.renamed += 1 if row is None and board.adopt_unmanaged: fallback = unmanaged_by_model.get((paper_id, model_name)) if fallback is not None and id(fallback) not in published: diff --git a/backend/tests/evaluation/test_carbon_board_syncs.py b/backend/tests/evaluation/test_carbon_board_syncs.py index 791eaaabc..23ec76251 100644 --- a/backend/tests/evaluation/test_carbon_board_syncs.py +++ b/backend/tests/evaluation/test_carbon_board_syncs.py @@ -675,6 +675,72 @@ def test_sync_reports_unknown_models_to_the_release_radar(): assert session.query(ModelReleaseSignal).count() == 1 +def _add_release(session: Session) -> ModelRelease: + release = ModelRelease( + id=7, + paper_id=2, + canonical_name="Mythos 7", + publisher="Anthropic", + aliases=[], + is_open=False, + ) + session.add(release) + session.commit() + return release + + +@pytest.mark.parametrize( + ("effort_in_model_name", "model_name"), + [(False, "Mythos 7"), (True, "Mythos 7 (max)")], +) +def test_auto_matched_effort_labels_keep_one_row_when_the_label_gains_an_alias( + effort_in_model_name, model_name +): + session = _session() + release = _add_release(session) + board = _board(effort_in_model_name=effort_in_model_name) + entries = [ + _entry("Opus 5.5 (xhigh)", 3.61), + _entry("Sol 5.6 (xhigh)", 4.7), + _entry("Mythos 7 (max)", 6.0), + ] + first = LiveLeaderboardSyncService(session, board).sync(entries) + assert first.auto_matched == ["Mythos 7 (max) (mini-SWE-agent)"] + row = _rows(session)[f"{model_name} (mini-SWE-agent)"] + + session.add( + ModelProviderAlias( + model_release_id=release.id, provider="test-board", alias="Mythos 7 (max)" + ) + ) + session.commit() + again = LiveLeaderboardSyncService(session, board).sync(entries) + assert (again.created, again.renamed) == (0, 0) + assert _rows(session)[f"{model_name} (mini-SWE-agent)"] is row + assert session.query(Evaluation).filter_by(paper_id=2).count() == 2 + + +def test_sync_renames_the_managed_row_of_an_upstream_label(): + session = _session() + _add_release(session) + entries = [ + _entry("Opus 5.5 (xhigh)", 3.61), + _entry("Sol 5.6 (xhigh)", 4.7), + _entry("Mythos 7 (max)", 6.0), + ] + LiveLeaderboardSyncService(session, _board()).sync(entries) + row = _rows(session)["Mythos 7 (mini-SWE-agent)"] + row.model_name = "Mythos 7 (max)" + row.methodology += " Reviewer note." + session.commit() + + stats = LiveLeaderboardSyncService(session, _board()).sync(entries) + assert (stats.created, stats.renamed) == (0, 1) + assert row.model_name == "Mythos 7" + assert row.methodology.endswith("Test protocol. Reviewer note.") + assert stats.missing_upstream == [] + + def test_bare_model_names_reach_the_radar_with_their_family_lab(): session = _session() LiveLeaderboardSyncService(session, _board()).sync(