+ # It's wrong to just give the FEN (the move history is useful,
+ # and per the UCI spec, we should really have sent "ucinewgame"),
+ # but it's easier, and it works around a Stockfish repetition issue.
+ if ($engine->{'chess960'} != $pos->{'chess960'}) {
+ uciprint($engine, "setoption name UCI_Chess960 value " . ($pos->{'chess960'} ? 'true' : 'false'));
+ $engine->{'chess960'} = $pos->{'chess960'};
+ }
+ uciprint($engine, "position fen " . $pos->fen());
+ uciprint($engine, "go infinite");
+ $pos_calculating = $pos;
+ $pos_calculating_started = [Time::HiRes::gettimeofday];
+