Strange draw scores when searching Fine#70

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

konsolas
Posts: 182
Joined: Sun Jun 12, 2016 5:44 pm
Location: London
Full name: Vincent

Re: Strange draw scores when searching Fine#70

Post by konsolas »

xr_a_y wrote: Fri Feb 15, 2019 2:10 pm Nop, without SE, score drops but later, at depth 51.

I am quite sure Minic is not pruning/reducing in end games but to be sure I use the "mateFinder" mode of Minic (no reduction, no pruning), with SE and I get :

Code: Select all

# This is Minic version 0.37
# Info  2019-02-15 13:45:39-019: Init hash
# Warn  2019-02-15 13:45:39-019: ARG key not given, ttSizeMb
# Info  2019-02-15 13:45:39-019: From config file, ttSizeMb : 1024
# Info  2019-02-15 13:45:39-019: Init TT
# Info  2019-02-15 13:45:39-019: Bucket size 48
# Info  2019-02-15 13:45:39-288: Size of TT 768Mb
# Info  2019-02-15 13:45:39-288: Init stat
# Info  2019-02-15 13:45:39-288: Init lmr
# Info  2019-02-15 13:45:39-288: Init mvv-lva
# Info  2019-02-15 13:45:39-288: Init mask
# Info  2019-02-15 13:45:39-288: Material hash total : 944784
# Warn  2019-02-15 13:45:39-289: ARG key not given, threads
# Info  2019-02-15 13:45:39-289: From config file, threads : 1
# Info  2019-02-15 13:45:39-289: Using 1 threads
# Error 2019-02-15 13:45:39-289: ARG value not given, mateFinder
@todo:: backtrace
# Info  2019-02-15 13:45:39-289: From config file, mateFinder : false
# Warn  2019-02-15 13:45:39-289: ARG key not given, book
# Info  2019-02-15 13:45:39-289: From config file, book : true
# Info  2019-02-15 13:45:39-289: Reading fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
# Info  2019-02-15 13:45:39-289: No en passant square given
# Info  2019-02-15 13:45:39-289: You can use -xboard command line option to enter xboard mode
# Info  2019-02-15 13:45:39-289: Reading fen 8/k7/3p4/p2P1p2/P2P1P2/8/8/K7 w - -
# Warn  2019-02-15 13:45:39-289: No castling right given
# Info  2019-02-15 13:45:39-289: No en passant square given
# Info  2019-02-15 13:45:39-290: Position
# +-+-+-+-+-+-+-+-+
# | | | | | | | | |
# +-+-+-+-+-+-+-+-+
# |k| | | | | | | |
# +-+-+-+-+-+-+-+-+
# | | | |p| | | | |
# +-+-+-+-+-+-+-+-+
# |p| | |P| |p| | |
# +-+-+-+-+-+-+-+-+
# |P| | |P| |P| | |
# +-+-+-+-+-+-+-+-+
# | | | | | | | | |
# +-+-+-+-+-+-+-+-+
# | | | | | | | | |
# +-+-+-+-+-+-+-+-+
# |K| | | | | | | |
# +-+-+-+-+-+-+-+-+
# wk a1
# bk a7
# Turn white
# Phase 0.159673
# Static score 70
# Hash 7725503017962112006
# FEN 8/k7/3p4/p2P1p2/P2P1P2/8/8/K7 w - - 0 1
 
