OliThink 5.4.0 has been published with an big leap in strength for only 3 lines of code

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Dann Corbit
Posts: 11216
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: OliThink 5.4.0 has been published with an big leap in strength for only 3 lines of code

Post by Dann Corbit » Sun Jul 05, 2020 10:35 pm

It does not take a lot of code to connect to the Syzygy tablebase files. Proven Elo increase (as opposed to other formats where most experiments show neutral Elo effect).
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.

OliverBr
Posts: 333
Joined: Tue Dec 18, 2007 8:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch
Contact:

Re: OliThink 5.4.0 has been published with an big leap in strength for only 3 lines of code

Post by OliverBr » Mon Jul 06, 2020 7:21 pm

Dann Corbit wrote:
Sun Jul 05, 2020 10:35 pm
It does not take a lot of code to connect to the Syzygy tablebase files. Proven Elo increase (as opposed to other formats where most experiments show neutral Elo effect).
This is my idea, too. It's the last missing piece that should improve the engine notably with additional little code.
Chess Engine OliThink: http://brausch.org/home/chess

OliverBr
Posts: 333
Joined: Tue Dec 18, 2007 8:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch
Contact:

Re: OliThink 5.4.0 has been published with an big leap in strength for only 3 lines of code

Post by OliverBr » Fri Jul 10, 2020 3:34 pm

Finally Olithink 5.5.2 has been released. The most interesting new feature is the ability to beat anyone easily in BNK vs K endgame. Example:



Leela, who runs directly into the safe black corners, suffers the same fate in no more than 30 moves.

Of course, this is nothing special for an engine, but actually OliThink couldn't do it before 5.5.2. I had to implement a special evaluation:

Initialization:

Code: Select all

int cornbase[] = {4, 4, 2, 1, 0, 0 ,0};
int bishcorn[64];
u64 whitesq;
for (i = 0; i < 64; i++) if ((i/8)%2 != (i&7)%2) whitesq |= BIT[i];
for (i = 0; i < 32; i++) bishcorn[i] = bishcorn[63-i] = (i&7) < 4 ? cornbase[(i&7) + i/8] : -cornbase[7 - (i&7) + i/8];
Evaluation (sf: B=3, N=2)

Code: Select all

int km = kmobil[kingpos[c]];
u64 b = pieceb[BISHOP] & colorb[c^1];
if (_bitcnt(b) == 1 && !pieceb[PAWN] && sf == 5 && sfi == 0) { // BNK_vs_k
     int bc = bishcorn[kingpos[c]] << 2 ;
     if (b & whitesq) km += bc; else km -= bc;
}
Chess Engine OliThink: http://brausch.org/home/chess

OliverBr
Posts: 333
Joined: Tue Dec 18, 2007 8:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch
Contact:

Re: OliThink 5.4.0 has been published with an big leap in strength for only 3 lines of code

Post by OliverBr » Tue Jul 14, 2020 6:23 pm

OliThink 5.5.4 has been released.

I would like to note that there is a Java version, which yields the exact same score/numbers and need only about 35% more time. (see third column time in 1/100sec.)

C:

Code: Select all

./olithink554 -sd 16 "6k1/5p1p/P1pb1nq1/6p1/3P4/1BP2PP1/1P1Nb2P/R1B3K1 b - - 9 9"
 1   213      0        55  f6d5 
 2   129      0       254  f6d5 a6a7 
 3    91      0      5939  g6d3 d2e4 f6e4 
 4   -93      0     10097  f6d5 a6a7 d5b6 a7a8q b6a8 a1a8 g8g7 
 5  -219      0     20640  f6d5 b3d5 e2a6 d5e4 f7f5 
 6  -197      1     32372  e2a6 a1a6 g6d3 a6c6 d3e3 g1f1 e3d3 f1e1 
 7  -205      1     47864  e2a6 a1a6 g6d3 a6c6 d3e3 g1f1 e3d3 f1f2 f6e8 
 8  -171      4    148495  f6e8 a6a7 e8c7 a7a8q c7a8 a1a8 g8g7 d2e4 d6e7 g1f2 e2d3 
 9  -202     10    345669  f6e8 a6a7 e8c7 a7a8q c7a8 a1a8 g8g7 a8a7 g5g4 b3f7 g6f7 a7f7 g7f7 
