Bill Forster wrote: ↑Tue Jan 19, 2021 9:57 am
Uri Blass wrote: ↑Tue Jan 19, 2021 7:29 am
If I understand correctly sargon now only know not to play a move that force a draw by repetition when it has a better alternative.
It does not have draw by repetition knowledge during the search(and note that you do not need hash tables for it but only to see that the line in the search leads to a draw by repetition so you evaluate it as a draw).
This is exactly right.
In general my goal in this project was simply to convert the classic Z80 code to X86 with no emulation or simulation to see how quickly it would run on modern machines. Once I met that goal I started adding things on;
- Allowing arbitrary depth instead of the original hardwired limit of depth 6
- Give it a UCI interface so it can run as an engine in a GUI
- Not just adding the most basic play a game UCI commands, but including arbitrary position setup, optional dynamic depth, time management and most importantly and a real bonus ....
- Teasing out the PV and a centipawn evaluation! The original code makes no attempt to collect this information and provide it to the user in any way
- Opening up the minimax and alpha-beta algorithms, demonstrating how they work with runtime ascii art "animation" (sort of).
- Providing a faithful conversion of the original Z80 code to genuine Z80 mnemonics as a side effect. Retro hackers should prefer using this version to the extant Sargon code which uses odd non-standard third party mnemonics.
All of these extra things are just bonuses though. And none of them require any changes to the core Sargon 1978 chess code.
Similarly, the fact that the engine is perhaps a reasonably fun partner for weak to average players is just a happy accident (another bonus) not really a project goal.
When I realised I could work around the annoying habit of Sargon being too keen to repeat positions, by asking it to try again with the offending repeating move removed from its list of candidate moves - I thought why not? Although this is the closest I have come yet to changing the Sargon 1978 chess code itself. Arguably I may even have stepped over the line (because I had to write some external C code to peer into the implementation and pluck out the offending move).
I am now wondering about supercharging the Sargon 1978 code when there aren't too many pieces on the board. Again I want to leave the chess algorithm in tact - just have it produce the same results faster. In that case it would hopefully be able to calculate for example a 'seize the opposition' move in a simple pawn endgame in much less than 3 minutes. The idea is to add a transposition table cache around the outside, like a kind of code exo-skeleton. I don't yet know if this is even possible. I will have to revisit the tree building order etc. I don't know much about hash caches, I've only ever worked on primitive and retro engines without them. My intuition is that this would only be useful in the ending, when presumably Sargon 1978 is recalculating a comparitive handful of possible positions over and over again. But I can't really judge unless I actually go ahead and try to do it, at the moment I lack the requisite expertise. But it sounds like a potentially fun way of extending the Sargon 1978 project even further.
Mr. Forster, thanks very much for your explanation, and also thanks for making this project to convert Sargon 1978 into a fun challenger for human players rated between 1600 thru 1650. Today I wanted to know if a human rated between 1600 to 1650 could convert this overwhelming winning Black position from yesterday previous game between the two Sargons into a win, so I copied this position and emailed it to my friend in Puerto Rico
Sanchez Martinez, Xavier rated only 1620 and asked him over the phone if he can take at look at this position that I emailed him after 37. Rh1 and in less than two minutes he can tell me how he would plan to beat Sargon-1978-V1.01Beta which I provided the download Link. After he looked at the position it took him about 1 minutes and 50 seconds, then he told me that because of the Black Bishop controlling the diagonal even if he did not have the White Bishop that he could convert this position into a win. So after he told me that I asked him to play it out in 10'+5" and to email me the game when he finished. I gave him the position after 37. Rh1 with Black to play and that is when i called him and told him to look at it and before he play to win with Black to discuss with me his plan, like that I knew that he was not going to use an engine to cheat. I usually talk with friends from other counties using Skype, just to check if they are cheating or NOT.
[pgn][Event "human rated 1620 Vs Sargon Beta"]
[Date "2021.01.18"]
[Round "?"]
[White "Sargon-1978-V1.01Beta"]
[Black "Sanchez Martinez, Xavier"]
[Result "0-1"]
[BlackElo "1665"]
[ECO "C47"]
[Opening "Four Knights"]
[Time "11:47:02"]
[Variation "Scotch, 4...exd4 5.Nxd4 Bb4"]
[WhiteElo "1660"]
[TimeControl "600+5"]
[Termination "normal"]
[PlyCount "81"]
1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. d4 exd4 5. Nxd4 Bb4 6. Qd3 Qe7 7. Nxc6
dxc6 8. f3 O-O 9. Bg5 Rd8 10. Qe3 Qe5 11. a3 Bc5 12. Qf4 Qd4 13. Qh4 Be6
14. Rd1 Qe5 15. Rxd8+ Rxd8 16. Bf4 Qd4 17. Bd3 Bxa3 18. Bxc7 Bxb2 19. Bxd8
Bxc3+ 20. Ke2 Qxd8 21. e5 Bxe5 22. Bxh7+ Kf8 23. Rd1 Qc7 24. Be4 Nd5 25.
Bxd5 cxd5 26. Qa4 Bxh2 27. Rb1 a5 28. Qb3 d4 29. Qb2 Bd5 30. Kd1 Be5 31.
Qb6 Qxb6 32. Rxb6 Bc6 33. Kd2 Ke7 34. Rb1 a4 35. Re1 Kd6 36. Rb1 b5 37. Rh1 b4
38. Rb1 a3 39. Rh1 d3 40. cxd3 Bc3+ 41. Kc2 Ba4+ 42. Kb1 Bb3 43. g3 a2+ 44. Kc1
a1=Q# 0-1[/pgn]