New 6-piece tablebases

Discussion of chess software programming and technical issues.

Moderators: hgm, chrisw, Rebel

Vinvin
Posts: 5252
Joined: Thu Mar 09, 2006 9:40 am
Full name: Vincent Lejeune

Re: New 6-piece tablebases

Post by Vinvin »

Edmund wrote:
Vinvin wrote:Why not 0.00 ? and why only 1 tb access ??
If I am not mistaken it is called swindle mode. If the root position is available for probing it will elimate bad moves and then play the best move from an alpha beta search, putting pressure on the opponent and luring him to make a mistake.
Ah, nice !
But tb=1 is misleading.
phenri
Posts: 284
Joined: Tue Aug 13, 2013 9:44 am

Re: New 6-piece tablebases

Post by phenri »

phenri wrote:Thanks Ronald

Here's a new compilation based on the latest sotckifish dated 23 September 2013. Source code included

Stockfish-master_130923_sbase_support.7z
Some report that the link is not working for them. So here's one from another hoster.
Stockfish-master_130923_sbase_support.7z
syzygy
Posts: 5661
Joined: Tue Feb 28, 2012 11:56 pm

Re: New 6-piece tablebases

Post by syzygy »

Edmund wrote:
Vinvin wrote:Why not 0.00 ? and why only 1 tb access ??
If I am not mistaken it is called swindle mode. If the root position is available for probing it will elimate bad moves and then play the best move from an alpha beta search, putting pressure on the opponent and luring him to make a mistake.
Exactly.

It would be nice to see both the search score and the tb score, but then UCI needs to be extended (I think). It might be less confusing if the reported score is 0.00.

Note that the same happens with tb losses and tb wins.
Vinvin wrote:Ah, nice !
But tb=1 is misleading.
tb=1 refers to only the root position being probed.
It would be more correct to report tb = # legal root moves, as in reality all root moves are probed.
syzygy
Posts: 5661
Joined: Tue Feb 28, 2012 11:56 pm

Re: New 6-piece tablebases

Post by syzygy »

syzygy wrote:Note that the same happens with tb losses and tb wins.
To see how it works, try these positions versus an engine without tablebases.
[d]8/8/8/5N2/8/p7/8/2NK3k w
White can win just within the 50-move rule. Stockfish+tb will win it as white, but will almost certainly draw as black.

[d]K7/N7/k7/8/3p4/8/N7/8 w
Black is "lost" but can draw thanks to the 50-move rule. Stockfish+tb will draw as black, but will most likely win as white (black can afford some inaccuracies here, though).
User avatar
RJN
Posts: 303
Joined: Fri Jun 21, 2013 5:18 am
Location: Orion Spiral Arm

Re: New 6-piece tablebases

Post by RJN »

You are right, Ronald. Nice example positions.

Note: Houdini is named "Gaviota" in the below, but Houdini TBs were disabled for this test. Stockfish is using the Syzygy bases.

Of course, if Houdini had TBs enabled, this would have gone differently, and it was just used as a sparring opponent. Pure calculation still can't compete in these type of "near 50" positions, unless given a long time, even for 5-piece.


Time Control: 40 moves in 5 minutes, repeating

[pgn][Event "Computer chess game"]
[Site "Rob-PC"]
[Date "2013.09.23"]
[Round "?"]
[White "Stockfish_130923_x64_modern_sse42"]
[Black "Houdini_3_x64_Gaviota-TEST"]
[Result "1-0"]
[BlackElo "2200"]
[ECO "TB: Wh"]
[Opening "ite wins in 1"]
[Time "15:00:14"]
[WhiteElo "2200"]
[TimeControl "40/300:40/300:40/300"]
[SetUp "1"]
[FEN "8/8/8/5N2/8/p7/8/2NK3k w - - 0 1"]
[Termination "normal"]
[PlyCount "81"]
[WhiteType "program"]
[BlackType "program"]