10  -128     29   1041010  d6b8 a6a7 b8a7 a1a7 f6d5 c3c4 d5b6 c4c5 b6d5 d2e4 
11  -136     37   1344596  d6b8 a6a7 b8a7 a1a7 f6d5 c3c4 d5b6 c4c5 b6d5 a7a8 g8g7 d2e4 
12  -141     64   2489954  d6b8 a6a7 b8a7 a1a7 f6d5 c3c4 d5b6 c4c5 b6d5 b3d5 c6d5 b2b4 
13  -144    144   5903368  d6b8 a6a7 b8a7 a1a7 f6d5 c3c4 d5b6 c4c5 b6d5 b3d5 c6d5 a7a8 g8g7 b2b4 
14   -91    364  15740498  d6b8 a6a7 b8a7 a1a7 f6d5 c3c4 d5b4 c4c5 g6d3 b3f7 g8f8 g1g2 d3d4 d2b3 d4e5 
15   -98    948  44025164  d6b8 a6a7 b8a7 a1a7 f6d5 g1f2 g6e6 d2f1 h7h6 a7a8 g8g7 b3d5 c6d5 f1e3 e2d3 b2b3 
16   205   3871 198837632  g6d3 g1f2 e2f3 d2f3 f6g4 f2e1 d3f3 b3c4 f3f2 e1d1 f2h2 a1a5 g4f2 d1c2 f2e4 c2b1 e4d2 c1d2 h2d2 a6a7 d2e1 b1a2 
move g6d3
Java:

Code: Select all

java -jar OliThink554.jar -sd 16 "6k1/5p1p/P1pb1nq1/6p1/3P4/1BP2PP1/1P1Nb2P/R1B3K1 b - - 9 9"
 1   213      0        55  f6d5 
 2   129      1       254  f6d5 a6a7 
 3    91      2      5939  g6d3 d2e4 f6e4 
 4   -93      3     10097  f6d5 a6a7 d5b6 a7a8q b6a8 a1a8 g8g7 
 5  -219      4     20640  f6d5 b3d5 e2a6 d5e4 f7f5 
 6  -197      5     32372  e2a6 a1a6 g6d3 a6c6 d3e3 g1f1 e3d3 f1e1 
 7  -205      7     47864  e2a6 a1a6 g6d3 a6c6 d3e3 g1f1 e3d3 f1f2 f6e8 
 8  -171     22    148495  f6e8 a6a7 e8c7 a7a8q c7a8 a1a8 g8g7 d2e4 d6e7 g1f2 e2d3 
 9  -202     33    345669  f6e8 a6a7 e8c7 a7a8q c7a8 a1a8 g8g7 a8a7 g5g4 b3f7 g6f7 a7f7 g7f7 
10  -128     61   1041010  d6b8 a6a7 b8a7 a1a7 f6d5 c3c4 d5b6 c4c5 b6d5 d2e4 
11  -136     71   1344596  d6b8 a6a7 b8a7 a1a7 f6d5 c3c4 d5b6 c4c5 b6d5 a7a8 g8g7 d2e4 
12  -141    109   2489954  d6b8 a6a7 b8a7 a1a7 f6d5 c3c4 d5b6 c4c5 b6d5 b3d5 c6d5 b2b4 
13  -144    220   5903368  d6b8 a6a7 b8a7 a1a7 f6d5 c3c4 d5b6 c4c5 b6d5 b3d5 c6d5 a7a8 g8g7 b2b4 
14   -91    505  15740498  d6b8 a6a7 b8a7 a1a7 f6d5 c3c4 d5b4 c4c5 g6d3 b3f7 g8f8 g1g2 d3d4 d2b3 d4e5 
15   -98   1299  44025164  d6b8 a6a7 b8a7 a1a7 f6d5 g1f2 g6e6 d2f1 h7h6 a7a8 g8g7 b3d5 c6d5 f1e3 e2d3 b2b3 
16   205   5148 198837632  g6d3 g1f2 e2f3 d2f3 f6g4 f2e1 d3f3 b3c4 f3f2 e1d1 f2h2 a1a5 g4f2 d1c2 f2e4 c2b1 e4d2 c1d2 h2d2 a6a7 d2e1 b1a2 
move g6d3
Chess Engine OliThink: http://brausch.org/home/chess

