check extension

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

AndrewShort

check extension

Post by AndrewShort »

when people talk of "check extensions", are they referring to:

(a) Quies() considers all checking moves and check evasion moves (in addition to captures, promotions). This implies that Quies must account for draw by repetition, since perpetual check could result, putting Quies in an infinite loop...

or do they mean

(b) the main search is expanded one full ply if side to move is in check

or do the mean

(c) both (a) and (b) above
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: check extension

Post by bob »

AndrewShort wrote:when people talk of "check extensions", are they referring to:

(a) Quies() considers all checking moves and check evasion moves (in addition to captures, promotions). This implies that Quies must account for draw by repetition, since perpetual check could result, putting Quies in an infinite loop...

or do they mean

(b) the main search is expanded one full ply if side to move is in check

or do the mean

(c) both (a) and (b) above
(b) although the "one full ply" is not an absolute...
AndrewShort

Re: check extension

Post by AndrewShort »

but if you don't do (a), isn't your static eval grossly inaccurate? A player might be in check, and thus in mating danger, but the static eval wouldn't know it, thinking the position was quiescent, when it really isn't...
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: check extension

Post by bob »

AndrewShort wrote:but if you don't do (a), isn't your static eval grossly inaccurate? A player might be in check, and thus in mating danger, but the static eval wouldn't know it, thinking the position was quiescent, when it really isn't...
The idea, at least in the case of crafty, prevents that to an extent. In Crafty, I extend when I give check, which means that when a path goes from normal search to call Quiesce() it will _never_ be in check at the first ply of the q-search, because for that to happen the search would not have extended the check, something that can't happen. Once in the search, yes things could have some inaccuracy since a capture move can also be a checking move. But the q-search is already horribly inaccurate since it only considers captures anyway, so the effect seems to be something that can be ignored.
Uri Blass
Posts: 10267
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: check extension

Post by Uri Blass »

AndrewShort wrote:but if you don't do (a), isn't your static eval grossly inaccurate? A player might be in check, and thus in mating danger, but the static eval wouldn't know it, thinking the position was quiescent, when it really isn't...
I think that most programmers of top programs(including glaurung and fruit) do both a and b but only b is considered to be a check extension.

Uri
AndrewShort

Re: check extension

Post by AndrewShort »

Can someone explain to me how the check extension works? If before you call Quies the side to move is in check, you expand that particular path one more ply, then call Quies, so that Quies is never called with the side to move in check.

That does not make sense to me, as it would only search 1 ply deeper along that path, while the actual mating sequence might consist of 3 or 4 checks deeper. I thought the whole idea of check extension is to exhaust a particular main path along a checking line, if any, then go into Quies. But to expand 1 ply would not exhaust the checking line.

Unless the path is expanded by check evasions as well...

thanks in advance for clearing my head on this...
Aleks Peshkov
Posts: 892
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia

Re: check extension

Post by Aleks Peshkov »

Check extension is a modest reshaping of the search tree. The idea of extensions is to weaken pushing dangerous variations above search horizon with useless temporary delaying moves.

Real checkmates are to rare to worry about except artificial tactical test suits.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: check extension

Post by bob »

AndrewShort wrote:Can someone explain to me how the check extension works? If before you call Quies the side to move is in check, you expand that particular path one more ply, then call Quies, so that Quies is never called with the side to move in check.

That does not make sense to me, as it would only search 1 ply deeper along that path, while the actual mating sequence might consist of 3 or 4 checks deeper. I thought the whole idea of check extension is to exhaust a particular main path along a checking line, if any, then go into Quies. But to expand 1 ply would not exhaust the checking line.

Unless the path is expanded by check evasions as well...

thanks in advance for clearing my head on this...
At any normal node (not in q-search) if I make a move that gives check to the opponent, I increment depth by one ply. Not just at nodes close to the q-search horizon, but anywhere.
AndrewShort

Re: check extension

Post by AndrewShort »

ahhh, I see. I didn't realize that.

So if you happen to come across 4 checking moves in a main search path, the path is extended 4 ply. The checking moves are not necessarily every 2 plies - it could skip some plies, and also some checks are evaded by another check. And since you always extend one more ply when you see a check, that guarantees Quies will never start in check.
AndrewShort

Re: check extension

Post by AndrewShort »

still, though, as Aleks points out, check extensions do not exhaust a possible checking line. If there was only 1 check in the main search path, say, at the end, then the path is only extended 1 ply, where the opponent gets to evade the check.

Shouldn't the path be extended even further to see if the checking line can be continued - it could lead to mate. ?

or is that more for solving mating puzzles, as Aleks points out?