An alternative to IID

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Cardoso
Posts: 362
Joined: Thu Mar 16, 2006 7:39 pm
Location: Portugal
Full name: Alvaro Cardoso

Re: An alternative to IID

Post by Cardoso »

Rebel wrote: Thu Aug 13, 2020 8:46 am Took IID out (of my oldie) and replaced it with a full ply reduction without research and it gave me +17 elo after 5000 games.

Not sure if that works for modern searchers.
Thanks Ed for sharing.
But I have one question, you do this only at pv nodes (beta != alpha + 1) like it's done on IID, or you do it at every node?

best regards,
Alvaro
User avatar
Rebel
Posts: 6995
Joined: Thu Aug 18, 2011 12:04 pm

Re: An alternative to IID

Post by Rebel »

Cardoso wrote: Sat Aug 22, 2020 2:21 pm
Rebel wrote: Thu Aug 13, 2020 8:46 am Took IID out (of my oldie) and replaced it with a full ply reduction without research and it gave me +17 elo after 5000 games.

Not sure if that works for modern searchers.
Thanks Ed for sharing.
But I have one question, you do this only at pv nodes (beta != alpha + 1) like it's done on IID, or you do it at every node?

best regards,
Alvaro
Every node.

The basic idea is that the node has a good best move the next iteration.

Of course you can add a list of exceptions, such as:

1. Don't reduce when the king is in check;

2. Don't reduce when there is a winning knight/bishop/rook/queen capture, in 95% of the cases it will become the best move anyway;

3. whatever more.
90% of coding is debugging, the other 10% is writing bugs.
OliverBr
Posts: 725
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: An alternative to IID

Post by OliverBr »

hgm wrote: Fri Aug 14, 2020 2:37 pm Reducing everything but the PV isn't necessarily bad. Even reducing everything including the PV would not be detrimental, it just means you lie more about your depth.
This correct. With this trick, my engine searches most test positions 3-4 more plies deep. So it looks like, but it isn't. But those alleged search depths are never really true or who believes that the big engines really can search any complex position entirely to depth 36 or deeper? They do this only for particular lines, still "36" looks amazing.

About the improvement of this IIR: I got mixed results:
1) Gain of ~20 ELO against its former self in fast games. (40/20)
2) Gain of ~10 ELO against its former self in moderate games. (40/40)
3) No gain at all against other opponents. I wouldn't be surprise if this happens to others, too.
4) Very mixed results for position testing, but generally this become worse.

Some of my favorite positions won't work at all like this one. Qd3 was found before @ply 16, with this IIR it's not found at all. No wonder they say Qd3 is "invisible" for computers, if computers typically prune almost everything away.

[d]6k1/5p1p/P1pb1nq1/6p1/3P4/1BP2PP1/1P1Nb2P/R1B3K1 b - - 9 9 bm Qd3
Chess Engine OliThink: http://brausch.org/home/chess
OliThink GitHub:https://github.com/olithink
OliverBr
Posts: 725
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: An alternative to IID

Post by OliverBr »

Rebel wrote: Sat Aug 22, 2020 6:38 pm
Cardoso wrote: Sat Aug 22, 2020 2:21 pm But I have one question, you do this only at pv nodes (beta != alpha + 1) like it's done on IID, or you do it at every node?
Every node.
Yes. Every node. Only when I do it at every nodes the engine plays notably stronger (against its former self).
This is why I don't understand what Stockfish is here doing:

https://github.com/official-stockfish/S ... 9082246a0a

Why is it doing it only at pvnodes? It doesn't make any sense to me...

Code: Select all

// Step 11. If the position is not in TT, decrease depth by 2
    if (   PvNode
        && depth >= 6
        && !ttMove)
        depth -= 2;
Chess Engine OliThink: http://brausch.org/home/chess
OliThink GitHub:https://github.com/olithink
User avatar
hgm
Posts: 27809
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: An alternative to IID

Post by hgm »

As for most modern engines the PV was about the only branch in the tree for which they were not lying about the depth, reducing in the PV means that the reported depth now is a total lie...
OliverBr
Posts: 725
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: An alternative to IID

Post by OliverBr »

I don't get it yet. With a parameter change it really outperforms 5.6.5 in h2h:

Code: Select all

   # PLAYER             :  RATING  ERROR  POINTS  PLAYED   (%)    W    D    L  D(%)  CFS(%)
   1 OliThink 5.6.5b    :      35     10  1377.5    2505  55.0  903  949  653  37.9     100
   2 OliThink 5.6.5     :       0   ----  1127.5    2505  45.0  653  949  903  37.9     ---