User avatar
MikeB
Posts: 4170
Joined: Thu Mar 09, 2006 5:34 am
Location: Pen Argyl, Pennsylvania

Re: OliThink 5.4.0 has been published with an big leap in strength for only 3 lines of code

Post by MikeB » Tue Jul 14, 2020 7:50 pm

OliverBr wrote:
Tue Jun 16, 2020 9:29 pm
Dann Corbit wrote:
Tue Jun 16, 2020 4:24 pm
It is a happy day when a new Olithink arrives.
Now we wait for lazy SMP.
;-)
Hi Dann,
Lazy SMP is far away, when still bugs exists like playing Kf1 here on ply15. All those zeros are nonsense, too, because black won't do the repetition.


Code: Select all

 ./olithink540 
force
setboard 8/8/8/5k2/5p2/4q3/4K3/4R2R w - - 14 135
analyze
 1    -9      0         3  e2d1 
 2   -11      0       107  e2d1 e3c3 
 3    -9      0      1005  e2f1 e3d3 f1f2 d3g3 f2f1 
 4   -28      0      3501  e2d1 e3d3 d1c1 d3c3 c1b1 f4f3 
 5    -7      0      9111  e2d1 e3d3 d1c1 d3c3 c1b1 c3b3 b1a1 f4f3 
 6   -27      0     20514  e2d1 e3d3 d1c1 f4f3 h1h5 f5g4 h5h2 d3c3 c1d1 
 7     0      1     58780  e2f1 e3f3 f1g1 f3g3 g1f1 g3d3 f1f2 d3g3 f2f1 
 8     0      1     80750  e2f1 e3f3 f1g1 f3g3 g1f1 g3f3 
 9     0      3    154499  e2f1 e3f3 f1g1 f3g3 g1f1 g3f3 
10     0      5    256085  e2f1 e3f3 f1g1 f3g3 g1f1 g3f3 
11     0     10    452480  e2f1 e3f3 f1g1 f3g3 g1f1 g3f3 
12     0     42   1933782  e2f1 e3f3 f1g1 f3g3 g1f1 g3f3 
13     0     64   2999141  e2f1 e3d3 f1f2 d3g3 f2f1 g3f3 f1g1 f3g3 g1f1 
14   -90    478  25154780  e2d1 e3d3 d1c1 f4f3 h1f1 f5g6 f1g1 g6f7 g1f1 f7f6 e1d1 d3e3 c1b1 e3b6 b1c2 f3f2 d1e1 f6g5 
15     0   1162  59682377  e2f1 e3d3 f1f2 d3g3 f2f1 f4f3 h1g1 g3h2 g1g7 h2h1 g7g1 h1h2 
16   -97   3570 195944937  e2d1 e3d3 d1c1 f4f3 h1f1 f5f4 c1b2 d3d2 b2b3 f3f2 e1c1 d2d3 b3b4 d3e2 b4a5 e2d2 a5a6 d2d3 a6a7 d3d7 a7a8 d7d8 a8a7 
But, it is a draw - so zero is not as bad as you think.
Image

OliverBr
Posts: 333
Joined: Tue Dec 18, 2007 8:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch
Contact:

Re: OliThink 5.4.0 has been published with an big leap in strength for only 3 lines of code

Post by OliverBr » Tue Jul 14, 2020 8:43 pm

MikeB wrote:
Tue Jul 14, 2020 7:50 pm
But, it is a draw - so zero is not as bad as you think.
It's not a draw after e2f1 (Kf1), so it is as bad as we think.

At least 5.5.4 recognises the thread at ply 14:

Code: Select all

8/8/8/5k2/5p2/4q3/4K3/4R2R w - - 14 135
 1   -73      0         3  e2d1 
 2   -38      0       135  e2d1 e3c3 
 3   -36      0       812  e2f1 e3d3 f1f2 d3g3 f2f1 
 4   -55      0      2267  e2d1 e3d3 d1c1 d3c3 c1b1 f4f3 
 5   -30      0      5380  e2f1 e3f3 f1g1 f3g3 g1f1 f4f3 h1h6 
 6   -30      0      9729  e2f1 e3f3 f1g1 f3g4 g1f2 g4g3 f2f1 f4f3 h1h6 
 7   -33      0     24422  e2f1 e3d2 e1e8 d2d3 f1f2 d3d4 f2f1 d4d1 e8e1 d1c2 
 8   -47      2     73730  e2f1 e3d2 h1h8 d2d3 f1g2 d3d5 g2f1 d5f3 f1g1 f3g3 g1f1 f4f3 
 9   -44      3    119889  e2f1 e3f3 f1g1 f3g4 g1f2 g4g3 f2f1 f4f3 h1g1 g3h2 g1g7 f3f2 
