Page 1 of 3

perpetual check position

Posted: Tue Aug 16, 2016 11:24 pm
by zenpawn
Hi all,

This is my first post, having become hooked in late May to this addictive hobby. I now have a frustratingly-weak (~1800-1900 at 2+6 or 40/4 TC) chess engine all my own . :)

I forget where I got this position. It was an example of perpetual check/three-fold repetition when white is to move, whereas if black moves first, he wins.

[d]qn6/qn6/pp6/6k1/4R3/8/4R3/K7 w - - 0 1

My question is what should be the minimum depth an engine needs to declare this a draw as white? How does this number change (roughly; I understand this depends on the R settings, etc.) with various pruning techniques (LMR, null move, futility)?

While my engine understands repetitions and indeed spits out a ton in debug mode, it still fails to see the draw at depth 16, instead playing the losing 3.Rg2+ after a good start with 1.Re5+ Kf6 2.Re6+ Kg7

Thanks,
-Erin

Re: perpetual check position

Posted: Tue Aug 16, 2016 11:34 pm
by bob
zenpawn wrote:Hi all,

This is my first post, having become hooked in late May to this addictive hobby. I now have a frustratingly-weak (~1800-1900 at 2+6 or 40/4 TC) chess engine all my own . :)

I forget where I got this position. It was an example of perpetual check/three-fold repetition when white is to move, whereas if black moves first, he wins.

[d]qn6/qn6/pp6/6k1/4R3/8/4R3/K7 w - - 0 1

My question is what should be the minimum depth an engine needs to declare this a draw as white? How does this number change (roughly; I understand this depends on the R settings, etc.) with various pruning techniques (LMR, null move, futility)?

While my engine understands repetitions and indeed spits out a ton in debug mode, it still fails to see the draw at depth 16, instead playing the losing 3.Rg2+ after a good start with 1.Re5+ Kf6 2.Re6+ Kg7

Thanks,
-Erin
Difficult to compare depths. First, here is Crafty's output:

Code: Select all

         12->   0.03/18.00  -13.90   1. Re5+ Kf4 2. R2e4+ Kf3 3. Re3+ Kf2
                                     4. Re2+ Kg3 5. R2e3+ Kg4 6. R3e4+ Kh3
                                     7. Re3+ Kg2 8. Re2+ Kg1 9. Re1+ Kh2
                                     10. R1e2+ Kh1 11. Rd5 b5 12. Rd1+ Qg1
                                     13. Rxg1+ Kxg1
         13     0.04/18.00    0.00   1. Re5+ Kf4 2. R2e4+ Kf3 3. Re3+ Kf2
                                     4. Re2+ Kg3 5. R2e3+ Kg4 6. R3e4+ Kh3
                                     7. Re3+ Kg2 8. Re2+ Kg1 9. Re1+ Kh2
                                     10. R1e2+ Kh1 11. Re1+ Kh2 <3-fold>
         13->   0.04/18.00    0.00   1. Re5+ Kf4 2. R2e4+ Kf3 3. Re3+ Kf2
                                     4. Re2+ Kg3 5. R2e3+ Kg4 6. R3e4+ Kh3
                                     7. Re3+ Kg2 8. Re2+ Kg1 9. Re1+ Kh2
                                     10. R1e2+ Kh1 11. Re1+ Kh2 <3-fold>
         14     0.04/18.00    0.00   1. Re5+ Kf4 2. R2e4+ Kf3 3. Re3+ Kf2
                                     4. Re2+ Kg3 5. R2e3+ Kg4 6. R3e4+ Kh3
                                     7. Re3+ Kg2 8. Re2+ Kg1 9. Re1+ Kh2
                                     10. R1e2+ Kh1 11. Re1+ Kh2 <3-fold>
         14->   0.04/18.00    0.00   1. Re5+ Kf4 2. R2e4+ Kf3 3. Re3+ Kf2
                                     4. Re2+ Kg3 5. R2e3+ Kg4 6. R3e4+ Kh3
                                     7. Re3+ Kg2 8. Re2+ Kg1 9. Re1+ Kh2
                                     10. R1e2+ Kh1 11. Re1+ Kh2 <3-fold>
It sees the 3-fold at depth=13 and keeps it forever after that. Whether you see it at 13 or beyond depends on a lot of things. Do you do check extensions? Do you do checks in the q-search? Do you reduce checking moves? Etc. The answer to all of those will affect where you pick this up...

Re: perpetual check position

Posted: Wed Aug 17, 2016 12:06 am
by zenpawn
Thank you, Robert. It's an honor.