1. Na2 {+6.84/31 3} Kg2 {-0.82/23 6} 2. Ke2 {+6.84/32 2} Kg1 {-0.89/24 7}
3. Ne3 {+7.01/33 3} Kh2 {-1.01/25 8} 4. Kf3 {+6.84/34 5} Kh3 {-1.06/23 5}
5. Ng2 {+6.84/34 4} Kh2 {-1.06/22 0} 6. Nf4 {+6.84/35 4} Kh1 {-0.99/24 12}
7. Ke3 {+6.84/33 4} Kh2 {-0.99/25 14} 8. Kf2 {+6.84/33 4} Kh1 {-0.99/24} 9.
Nd3 {+6.84/32 2} Kh2 {0.00/1} 10. Nf4 {0.00/100 0} Kh1 {0.00/1} 11. Kg3
{+6.84/12 0} Kg1 {0.00/1} 12. Ne2+ {+6.80/30 3} Kf1 {-0.37/9 0} 13. Kf3
{+6.84/33 3} Ke1 {0.00/1} 14. Ng3 {+6.84/35 4} Kd2 {-0.87/25 10} 15. Ke4
{+6.98/35 3} Kc2 {-0.95/26 14} 16. Nf1 {+6.98/35 4} Kb2 {-0.97/28 14} 17.
Kd3 {+6.98/12 0} Kb3 {-1.08/27 12} 18. Nd2+ {+7.05/34 5} Kb2 {-1.06/26 10}
19. Ne4 {+M26/34 4} Kb3 {-1.06/25 0} 20. Nec3 {+M25/12 0} Kb2 {0.00/1} 21.
Ne2 {+M24/12 0} Kb3 {-M20/28 10} 22. Nec1+ {+M23/12 0} Ka4 {-M19/30 11} 23.
Kc4 {+M22/12 0} Ka5 {0.00/1} 24. Kc5 {+M21/12 0} Ka6 {-M17/30 12} 25. Kc6
{+M20/12 0} Ka5 {-M16/30 11} 26. Nd3 {+M19/12 0} Ka6 {-M15/31 12} 27. Ndb4+
{+M16/27 0} Ka7 {-M14/30 11} 28. Kc7 {+M15/12 0} Ka8 {0.00/1} 29. Nd3
{+M13/34 8} Ka7 {0.00/1 0} 30. Nc5 {+M12/13 0} Ka8 {0.00/1} 31. Kb6
{+M11/12 0} Kb8 {0.00/1 0} 32. Nb7 {+M10/12 0} Kc8 {-M9/28 2} 33. Kc6
{+M9/12 0} Kb8 {0.00/1 0} 34. Nd6 {+M8/12 0} Ka7 {-M7/24 0} 35. Kb5 {+M7/12
0} Kb8 {-M6/22 0} 36. Kb6 {+M6/12 0} Ka8 {0.00/1} 37. Kc7 {+M5/12 0} Ka7
{0.00/1 0} 38. Nb4 {+M4/12 0} a2 {-M3/16 0} 39. Nb5+ {+M3/100 0} Ka8
{0.00/1} 40. Nd5 {+M2/12 0} a1=Q {-M1/12 0} 41. Nb6# {+M1/13 0} 1-0[/pgn]

[pgn][Event "Computer chess game"]
[Site "Rob-PC"]
[Date "2013.09.23"]
[Round "?"]
[White "Stockfish_130923_x64_modern_sse42"]
[Black "Houdini_3_x64_Gaviota-TEST"]
[Result "1-0"]
[BlackElo "2200"]
[ECO "TB: Wh"]
[Opening "ite wins in 1"]
[Time "15:08:55"]
[WhiteElo "2200"]
[TimeControl "40/300:40/300:40/300"]
[SetUp "1"]
[FEN "K7/N7/k7/8/3p4/8/N7/8 w - - 0 1"]
[Termination "normal"]
[PlyCount "99"]
[WhiteType "program"]
[BlackType "program"]