10   -35      8    254670  e2f1 e3d2 h1h8 d2d3 f1g2 d3d5 g2f1 d5b5 f1g1 b5c5 g1f1 c5c4 f1g2 c4c2 g2h1 f4f3 
11   -40     22    775796  e2f1 e3d2 h1g1 f4f3 e1e8 d2c1 e8e1 c1c5 g1h1 f5g5 h1g1 g5h4 g1g7 
12   -70     44   1642203  e2f1 e3d2 h1h5 f5g4 e1e5 f4f3 h5f5 d2g2 f1e1 g2g1 e1d2 f3f2 f5g5 g4h4 g5h5 h4g3 e5e3 g3f4 
13   -48    140   5602130  e2f1 e3d3 f1f2 d3g3 f2f1 f4f3 h1g1 g3h4 e1e8 h4c4 f1e1 c4b4 e1f2 b4c5 e8e3 f5f4 g1e1 f4g4 
14   -82    500  22148561  e2d1 e3d3 d1c1 d3c3 c1b1 f4f3 h1f1 f5g4 f1g1 g4f4 g1f1 c3d3 b1c1 d3d4 c1c2 f3f2 e1e2 d4c4 c2d1 
15   -91    688  31095443  e2d1 e3d3 d1c1 d3c3 c1b1 f4f3 h1f1 f5g4 f1g1 g4f4 g1f1 c3b3 b1c1 b3a2 f1g1 a2a3 c1d2 a3d6 d2c2 d6c5 c2d3 f3f2 
16   -85   1350  62306175  e2d1 e3d3 d1c1 d3c3 c1b1 f4f3 h1f1 f5g4 f1g1 g4f4 g1f1 c3d2 e1d1 d2b4 b1a1 b4a4 a1b1 a4b5 b1c1 b5c5 c1b2 f3f2 b2a1 
17   -91   3661 175215208  e2d1 e3d3 d1c1 d3c3 c1b1 f4f3 h1f1 f5g4 f1g1 g4f4 g1f1 c3c5 e1c1 c5b6 b1a2 f3f2 c1c4 f4g3 a2a3 g3g2 c4c1 g2h3
Playing the blunder "Kf1" yields to

Code: Select all

Kf1
 1    38      0        83  e3d2 
 2    36      0       329  e3f3 f1g1 f3g3 g1f1 
 3    67      0       735  e3f3 f1g1 f3g3 g1f1 f4f3 
 4    30      0      2085  e3f3 f1g1 f3g3 g1f1 f4f3 h1h6 
 5    30      0      5917  e3f3 f1g1 f3g4 g1f2 g4g3 f2f1 f4f3 h1h6 
 6    34      0     13238  e3f3 f1g1 f3g3 g1f1 f4f3 h1h5 f5g6 e1e5 g6f7 
 7    44      0     26681  e3f3 f1g1 f3g3 g1f1 f4f3 h1g1 g3h2 g1g7 f3f2 
 8    33      3    114359  e3f3 f1g1 f3g4 g1f1 f4f3 h1h2 g4d4 h2h5 f5g4 e1e5 g4g3 
 9    35     11    378582  e3d2 h1h8 d2d3 f1g2 d3d5 g2f1 d5b5 f1g1 b5c5 g1f1 c5c4 f1g2 c4c2 g2h1 f4f3 
