From ddaeed83744735c4310fbfba9da88fff8e8999c2 Mon Sep 17 00:00:00 2001 From: andrew Date: Thu, 31 Aug 2023 04:16:37 -0400 Subject: [PATCH] Critical bug fix when setting test.errors Somehow in 10 years I've not yet encounted that in python the expression 3 or 3 evaluates to 3, and not True. This allowed for an attempt to save non-boolean values into the test.error field. Which produced seemingly infinite time losses on some tests I was running with some of the first versions of Torch to ever be on OpenBench. Also, don't report time loss PGNS back. No one cares about them, and flagging the tests is annoying. --- Client/Client.py | 3 --- OpenBench/utils.py | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Client/Client.py b/Client/Client.py index bc7e95d..b8b4082 100644 --- a/Client/Client.py +++ b/Client/Client.py @@ -571,9 +571,6 @@ class PGNHelper: reason = PGNHelper.get_pgn_header(sliced_headers, 'Termination') - if reason and 'time forfeit' in reason: - return 'Time Forfeit' - if reason and 'abandoned' in reason: return 'Disconnect' diff --git a/OpenBench/utils.py b/OpenBench/utils.py index 0414eac..e22f0e0 100644 --- a/OpenBench/utils.py +++ b/OpenBench/utils.py @@ -821,7 +821,6 @@ def update_test(request, machine): crashes = int(request.POST['crashes' ]) timelosses = int(request.POST['timelosses']) illegals = int(request.POST['illegals' ]) - has_error = crashes or timelosses or illegals # Extract Database information machine_id = int(request.POST['machine_id']) @@ -851,7 +850,8 @@ def update_test(request, machine): test.WW += WW test.games += games # Overall - test.error = test.error or has_error + # Consider only Crashes or Illegal moves as real errors + test.error = bool(test.error or crashes or illegals) if test.test_mode == 'SPRT':