A "persistent score" flag

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

Moderators: hgm, Rebel, chrisw

Rodolfo Leoni
Posts: 545
Joined: Tue Jun 06, 2017 4:49 pm
Location: Italy

A "persistent score" flag

Post by Rodolfo Leoni »

The position at bottom of topic (or similar) often appear from engines games, when I let them play the King's Indian Mar del Plata, out of book. I mean, they start playing after this opening variation:

[pgn][Event "?"]
[Site "?"]
[Date "????.??.??"]
[Round "?"]
[White "?"]
[Black "?"]
[Result "*"]
[ECO "E99p"]

1.d4 Nf6 2.c4 g6 3.Nc3 Bg7 4.e4 d6 5.Nf3 O-O 6.Be2 e5 7.O-O Nc6 8.d5 Ne7
9.Ne1 Nd7 10.f3 f5 11.g4 Nf6 12.Nd3 *

[/pgn]

[d]r1bq1rk1/ppp1n1bp/3p1np1/3Ppp2/2P1P1P1/2NN1P2/PP2B2P/R1BQ1RK1 b - - 2 12

It's obvious engines cannot think at "strategies", so they'll often don't open lines on the Q side as white, or they'll often don't try to attack kign's castling when playing it as black. Evaluation factors as, for example, space control or pieces mobility can give a wrong score output.

The following position is a draw, but every engine will score it with a little advantage for white. The only "flag" about a possible draw is the "persistent score", +87 cps, since depth 30. And my question is:

Can this search pattern be detected to score such positions as draw?

Thanks. :)

[d]r1q2rk1/2nbn1b1/1p1p2p1/p1pPp1Pp/P1P1Pp1P/1PNN1P2/2Q2R1K/R3BB2 w - - 0 1

Code: Select all

FEN: r1q2rk1/2nbn1b1/1p1p2p1/p1pPp1Pp/P1P1Pp1P/1PNN1P2/2Q2R1K/R3BB2 w - - 0 1

Stockfish_17071401_x64_modern:
 8/8	00:00	 4k	1,809k	+0.87	1.Nb5 Ne8 2.Bc3 Qd8 3.Qe2 Nc8 4.Bg2 Nc7
 9/9	00:00	 4k	2,134k	+0.87	1.Nb5 Ne8 2.Bc3 Qd8 3.Qe2 Nc8 4.Bg2 Nc7 5.Qf1
 10/10	00:00	 5k	1,762k	+0.87	1.Nb5 Ne8 2.Bc3 Qd8 3.Re2 Nc8 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.Qe2 Nc8 4.Bg2 Nc7 5.Kg1 Na6 6.Bb2 Na7 7.Nc3 Qb7 8.Rff1 Rae8 9.Nf2 Nb4 10.Rad1 Ra8 11.Qd2 Rae8 12.Ba3 Nc8 13.Nb5 Qb8 14.Qe2 Kh7 15.Bb2 Kg8 16.Nc3 Ne7 17.Qd2 Nc8 18.Rfe1 Kh7 19.Ba3 Kg8 20.Bh3 Bxh3 21.Nxh3 Qb7 22.Nf2 Qd7
 44/45	06:28	 1,342,530k	3,457k	+0.87	1.Nb5 Ne8 2.Bc3 Qb8 3.Qe2 Nc8 4.Bg2 Nc7 5.Kg1 Na6 6.Bb2 Na7 7.Nc3 Qb7 8.Rff1 Rae8 9.Nf2 Nb4 10.Rad1 Ra8 11.Qd2 Rae8 12.Ba3 Nc8 13.Nb5 Qb8 14.Qe2 Kh7 15.Bb2 Kg8 16.Nc3 Ne7 17.Qd2 Nc8 18.Nd3 Qc7 19.Nb5 Qb7 20.Nf2 Qb8 21.Nc3 Qb7 22.Ba3 Qb8 23.Bh3 Bxh3
 45/45	09:50	 1,979,736k	3,351k	+0.87	1.Nb5 Ne8 2.Bc3 Qb8 3.Qe2 Nc8 4.Bg2 Nc7 5.Kg1 Na6 6.Bb2 Na7 7.Nc3 Qb7 8.Rff1 Rae8 9.Nf2 Nb4 10.Rad1 Ra8 11.Qd2 Rae8 12.Ba3 Nc8 13.Nb5 Qb8 14.Qe2 Kh7 15.Bb2 Kg8 16.Nc3 Ne7 17.Qd2 Nc8 18.Nd3 Qc7 19.Nb5 Qb7 20.Nf2 Qb8 21.Nc3 Qb7 22.Ba3 Qb8 23.Bh3 Bxh3

F.S.I. Chess Teacher
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: A "persistent score" flag

Post by zullil »

Rodolfo Leoni wrote:
The only "flag" about a possible draw is the "persistent score", +87 cps, since depth 30. And my question is:

Can this search pattern be detected to score such positions as draw?

Thanks. :)
The pattern only appears after the search is made. Suppose the position in question appeared at a leaf in a search from an earlier position. How would the engine know that, with further searching, the evaluations of that leaf position would eventually show no progress? Hence the need for a static evaluation process.
Rodolfo Leoni
Posts: 545
Joined: Tue Jun 06, 2017 4:49 pm
Location: Italy

Re: A "persistent score" flag

Post by Rodolfo Leoni »

zullil wrote:
Rodolfo Leoni wrote:
The only "flag" about a possible draw is the "persistent score", +87 cps, since depth 30. And my question is:

Can this search pattern be detected to score such positions as draw?

Thanks. :)
The pattern only appears after the search is made. Suppose the position in question appeared at a leaf in a search from an earlier position. How would the engine know that, with further searching, the evaluations of that leaf position would eventually show no progress? Hence the need for a static evaluation process.
Being not a chess programmer (except for some easy VB tools), I've a lot of doubts too. I'm trying to better understand the process, which looks very similar to the one of the "Easy position, for humans". Engine tries to avoid 3 fold repetitions while on search, and I wonder if it can be detected....

But I accept the fact my understanding of the problem is very limited. :)
F.S.I. Chess Teacher
User avatar
hgm
Posts: 27795
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: A "persistent score" flag

Post by hgm »

A much more sensible approach would be to have the engine recognize the position as drawish in the static evaluation. It doesn't seem to be very difficult in this case to recognize some drawish aspects. Such as the Pawn structure, penetrable only in one place, which can be abundantly defended. This would be pretty cheap, as Pawn evaluations are hashed, so that even quite complex analysis would not have measurable impact on speed. Detecting such a drawishness indicator could make the engine divide the evaluation score by 2, which would probably be enough to reject it compared to more promising lines of play.
Rodolfo Leoni
Posts: 545
Joined: Tue Jun 06, 2017 4:49 pm
Location: Italy

Re: A "persistent score" flag

Post by Rodolfo Leoni »

hgm wrote:A much more sensible approach would be to have the engine recognize the position as drawish in the static evaluation. It doesn't seem to be very difficult in this case to recognize some drawish aspects. Such as the Pawn structure, penetrable only in one place, which can be abundantly defended. This would be pretty cheap, as Pawn evaluations are hashed, so that even quite complex analysis would not have measurable impact on speed. Detecting such a drawishness indicator could make the engine divide the evaluation score by 2, which would probably be enough to reject it compared to more promising lines of play.
Looks brilliant. If engines can recognize it, then they'd avoid to close the position. At least, playing white. But black too could find opponent has the best chances on the Q side, and it possibly could choose not to close the K side...

Thanks. :)
F.S.I. Chess Teacher