Closed En-En-Code closed 1 year ago
Good catch on the rook/queen. Same for nodeCount. I don't exactly understand:
//What was happening previously was the engine would often be over the nodeCount,
//and was therefore forced to search the entire remaining depth instead of quiting out.
It's been a long time since I looked at this code. The if statement I used to have for timeouts seems especially odd. Maybe it was supposed to be an or instead of an and?
Thanks for the work again, changes look good!
I think the problem was the inequality was the wrong direction. Once the engine went over the specified number of nodes in a depth, it could not leave the depth since nodes < 3000
or 7500
would always be false, problematic in, say, endgames with a lot of decision points. If it went the other direction, it wouldn't have a problem leaving the depth early enough since Apollo's time management gives it quite a bit of leeway to continue searching without risking timeout.
Various illegal moves previously found in printed PVs have been resolved, namely moves after a checkmate, repeating moves being followed up by non-sense, and a mix-up in Zobrist calculations caused a promoting Black rook to have the same hash as a promoting Black queen. Some changes have made to printing the PV string. First, it is done with a single
printf
statement, to comply with UCI better. The input is also flushed afterwards, so GUIs render it as it is created. The big changes are changes to time management. No longer will the engine get stuck in an AB search and lose to time/disconnect. It turns out that devising an alternative time management scheme was pretty difficult to even break even with what it had before. Here are the results from 360 games at 40 moves/1 minute:Unfortunately, my sample size leaves a lot to be desired, but I can try to get in more if need be.