White advantage = 11.58 +/- 5.75
Draw rate (equal opponents) = 38.23 % +/- 1.00
BUT: Analyzing tactical position it's just meh. Does anybody have an explanation for this?

Example: It just won't find Rxh7, even in depth 21:

Code: Select all

./olithink565b
2rq1bk1/1br2p1p/p2p2p1/1p1P4/4Q3/PP3N2/1BP5/1K1R3R w - - bm Rxh7
 1  -128      0       123  c2c3 
 2  -131      0       597  c2c4 b5c4 
 3  -152      0      1901  c2c4 b5c4 b3b4 
 4  -161      0     10651  e4d4 f7f6 c2c4 b5c4 
 5  -151      0     14165  e4d4 f7f6 d4f4 f8g7 c2c3 
 6  -148      1     23682  e4d4 f7f6 f3g5 c7c2 g5e6 d8e7 
 7  -148      1     32303  e4d4 f7f6 f3g5 c7c2 g5e6 d8e7 d4f6 
 8   -95      1     45631  e4d4 f7f6 f3g5 c7c2 h1h7 f8e7 d4e4 f6g5 
 9   -96      5    134530  e4d4 f7f6 f3g5 c7e7 g5e6 e7e6 d5e6 b7h1 d1h1 
10   -88      9    256468  e4d4 f7f6 f3g5 c7e7 c2c4 b5c4 b3c4 f8g7 g5e6 e7e6 
11   -84     14    391625  e4d4 f7f6 f3g5 c7e7 g5e6 e7e6 d5e6 b7h1 d1h1 f8e7 c2c3 
12   -50     21    641480  e4d4 f7f6 f3g5 c7e7 g5e4 e7e5 d4a7 e5e4 a7b7 c8c7 b7a6 
13   -52     34   1109766  e4d4 f7f6 f3g5 c7e7 h1h2 f8g7 g5e6 d8d7 e6g7 e7e5 d4h4 d7g7 b2e5 
14   -52     63   2197935  e4d4 f7f6 f3g5 c7e7 h1h2 f8g7 g5e6 d8d7 e6g7 e7e5 d4h4 d7g7 b2e5 d6e5 
15   -46    112   4190512  e4d4 f7f6 f3g5 c7e7 h1h2 e7d7 d4e4 d8e8 e4e8 c8e8 b2f6 h7h6 g5e6 d7f7 h2f2 
16   -52    192   7447260  e4d4 f7f6 f3g5 c7e7 h1h2 e7d7 d4e4 d8e8 b2f6 e8e4 g5e4 h7h6 f6g5 f8g7 g5h6 g7e5 
17   -14    356  14686218  e4d4 f7f6 f3g5 c7e7 h1h2 e7d7 g5e6 d8e7 d1f1 f8g7 e6g7 g8g7 f1f6 e7e1 b1a2 g7g8 f6f4 
18     2    645  27681086  e4d4 f7f6 f3g5 c7e7 h1h2 f8g7 g5h7 e7f7 d4g4 g6g5 d1f1 f6f5 g4g5 d8g5 h7g5 f7f8 g5e6 
19     2   1229  54845898  e4d4 f7f6 f3g5 c7e7 h1h2 e7g7 g5e6 d8e7 e6g7 f8g7 c2c4 b5c4 b3c4 h7h5 d1g1 g8h7 h2g2 g6g5 
20     7   2001  90917164  e4d4 f7f6 f3g5 c7e7 h1h2 e7g7 g5e6 d8e7 e6g7 f8g7 d4h4 h7h5 h2f2 g8f7 c2c4 b5c4 
21    22   2979 138245964  e4d4 f7f6 f3g5 c7e7 d4f6 f8g7 f6e7 d8e7 h1h7 g7f6 h7e7 f6e7 g5e4 g6g5 b2c3 g5g4 d1g1 b7d5 
5.6.5 found it easily:

Code: Select all

