Skip to content

Commit

Permalink
Document some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
vondele committed Jul 10, 2024
1 parent bf62adf commit f17bfdd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
16 changes: 10 additions & 6 deletions worker/games.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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


Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -1181,7 +1185,7 @@ def launch_fastchess(
+ cmd[idx + 1 :]
)

print(cmd)
# print(cmd)
try:
with subprocess.Popen(
cmd,
Expand Down
2 changes: 1 addition & 1 deletion worker/sri.txt
Original file line number Diff line number Diff line change
@@ -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"}
13 changes: 11 additions & 2 deletions worker/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f17bfdd

Please sign in to comment.