tablebases for chess variant question

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

Moderators: hgm, Rebel, chrisw

User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: tablebases for chess variant question

Post by hgm »

Uri Blass wrote:I wonder if there are places to find tablebases for games based on the rules of chess but different target.

For example if the target is to capture all the pieces of the opponent.

[D]8/8/8/4b3/8/8/8/Q1Q5 b - - 0 1

Here white should win and I expect tablebases to tell me how many moves to win.

You can play also when the target is only to capture one piece of the opponent so white need to capture the bishop without losing the queen so it is possible to have also these types of tablebases.

In the diagram of course black win in this case by BxQ
QQB is a general win, with extinction royalty, in maximally 4 moves:

Code: Select all

        mated    mate
King captures 148656
mates    3776         ( 0.01 sec)
in-1    11420   18192 ( 0.03 sec) 89302
in-2    66538   41164 ( 0.07 sec) 273750
in-3   114898   39206 ( 0.10 sec) 134818
in-4     9960    2766 ( 0.12 sec) 9960
in-5        0       0 ( 0.13 sec) 0
won:     249984 (100.0%)
lost:    206592 ( 82.6%)
avg:        2.6 moves
Even when one of the Queens is royal, and the other is not, it is mate in 4; just the average DTM is a bit higher:

Code: Select all

        mated    mate
King captures 148656
mates    1600         ( 0.01 sec)
in-1     4955   12936 ( 0.02 sec) 46095
in-2    32512   28224 ( 0.05 sec) 212576
in-3   121557   50310 ( 0.09 sec) 190261
in-4    34352    9858 ( 0.11 sec) 34352
in-5        0       0 ( 0.12 sec) 0
won:     249984 (100.0%)
lost:    194976 ( 78.0%)
avg:        2.9 moves
When both Queens are absolutely royal, it is still generally won, but it gets a whole lot more difficult, because you can no longer afford to step on the diagonal of the Bishop, to completely cover it or block the Bishop. Then it can take up to 18 moves to achieve checkmate.

Code: Select all

        mated    mate
King captures 74816
mates     216         ( 0.00 sec)
in-1      616    1512 ( 0.01 sec) 1048
in-2     1908    4636 ( 0.01 sec) 2372
in-3      592    3784 ( 0.01 sec) 1552
in-4     1400    1824 ( 0.01 sec) 5640
in-5     3048    4216 ( 0.01 sec) 7816
in-6     3744    7396 ( 0.01 sec) 7648
in-7     3548    8500 ( 0.02 sec) 10500
in-8     8180   13128 ( 0.02 sec) 19532
in-9     9464   17596 ( 0.03 sec) 22024
in-10   11916   16984 ( 0.04 sec) 33196
in-11   14984   17888 ( 0.04 sec) 30728
in-12   17808   18192 ( 0.05 sec) 48224
in-13   20524   14748 ( 0.06 sec) 43436
in-14   27668   15908 ( 0.07 sec) 75396
in-15   29336   13480 ( 0.08 sec) 71928
in-16   29752   10464 ( 0.09 sec) 57696
in-17   14360    4528 ( 0.09 sec) 15984
in-18    1312     384 ( 0.10 sec) 1312
in-19       0       0 ( 0.10 sec) 0
won:     249984 (100.0%)
lost:    200376 ( 80.2%)
avg:       12.8 moves
Uri Blass
Posts: 10297
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: tablebases for chess variant question

Post by Uri Blass »

hgm wrote:
Uri Blass wrote:I wonder if there are places to find tablebases for games based on the rules of chess but different target.

For example if the target is to capture all the pieces of the opponent.

[D]8/8/8/4b3/8/8/8/Q1Q5 b - - 0 1

Here white should win and I expect tablebases to tell me how many moves to win.

You can play also when the target is only to capture one piece of the opponent so white need to capture the bishop without losing the queen so it is possible to have also these types of tablebases.

In the diagram of course black win in this case by BxQ
QQB is a general win, with extinction royalty, in maximally 4 moves:

Code: Select all

        mated    mate
King captures 148656
mates    3776         ( 0.01 sec)
in-1    11420   18192 ( 0.03 sec) 89302
in-2    66538   41164 ( 0.07 sec) 273750
in-3   114898   39206 ( 0.10 sec) 134818
in-4     9960    2766 ( 0.12 sec) 9960
in-5        0       0 ( 0.13 sec) 0
won:     249984 (100.0%)
lost:    206592 ( 82.6%)
avg:        2.6 moves
Even when one of the Queens is royal, and the other is not, it is mate in 4; just the average DTM is a bit higher:

Code: Select all

        mated    mate