# Info  2019-02-15 13:45:39-290: msecPerMove     86400000
# Info  2019-02-15 13:45:39-290: msecInTC        -1
# Info  2019-02-15 13:45:39-290: msecInc         -1
# Info  2019-02-15 13:45:39-290: nbMoveInTC      -1
# Info  2019-02-15 13:45:39-290: msecUntilNextTC -1
# Info  2019-02-15 13:45:39-290: currentNbMoves  1
# Info  2019-02-15 13:45:39-290: Search Sync
# Info  2019-02-15 13:45:39-290: Wait for workers to be ready
# Info  2019-02-15 13:45:39-290: ...ok
# Info  2019-02-15 13:45:39-290: Calling main thread search
# Info  2019-02-15 13:45:39-290: Search launched 0
# Info  2019-02-15 13:45:39-290: Search called
# Info  2019-02-15 13:45:39-290: requested time  86400000
# Info  2019-02-15 13:45:39-290: requested depth 70
# Info  2019-02-15 13:45:39-290: Init stat
# Info  2019-02-15 13:45:39-290: Init killers
# Info  2019-02-15 13:45:39-290: Init history
# Info  2019-02-15 13:45:39-290: Init counter
1 98 0 5 2 5 0  a1b2
2 79 0 23 3 22 0        a1b2 a7b6
3 106 0 68 4 68 0       a1b2 a7b6 b2c3
4 100 0 137 5 137 0     a1b2 a7b6 b2c3 b6c7
5 106 0 244 6 243 0     a1b2 a7b6 b2c3 b6c7 c3c4
6 106 0 454 7 453 0     a1b2 a7b6 b2c3 b6b7 c3c4 b7c7
7 109 0 695 8 694 0     a1b2 a7b6 b2c3 b6b7 c3c4 b7c7 c4b5
8 107 0 1215 10 1215 0  a1b2 a7b6 b2c3 b6b7 c3d3 b7c7 d3e3 c7d7
9 106 0 1638 10 1637 0  a1b2 a7b6 b2c3 b6b7 c3d3 b7c7 d3e3 c7d7 e3d3
10 103 0 3689 12 3688 1         a1b2 a7b6 b2c2 b6a7 c2d3 a7a6 d3e3 a6b6 e3f3 b6c7
11 104 0 4723 12 4723 2         a1b2 a7b8 b2b3 b8c7 b3c4 c7b6 c4d3 b6c7 d3e3 c7d7 e3f3
12 100 0 5516 13 5515 2         a1b2 a7b8 b2b3 b8c7 b3c4 c7b6 c4d3 b6c7 d3e3 c7d7 e3f3 d7e7
13 102 0 6627 14 3313 3         a1b2 a7b8 b2b3 b8c7 b3c4 c7b6 c4d3 b6c7 d3e3 c7d7 e3f3 d7e7 f3e3
14 105 0 10016 16 3338 5        a1b2 a7b8 b2b3 b8c7 b3c4 c7b6 c4d3 b6c7 d3c3 c7b7 c3c2 b7b8 c2d3 b8c7 d3e3
15 105 0 12595 19 4198 7        a1b2 a7b8 b2b3 b8c7 b3c4 c7b6 c4d3 b6c7 d3c3 c7b7 c3c2 b7b6 c2d3 b6c7 d3e3
16 105 0 15416 19 3853 9        a1b2 a7b8 b2b3 b8c7 b3c3 c7b7 c3c2 b7b6 c2b2 b6a6 b2b1 a6a7 b1c1 a7b6 c1c2 b6a6
17 105 0 21718 19 3619 14       a1b2 a7b8 b2c2 b8c8 c2d3 c8b7 d3d2 b7c8 d2d3 c8b7 d3d2 b7a8 d2e2 a8b7 e2f3 b7c7 f3e3
18 101 1 43460 24 3950 30       a1b2 a7b8 b2c2 b8c8 c2d3 c8b7 d3d2 b7c7 d2c3 c7b7 c3d2 b7c7 d2c3 c7b6 c3c2 b6a6 c2d1 a6a7
19 101 1 48828 24 4069 34       a1b2 a7b8 b2c2 b8c8 c2d3 c8b7 d3d2 b7c7 d2e1 c7d7 e1f2 d7d8 f2g3 d8e7 g3f3 e7d8 f3g2 d8c7 g2f3
20 102 1 60582 24 4038 43       a1b2 a7b8 b2c2 b8c8 c2d3 c8c7 d3e3 c7d8 e3d3 d8c7 d3e3 c7d8 e3e2 d8d7 e2d2 d7c7 d2d1 c7b7 d1c1 b7c8 c1c2
21 101 1 73695 25 4094 52       a1b2 a7b8 b2c2 b8c8 c2d3 c8c7 d3e3 c7d8 e3d3 d8c7 d3e3 c7d8 e3d3 d8c7 d3e3 c7d8 e3f2 d8e7 f2g3 e7f6 g3f3 f6g7 f3f2 g7g8
22 102 2 79658 27 3982 56       a1b2 a7a6 b2b1 a6a7 b1c1 a7b7 c1c2 b7b6 c2d2 b6c7 d2c3 c7b7 c3d3 b7c7 d3e3 c7d7 e3e2 d7d8 e2d1 d8d7 d1c1 d7c8 c1c2
23 104 2 93467 28 4063 67       a1b2 a7a6 b2c1 a6b7 c1d2 b7c8 d2e2 c8d8 e2d1 d8d7 d1c1 d7c7 c1b1 c7b7 b1c2 b7b6 c2d2 b6c7 d2d3 c7b6 d3e2 b6b7 e2f2 b7a7 f2g3 a7a6 g3f2
24 104 2 113426 37 4050 80      a1b2 a7a8 b2c3 a8b7 c3b3 b7a7 b3c4 a7b6 c4d3 b6c7 d3c4 c7b6 c4d3 b6c7 d3c4 c7b6 c4d3 b6c7 d3e3 c7d8 e3f2 d8e7 f2e1 e7d7 e1e2 d7d8
25 104 3 132750 38 4022 95      a1b2 a7a8 b2b3 a8a7 b3c4 a7b6 c4d3 b6c7 d3c2 c7c8 c2d2 c8d8 d2c3 d8c7 c3d3 c7b7 d3e2 b7c8 e2f2 c8d7 f2g3 d7e7 g3h4 e7f6 h4h5 f6f7
26 104 3 155582 38 3989 112     a1b2 a7a8 b2c2 a8b8 c2d2 b8c8 d2e1 c8d7 e1d1 d7c7 d1c2 c7b8 c2d2 b8c8 d2e1 c8d7 e1d1 d7c7 d1c2 c7b8 c2d2 b8c8 d2d3 c8b7 d3e2 b7c8 e2d2 c8d8 d2c3 d8c7 c3d3
27 102 4 197824 38 4037 143     a1b2 a7a8 b2c2 a8b8 c2d2 b8c8 d2e1 c8d7 e1d1 d7c7 d1e1 c7d7 e1d1 d7c7 d1e1 c7d7 e1d1 d7c7 d1c1 c7b7 c1d2 b7c8 d2e3 c8d7 e3e2 d7e7 e2e3
28 103 5 207016 38 4059 149     a1b2 a7a8 b2c2 a8b8 c2d2 b8c8 d2e2 c8d8 e2e1 d8d7 e1f1 d7e8 f1e2 e8d8 e2e1 d8d7 e1f1 d7e8 f1e2 e8d8 e2d1 d8c7 d1c1 c7b7 c1b1 b7a7 b1a2 a7b7 a2b1 b7a7 b1c1
29 103 5 216288 38 4005 156     a1b2 a7a8 b2c2 a8b8 c2d2 b8c8 d2e2 c8d8 e2e1 d8d7 e1d1 d7c7 d1c1 c7b7 c1b1 b7a7 b1a2 a7b7 a2b3 b7a7 b3c4 a7b6 c4d3 b6c7 d3e2 c7d8 e2e1 d8d7 e1f1 d7e8 f1f2 e8d8
30 103 5 224308 38 4005 161     a1b2 a7a8 b2c2 a8b8 c2d2 b8c8 d2e2 c8d8 e2e1 d8d7 e1d1 d7c7 d1c1 c7b7 c1d2 b7c8 d2e2 c8d8 e2e1 d8d7 e1d1 d7c7 d1c1 c7b7 c1d2 b7c8 d2e3 c8d7 e3f3 d7c7
31 1275 901 26481497 56 2936 12477      a1b1 a7b7 b1c1 b7c7 c1d1 c7d8 d1c2 d8e7 c2b3 e7f6 b3c4 f6g6 c4b5 g6h5 b5c6 h5g4 c6d6 g4f4 d6c6 f4g3 d5d6 f5f4 d6d7 f4f3 d7d8q f3f2 d8f8 g3g2 d4d5 f2f1q f8f1 g2f1 d5d6 f1f2 d6d7 f2f3 d7d8q f3g3 d8a5 g3g4 a5d5
32 1409 1235 36694973 58 2969 18108     a1b1 a7b7 b1c1 b7c7 c1d1 c7d8 d1c2 d8c7 c2d3 c7b7 d3e2 b7c7 e2f2 c7b8 f2f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5f5 d3e2 f5e4 e2d2 e4b1 d2c3 d4d5 f2f1q b1f1 c3b4 f1f4 b4c3 d5d6 c3b3 d6d7 b3a2 d7d8q a2b2
37 2240 10767 311292961 71 2890 169143  a1b1 a7b7 b1c1 b7c7 c1d1 c7d7 d1c2 d7e7 c2c3 e7f7 c3c4 f7g6 c4b5 g6h5 b5c6 h5g4 c6d6 g4f4 d6c6 f4e3 d5d6 f5f4 d6d7 f4f3 d7d8q f3f2 d8g5 e3d3 g5f5 d3e2 d4d5 f2f1r f5f1 e2f1 d5d6 f1f2 d6d7 f2f1 d7d8q f1g1
38 2240 10838 313467545 71 2892 170287  a1b1 a7b7 b1c1 b7c7 c1d1 c7d7 d1c2 d7e7 c2c3 e7f7 c3c4 f7g6 c4b5 g6h5 b5c6 h5g4 c6d6 g4f4 d6c6 f4e3 d5d6 f5f4 d6d7 f4f3 d7d8q f3f2 d8g5 e3d3 g5f5 d3e2 f5b5 e2e1 d4d5 f2f1q b5f1 e1f1 d5d6 f1f2 d6d7 f2f1 d7d8q f1g1
39 0 43066 1202825348 72 2792 695582    a1b2 a7a8 b2c3 a8b7 c3c2 b7b8 c2d3 b8c7 d3c4 c7b6 c4d3 b6c7 d3c4 c7b6 c4d3 b6c7 d3c4 c7b6 c4d3 b6c7
same issue ! this has nothing to do with pruning ... I am scared now :shock: :?

