-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Principal Variation Search #141
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions for clarification
Wow this is impressive Not quite clear to me the (subtle?) differences between PVS and NegaScout yet (or if they are actually the same thing?) - is NegaScout still in our "book of work"? Looking at the issues, seems like they (PVS and NegaScout) are being lumped in together, i.e. #71 PS: did a quick visualisation of the fen strings, can't say I managed to reach any conclusion why sometimes PVS is so much faster, sometimes we get similar perf... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks v good (good design good tests imo) - nothing blocking really
Left some very annoying/nitpicking comments, mostly v trivial (doc string and naming stuff)
Happy to approve if want to leave the changes in next PR
One overarching issue with this design (my fault) is that any underlying changes e.g. TT move ordering now needs to be implemented twice. I have an idea on how to refactor it to save us form DRY (don't repeat yourself) - @michelle-lai-swl for next PR pls. |
Implemented pseudo-code described here: https://en.wikipedia.org/wiki/Principal_variation_search
Performs similar to negamax in most cases, but shows significant improvements in some cases.
Performance change: (used test_performance.py)
FEN: r1b2rk1/ppqn1pbp/6p1/3pp3/7B/2PB1N2/PP3PPP/R2QR1K1 w - - 0 16
PVS: 27345484 function calls (27283687 primitive calls) in 15.451 seconds
Negamax: 49480947 function calls (49373488 primitive calls) in 27.578 seconds
FEN: 8/8/8/8/5R2/2pk4/5K2/8 b - - 0 1
PVS: 19218758 function calls (19146750 primitive calls) in 9.663 seconds
Negamax: 20640107 function calls (20567047 primitive calls) in 10.045 seconds
FEN: r1b2rk1/ppq2ppp/3bpn2/3pP3/8/2PB2B1/PP1N1PPP/R2QK2R b KQ - 0 11
PVS: 84376165 function calls (84159373 primitive calls) in 47.843 seconds
Negamax: 79506308 function calls (79300989 primitive calls) in 43.080 seconds
Creds: Created with the wonders of Github Copilot with Kelvin's help