Skip to content

Commit

Permalink
Revert default Syzygy max_fds to 128
Browse files Browse the repository at this point in the history
Python's mmap.mmap() actually (unnecessarily, with regard to our use
case) duplicates the file descriptor and keeps a copy around for the
lifetime of the memory map.
  • Loading branch information
niklasf committed Mar 31, 2023
1 parent 0392397 commit 12c6211
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chess/syzygy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ class Tablebase:
"""
Manages a collection of tablebase files for probing.
"""
def __init__(self, *, max_fds: Optional[int] = None, VariantBoard: Type[chess.Board] = chess.Board) -> None:
def __init__(self, *, max_fds: Optional[int] = 128, VariantBoard: Type[chess.Board] = chess.Board) -> None:
self.variant = VariantBoard

self.max_fds = max_fds
Expand Down Expand Up @@ -1963,7 +1963,7 @@ def __exit__(self, exc_type: Optional[Type[BaseException]], exc_value: Optional[
self.close()


def open_tablebase(directory: str, *, load_wdl: bool = True, load_dtz: bool = True, max_fds: Optional[int] = None, VariantBoard: Type[chess.Board] = chess.Board) -> Tablebase:
def open_tablebase(directory: str, *, load_wdl: bool = True, load_dtz: bool = True, max_fds: Optional[int] = 128, VariantBoard: Type[chess.Board] = chess.Board) -> Tablebase:
"""
Opens a collection of tables for probing. See
:class:`~chess.syzygy.Tablebase`.
Expand Down

0 comments on commit 12c6211

Please sign in to comment.