I'm writing a Java chess app that interfaces with a UCI engine. I have a series of test positions for which I want to get analysis from the engine. I want my tests to be reproducible so I'm trying to use the engine in a deterministic manner. So I'm using a single thread; a fixed depth search; and I clear the engine hash prior to starting any analysis.
However, I'm finding that if I analyse "test B" alone in a test run, it will fail. But if I run "test A followed by test B", both will pass. This is because analysing position B differs depending on whether position A was analysed previously or not.
- I don't restart the engine process between test positions. I assumed that a clear hash would be enough
- I may not be using the UCI "isready" in the right places. I only do that once when initially starting the engine; not between every test position
UCI commands prior to first analysis:
Code: Select all
UCI COMMAND [uci]
UCI COMMAND [isready]
UCI COMMAND [setoption name hash value 64]
UCI COMMAND [setoption name threads value 1]
UCI COMMAND [ucinewgame]
UCI COMMAND [position fen r4rk1/pppbqppp/5n2/3P4/3P4/b4B2/P1Q2PPP/RN3RK1 w - - 0 1]
UCI COMMAND [setoption name Clear Hash]
UCI COMMAND [setoption name Ponder value false]
UCI COMMAND [go depth 10 ]
Code: Select all
UCI COMMAND [stop]
UCI COMMAND [position fen r4rk1/pppbqppp/5n2/3P4/3P4/b1N2B2/P1Q2PPP/R4RK1 b - - 0 1]
UCI COMMAND [setoption name Clear Hash]
UCI COMMAND [setoption name Ponder value false]
UCI COMMAND [go depth 10 ]
Thanks for any help,
Gordon