LeelaChessZero / lc0

The rewritten engine, originally for tensorflow. Now all other backends have been ported here.
GNU General Public License v3.0
2.38k stars 525 forks source link

Fix TaskWorkers range #1933

Closed skiminki closed 9 months ago

skiminki commented 9 months ago

Option TaskWorkers uses default value (-1) outside its range [0, 128]. Fix this by expanding the range to [-1, 128].


The out-of-bounds default broke python-chess for me:

DEBUG:chess.engine:<UciProtocol (pid=101352)>: Connection made
DEBUG:chess.engine:<UciProtocol (pid=101352)>: << uci
DEBUG:chess.engine:<UciProtocol (pid=101352)>: >> id name Lc0 v0.31.0-dev+git.3f4c157
DEBUG:chess.engine:<UciProtocol (pid=101352)>: >> id author The LCZero Authors.
...
DEBUG:chess.engine:<UciProtocol (pid=101352)>: >> option name TaskWorkers type spin default -1 min 0 max 128
...
DEBUG:chess.engine:<UciProtocol (pid=101352)>: >> uciok
/usr/lib/python3.11/asyncio/unix_events.py:940: RuntimeWarning: A loop is being detached from a child watcher with pending handlers
  warnings.warn(
Error: expected value for option 'TaskWorkers' to be at least 0, got: -1
Error: cannot access local variable 'engine' where it is not associated with a value

Extending the range to [-1, 128] fixed it.