Tablebase suggestion

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

User avatar
Ajedrecista
Posts: 2196
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Re: Tablebase suggestion.

Post by Ajedrecista »

Hello:

I want to add something inside all this technical discussion:

Op1 - Partial 8-piece tablebase available

This is an article on Lichess blog posted today about the generation, storage and uploading of op1 partial 8-man EGTB.

Regards from Spain.

Ajedrecista.
Jouni
Posts: 3821
Joined: Wed Mar 08, 2006 8:15 pm
Full name: Jouni Uski

Re: Tablebase suggestion

Post by Jouni »

What is 7/8 piece benefit? Remainder:

TB6 on SSD

Results of Stockfish vs StockfishSyzygy (10+0.1, 1t, 16MB, UHO_XXL_+0.90_+1.19.pgn):
Elo: -1.26 +/- 1.46, nElo: -2.64 +/- 3.05
LOS: 4.46 %, DrawRatio: 57.40 %, PairsRatio: 0.96
Games: 50000, Wins: 13671, Losses: 13853, Draws: 22476, Points: 24909.0 (49.82 %)
Ptnml(0-2): [130, 5293, 14349, 5085, 143], WL/DD Ratio: 1.37
Jouni
syzygy
Posts: 5898
Joined: Tue Feb 28, 2012 11:56 pm

Re: Tablebase suggestion.

Post by syzygy »

Ajedrecista wrote: Sat Feb 07, 2026 6:47 pm Hello:

I want to add something inside all this technical discussion:

Op1 - Partial 8-piece tablebase available

This is an article on Lichess blog posted today about the generation, storage and uploading of op1 partial 8-man EGTB.
Interesting. So 9-piece op2 is indeed being worked on.
Geezer one
Posts: 18
Joined: Wed Jul 24, 2024 4:40 pm
Full name: Guy Russo

Re: Tablebase suggestion

Post by Geezer one »

Jouni wrote: Sat Feb 07, 2026 7:39 pm What is 7/8 piece benefit? Remainder:

TB6 on SSD

Results of Stockfish vs StockfishSyzygy (10+0.1, 1t, 16MB, UHO_XXL_+0.90_+1.19.pgn):
Elo: -1.26 +/- 1.46, nElo: -2.64 +/- 3.05
LOS: 4.46 %, DrawRatio: 57.40 %, PairsRatio: 0.96
Games: 50000, Wins: 13671, Losses: 13853, Draws: 22476, Points: 24909.0 (49.82 %)
Ptnml(0-2): [130, 5293, 14349, 5085, 143], WL/DD Ratio: 1.37
Engine strength is highly dependant on Neural Nets. They were trained with tablebase data included. 8 piece tablebase could improve that training data.
syzygy
Posts: 5898
Joined: Tue Feb 28, 2012 11:56 pm

Re: Tablebase suggestion

Post by syzygy »

syzygy wrote: Thu Feb 05, 2026 11:40 pmThe first half of the iteration is:

Code: Select all

S1 = Load(W, WIN_IN_N(n));
R1 = Predecessor(S1);
S2 = Load(B, UNKNOWN);
S2 = S2 & R1;
----
R2 = Load(W, WIN_IN<=N(n));
S3 = ProveSuccessor(S2, R2);
B = Add(S3, LOSE_IN_N(n));
----
R3 = Predecessor(S3);
S4 = Load(W, UNKNOWN);
S4 = S4 & R3;
W = Add(S4, WIN_IN_N(n+1));
(and then we do the same steps with W and B reversed)
Instead of working with intermediate "W" and "B" tables to and from which WIN/LOSE_IN_N(n) positions are added and extracted during each iteration, it seems a lot more efficient to keep everything in bitmaps and only merge them at the end. This probably requires more disk space for intermediate files, but if disk space is limited then generating 8-piece tables is a very silly idea to begin with.

So the goal is to generate the WIN_IN_N(n) and LOSE_IN_N(n) bitmaps for both wtm and btm.
To do this, the algorithm also needs to maintain UNKNOWN and WIN_IN<=N(n) bitmaps (for both wtm and btm).

However, what is the UNKNOWN bitmap used for exactly:

Code: Select all

S1 = Load(W, WIN_IN_N(n));
R1 = Predecessor(S1);
S2 = Load(B, UNKNOWN);
S2 = S2 & R1;
----
R2 = Load(W, WIN_IN<=N(n));
S3 = ProveSuccessor(S2, R2);
B = Add(S3, LOSE_IN_N(n));
R1 is the set of potential btm LOSE_IN_N(n) positions, which are the positions from which a btm move leads to a wtm WIN_IN_N(n) position.
So we already know that R1 will not contain any LOSE_IN_N(k) positions for k < N.
So the AND operation with UNKNOWN can only remove illegal positions and positions which have been determined to be a win.
The set of positions that have been determined to be a win corresponds to the WIN_IN<=N(n) bitmap.
What if we include in the WIN_IN_<=N(n) bitmap the set of ILLEGAL positions. Then we don't need the UNKNOWN bitmap to generate LOSE_IN_N(n).
(So instead of AND with UNKNOWN, we AND with NOT WIN_IN_<=N(n).)

