How do you make sure that your array is free of trash ?
Here is what i mean (2 options):
Code: Select all
void search(...)
{
option1: triangular[rd2][rd2].move = moveNone
while(moves)
{
...
option2:
triangular[rd2+1][rd2+1].move = moveNone
moveDo()
value=-search()
moveUndo()
if(value>alpha) collectPv()
...
}
...
}
doesnt belong to the current line. Imagine you
deepen move1(rd2) which leads to pv.Now move2(rd2) will get a transScore leading to a new pv (but,you dont have a continuation).
Does your triangularArray still contains the subsequent moves of move1 ??! And will they be added to move2 as newPv ??
i dont use the triangular approach, so i am not sure at the moment
if it is enough to clean up the _next_ entry only !? However, when returning a score which leads to a newPv make sure that the triangular array is cleaned up, or includes the moves _really_ belonging to the current bestmove.
That problem is not only given by using early return by trans, but a general issue to handle if you return scores which may lead to a new
pv and dont include a move.