10    28     31   1231725  e3d2 h1h8 d2d3 f1g2 d3d5 g2f1 d5b5 f1g1 b5c5 g1f1 c5c4 f1g2 c4a2 g2f1 f4f3 h8h4 
11    33     58   2359441  e3d2 h1h8 f5g4 e1e8 d2c1 f1f2 c1c2 e8e2 c2c5 f2f1 c5c4 h8e8 c4c1 e2e1 c1d2 
12    48    171   7276759  e3f3 f1g1 f3g3 g1f1 f4f3 h1g1 g3h4 e1e8 h4c4 f1e1 c4c3 e1f2 c3c5 e8e3 f5f4 g1e1 f4g4 
13   468    189   8076867  e3f3 f1g1 f3g3 g1f1 f4f3 h1g1 g3d6 g1g8 d6d3 f1f2 d3c2 f2f3 c2b3 f3f2 b3g8 e1e2 g8d5 f2f1 
14   478    206   8883786  e3f3 f1g1 f3g3 g1f1 f4f3 h1g1 g3d6 g1g8 d6a6 f1g1 f3f2 g1f2 a6a2 f2e3 a2g8 e1f1 f5e5 f1e1 g8g3 e3d2 e5d4 d2d1 
15   480    242  10490076  e3f3 f1g1 f3g3 g1f1 f4f3 h1g1 g3d6 g1g8 d6a6 f1g1 f3f2 g1f2 a6a2 e1e2 a2g8 e2e3 g8g5 e3e8 g5f4 f2e1 f4f3 
16   481    282  12292976  e3f3 f1g1 f3g3 g1f1 f4f3 h1g1 g3d6 g1g8 d6a6 f1g1 f3f2 g1f2 a6a2 e1e2 a2g8 e2e3 g8g5 e3e8 g5f4 f2e1 f4h4 e1f1 h4g3 
[/quote]
Chess Engine OliThink: http://brausch.org/home/chess

OliverBr
Posts: 333
Joined: Tue Dec 18, 2007 8:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch
Contact:

Re: OliThink 5.4.0 has been published with an big leap in strength for only 3 lines of code

Post by OliverBr » Tue Jul 21, 2020 8:40 pm

Now having some test hardware, I can confirm that 5.5.8 looks like the best version so far.
Moreover a serious time management bug has been fixed.
Chess Engine OliThink: http://brausch.org/home/chess

OliverBr
Posts: 333
Joined: Tue Dec 18, 2007 8:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch
Contact:

Re: OliThink 5.4.0 has been published with an big leap in strength for only 3 lines of code

Post by OliverBr » Wed Jul 29, 2020 10:55 pm

5.6.0 has been published.

These are the results of 2000 games with tc=40/80:

Code: Select all

40/80:
   # PLAYER            :  RATING  ERROR  POINTS  PLAYED   (%)    W    D     L  D(%)  CFS(%)
   1 Fruit 2.1         :     179     20   734.0    1000  73.4  633  202   165  20.2     100
   2 Arasan 11.7       :      53     20   574.5    1000  57.5  494  161   345  16.1     100
   3 OliThink 5.6.0    :       0   ----   691.5    2000  34.6  510  363  1127  18.1     ---

White advantage = 32.99 +/- 7.27
Draw rate (equal opponents) = 19.82 % +/- 0.91
It is tradition that OliThink performs better in very fast games, so here the results of a tourney with tc=40/20:

Code: Select all

40/20:
   # PLAYER            :  RATING  ERROR  POINTS  PLAYED   (%)    W    D    L  D(%)  CFS(%)
   1 Fruit 2.1         :     136     48   136.5     200  68.2  123   27   50  13.5     100
   2 Arasan 11.7       :      34     47   109.5     200  54.8   94   31   75  15.5      92
   3 OliThink 5.6.0    :       0   ----   154.0     400  38.5  125   58  217  14.5     ---

White advantage = 39.82 +/- 16.00
Draw rate (equal opponents) = 15.27 % +/- 1.83
Chess Engine OliThink: http://brausch.org/home/chess

OliverBr
Posts: 333
Joined: Tue Dec 18, 2007 8:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch
Contact:

Re: OliThink 5.4.0 has been published with an big leap in strength for only 3 lines of code

Post by OliverBr » Mon Aug 03, 2020 11:07 am

5.6.1 has been published. I hesitated for a long time, because it gave ambiguous results. The implemented code is quite straight forward and tests show an ELO gain of +15 compared to 5.6.0 but it performs worse against Fruit 2.1.

Anyway it has something special: A win against Stockfish 5 in 40/40. This win doesn't say that match, because it needed 1271 rounds à 2 games to achieve it 8-)

Chess Engine OliThink: http://brausch.org/home/chess

Post Reply