../565/olithink
2rq1bk1/1br2p1p/p2p2p1/1p1P4/4Q3/PP3N2/1BP5/1K1R3R w - - bm Rxh7
 1  -128      0       123  c2c3 
 2  -131      0       597  c2c4 b5c4 
 3  -152      0      1901  c2c4 b5c4 b3b4 
 4  -161      0     10651  e4d4 f7f6 c2c4 b5c4 
 5  -151      0     14166  e4d4 f7f6 d4f4 f8g7 c2c3 
 6  -148      1     23267  e4d4 f7f6 f3g5 c7c2 g5e6 d8e7 
 7  -148      1     35045  e4d4 f7f6 f3g5 c7c2 g5e6 d8e7 d4f6 
 8   -95      2     51192  e4d4 f7f6 f3g5 c7c2 h1h7 f8e7 d4e4 f6g5 
 9   -96      5    143034  e4d4 f7f6 f3g5 c7e7 g5e6 e7e6 d5e6 b7h1 d1h1 
10   -88      9    247671  e4d4 f7f6 f3g5 c7e7 c2c4 b5c4 b3c4 f8g7 g5e6 e7e6 
11   -84     17    514296  e4d4 f7f6 f3g5 c7e7 g5e6 e7e6 d5e6 b7h1 d1h1 f8e7 c2c3 
12   -61     56   1988505  e4d4 f7f6 f3g5 c7d7 d4e4 d8e8 e4e8 c8e8 b2f6 h7h6 g5e6 a6a5 
13   -52     95   3631738  e4d4 f7f6 f3g5 c7e7 h1h2 f8g7 g5e6 d8d7 e6g7 e7e5 d4h4 d7g7 b2e5 
14   -46    209   8635629  e4d4 f7f6 f3g5 c7e7 h1h2 e7d7 d4e4 d8e8 e4e6 e8e6 d5e6 d7c7 b2f6 h7h6 g5f7 
15    26    367  16017463  h1h7 g8h7 d1h1 f8h6 e4f4 d8f8 f4f6 c7c3 b2c3 c8c3 f6c3 b7d5 c3f6 d5f3 f6f3 h7g8 
16    25    524  23978895  h1h7 g8h7 d1h1 f8h6 e4f4 d8f8 f4f6 c7c3 b2c3 c8c3 f6c3 b7d5 c3d3 d5c6 d3e3 f7f6 c2c3 
17   296   1626  80801479  h1h7 g8h7 d1h1 f8h6 e4f4 d8f8 f3g5 h7g8 g5e4 f7f5 h1h6 f8h6 e4f6 g8g7 f6g4 g7g8 g4h6 g8h7 h6f7 h7g8 f7d6 c8b8 
18   321   3523 181808274  h1h7 g8h7 d1h1 f8h6 e4f4 d8f8 f3g5 h7g8 g5e4 f7f5 h1h6 f8h6 e4f6 g8g7 f6g4 g7f7 g4h6 f7e7 f4e3 e7f8 e3e6 f5f4 e6d6 f8e8 d6g6 e8d8 
Chess Engine OliThink: http://brausch.org/home/chess
OliThink GitHub:https://github.com/olithink
User avatar
Rebel
Posts: 6995
Joined: Thu Aug 18, 2011 12:04 pm

Re: An alternative to IID

Post by Rebel »

hgm wrote: Sat Aug 22, 2020 7:24 pm As for most modern engines the PV was about the only branch in the tree for which they were not lying about the depth, reducing in the PV means that the reported depth now is a total lie...
As long as one doesn't lie against elo :D
90% of coding is debugging, the other 10% is writing bugs.
User avatar
hgm
Posts: 27809
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: An alternative to IID

Post by hgm »

Not really. Printing depth has never contributed anything to Elo. It is purely a service to the engine user. Intentionally lying about it seems rather immoral. People did not look kindly upon Vas, for cheating with the depth. Or upon Robert, for adding 14% to his nps. Both had high Elo, as well as a ruined reputation.
User avatar
Rebel
Posts: 6995
Joined: Thu Aug 18, 2011 12:04 pm

Re: An alternative to IID

Post by Rebel »

hgm wrote: Sun Aug 23, 2020 7:37 pm Not really. Printing depth has never contributed anything to Elo. It is purely a service to the engine user. Intentionally lying about it seems rather immoral. People did not look kindly upon Vas, for cheating with the depth. Or upon Robert, for adding 14% to his nps. Both had high Elo, as well as a ruined reputation.
Sure, but that's another subject, I think we have a misunderstanding
90% of coding is debugging, the other 10% is writing bugs.
OliverBr
Posts: 725
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: An alternative to IID

Post by OliverBr »

Anyway, even there are some questions without answer, there is an ELO gain of about ~25.
=> OliThink 5.6.6 has been released.
Chess Engine OliThink: http://brausch.org/home/chess
OliThink GitHub:https://github.com/olithink