duanegoodner / xiangqigame

C++ AI engine for Chinese Chess, wrapped in Python manager and CLI.
MIT License
1 stars 0 forks source link

Program crashes when using AI player search depth >= 8 #75

Open duanegoodner opened 1 day ago

duanegoodner commented 1 day ago

Describe the bug Game with search-depth > 8 crashes, apparently due to high system memory usage.

To Reproduce Steps to reproduce the behavior:

  1. Install using procedure at https://github.com/duanegoodner/xiangqigame.
  2. From command line, run play_xiangqi -rst 8 -bst 8
  3. Eventually (usually after ~30 moves) program crashes, with terminal message similar to:
    [1]    1839133 killed

Expected behavior Game runs to completion (either RED WINS, BLACK WINS, or DRAW), and program terminates without crashing.

Desktop (please complete the following information):

Additional context Based on memory usage output by running top in another terminal while game is running, appears OS is killing process because of high memory usage. Likely due to TranspositionTable becoming very large.

Potential Solution Implement TranspositionTable pruning to remove old / un-useful entries.

duanegoodner commented 1 day ago

Most likely due to very large TranspositionTable. Currently, have no limit on TranspositionTable size, and do not perform any pruning.

Plan to implement a pruning scheme, and add option to specify max size of table.