Now what about these two lines:

Code: Select all

R2 = Load(W, WIN_IN<=N(n));
S3 = ProveSuccessor(S2, R2);
If we include the ILLEGAL positions in the WIN_IN<=N bitmap, then ProveSuccessor(S2,R2) still works correctly. A move from a potential loss in S2 into an illegal position is an illegal move and therefore does not refute the loss. In fact, we can now dispense with checking move legality, which is great. We actually want the ILLEGAL positions to be included in WIN_IN<=N(n) here anyway!

The other part is:

Code: Select all

R3 = Predecessor(S3);
S4 = Load(W, UNKNOWN);
S4 = S4 & R3;
W = Add(S4, WIN_IN_N(n+1));
R3 is the set of position wtm positions for which a move leads to a btm LOSE_IN_N(n). Since these positions have a winning move, they cannot be losing positions.
So, again, the AND operation with UNKNOWN can only remove illegal positions and positions which have been determined earlier to be a win.
So we can again replace UNKNOWN with the bitmap that is the union of ILLEGAL and WIN_IN<=N(n).

So maintaining an UNKNOWN bitmap does not seem necessary. We only need to maintain wtm and btm bitmaps of illegal plus winning positions. This is a very welcome simplification and efficiency gain.
User avatar
Ajedrecista
Posts: 2196
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Re: Tablebase suggestion.

Post by Ajedrecista »

Hello:

I played another interesting-to-me game today: I played four 5+0 games against a much better player than me and lost the first three clearly, although not in few moves. I was white in the fourth, an Albin Countergambit arose and there were many trades until we reached a B+4P vs. B+4P endgame (both LSB) with an unpleasant position for me with less time on the clock, but not in time trouble. The key position was:

[d]8/p7/2b5/P1p5/2P4p/5k2/3K3P/5B2 w - - 1 42

I rightly thought that my bishop should stay at f1-h3 diagonal (g3 square covered by Ph2 and g2 square covered by Bf1), but I played Ke1? instead the only drawing move Bh3!

Code: Select all

FEN: 8/p7/2b5/P1p5/2P4p/5k2/3K3P/5B2 w - - 1 42

Stockfish-18-windows-x86-64-sse41-popcnt:
Found 145 WDL and 145 DTZ tablebase files (up to 5-man).
Available processors: 0-3
Using 2 threads
NNUE evaluation using nn-c288c895ea92.nnue (125MiB, (102384, 1024, 15, 32, 1))
NNUE evaluation using nn-37f18f62d772.nnue (6MiB, (22528, 128, 15, 32, 1))
Network replica 1: Shared memory.
[...]
 91/24	00:22	  17.313.508	788.267	 0,00	Bf1h3 Bc6e8 Bh3e6 Kf3e4 Kd2c3 Ke4e3 Be6g8 Be8g6 Bg8e6
 92/48	00:28	  22.049.519	791.582	 0,00	Bf1h3 Bc6e8 Bh3e6 Kf3e4 Kd2c3 Ke4e3 Be6d5 Be8d7 Bd5g8 Bd7g4 Bg8f7 Bg4d1 Bf7d5 Ke3f2 Kc3d3 Kf2g1 Kd3e3 Kg1xh2 Ke3f2 Kh2h3 Bd5e6+ Bd1g4 Be6d5 Bg4c8 Kf2f3 Kh3h2 Kf3f2
 93/36-	00:49	  37.285.246	762.729	-0,02	Bf1h3 Bc6e8
 93/46-	00:53	  42.333.244	789.799	-0,03	Bf1h3 Bc6e8
 93/61-	01:44	 111.481.494	1.068.721	-0,30	Bf1h3 Bc6e8
 93/131+	02:30	 177.231.504	1.180.850	-0,30	Bf1h3
 93/131+	03:27	 293.690.190	1.414.999	-0,17	Bf1h3
 93/131	05:30	 570.830.976	1.729.224	-0,14	Bf1h3 Bc6e8 Bh3e6 Kf3e4 Kd2c3 Ke4e3 Be6d5 Be8g6 Bd5e6 Ke3e2 Be6d5 Ke2d1 Bd5e6 Kd1e1 Be6d5 Bg6h7 Bd5e6 Ke1d1 Be6f7 Bh7e4 Bf7h5+ Kd1e1 Bh5f7 Be4f5 Bf7d5 Ke1d1 Bd5f3+ Kd1c1 Bf3h5 Kc1b1 Bh5e8 Kb1a2 Be8a4 Bf5g6 Ba4c6 Bg6h5 Bc6a4 Ka2a3 Ba4c6 Bh5d1 Bc6d7 Bd1f3 Bd7e8 Bf3e4 Be8b5 Be4h7 Bb5e8 Ka3a2 Be8c6 Ka2b1 Bc6d7 Bh7e4 Kc3b3 Be4c2+ Kb3c3 Kb1c1 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 Ke2f2 Kc3d2 Kf2g2 Kd2e3 Kg2xh2 Ke3f2 Bf1h3 Bg8f7 Bh3d7 Bf7d5 Bd7g4 Bd5g8 Bg4h5 Bg8e6 Bh5d1 Be6g8 Kh2h3 Bg8e6+ Bd1g4 Be6f7 Bg4f5 Kf2f3 Bf5c2 Bf7e6+ Kh3h2 Kf3f2 Bc2b3 Be6g8 Bb3a4 Bg8e6 Ba4c2 Be6f7 Bc2e4 Bf7e6 Be4c2
 98/13	07:26	 808.349.428	1.811.390	 0,00	Bf1h3 Bc6e8 Bh3e6 Kf3e4 Kd2c3 Ke4e3 Be6g8 Be8g6 Bg8e6 Bg6h5 Be6d5 Bh5e8
