performance progress tracking

This commit is contained in:
Moritz 2025-11-15 18:30:21 +01:00
parent f1ec0a08d9
commit e66771dba9
16 changed files with 2816 additions and 121 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,78 @@
# converts the stockfish test suite epd file to a csv file containing just the fen and the best move
import sys
INPUT_FILE_PATH = "STS1-STS15_LAN_v6.epd"
OUTPUT_FILE_PATH = "../src/bin/stockfish_testsuite.csv"
def parse_line(line: str) -> str | None:
try:
parts = line.split(';')
if not parts:
return None
main_part = parts[0]
other_parts = parts[1:]
bm_index = main_part.find(" bm ")
if bm_index == -1:
return None
fen = main_part[:bm_index].strip()
print(f"fen: '{fen}'")
fen += " 0 1"
lan_move = None
for part in other_parts:
part = part.strip()
if part.startswith('c9 "'):
content_start = len('c9 "')
content_end = part.rfind('"')
if content_end <= content_start:
return None
content = part[content_start:content_end].strip()
if not content:
return None
lan_move = content.split()[0]
break
if lan_move is None:
return None
return f"{fen},{lan_move}"
except Exception:
return None
def convert_file(input_path: str, output_path: str):
try:
with open(input_path, 'r', encoding='utf-8') as infile, \
open(output_path, 'w', encoding='utf-8') as outfile:
for line in infile:
line_content = line.strip()
if not line_content:
continue
output_line = parse_line(line_content)
if output_line:
outfile.write(output_line + '\n')
except FileNotFoundError:
print(f"Error: Input file '{input_path}' not found.", file=sys.stderr)
sys.exit(1)
except IOError as e:
print(f"Error reading/writing file: {e}", file=sys.stderr)
sys.exit(1)
except Exception as e:
print(f"An unexpected error occurred: {e}", file=sys.stderr)
sys.exit(1)
if __name__ == "__main__":
convert_file(INPUT_FILE_PATH, OUTPUT_FILE_PATH)

View file

@ -1,22 +0,0 @@
a2a3 380
b2b3 420
c2c3 420
d2d3 539
e2e3 599
f2f3 380
g2g3 420
h2h3 380
a2a4 420
b2b4 421
c2c4 441
d2d4 560
e2e4 600
f2f4 401
g2g4 421
h2h4 420
b1a3 400
b1c3 440
g1f3 440
g1h3 400
Total8902