1. Nb4+ {+6.44/12 0} Kb6 {-1.00/26 7} 2. Nd3 {+6.44/12 0} Ka5 {-1.16/24 8}
3. Kb7 {+7.65/29 3} Ka4 {-1.16/22} 4. Nc6 {+7.63/31 4} Kb3 {-1.38/26 8} 5.
Nce5 {+7.75/31 2} Kc3 {-1.39/26 7} 6. Kb6 {+7.77/33 3} Kb3 {-1.47/24 6} 7.
Kb5 {+7.81/33 3} Kc3 {-1.41/24 8} 8. Ka4 {+7.91/34 4} Kd2 {-1.40/24 6} 9.
Kb3 {+7.91/34 4} Ke3 {-1.41/24 7} 10. Kc2 {+7.91/30 3} Ke4 {-1.45/25 9} 11.
Kd2 {+7.91/32 3} Kd5 {-1.46/25 19} 12. Ke2 {+7.93/31 4} Ke4 {-1.47/24 5}
13. Kf2 {+7.93/32 4} Kf5 {-1.47/25 7} 14. Kf3 {+7.93/32 5} Ke6 {-1.47/25 7}
15. Kf4 {+7.93/32 4} Kd5 {-1.46/22 6} 16. Kf5 {+7.93/30 4} Kd6 {-1.46/20}
17. Ke4 {+7.93/30 5} Ke6 {-1.45/22 6} 18. Nc4 {+7.97/32 5} Kf6 {-1.41/23 7}
19. Kd5 {+7.97/32 5} Ke7 {-1.38/23 12} 20. Ke5 {+7.97/32 6} Kd7 {-1.33/21
7} 21. Kf6 {+7.97/33 5} Kc6 {-1.31/22 7} 22. Ke6 {+7.97/33 6} Kc7 {-1.25/22
7} 23. Nce5 {+7.97/33 4} Kd8 {-1.17/22 15} 24. Kd6 {+7.97/33 5} Ke8
{-1.33/21 9} 25. Nc6 {+7.97/33 6} Kf7 {-1.15/22 6} 26. Ke5 {+7.97/33 7} Kg6
{-1.41/22 6} 27. Ke6 {+8.00/33 7} Kg5 {-1.20/21 5} 28. Nce5 {+8.00/34 7}
Kh6 {-1.28/22 9} 29. Kf6 {+8.14/34 7} Kh5 {-1.00/21 5} 30. Nf7 {+8.56/33 5}
Kg4 {-0.95/22 5} 31. Ng5 {+8.68/33 9} Kh4 {-1.06/22 5} 32. Kf5 {+M27/12 0}
Kg3 {-1.06/23 6} 33. Ke4 {+M26/12 0} Kg4 {-1.03/23 6} 34. Nf7 {+M25/12 0}
Kg3 {-1.06/22 7} 35. Nfe5 {+M24/12 0} Kh4 {-1.06/22 9} 36. Kf5 {+M23/18 0}
Kh3 {-1.70/22 14} 37. Kg5 {+M20/13 0} Kg3 {-M14/26 5} 38. Kh5 {+M19/12 0}
Kh3 {-M12/28 4} 39. Nc4 {+M12/37 48} Kg3 {-M11/26 4} 40. Nd2 {+M11/42 35}
Kh3 {-M10/29 5} 41. Ne4 {+M10/36 5} Kg2 {-M9/28 3} 42. Kg4 {+M9/12 0} Kf1
{-M8/26 0} 43. Kf3 {+M8/39 5} Kg1 {0.00/1 0} 44. Nd2 {+M7/44 5} Kh2 {-M6/22
0} 45. Nf4 {+M6/49 8} Kh1 {-M5/20 0} 46. Kf2 {+M5/55 53} d3 {-M4/18 0} 47.
Kg3 {+M4/57 45} Kg1 {0.00/1} 48. Nh3+ {+M3/100 0} Kh1 {0.00/1} 49. Nf3
{+M2/100 0} d2 {0.00/1} 50. Nf2# {+M1/13 0} 1-0[/pgn]
syzygy
Posts: 5661
Joined: Tue Feb 28, 2012 11:56 pm

Re: New 6-piece tablebases

Post by syzygy »

RJN wrote:Of course, if Houdini had TBs enabled, this would have gone differently, and it was just used as a sparring opponent.
Even when using Nalimov tablebases, it is likely that Houdini would not win the first position as white. Nalimov minimises distance-to-mate, but what needs to be minimised here is distance to a pawn move or capture.

I suppose H3+Nalimov would draw the second position as black, because black has quite a bit of a margin. Still, with Nalimov black might move the pawn too quickly.
User avatar
RJN
Posts: 303
Joined: Fri Jun 21, 2013 5:18 am
Location: Orion Spiral Arm

Re: New 6-piece tablebases

Post by RJN »

Houdini using Nalimov was able to win the 1st position against SF using Syzygy:

[pgn][Event "Computer chess game"]
[Site "Rob-PC"]
[Date "2013.09.23"]
[Round "?"]
[White "Houdini_3_x64_Nalimov-TEST"]
[Black "Stockfish_130923_x64_modern_sse42"]
[Result "1-0"]
[BlackElo "2200"]
[ECO "TB: Wh"]
[Opening "ite wins in 1"]
[Time "18:44:49"]
[WhiteElo "2200"]
[TimeControl "40/300:40/300:40/300"]
[SetUp "1"]
[FEN "8/8/8/5N2/8/p7/8/2NK3k w - - 0 1"]
[Termination "normal"]
[PlyCount "103"]
[WhiteType "program"]
[BlackType "program"]

1. Na2 {+M52/99 0} Kh2 {-6.84/28 3} 2. Ke2 {+M51/99} Kg2 {-6.86/30 2} 3.
Ke3 {+M50/99} Kg1 {-6.78/30 2} 4. Kf3 {+M49/99 0} Kf1 {-6.82/31 3} 5. Nd6
{+M48/99 0} Ke1 {-6.82/31 4} 6. Ne4 {+M47/99 0} Kf1 {-6.82/33 3} 7. Nc5
{+M46/99 0} Ke1 {-6.82/32 2} 8. Nd3+ {+M45/99 0} Kf1 {-6.82/33 4} 9. Kf4
{+M44/99 0} Kg2 {-6.90/32 2} 10. Kg4 {+M43/99} Kh1 {-6.90/33 4} 11. Kf3
{+M42/99 0} Kh2 {-6.90/34 4} 12. Nf4 {+M41/99 0} Kg1 {-6.90/35 6} 13. Ke2
{+M40/99 0} Kh1 {-6.90/34 5} 14. Kf1 {+M39/99 0} Kh2 {-6.86/12 0} 15. Kf2
{+M38/99} Kh1 {-6.86/12 0} 16. Kg3 {+M37/99 0} Kg1 {-6.82/12 0} 17. Ne2+
{+M36/99 0} Kf1 {-6.82/13 0} 18. Kf3 {+M35/99} Ke1 {-6.82/12 0} 19. Ng3
{+M34/99} Kd1 {-6.82/34 5} 20. Ke4 {+M33/99} Kd2 {-6.82/34 5} 21. Kd4
{+M32/99 0} Kd1 {-6.92/35 6} 22. Kd3 {+M31/99} Ke1 {-6.92/12 0} 23. Ke3
{+M30/99} Kd1 {-6.92/12 0} 24. Ne4 {+M29/99 0} Ke1 {-7.03/34 5} 25. Nd2
{+M28/99 0} Kd1 {-7.03/12 0} 26. Nf3 {+M27/99} Kc2 {-7.03/12 0} 27. Ke2
{+M26/99 0} Kb2 {-7.45/34 11} 28. Kd3 {+M25/99} Kb3 {-7.45/12 0} 29. Nd2+
{+M24/99 0} Kb2 {-7.45/15 0} 30. Ne4 {+M23/99} Kb3 {-7.45/12 0} 31. Nec3
{+M22/99 0} Kb2 {-7.45/12 0} 32. Ne2 {+M21/99} Kb3 {-7.45/13 0} 33. Nec1+
{+M20/99 0} Ka4 {-7.45/13 0} 34. Kc4 {+M19/99 0} Ka5 {-7.45/12 0} 35. Kc5
{+M18/99 0} Ka6 {-7.45/13 0} 36. Kc6 {+M17/99 0} Ka5 {-M16/35 19} 37. Nd3
{+M16/99 0} Ka6 {-M15/38 22} 38. Ndb4+ {+M15/99 0} Ka7 {-M14/40 23} 39. Kc7
{+M14/99 0} Ka8 {-M13/43 38} 40. Nd3 {+M13/99} Ka7 {-M12/45 69} 41. Nc5
{+M12/99 0} Ka8 {-M11/43 8} 42. Kb6 {+M11/99} Kb8 {-M10/43 5} 43. Nb7
{+M10/99 0} Kc8 {-M9/44 5} 44. Kc6 {+M9/99} Kb8 {-M8/48 5} 45. Nd6 {+M8/99
0} Ka7 {-M7/50 5} 46. Kb5 {+M7/99} Kb8 {-M6/53 7} 47. Kb6 {+M6/99 0} Ka8
{-M5/58 5} 48. Kc7 {+M5/99 0} Ka7 {-M4/62 5} 49. Nb4 {+M4/99 0} Ka8 {-M3/63
5} 50. Nc6 {+M3/99 0} a2 {-M2/100 0} 51. Nc4 {+M2/99 0} a1=Q {-M1/100 0}
52. Nb6# {+M1/99 0} 1-0[/pgn]
syzygy
Posts: 5661
Joined: Tue Feb 28, 2012 11:56 pm

