Check extension

Discussion of chess software programming and technical issues.

Moderator: Ras

bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Check extension

Post by bob »

Uri Blass wrote:A capture does not reduce the options of the opponent significantly like checks so it does not worth extensions.
1/2 of the captures played in a game have a nearly forced reply if you don't want to lose. In the Ruy Lopez, Bxc6 requires a re-capture on c6 to avoid ending up a piece down. That's pretty forcing. With one exception. You can play a check which then dictates your opponent's reply, and then you can make the capture on the next ply. Which is _exactly_ my point. Any move with a forced or nearly-forced reply is a good horizon-effect type move,, and those need to be extended. The recapture extension is not as effective, however, because if something big is under attack, a minor piece trade is not enough to divert my attention, while a check does it every time.


Sometimes a capture even increase the number of options of the opponent because it open files.
_later_ in the search. But not at the point where the initial capture of an exchange is played. There you either recapture, come up with a more significant threat which is rare, or you lose material.

capture has also another property that is a reason not to extend it.
unlike other moves you can be almost sure if it fail high or fail low so it is uninterest to extend it.
Note that I am talking about a "recapture" from the "recapture extension" idea. And there the recapture won't fail high. And it rarely fails low since it is necessary to maintain a material state.

I think that it may be a good idea to have some function that predict some estimate for probability of fail high and fail low and it is better to extend moves that the probability is closer to 1/2(I am talking about moves that are not first move to search).

This is the reason that killers are better candidates to extend(you do not extend them but simply not prune them by late move reductions but it is the same idea and every pruning can be described as extension).

Uri
Of course they can. And the reason this is so effective with checks is because of their highly forcing nature and the ease with which they can push some threat off over the horizon, which makes it disappear as far as the search is concerned...
Uri Blass
Posts: 11136
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Check extension

Post by Uri Blass »

some notes:

1)It is correct that many captures force recaptures but the problem is that if you extend captures and not only recapture extensions then you extend also Bxc6 a5 and not only Bxc6 dxc6 or Bxc6 bxc6

2)I believe that extending recaptures may be more productive if you extend trades of the biggest piece of both sides.

I wonder if you tested the recapture extension in case that you limit it only for trading of the biggest piece on the board.

Uri
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Check extension

Post by bob »

Uri Blass wrote:some notes:

1)It is correct that many captures force recaptures but the problem is that if you extend captures and not only recapture extensions then you extend also Bxc6 a5 and not only Bxc6 dxc6 or Bxc6 bxc6
I would agree with that, but I was explicitly talking about the classic recapture extension and why it was used. At today's depths, at least for my program, it actually began to hurt a very small amount. I would not be surprised if the check extension goes away in another 5 years or so. It is only worth 10 Elo or so today...


2)I believe that extending recaptures may be more productive if you extend trades of the biggest piece of both sides.

I wonder if you tested the recapture extension in case that you limit it only for trading of the biggest piece on the board.

Uri
No, but I did try several variations. The way I originally implemented it, was very tightly constrained. to(ply) == to(ply-1), etc. Berliner implemented it where any capture that brought the material balance back to the "norm" was extended, so that BxN, Qh5+ Kg8 PxB would be extended since the PxB is a recapture, but is separated from the original capture by the check/escape-check pair. He also considered things like Bxa8 Nxa1 (both sides captured a rook) as a capture/recapture pair... A few years ago I found that a tightly constrained recapture was better. I now realize this was true, not because the others are bad to extend, but that the recapture extension in general hurts more than it helps and the more it is limited, the less it hurts....
Aleks Peshkov
Posts: 971
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia
Full name: Aleks Peshkov

Re: Check extension

Post by Aleks Peshkov »

Extensions designed avoid horizon problems, so it make sense to extend only near horizon.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Check extension

Post by bob »

Aleks Peshkov wrote:Extensions designed avoid horizon problems, so it make sense to extend only near horizon.
Maybe. But what if you take a position like wac230 as an example, where black can make progress, but it has to first deal with a bunch of checks by the rook, which white plays simply to delay the inevitable progress? A long series of rook checks can eat up all of your depth.
Uri Blass
Posts: 11136
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Check extension

Post by Uri Blass »

bob wrote:
Uri Blass wrote:some notes:

1)It is correct that many captures force recaptures but the problem is that if you extend captures and not only recapture extensions then you extend also Bxc6 a5 and not only Bxc6 dxc6 or Bxc6 bxc6
I would agree with that, but I was explicitly talking about the classic recapture extension and why it was used. At today's depths, at least for my program, it actually began to hurt a very small amount. I would not be surprised if the check extension goes away in another 5 years or so. It is only worth 10 Elo or so today...


2)I believe that extending recaptures may be more productive if you extend trades of the biggest piece of both sides.

I wonder if you tested the recapture extension in case that you limit it only for trading of the biggest piece on the board.

