Skip to content

Conversation

@Vizvezdenec
Copy link
Member

@Vizvezdenec Vizvezdenec commented Sep 14, 2019

Use fraction of negative complexity also in midgame evaluation

STC run was stopped after 200k games (and not converging):
http://tests.stockfishchess.org/tests/view/5d7cfdb10ebc5902d386572c
LLR: -1.75 (-2.94,2.94) [0.50,4.50]
Total: 200319 W: 44197 L: 43310 D: 112812
passed speculative LTC
http://tests.stockfishchess.org/tests/view/5d7d14680ebc5902d3866196
LLR: 2.95 (-2.94,2.94) [0.00,3.50]
Total: 41051 W: 6858 L: 6570 D: 27623
This patch finally introduces something that was tried for years - midgame score dependance on complexity of position.
The most obvious field of play of this patch will be (again!) 4 vs 3 etc same flank endgames where sides have a lot of non-pawn material (4 vs 3 draw mostly remains the same draw even if we add a lot of equal material to both sides but eval will be much higher because we are further from endgame).
This is the first and not really precise version, a lot of other stuff can be tried on top of it (separate complexity for middlegame, some more terms, even simple retuning of values).
bench 4248476

bench 4248476
@snicolet snicolet changed the title Use fraction of negative complexity also in midgame evaluation. Introduce midgame initiative Sep 14, 2019
@snicolet
Copy link
Member

Approved, congrats!

You write:

"the most obvious field of play of this patch will be [one flank endgames]"

I have measured the two probabilities P(A|B) and P(B|A) for
A = "complexity < -50"
B =" one flank endgame"

using the following pieces of code:

if (complexity < -50)  
     dbg_mean_of(almostUnwinnable); 

Total 260050 Mean 0.0927552
if (almostUnwinnable)  
     dbg_mean_of(complexity < -50);

Total 24305 Mean 0.99243

So indeed complexity is inferior to -50 in 99% of the one-flank endgames, but one-flank endgames are only 10% of the cases where complexity is inferior to -50 (and the patch applies).

@snicolet
Copy link
Member

Merged via 843a6c4, thanks!

@snicolet snicolet closed this Sep 14, 2019
@Vizvezdenec
Copy link
Member Author

well I mean that it's the most obvious case to my imagination.
I guess this patch is more complex than I initially thought then :)

snicolet referenced this pull request in Vizvezdenec/Stockfish Sep 14, 2019
bench 4248476
snicolet added a commit to snicolet/Stockfish that referenced this pull request Sep 15, 2019
This patch decreases the endgame scale factor using the 50 moves counter.
Looking at some games with this patch, this seems to have two effects on
the playing style:

1) when no progress can be made in late endgames (for instance in fortresses
   or opposite bishops endgames) the evaluation will be largely tamed down
   toward a draw value.

2) more interestingly, there is also a small effect in the midgame play because
   Stockfish will panic a little bit if there are more than four consecutive
   shuffling moves with an advantage: the engine will try to move a pawn or to
   exchange a piece to keep the advantage, so the follow-ups of the position
   will be discovered earlier by the alpha-beta search.

passed STC:
LLR: 2.95 (-2.94,2.94) [0.50,4.50]
Total: 23017 W: 5080 L: 4805 D: 13132
http://tests.stockfishchess.org/tests/view/5d7e4aef0ebc59069c36fc74

passed LTC:
LLR: 2.95 (-2.94,2.94) [0.00,3.50]
Total: 30746 W: 5171 L: 4911 D: 20664
http://tests.stockfishchess.org/tests/view/5d7e513d0ebc59069c36ff26

Pull request: official-stockfish/Stockfish#2304

Bench: 4272173
snicolet added a commit that referenced this pull request Sep 15, 2019
This patch decreases the endgame scale factor using the 50 moves counter.
Looking at some games with this patch, it seems to have two effects on
the playing style:

1) when no progress can be made in late endgames (for instance in fortresses
   or opposite bishops endgames) the evaluation will be largely tamed down
   towards a draw value.

2) more interestingly, there is also a small effect in the midgame play because
   Stockfish will panic a little bit if there are more than four consecutive
   shuffling moves with an advantage: the engine will try to move a pawn or to
   exchange a piece to keep the advantage, so the follow-ups of the position
   will be discovered earlier by the alpha-beta search.

passed STC:
LLR: 2.95 (-2.94,2.94) [0.50,4.50]
Total: 23017 W: 5080 L: 4805 D: 13132
http://tests.stockfishchess.org/tests/view/5d7e4aef0ebc59069c36fc74

passed LTC:
LLR: 2.95 (-2.94,2.94) [0.00,3.50]
Total: 30746 W: 5171 L: 4911 D: 20664
http://tests.stockfishchess.org/tests/view/5d7e513d0ebc59069c36ff26

Pull request: #2304

Bench: 4272173
MichaelB7 pushed a commit to MichaelB7/Stockfish that referenced this pull request Sep 16, 2019
This patch decreases the endgame scale factor using the 50 moves counter.
Looking at some games with this patch, this seems to have two effects on
the playing style:

1) when no progress can be made in late endgames (for instance in fortresses
   or opposite bishops endgames) the evaluation will be largely tamed down
   toward a draw value.

2) more interestingly, there is also a small effect in the midgame play because
   Stockfish will panic a little bit if there are more than four consecutive
   shuffling moves with an advantage: the engine will try to move a pawn or to
   exchange a piece to keep the advantage, so the follow-ups of the position
   will be discovered earlier by the alpha-beta search.

passed STC:
LLR: 2.95 (-2.94,2.94) [0.50,4.50]
Total: 23017 W: 5080 L: 4805 D: 13132
http://tests.stockfishchess.org/tests/view/5d7e4aef0ebc59069c36fc74

passed LTC:
LLR: 2.95 (-2.94,2.94) [0.00,3.50]
Total: 30746 W: 5171 L: 4911 D: 20664
http://tests.stockfishchess.org/tests/view/5d7e513d0ebc59069c36ff26

Pull request: official-stockfish#2304

Bench: 4272173
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants