Skip to content

Commit 10d500e

Browse files
robertnurnbergppigazzini
authored andcommitted
Asciify player names for uniform Event tags
1 parent 6217ade commit 10d500e

4 files changed

Lines changed: 30 additions & 4 deletions

File tree

server/fishtest/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from fishtest.stats.stat_util import SPRT_elo, get_elo
1919
from fishtest.util import strip_run, worker_name
2020

21-
WORKER_VERSION = 321
21+
WORKER_VERSION = 322
2222

2323
WORKER_API_PATHS = {
2424
"/api/request_version",

worker/games.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import tempfile
1919
import threading
2020
import time
21+
import unicodedata
2122
from concurrent.futures import ThreadPoolExecutor
2223
from datetime import datetime, timedelta, timezone
2324
from pathlib import Path
@@ -1684,7 +1685,32 @@ def format_fastchess_options(options):
16841685
nodestime_cmd = ["timemargin=10000"]
16851686

16861687
def make_player(arg):
1687-
return run["args"][arg].split(" ")[0]
1688+
# Ensure uniform event naming across all platforms.
1689+
replacements = {
1690+
"\u00df": "ss",
1691+
"\u1e9e": "SS",
1692+
"\u00e6": "ae",
1693+
"\u00c6": "AE",
1694+
"\u0153": "oe",
1695+
"\u0152": "OE",
1696+
"\u00f8": "o",
1697+
"\u00d8": "O",
1698+
"\u0142": "l",
1699+
"\u0141": "L",
1700+
"\u0111": "d",
1701+
"\u0110": "D",
1702+
"\u00f0": "d",
1703+
"\u00d0": "D",
1704+
"\u00fe": "th",
1705+
"\u00de": "TH",
1706+
"\u0127": "h",
1707+
"\u0126": "H",
1708+
}
1709+
replacements = str.maketrans(replacements)
1710+
player = run["args"][arg].split(" ")[0].translate(replacements)
1711+
player = unicodedata.normalize("NFKD", player)
1712+
no_accents = "".join(c for c in player if not unicodedata.combining(c))
1713+
return no_accents.encode("ascii", errors="replace").decode("ascii")
16881714

16891715
if spsa_tuning:
16901716
tc_limit *= 2

worker/sri.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"__version": 321, "updater.py": "sUFX8k5Cb1k3f2Vpp6i1XmIJpYJ9+1U1H/4GDyWiLOnyN6/OxPOJSirPu6CnkPOb", "worker.py": "Ro/AxxY7FeE7vcciD5Q+cbZXobs0/XGbJrkq7y2Ch2n7g1kZs0A6ApqPUBRz3q+l", "games.py": "iRc54dGgrQBYp5ZtSKCbD2SFajhLGjc1Pv01wjqDgchceQnPMPlclMAVxthfuz6a"}
1+
{"__version": 322, "updater.py": "sUFX8k5Cb1k3f2Vpp6i1XmIJpYJ9+1U1H/4GDyWiLOnyN6/OxPOJSirPu6CnkPOb", "worker.py": "4pk3QIV0NKlU4L0fbAcwrwapMUeZTqRCQjwty8nRNLc90VtVwQbL84Y1wcoBDv48", "games.py": "PZ5t74yJuStxJP5m26Tk/iYRsvFZogXSbJmyyHhfu68/c4+x/GTDTnIdC1dfp7VG"}

worker/worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474

7575
FASTCHESS_SHA = "3de44228aec904e688a4ad71c554eb9d461a5a2a"
7676

77-
WORKER_VERSION = 321
77+
WORKER_VERSION = 322
7878
FILE_LIST = ["updater.py", "worker.py", "games.py"]
7979
HTTP_TIMEOUT = 30.0
8080
INITIAL_RETRY_TIME = 15.0

0 commit comments

Comments
 (0)