King captures 148656
mates    1600         ( 0.01 sec)
in-1     4955   12936 ( 0.02 sec) 46095
in-2    32512   28224 ( 0.05 sec) 212576
in-3   121557   50310 ( 0.09 sec) 190261
in-4    34352    9858 ( 0.11 sec) 34352
in-5        0       0 ( 0.12 sec) 0
won:     249984 (100.0%)
lost:    194976 ( 78.0%)
avg:        2.9 moves
When both Queens are absolutely royal, it is still generally won, but it gets a whole lot more difficult, because you can no longer afford to step on the diagonal of the Bishop, to completely cover it or block the Bishop. Then it can take up to 18 moves to achieve checkmate.

Code: Select all

        mated    mate
King captures 74816
mates     216         ( 0.00 sec)
in-1      616    1512 ( 0.01 sec) 1048
in-2     1908    4636 ( 0.01 sec) 2372
in-3      592    3784 ( 0.01 sec) 1552
in-4     1400    1824 ( 0.01 sec) 5640
in-5     3048    4216 ( 0.01 sec) 7816
in-6     3744    7396 ( 0.01 sec) 7648
in-7     3548    8500 ( 0.02 sec) 10500
in-8     8180   13128 ( 0.02 sec) 19532
in-9     9464   17596 ( 0.03 sec) 22024
in-10   11916   16984 ( 0.04 sec) 33196
in-11   14984   17888 ( 0.04 sec) 30728
in-12   17808   18192 ( 0.05 sec) 48224
in-13   20524   14748 ( 0.06 sec) 43436
in-14   27668   15908 ( 0.07 sec) 75396
in-15   29336   13480 ( 0.08 sec) 71928
in-16   29752   10464 ( 0.09 sec) 57696
in-17   14360    4528 ( 0.09 sec) 15984
in-18    1312     384 ( 0.10 sec) 1312
in-19       0       0 ( 0.10 sec) 0
won:     249984 (100.0%)
lost:    200376 ( 80.2%)
avg:       12.8 moves
When both Queens are absolutely royal it is a draw if the bishop can be in the long diagonal.

Reason is that the diagonal has 8 square and one queen can control only 3 squares in that diagonal so the bishop can always stay in the long diagonal.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: tablebases for chess variant question

Post by hgm »

Good point. This exposed a bug in my EGT generator. That is, I had used a shortcut that isn't sound with sliding royals, and had forgotten all about that. Namely after the white unmove to a newly won position, I did not bother to actually perform the black unmoves of the King (the only black piece) to the 'potentially lost' grandparent before starting the verification. Based on the idea that the verification move that would be blocked by the King that was not supposed to be there would go to a (newly) won position anyway. But when the King is a slider, it would of course also block escapes to all squares behind it! So some excapes would be overlooked, leading to positions being verified as losses that weren't real losses at all.

After making the generator 'slider proof' by faithfully performing the black unmoves on the board, I get the following results:

Extinction royaly (both Queens can be put at risk, as you have a spare one):

Code: Select all

        mated    mate
King captures 148656
mates    3776         ( 0.01 sec)
in-1     7912   18192 ( 0.03 sec)
in-2    55304   36168 ( 0.06 sec)
in-3   122784   42968 ( 0.09 sec)
in-4    16816    4000 ( 0.12 sec)
in-5        0       0 ( 0.12 sec)
won:     249984 (100.0%)
lost:    206592 ( 82.6%)
avg:        2.7 moves
One royal Queen, one non-royal Queen:

Code: Select all

        mated    mate
King captures 148656
mates    1600         ( 0.00 sec)
in-1     3080   12936 ( 0.02 sec)
in-2    24504   23344 ( 0.05 sec)
in-3   112320   51232 ( 0.08 sec)
in-4    53472   13816 ( 0.11 sec)
in-5        0       0 ( 0.13 sec)
won:     249984 (100.0%)
lost:    194976 ( 78.0%)
avg:        3.1 moves
Two absolutely royal Queens:

Code: Select all

        mated    mate
King captures 148656
mates     112         ( 0.00 sec)
in-1      288    1264 ( 0.00 sec)
in-2     1616    3584 ( 0.00 sec)
in-3     6384   13312 ( 0.01 sec)
in-4     5248   18016 ( 0.01 sec)
in-5      704    2624 ( 0.01 sec)
in-6       96     464 ( 0.03 sec)
in-7        0       0 ( 0.03 sec)
won:     187920 ( 75.2%)
lost:     14448 (  5.8%)
avg:        3.3 moves
Indeed the latter case is in general a fortress draw. The large number of wins (i.e. with white to move) are mostly instant captures, which are quite common because two Queens typically attack a very large fraction of the board. Ignoring those (arguably illegal) positions would make the number of wins drop to 15.7%. (But that would still be expressed as a percentage of the total including the King-capture positions. Otherwise it would be 38%.)