From f17bfdd08062d1fb3268f9cb810adbbb8b564d4e Mon Sep 17 00:00:00 2001 From: Joost VandeVondele Date: Wed, 10 Jul 2024 21:45:32 +0200 Subject: [PATCH] Document some issues --- worker/games.py | 16 ++++++++++------ worker/sri.txt | 2 +- worker/worker.py | 13 +++++++++++-- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/worker/games.py b/worker/games.py index f65e1cd6f..1a33f8406 100644 --- a/worker/games.py +++ b/worker/games.py @@ -918,7 +918,9 @@ def result_to_score(_result): odd = round_ even = round_ + 1 if odd in rounds.keys() and even in rounds.keys(): - print("Hi there:", rounds) + print( + "Hi there:", rounds + ) # TODO TODO https://github.com/Disservin/fast-chess/issues/532 assert rounds[odd]["white"][0:3] == "New" assert rounds[odd]["white"] == rounds[even]["black"] assert rounds[odd]["black"] == rounds[even]["white"] @@ -956,7 +958,9 @@ def results_to_score(results): s5 = results_to_score(rounds["pentanomial"]) + results_to_score(rounds["trinomial"]) assert sum(LDW) == 2 * sum(rounds["pentanomial"]) + sum(rounds["trinomial"]) epsilon = 1e-4 - print("Here we have: ", wld, rounds, s3, s5) + print( + "Here we have: ", wld, rounds, s3, s5 + ) # TODO TODO https://github.com/Disservin/fast-chess/issues/532 assert abs(s5 - s3) < epsilon @@ -1001,16 +1005,16 @@ def shorten_hash(match): else: raise WorkerException("Finished match uncleanly") - # Parse line like this: + # Parse line like this: # TODO TODO https://github.com/Disservin/fast-chess/issues/535 # Warning: New-SHA doesn't have option ThreatBySafePawn if "Warning:" in line and "doesn't have option" in line: - message = r'Cutechess-cli says: "{}"'.format(line) + message = r'fast-chess says: "{}"'.format(line) raise RunException(message) # Parse line like this: # Warning: Invalid value for option P: -354 if "Warning:" in line and "Invalid value" in line: - message = r'Cutechess-cli says: "{}"'.format(line) + message = r'fast-chess says: "{}"'.format(line) raise RunException(message) # Parse line like this: @@ -1181,7 +1185,7 @@ def launch_fastchess( + cmd[idx + 1 :] ) - print(cmd) + # print(cmd) try: with subprocess.Popen( cmd, diff --git a/worker/sri.txt b/worker/sri.txt index 80ae1b753..13d33f393 100644 --- a/worker/sri.txt +++ b/worker/sri.txt @@ -1 +1 @@ -{"__version": 241, "updater.py": "Mg+pWOgGA0gSo2TuXuuLCWLzwGwH91rsW1W3ixg3jYauHQpRMtNdGnCfuD1GqOhV", "worker.py": "y+b53giRCKMpBIZH180qFQnIjReH0HLiahq4prw497j8KzwYt6gM6urNMpttUfig", "games.py": "I9/zSBcifvMrKrSySiUe9jvV+kVRbWB8flV6hFvNL9aNty4aCwB/kLPXWhGKEprI"} +{"__version": 241, "updater.py": "Mg+pWOgGA0gSo2TuXuuLCWLzwGwH91rsW1W3ixg3jYauHQpRMtNdGnCfuD1GqOhV", "worker.py": "fVKhQAq40Q4MpaR/eJc0+3vBgVs76JpHasMV51cO7TJBGOpr26A7KN06gbpWuI9l", "games.py": "WZWABDxNfVg2hrily964O6GZy4WCXXEcTEGerRHOxplUuINLa1nXpVOw3CDEaqLQ"} diff --git a/worker/worker.py b/worker/worker.py index 09cfab293..ff38e6293 100644 --- a/worker/worker.py +++ b/worker/worker.py @@ -412,7 +412,9 @@ def verify_required_fastchess(fastchess_path): close_fds=not IS_WINDOWS, ) as p: errors = p.stderr.read() - pattern = re.compile("fast-chess alpha ([0-9]*).([0-9]*).([0-9]*)") + pattern = re.compile( + "fast-chess alpha ([0-9]*).([0-9]*).([0-9]*)" + ) # TODO TODO https://github.com/Disservin/fast-chess/issues/526 major, minor, patch = 0, 0, 0 for line in iter(p.stdout.readline, ""): m = pattern.search(line) @@ -455,10 +457,17 @@ def setup_fastchess(worker_dir): # build it ourselves try: + fastchess_sha = "553339ce0b4e3af03b632b400ee37a0a250eac4d" + username = "gahtan-syarif" fastchess_sha = "29fc1002bd3ff362b3a0662a1ba0c9d261d1bc6e" + username = "Disservin" item_url = ( - "https://api.github.com/repos/Disservin/fast-chess/zipball/" + fastchess_sha + "https://api.github.com/repos/" + + username + + "/fast-chess/zipball/" + + fastchess_sha ) + print("Building fast chess from sources at {}".format(item_url)) blob = requests_get(item_url).content