Problem with Fine 70

Discussion of chess software programming and technical issues.

Moderator: Ras

Carbec
Posts: 162
Joined: Thu Jan 20, 2022 9:42 am
Location: France
Full name: Philippe Chevalier

Problem with Fine 70

Post by Carbec »

Hello,

I use this position to test my hashtable. First, I thought it was ok, but suddenly the score dropped, and the best move changed :

Code: Select all

info score cp  107 depth  1 seldepth  0 nodes          6 nps    6000 time      1 pv a1b2
info score cp   83 depth  2 seldepth  0 nodes         18 nps    9000 time      2 pv a1b2 a7b6
info score cp  105 depth  3 seldepth  0 nodes         74 nps   18500 time      4 pv a1b2 a7b6 b2c3
info score cp   98 depth  4 seldepth  0 nodes        142 nps   28400 time      5 pv a1b2 a7b6 b2c3 b6c7
info score cp  108 depth  5 seldepth  0 nodes        310 nps   44285 time      7 pv a1b2 a7b6 b2c3 b6c7 c3d3
info score cp   99 depth  6 seldepth  0 nodes        515 nps   57222 time      9 pv a1b2 a7b6 b2c3 b6c7 c3d3 c7d7
info score cp  101 depth  7 seldepth  0 nodes        820 nps   68333 time     12 pv a1b2 a7b6 b2c3 b6c7 c3d3 c7d7 d3e3
info score cp  108 depth  8 seldepth  9 nodes       1464 nps   97600 time     15 pv a1a2 a7b6 a2b3 b6c7 b3c4 c7b6 c4d3 b6c7
info score cp  110 depth  9 seldepth  9 nodes       1879 nps   98894 time     19 pv a1a2 a7b6 a2b3 b6c7 b3c4 c7b6 c4d3 b6c7 d3e3
info score cp  101 depth 10 seldepth 11 nodes       2875 nps  130681 time     22 pv a1a2 a7b6 a2b3 b6c7 b3c4 c7b6 c4d3 b6c7 d3e3 c7d7
info score cp  110 depth 11 seldepth  0 nodes       3640 nps  145600 time     25 pv a1a2 a7b6 a2b3 b6c7 b3c4 c7b6 c4d3 b6b7 d3e2 b7c7 e2e3
info score cp  100 depth 12 seldepth 13 nodes       5545 nps  191206 time     29 pv a1a2 a7b6 a2b3 b6c7 b3c4 c7b6 c4c3 b6c7 c3d2 c7d7 d2e3 d7e7
info score cp  100 depth 13 seldepth 13 nodes       6655 nps  201666 time     33 pv a1a2 a7b6 a2b3 b6c7 b3c4 c7b6 c4c3 b6c7 c3d2 c7d7 d2d3 d7e7 d3e3
info score cp  101 depth 14 seldepth 15 nodes       7797 nps  210729 time     37 pv a1a2 a7b6 a2b3 b6c7 b3c4 c7b6 c4c3 b6c7 c3d2 c7d7 d2d3 d7c7 d3e3 c7d7
info score cp  101 depth 15 seldepth  0 nodes       9597 nps  234073 time     41 pv a1a2 a7b6 a2b3 b6c7 b3c4 c7b6 c4c3 b6c7 c3d2 c7d7 d2d3 d7c7 d3e2 c7d7 e2e3
info score cp  101 depth 16 seldepth 15 nodes      14047 nps  305369 time     46 pv a1a2 a7b6 a2b3 b6c7 b3c4 c7b6 c4c3 b6c7 c3b3 c7b6 b3c4 b6a6 c4d3 a6b6 d3e2 b6c7
info score cp  100 depth 17 seldepth 18 nodes      21790 nps  419038 time     52 pv a1a2 a7b6 a2b3 b6c7 b3c4 c7b6 c4c3 b6c7 c3b3 c7b7 b3b2 b7c7 b2c3 c7c8 c3c4 c8d7 c4b5
info score cp  100 depth 18 seldepth  0 nodes      24191 nps  431982 time     56 pv a1a2 a7b6 a2b3 b6c7 b3c4 c7b6 c4c3 b6c7 c3d3 c7b7 d3e3 b7c7 e3f3 c7b7 f3e2 b7b6 e2d2 b6c7
info score cp   98 depth 19 seldepth 19 nodes      35560 nps  564444 time     63 pv a1a2 a7b6 a2b3 b6c7 b3c4 c7b6 c4c3 b6b7 c3d3 b7c7 d3e3 c7d8 e3e2 d8d7 e2f3 d7e7 f3f2 e7f6 f2e3
info score cp   93 depth 20 seldepth 20 nodes      42591 nps  608442 time     70 pv a1a2 a7b6 a2b3 b6c7 b3c4 c7b6 c4c3 b6b7 c3b2 b7a8 b2c2 a8b8 c2d3 b8c7 d3e3 c7d8 e3e2 d8d7 e2f3 d7e7
info score cp  156 depth 21 seldepth 22 nodes      70052 nps  886734 time     79 pv a1b1 a7b7 b1c1 b7c7 c1d1 c7d7 d1c2 d7e7 c2b3 e7f6 b3c4 f6g6 c4b5 g6h5 b5c6 h5g4 c6d6 g4f4 d6e6 f4g4 d5d6
info score cp  144 depth 22 seldepth 22 nodes     104934 nps 1153120 time     91 pv a1b1 a7b7 b1c1 b7c7 c1d1 c7d7 d1c2 d7e7 c2b3 e7f6 b3c4 f6g6 c4b5 g6h5 b5c6 h5g4 c6d6 g4f4 d6e6 f4g4 d5d6 f5f4
info score cp  196 depth 23 seldepth 24 nodes     164030 nps 1532990 time    107 pv a1b1 a7b7 b1c1 b7c7 c1d1 c7d7 d1c2
info score cp  166 depth 24 seldepth 24 nodes     222540 nps 1854500 time    120 pv a1b1 a7b7 b1c1 b7c7 c1d1 c7d7 d1c2 d7e7 c2c3 e7f7 c3c4 f7g6 c4b5 g6h5 b5c6 h5g4 c6d6 g4f4 d6c5 f4e4 d5d6 f5f4 d6d7 f4f3
info score cp  207 depth 25 seldepth 24 nodes     337894 nps 2330303 time    145 pv a1b1 a7b8 b1c2 b8b7
info score cp  251 depth 26 seldepth 28 nodes     447644 nps 2712993 time    165 pv a1b1 a7b8 b1c2 b8b7 c2c3
info score cp   98 depth 27 seldepth 28 nodes     680881 nps 3289280 time    207 pv a1a2 a7b8 a2b1 b8c7
info score cp  268 depth 28 seldepth 28 nodes    1189309 nps 4101065 time    290 pv a1b1 a7b6 b1c2 b6b7 c2c3 b7b6 c3c4
info score cp  100 depth 29 seldepth 30 nodes    1473714 nps 4334452 time    340 pv a1a2 a7b8 a2b2 b8c8 b2c2 c8b8
info score cp  268 depth 30 seldepth 31 nodes    2676470 nps 4984115 time    537 pv a1b1 a7b6 b1c2 b6a6 c2d3 a6b6 d3c4
info score cp  100 depth 31 seldepth 32 nodes    4922522 nps 5500024 time    895 pv a1a2 a7b8 a2b1 b8c7 b1c2 c7b8 c2c1
info score cp  100 depth 32 seldepth 31 nodes    5525375 nps 5514346 time   1002 pv a1b2 a7a8 b2c3 a8b7 c3b3 b7c7 b3b2 c7c8 b2c3
info score cp  100 depth 33 seldepth 32 nodes   10347592 nps 5726392 time   1807 pv a1b2 a7a8 b2b3 a8a7 b3c2 a7b8 c2c1 b8b7 c1d2
info score cp  100 depth 34 seldepth 34 nodes   15066515 nps 5713505 time   2637 pv a1b2 a7a6 b2c1 a6b7 c1d1 b7c7 d1d2 c7c8 d2d3 c8c7
Do you know where the problem could be ?
Many thanks
JVMerlino
Posts: 1396
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: Problem with Fine 70

