hi,
didnt know where to post this so sorry for creating an issue..
If you want to prefer shorter mates you can easily change this line
|
return -self.eval_mate_upper if is_in_check else 0 |
to
return -self.eval_mate_upper + ply
i dont see any ply information yet but this is just the distance from the root, depth might not be accurate because of extensions..
you can then remove this
|
# try to reduce path to mate |
also this looks very dangerous
while python dictionaries look awesome for a tt, that tt implementation will grow infinitely if im not mistaken...
you can do something like this instead to create a list with a fixed amount of elements
tt_size = 2**19-1
transposition_table = [[] for _ in range(tt_size)]
and then you can calculate the index
index = hash % (tt_size - 1)
of course you would need to implement a hashing schema for this first...
additionally I think you are restricting the ttmove too much, you should always search it first if it is a legal move in the position, regardless of pvnode, check or entry depth..
|
if not is_pv_node and not is_in_check and tt_entry['tt_depth'] >= v_depth and abs(tt_entry['tt_value']) < self.eval_mate_upper and tt_entry['tt_move']: |
also if the ttmove is < beta you continue to search all other moves but you allow the ttmove to be searched again, just add a continue in your for loop