[...]
 128/36	13:00	1.143.422.244	1.465.538	 0,00	Bf1h3 Bc6e8 Bh3e6 Kf3e4 Kd2c3 Be8g6 Be6d5+ Ke4e3 Bd5g8 Ke3e2 Bg8d5
 129/30	13:45	1.216.096.789	1.473.799	 0,00	Bf1h3 Bc6e8 Bh3e6 Kf3e4 Kd2c3 Be8g6 Be6d5+ Ke4e3 Bd5g8 Ke3e2 Bg8d5 Ke2f2 Kc3d2 Bg6h5 Bd5e6 Kf2g2 Kd2e3 Kg2xh2 Ke3f2 Bh5d1 Be6g8 Kh2h3 Bg8e6+
 130/32	14:00	1.233.869.676	1.467.706	 0,00	Bf1h3 Bc6e8 Bh3e6 Kf3e4 Kd2c3 Be8g6 Be6d5+ Ke4e3 Bd5g8 Ke3e2 Bg8d5
There were 4,480,179 TB hits to the full set of 3, 4 and 5-man Syzygy EGTB, but please take a look into the little scare at depths 93 and 94 with almost one million TB hits, where SF 18 doubted about drawing or not. Since the position is a 10-man Op3 following the notation of the thread and some lines include ..., Kxh2, this would lead to a 9-man Op2, which would be very valuable here.
syzygy wrote: Sat Feb 07, 2026 9:36 pmInteresting. So 9-piece op2 is indeed being worked on.
------------

Placing your bishop in front of your own pawn to get some barrier on the g-file looks risky in my position because my pawn could be taken. It would have been a draw anyway, but very difficult to me... I did not even consider Bh3 to be fair.

Here is a PGN with some proposed lines:

[pgn][Event ""]
[Site ""]
[Round ""]
[Date "2026.02.13"]
[SetUp "1"]
[FEN "8/p7/2b5/P1p5/2P4p/5k2/3K3P/5B2 w - - 1 42"]
[Result "1/2-1/2"]

42.Bh3! (42.Ke1? Ke3 1-0 {(The true moves of the game)}) 42...Kf2 43.Be6 Kg1 44.Ke3 Kxh2 45.Kf2 {(The cage)} 45...h3 46.Bd5 Bd7 (46...Bxd5 47.cxd5 c4 1/2-1/2) 47.Be4 (47.Bf7 Kh1 48.Bd5+ (48.Bg8 Bc6 49.Be6 Kh2 (49...h2? 50.Bd5+ Bxd5 51.cxd5 c4 52.d6 c3 53.d7 c2 54.d8=Q c1=Q 55.Qd5# 1-0) 1/2-1/2) 48...Kh2 49.Bf7 1/2-1/2) 47...Be6 48.Bd5 1/2-1/2[/pgn]

Including my trademark cage of the cornered king which has become recurrent for me for some time now. If black dares to play ..., h2 after ..., Kh1, then faces the permanent threat of a checkmate with the bishop through the a8-h1 diagonal.

------------

Bh3! looks counterintuitive for a patzer like me, but I remember to have seen something similar before:

The power of a bishop facing three connected passed pawns.

67.- ..., Bh3! to win, with the same idea of build a barrier on the g-file.

Regards from Spain.

Ajedrecista.