Re: New 6-piece tablebases

Post by syzygy »

RJN wrote:Houdini using Nalimov was able to win the 1st position against SF using Syzygy:
Ok, this time it was lucky ;-)
shiv
Posts: 351
Joined: Sat Apr 01, 2006 2:03 am

Re: New 6-piece tablebases

Post by shiv »

syzygy wrote:
Edmund wrote:
Vinvin wrote:Why not 0.00 ? and why only 1 tb access ??
If I am not mistaken it is called swindle mode. If the root position is available for probing it will elimate bad moves and then play the best move from an alpha beta search, putting pressure on the opponent and luring him to make a mistake.
Exactly.

It would be nice to see both the search score and the tb score, but then UCI needs to be extended (I think). It might be less confusing if the reported score is 0.00.

Note that the same happens with tb losses and tb wins.
Vinvin wrote:Ah, nice !
But tb=1 is misleading.
tb=1 refers to only the root position being probed.
It would be more correct to report tb = # legal root moves, as in reality all root moves are probed.
Firstly, thanks a lot for this project! The liberal license and the ability to probe 6 man tablebases is very useful.

There is also another reason to see the tb score different from the engine score. Even a debug string such as "tb-score: {value}" has merit in my limited view (this output can be presented if a UCI option debug_Syzygy_logs is set to 1 for example.

As a chess player, I am interested to see the TB eval to learn certain endgames. Rook and f-h pawns vs Rook for example. I don't mind probing the tb score for this output and displaying it on a chess GUI. Downloading just that base file would be a lot easier than downloading/buying Nalimov.

For now, I might try to modify the patched Syzygy Stockfish and see if I can get this kind of output.
IQ
Posts: 162
Joined: Thu Dec 17, 2009 10:46 am

Re: New 6-piece tablebases

Post by IQ »

An easy solution might be to use the scale factor - in case of a DTZ draw just scale stockfishes score so its only between -0.10 and +0.10. This way Stockfish would play the same swindle moves but the user would be rather certain that stockfish thinks it is a draw.

Something similar could be done if the position is winning/loosing: just add/substract a large offset (lets say +-5) to stockfishes score (before repetition testing).
syzygy wrote:
Edmund wrote:
Vinvin wrote:Why not 0.00 ? and why only 1 tb access ??
If I am not mistaken it is called swindle mode. If the root position is available for probing it will elimate bad moves and then play the best move from an alpha beta search, putting pressure on the opponent and luring him to make a mistake.
Exactly.

It would be nice to see both the search score and the tb score, but then UCI needs to be extended (I think). It might be less confusing if the reported score is 0.00.

Note that the same happens with tb losses and tb wins.
Vinvin wrote:Ah, nice !
But tb=1 is misleading.
tb=1 refers to only the root position being probed.
It would be more correct to report tb = # legal root moves, as in reality all root moves are probed.