I've experimented with check extensions, but am currently favoring just allowing them in q-search instead. Also, LMR is not allowed when checking or in check.

I'm glad it's sufficiently long a variation to require 13 ply from Crafty (is that the mathematical minimum?).

I'll have to exercise some patience to see when my program finally spots it as I'm nowhere near reaching that depth in 4 seconds. :)

Re: perpetual check position

Posted: Wed Aug 17, 2016 1:55 am
by bob
zenpawn wrote:Thank you, Robert. It's an honor.

I've experimented with check extensions, but am currently favoring just allowing them in q-search instead. Also, LMR is not allowed when checking or in check.

I'm glad it's sufficiently long a variation to require 13 ply from Crafty (is that the mathematical minimum?).

I'll have to exercise some patience to see when my program finally spots it as I'm nowhere near reaching that depth in 4 seconds. :)
I don't think there is any mathematical minimum for these kinds of positions. First, it depends on whether you count 2-fold or 3-fold as reps. Then it depends on how you extend checks. One ply, more than one ply, one ply plus 1/2 or 1 ply if the opponent has only one legal move to get out of check? Singular extensions or not? The list goes on and on...

The challenge here is that one side wants to avoid the rep since he is material ahead. That gives two files for the king to meander up and down before repeating.

Re: perpetual check position

Posted: Wed Aug 17, 2016 9:39 am
by stegemma
zenpawn wrote:Hi all,

This is my first post, having become hooked in late May to this addictive hobby. I now have a frustratingly-weak (~1800-1900 at 2+6 or 40/4 TC) chess engine all my own . :)

I forget where I got this position. It was an example of perpetual check/three-fold repetition when white is to move, whereas if black moves first, he wins.

[d]qn6/qn6/pp6/6k1/4R3/8/4R3/K7 w - - 0 1

My question is what should be the minimum depth an engine needs to declare this a draw as white? How does this number change (roughly; I understand this depends on the R settings, etc.) with various pruning techniques (LMR, null move, futility)?

While my engine understands repetitions and indeed spits out a ton in debug mode, it still fails to see the draw at depth 16, instead playing the losing 3.Rg2+ after a good start with 1.Re5+ Kf6 2.Re6+ Kg7

Thanks,
-Erin
If your weak is frustrating, what should I think of my engines, that have 3/400 ELO less after more than 20 years of hobby work? ;)

Thanks for the position, I used it in my tests and Satana plays correctly in about 10 plyes (Satana has a 2 ply step and 1 second output of the pv, so they could be less than 10). In other positions it's not so smart.

Re: perpetual check position

Posted: Wed Aug 17, 2016 10:50 am
by Henk
Skipper is also still below 2100 ELO or maybe 2000 and I started in 2011. Authors of engines that failed usually keep quiet just like you don't see ill people on the street.

Re: perpetual check position

Posted: Wed Aug 17, 2016 1:54 pm
by ymatioun
I just searched this position with Fizbo to depth 39/seldepth 67, and it still does not see a draw.

It looks to me that the depth for a forced repetition draw here s really very high (black king can go on most squares in files f-g-h twice before it happens).

I don't have any special logic to recognize perpetual check, so i would not expect Fizbo to see it.

Does anybody use special logic for these positions?

Thanks.

Re: perpetual check position

Posted: Wed Aug 17, 2016 3:08 pm
by Karlo Bala
ymatioun wrote:I just searched this position with Fizbo to depth 39/seldepth 67, and it still does not see a draw.

It looks to me that the depth for a forced repetition draw here s really very high (black king can go on most squares in files f-g-h twice before it happens).

I don't have any special logic to recognize perpetual check, so i would not expect Fizbo to see it.

Does anybody use special logic for these positions?

Thanks.
Black king is restricted to 18 squares at most (probably cannot stand on every square in a row). 19th square for the black king is a repetition. In the worst case, that is 36 plays without extensions. With 1 ply out of check extension, that is 18 plays. With singular extensions even less. Now, if you reduce some moves after the check, than it is a different story...

Edit:
My experimental engine without extensions and with a heavy LMR found repetition on depth 32.

Re: perpetual check position

Posted: Wed Aug 17, 2016 4:16 pm
by elcabesa
vajolet start to think it is draw at depth 14

Re: perpetual check position

Posted: Wed Aug 17, 2016 4:21 pm
by JVMerlino
For what it's worth, Myrddin (a mediocre engine) finds draw at depth 19, but it takes almost eight minutes with 4 cores.