Maybe 3reps + TT ?

before returning a score in search

Code: Select all

    TT::Entry e;
    if (skipMove==INVALIDMOVE && TT::getEntry(computeHash(p), depth, e)) { // if not skipmove
        if ( e.h != 0 && !rootnode && !pvnode && ( (e.b == TT::B_alpha && e.score <= alpha) || (e.b == TT::B_beta  && e.score >= beta) || (e.b == TT::B_exact) ) ) {
            if ( e.m != INVALIDMOVE) pv.push_back(e.m); // here e.m might be INVALIDMOVE if B_alpha so don't try this at root node !
            return adjustHashScore(e.score, ply);
        }
}
we maybe have to check if it is not a draw ?
Out of pv I use 1rep, and 3 reps inside pv. I only let the search return a TT move if not inside pv.

Maybe it is not worth to concentrate on fine70 too much ...
While this issue can be seen clearly in Fine#70, I am worried that it is indicative of a deeper issue in how our search implementations work. If we ignore the output of Fine#70, there may be no other situations in which this issue comes to light, but it will still be an issue and may potentially lead to blunders.
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: Strange draw scores when searching Fine#70

Post by xr_a_y »

User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: Strange draw scores when searching Fine#70

Post by xr_a_y »

Same thing in xiphos:

Code: Select all

info depth 38 score cp 301 nodes 2988596 time 687 nps 4343889 pv a1b1
info depth 38 score cp 370 nodes 3400551 time 787 nps 4315420 pv a1b1
info depth 38 score cp 475 nodes 3571352 time 822 nps 4339431 pv a1b1
info depth 38 score cp 634 nodes 3644232 time 839 nps 4338371 pv a1b1
info depth 38 score cp 878 nodes 3708610 time 854 nps 4337555 pv a1b1
info depth 38 score cp 1240 nodes 4145840 time 951 nps 4354873 pv a1b1
info depth 38 score cp 1457 nodes 6450650 time 1521 nps 4238272 pv a1b1
info depth 39 score cp 0 nodes 6971910 time 1636 nps 4258955 pv a1b1
info depth 40 score cp 6 nodes 7467449 time 1758 nps 4245280 pv a1b1
info depth 40 score cp 17 nodes 8097718 time 1909 nps 4239642 pv a1b1
info depth 40 score cp 35 nodes 8449376 time 1983 nps 4258758 pv a1b1
info depth 40 score cp 64 nodes 8882478 time 2070 nps 4288980 pv a1b1
info depth 40 score cp 109 nodes 9388847 time 2199 nps 4267657 pv a1b1
info depth 40 score cp 178 nodes 9786153 time 2285 nps 4280906 pv a1b1
info depth 40 score cp 283 nodes 10265598 time 2405 nps 4266665 pv a1b1
info depth 40 score cp 442 nodes 10912758 time 2558 nps 4264461 pv a1b1
info depth 40 score cp 682 nodes 11731708 time 2723 nps 4306794 pv a1b1
konsolas
Posts: 182
Joined: Sun Jun 12, 2016 5:44 pm
Location: London
Full name: Vincent

