check extension

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

check extension

Post by lucasart »

Demolito extends checks, whose SEE >= 0.

In practice, I've never seen search explosions as a result, but I wonder…

Is it possible to have long sequences of checks, which involve no position repetition, and no SEE losing moves?
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: check extension

Post by Joost Buijs »

In endgames with only queens and just a few pawns it happens often that a king is chased over the entire board without getting a repetition, there are probably more situations where this can happen.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: check extension

Post by lucasart »

Joost Buijs wrote: Mon Dec 03, 2018 7:01 am In endgames with only queens and just a few pawns it happens often that a king is chased over the entire board without getting a repetition, there are probably more situations where this can happen.
Consecutive checks? I'm talking about check at every single ply (both sides), not 1 check per move.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
User avatar
Eelco de Groot
Posts: 4561
Joined: Sun Mar 12, 2006 2:40 am
Full name:   

Re: check extension

Post by Eelco de Groot »

No that does not happen of course. If the king is to move or the check has to be countered in some other way and there are no (other) extensions on that ply, searchdepth will eventually go down even if there are still more checks from the other side. Only for the side giving checks (that don't repeat the position) the searchdepth does not go down.
Last edited by Eelco de Groot on Mon Dec 03, 2018 11:33 am, edited 1 time in total.
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: check extension

Post by lucasart »

Eelco de Groot wrote: Mon Dec 03, 2018 11:26 am No that does not happen of course. If the king is to move or the check has to be countered in some other way and there are no (other) extensions on that ply, searchdepth will eventually go down once there are no more checks. But as long as there are checks that don't repeat the position searchdepth stays constant.
Yes, but how long? So far the longest sequence I can find is just 2 consecutive checks.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
Maarten Claessens
Posts: 106
Joined: Mon May 12, 2014 10:08 am
Location: Near Nijmegen

Re: check extension

Post by Maarten Claessens »

Nothing is unstable (Lawrence Krauss)
User avatar
Eelco de Groot
Posts: 4561
Joined: Sun Mar 12, 2006 2:40 am
Full name:   

Re: check extension

Post by Eelco de Groot »

Hi Lucas,

Sorry the answer I gave at first was wrong, had to edit.

Here I think I found an example of what Joost was saying, perpetual check by the queen, second diagram https://www.chessstrategyonline.com/con ... n-endgames (White has to allow a repeat of the position though, even if does not want that so not the best example. If the King has more squares available (or checking side does not want the draw) the checking sequences I think can get longer)
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: check extension

Post by Joost Buijs »

lucasart wrote: Mon Dec 03, 2018 9:44 am
Joost Buijs wrote: Mon Dec 03, 2018 7:01 am In endgames with only queens and just a few pawns it happens often that a king is chased over the entire board without getting a repetition, there are probably more situations where this can happen.
Consecutive checks? I'm talking about check at every single ply (both sides), not 1 check per move.
I didn't understood that you meant checks at every ply (evasion gives check), in that case it doesn't seem likely, maybe it can happen over a few plies, but nothing more.
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: check extension

Post by hgm »

This is a pretty long sequence:
[pgn][Event "Edited game"] [Site "ONTWIKKELLAPTOP"] [Date "2018.12.03"] [Round "-"] [White "-"] [Black "-"] [Result "*"] [FEN "4n2q/Qp4r1/8/4k3/1N6/N1K5/5n2/3R4 w - - 0 1"] [SetUp "1"] 1. Qb8+ Rc7+ 2. Nc4+ Kf4+ 3. Rd4+ Ne4+ * [/pgn]
I am not sure if the requirement that SEE>=0 is realistic in such a sequence: the checks are also evasions, and pruning check evasions seems risky. Without this requirement you could probably make much loger sequences.
petero2
Posts: 684
Joined: Mon Apr 19, 2010 7:07 pm
Location: Sweden
Full name: Peter Osterlund

Re: check extension

Post by petero2 »

lucasart wrote: Mon Dec 03, 2018 5:41 am Demolito extends checks, whose SEE >= 0.

In practice, I've never seen search explosions as a result, but I wonder…

Is it possible to have long sequences of checks, which involve no position repetition, and no SEE losing moves?
If the checks can also be captures, it is possible to construct a position with a quite long such sequence of checks. In normal positions, I don't think this will ever be a problem though.
[d]7q/q2q2qp/1q6/2q1q3/k2q3K/N1Q1Q3/1QPQ1Q2/Q2Q2Q1 w - - 0 1