Open mateusz2173 opened 4 months ago
Should be done after this: #10
I will start working on this today.
One more thing:
Operations on TT (write, read entry) should be safe to use with multiple threads.
We'll rely on it later.
One can do it with atomics or lockless tricks (like here https://www.chessprogramming.org/Shared_Hash_Table#Lockless) or whatever you consider good enough
Ohhhh, that changes things a bit. Sure I will change it.
Thx and sorry for the confusion
I should come up with some solution by the EOW.
@mateusz2173 Should TT also include age?
If it doesnt require a lot of effort, let's include it.
Read https://www.chessprogramming.org/Transposition_Table Transposition Table is a cache table for search. Implement transposition table which can store 3 types of scores:
alpha < score < beta
alpha < beta <= score
score <= alpha
)Along with scores we should also store:
If entry already exists for the position, replace it only if
current_depth > old_entry_depth
Add reading transposition table to the beginning of the search (before we jump into searching moves): In case we've found cache entry for the position and
depth_entry >= current_depth
then we can return cached score.Let's make cache size = 16MB for now Index the table using zobryist hashes (they are implemented in our base -
chess.hpp
)entry = table[position.hash % table_size]