Re: Strange draw scores when searching Fine#70

Post by konsolas »

Not storing draw scores in the transposition table seems to work for me, though I question how this will affect strength in other areas of the game
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: Strange draw scores when searching Fine#70

Post by xr_a_y »

Ok how do you "detect" draw score (==contemp ?)
konsolas
Posts: 182
Joined: Sun Jun 12, 2016 5:44 pm
Location: London
Full name: Vincent

Re: Strange draw scores when searching Fine#70

Post by konsolas »

xr_a_y wrote: Sat Feb 16, 2019 12:56 pm Ok how do you "detect" draw score (==contemp ?)
I haven't implemented contempt, so it's pretty easy - simply not storing 0s in the transposition table seems to work.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Strange draw scores when searching Fine#70

Post by Evert »

konsolas wrote: Sat Feb 16, 2019 12:31 pm Not storing draw scores in the transposition table seems to work for me, though I question how this will affect strength in other areas of the game
In what order do you test for repetition versus checking the transposition table? Does that make a difference?
konsolas
Posts: 182
Joined: Sun Jun 12, 2016 5:44 pm
Location: London
Full name: Vincent

Re: Strange draw scores when searching Fine#70

Post by konsolas »

Evert wrote: Sat Feb 16, 2019 1:10 pm
konsolas wrote: Sat Feb 16, 2019 12:31 pm Not storing draw scores in the transposition table seems to work for me, though I question how this will affect strength in other areas of the game
In what order do you test for repetition versus checking the transposition table? Does that make a difference?
Testing for repetitions is the first thing I do upon entering a node.
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: Strange draw scores when searching Fine#70

Post by xr_a_y »

On the same subject, I notice Minic is weaker if I put alpha_bound in TT. So I only insert exact and beta_bound inside TT.
Don't really know why ... :oops:
odomobo
Posts: 96
Joined: Fri Jul 06, 2018 1:09 am
Location: Chicago, IL
Full name: Josh Odom

Re: Strange draw scores when searching Fine#70

Post by odomobo »

xr_a_y wrote: Sat Feb 16, 2019 5:36 pm I notice Minic is weaker if I put alpha_bound in TT.
I've thought about this very issue, but haven't tested it much. An all-node (alpha_bound) should never benefit from move ordering, if not deep enough to use the actual value.

For depth-replaced TT entries (i.e. entries close to the root), then it might be bad to save all-nodes, since they benefit the most from good move ordering. For always-replace (or other) entries, I'm not sure.

Assuming perfect ordering and null-window search, then every cut-node will search 1 all-node, and each all-node will search n cut-nodes (where n is the branching factor). If not perfect ordering, then each cut-node may search some cut-nodes of its own before finally searching the all-node which produces the cutoff. This leads me to think that if your engine has very good ordering without the TT, then you may benefit from _only_ saving all-nodes and pv-nodes, for always-replace entries. This is because the all-node saves n lookups, and the cut-node would only save roughly 1 lookup (although can be much worse with even "semi-good" move ordering).

Just my 2 cents. I don't have a definitive answer yet.