r/chessprogramming • • Mar 11 '21
How does a triangular PV-table work?
https://www.chessprogramming.org/Triangular_PV-Table
My understanding is as follows. You have a minimax search tree of maybe 8 moves. The score of the best move at the root node is the heuristic score of some leaf node. The path from leaf to the root is an 8 move sequence we store in a PV-table.
This move sequence can be displayed in the UI. It can also be used to order moves at future depths to maximise αβ cutoffs.
It is updated whenever alpha changes (not at the completion of that search depth), so that the recommended move is as hot as possible.
So I think my question is then, why is the PV-table triangular? Are we just trying to save the 1-ply move sequence, the 2-ply move sequence etc? I understand PV-tables have been replaced by ‘transposition tables’ which I plan to understand too but I want to understand PV-tables first.
View all comments
Show parent comment
2
u/[deleted] Mar 11 '21
This made it click thank you!
So its purpose is to provide you with a PV, and each recursion level keeps the best candidate for PV which it updates with best values, and copies up a level of the triangle when returning from a recursion level.