Skip to content
Closed
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
4 changes: 3 additions & 1 deletion site/assets/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4568,7 +4568,9 @@ function loadBenchmarkIndex() {
}

function foldName(value) {
return String(value || "").toLowerCase().replace(/[^a-z0-9]+/g, "");
// Source names include τ-Rec and Φ-Bench; stripping their letters made
// literal name queries empty and hid real catalog records.
return String(value || "").toLowerCase().replace(/[^\p{L}\p{N}]+/gu, "");
}

// Names and aliases use the same matching rules for every source.
Expand Down
32 changes: 32 additions & 0 deletions tests/test_score_filters.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Score cutoff semantics and the data shared by ranking, charts and HTML seeds."""

import csv
import json
import math
import shutil
Expand Down Expand Up @@ -372,3 +373,34 @@ def test_seed_preserves_score_entry_proxy_and_prefers_release_or_publication():
assert "First dated LLM score (model-release proxy) Feb 29, 2024" in markup
assert "Pre-2024 score entry" in markup
assert "2 of 2 matches" in markup


@pytest.mark.parametrize(("query", "name"), [("τ", "τ-Rec"), ("π", "π-SUB"), ("Φ", "Φ-Bench")])
def test_catalog_search_keeps_unicode_letters_in_source_names(query, name):
# These names come from the committed source snapshot, not invented metadata.
with Path("data/leaderboard_snapshots/claire_radar_benchmarks_2026-09-25.csv").open() as file:
records = [
{"name": row["name"], "slug": row["benchmark_id"], "source": "claire_radar"}
for row in csv.DictReader(file)
]
script = r"""
const fs = require('node:fs');
const source = fs.readFileSync('site/assets/app.js','utf8');
const fn = name => {
const start = source.indexOf(`function ${name}(`);
return source.slice(start,source.indexOf('\n}\n',start)+2);
};
const search = new Function(
`${fn('foldName')}\n${fn('searchBenchmarkIndex')}\nreturn searchBenchmarkIndex;`
)();
const input = JSON.parse(fs.readFileSync(0,'utf8'));
console.log(JSON.stringify(search(input.records,input.query).map(row => row.name)));
"""
result = subprocess.run(
["node", "-e", script],
input=json.dumps({"records": records, "query": query}),
text=True,
capture_output=True,
check=True,
)
assert name in json.loads(result.stdout)
Loading