Uri
No, but I did try several variations. The way I originally implemented it, was very tightly constrained. to(ply) == to(ply-1), etc. Berliner implemented it where any capture that brought the material balance back to the "norm" was extended, so that BxN, Qh5+ Kg8 PxB would be extended since the PxB is a recapture, but is separated from the original capture by the check/escape-check pair. He also considered things like Bxa8 Nxa1 (both sides captured a rook) as a capture/recapture pair... A few years ago I found that a tightly constrained recapture was better. I now realize this was true, not because the others are bad to extend, but that the recapture extension in general hurts more than it helps and the more it is limited, the less it hurts....
I see no logical reason for the limitation of the same square.
capture recapture is not something less important when it is not in the same square.

If you want to limit capture recapture extensions then it is more logical to limit it to cases when the opponent has no better capture(it means not extending Bxa8 Nxa1 that trade rooks only when black has also Bxd1 that capture the queen that is more important than the rook).

This limitation of course happens when you trade only the biggest piece
but you may want to try to extend also trading the second big piece in case that you find that extending trading the biggest piece is productive.

Uri
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Check extension

Post by bob »

Uri Blass wrote:
bob wrote:
Uri Blass wrote:some notes:

1)It is correct that many captures force recaptures but the problem is that if you extend captures and not only recapture extensions then you extend also Bxc6 a5 and not only Bxc6 dxc6 or Bxc6 bxc6
I would agree with that, but I was explicitly talking about the classic recapture extension and why it was used. At today's depths, at least for my program, it actually began to hurt a very small amount. I would not be surprised if the check extension goes away in another 5 years or so. It is only worth 10 Elo or so today...


2)I believe that extending recaptures may be more productive if you extend trades of the biggest piece of both sides.

I wonder if you tested the recapture extension in case that you limit it only for trading of the biggest piece on the board.

Uri
No, but I did try several variations. The way I originally implemented it, was very tightly constrained. to(ply) == to(ply-1), etc. Berliner implemented it where any capture that brought the material balance back to the "norm" was extended, so that BxN, Qh5+ Kg8 PxB would be extended since the PxB is a recapture, but is separated from the original capture by the check/escape-check pair. He also considered things like Bxa8 Nxa1 (both sides captured a rook) as a capture/recapture pair... A few years ago I found that a tightly constrained recapture was better. I now realize this was true, not because the others are bad to extend, but that the recapture extension in general hurts more than it helps and the more it is limited, the less it hurts....
I see no logical reason for the limitation of the same square.
capture recapture is not something less important when it is not in the same square.

If you want to limit capture recapture extensions then it is more logical to limit it to cases when the opponent has no better capture(it means not extending Bxa8 Nxa1 that trade rooks only when black has also Bxd1 that capture the queen that is more important than the rook).

This limitation of course happens when you trade only the biggest piece
but you may want to try to extend also trading the second big piece in case that you find that extending trading the biggest piece is productive.

Uri
The reason same square is better is it limits the damage the recapture extension does. however, as I discovered with a ton of testing, just removing it was the best solution of all, Elo-wise. yes it slows down some problem positions. Kopec 22 is an example where the recapture extension can reduce the depth by 2 plies. But for Crafty, it hurt overall in real games...
mjlef
Posts: 1494
Joined: Thu Mar 30, 2006 2:08 pm

Re: Check extension

Post by mjlef »

I was interested if people have tried some of these ideas with check extensions, and which worked and which did not:

Extend all checks
Extend checks only in PV nodes (not zero width nodes)
Extend only non-losing checks
extend checks if captures, even if losing
etc.

Looking at Toga, some versions now only extend checks in PV nodes, or if they do not lose more than a pawn.

So, if you have tested things along these lines and are willing to share, please do.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Check extension

Post by bob »

mjlef wrote:I was interested if people have tried some of these ideas with check extensions, and which worked and which did not:

Extend all checks
Extend checks only in PV nodes (not zero width nodes)
Extend only non-losing checks
extend checks if captures, even if losing
etc.

Looking at Toga, some versions now only extend checks in PV nodes, or if they do not lose more than a pawn.

So, if you have tested things along these lines and are willing to share, please do.
I've tried each of those. I found that extending all checks was best. Some of the above make no difference in terms of playing strength, some make a small difference, always worse. I don't have the exact data handy, but when I evaluated all the extensions in Crafty, I tried every option I could think of, just as I did with the many ways to limit LMR.

If you have a specific idea, I can probably test it and post the results...
mjlef
Posts: 1494
Joined: Thu Mar 30, 2006 2:08 pm

Re: Check extension

Post by mjlef »

How about just testing what Toga uses? Extend all checks in PV nodes, and only checks that do not lose (based on on SEE) more than a pawn. A few thousand games should determine if this helps orr not, within a few percent. You can post the number of games won, lost or drawn for each version.