Closed HansLoehle closed 9 months ago
I agree that this code is quite ugly but it works as expected because of https://github.com/Matthies/RubiChess/blob/654d1bd09678ad49179c2ec6ef7237700f4ef74e/src/RubiChess.h#L1734-L1735 So prerootmovestack[PREROOTMOVES].hash is movestack[0].hash, the hash of the actual root position which needs to be included in the repetition search.
https://github.com/Matthies/RubiChess/blob/654d1bd09678ad49179c2ec6ef7237700f4ef74e/src/tbprobe.cpp#L714
the initialisation of i should read
i = PREROOTMOVES - 1
because in line 715 prerootmovestack[i].hash is accessed before i becomes decremented.