Skip to content
Permalink
Browse files

First try

  • Loading branch information...
MJZ1977 committed Feb 22, 2019
1 parent badb2ac commit f102d5d27d935bb70ea7f1cd51215dee437a84b9
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/search.cpp
@@ -958,6 +958,13 @@ namespace {
// Castling extension
else if (type_of(move) == CASTLING)
extension = ONE_PLY;

// Blocked position extension
else if (pos.rule50_count() > 20
&& abs(alpha) > Value(100)
&& depth < 3 * ONE_PLY
&& PvNode)
extension = ONE_PLY;

// Calculate new depth for this move
newDepth = depth - ONE_PLY + extension;

2 comments on commit f102d5d

@gvreuls

This comment has been minimized.

Copy link

gvreuls replied Feb 23, 2019

I doubt that the 50 moves rule itself is what causes the shuffling, but contempt which discourages draws. I strongly suspect that contempt causes shuffling in positions that are almost drawn because it encourages the engine to push the draw over the search horizon by making moves that don't progress towards it. In other words the draw by 50 moves rule is just one of the "draws are bad problems" the engine is trying to solve by postponement.

Edit: what I'm trying to say is that detecting a static position by lack of captures or pawn moves and extending the search should only help marginally to avoid shuffling because as long as you discourage the alternative of the draw the engine will still postpone the moves towards the draw (including moves that reset the 50 moves rule) as long as possible.

@MJZ1977

This comment has been minimized.

Copy link
Owner Author

MJZ1977 replied Feb 23, 2019

Yes I agree, but sometimes there is no good moves that reset the rule50(). So it is not perfect, but it should solve some situations.

Some positions to test
From last TCEC season
3r4/p3r1pk/PpBb1pRp/1KpPpP1P/2P1P1R1/8/8/8 b - - 32 86
8/8/8/1k6/2p5/p1K5/N2B2r1/8 b - - 59 109
4r3/2r3p1/3kp2p/1p1pNp1P/p2PnP2/P1PK4/1P6/6RR w - - 22 101
1r4k1/1r1bq3/4p1p1/3pPpPp/pNpN1P1P/P1PnQ3/1PK5/1R3R2 b - - 13 82

Other obvious draws
5k2/3b4/5p2/p1p1pPp1/PpPpP1Pp/1P1P3P/8/3R1K2 w - - 20 1
5k2/8/5p2/p1p1pPp1/PbPpP1Pp/3P3P/8/3R1K2 w - - 20 1

Verification (non draw, long zugzwang that SF should still find):
8/1b2P3/5k2/p7/Pp1K3p/1P6/2Bp3P/8 b - - 0 49
8/5k2/1r4p1/6Pp/R7/6K1/8/8 b - - 51 78

If you have other examples, please add them so I can try to solve.

Please sign in to comment.
You can’t perform that action at this time.