Post by JVMerlino »

It's a little difficult to determine because you only output one PV per depth, even when the best move changes. Presumably, the first move that is searched at depth N+1 was the best move from depth N, right? So, ideally you should output a PV from every move that is considered "best for now". For example, at depth 21 you would print a PV for a1a2 (the best move from the previous depth), and then another one when a1b1 is determined to be better than a1a2. I'm not necessarily saying that this will help you find your specific problem, but it is a good idea, both from a debugging standpoint and a display/GUI standpoint.
Carbec
Posts: 162
Joined: Thu Jan 20, 2022 9:42 am
Location: France
Full name: Philippe Chevalier

Re: Problem with Fine 70

Post by Carbec »

hello,

I finally found where my error was.

I have a table of bonus for each move, that I use to sort the moves.
So :
+ for a tt move : 2000000
+ for a capture : 1000000 + MvvLva (between 0 and 100)
+ for killer_1 : 900000
+ for killer_2 : 800000
+ for history : 1<<depth

This is where the problem comes for this position,
as we arrive soon at important depthes. The bonus
for the history moves becomes too big.

I replace it by : depth simply. And the problems
seems to have disapear.

Is there a consensus of how to sort the moves ,
and what bonus give ?

Thanks all
and merry Chrismas !!
JVMerlino
Posts: 1396
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: Problem with Fine 70

Post by JVMerlino »

Carbec wrote: Fri Dec 23, 2022 2:01 pm hello,

I finally found where my error was.

I have a table of bonus for each move, that I use to sort the moves.
So :
+ for a tt move : 2000000
+ for a capture : 1000000 + MvvLva (between 0 and 100)
+ for killer_1 : 900000
+ for killer_2 : 800000
+ for history : 1<<depth

This is where the problem comes for this position,
as we arrive soon at important depthes. The bonus
for the history moves becomes too big.

I replace it by : depth simply. And the problems
seems to have disapear.

Is there a consensus of how to sort the moves ,
and what bonus give ?

Thanks all
and merry Chrismas !!
https://www.chessprogramming.org/Move_Ordering
You can see a "typical move ordering" on that page. However, different engines might do slightly different things. For example, in Myrddin I put killer moves before equal captures.

https://www.chessprogramming.org/History_Heuristic
Typically a history score is calculated for a pair of squares (from and to), and is cumulatively updated every time a move qualifies. But, yes, sometimes, if you're not careful, the history score can get too big. In this case, you can simply go through the entire array and reduce all values by 2 or 4 or whatever you want.
JoAnnP38
Posts: 253
Joined: Mon Aug 26, 2019 4:34 pm
Location: Clearwater, Florida USA
Full name: JoAnn Peeler

Re: Problem with Fine 70

Post by JoAnnP38 »

Carbec wrote: Sun Dec 18, 2022 6:35 pm Problem with Fine 70
Would someone take a moment to educate me on the meaning for "Fine 70"? Does this relate to the Grandmaster Rueben Fine or is it something else? Could someone post the position?
User avatar
Ajedrecista
Posts: 2101
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Re: Problem with Fine #70.

Post by Ajedrecista »

Hello:
JoAnnP38 wrote: Fri Dec 23, 2022 7:03 pm
Carbec wrote: Sun Dec 18, 2022 6:35 pm Problem with Fine 70
Would someone take a moment to educate me on the meaning for "Fine 70"? Does this relate to the Grandmaster Rueben Fine or is it something else? Could someone post the position?
Please take a look here, where is well explained:

https://chessprogramming.org/Lasker-Reichhelm_Position

Regards from Spain.

Ajedrecista.
JVMerlino
Posts: 1396
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: Problem with Fine 70

Post by JVMerlino »

JoAnnP38 wrote: Fri Dec 23, 2022 7:03 pm
Carbec wrote: Sun Dec 18, 2022 6:35 pm Problem with Fine 70
Would someone take a moment to educate me on the meaning for "Fine 70"? Does this relate to the Grandmaster Rueben Fine or is it something else? Could someone post the position?
[fen]8/k7/3p4/p2P1p2/P2P1P2/8/8/K7 w - -[/fen]
It's a position well-known for testing the correctness/efficiency of a transposition table implementation. Even a moderately strong engine can get to depth 40 or 50 within a few seconds, and the point is to find that the (very unintuitive) move Kb1 is the only winning move.