Extensions: everywhere or near the tips?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Cardoso
Posts: 362
Joined: Thu Mar 16, 2006 7:39 pm
Location: Portugal
Full name: Alvaro Cardoso

Extensions: everywhere or near the tips?

Post by Cardoso »

Hi,
I've been thinking about this. Is there any real benefit to extend a line at ply 2 or 3 or 4... if we ave a remaining depth of say 15 plies?
Shouldn't we only do extensions if we have remaining depth > 4 plies?
Because that is where we are running out of remaining depth and horizon problems occur.

What do you think about this?

Alvaro
User avatar
Desperado
Posts: 879
Joined: Mon Dec 15, 2008 11:45 am

Re: Extensions: everywhere or near the tips?

Post by Desperado »

Hi Alvaro,

i thought about this several times.And it seemed to me a logical approach.
But practise showed me that the search-behaviour may become totally different for forced lines.

(i think you mean rdepth<4...,near the horizon)

i had to search a mate in 7(14 plies). The line was including silent moves.
so the search result on low iteration depth immediatelly got the mate result, until ply 7,8,9 or so. Then the extension were off so to say for the
first plies. Now the evaluation changed, and i think some lines were reduced or pruned away and the search wasnt interested in the line without the previous extensions. So it just searched other lines. The search got somehow unstable.

it is hard to imagine what exactly was going on.
I think it is a good idea in general that the search behavior will be the same for each iteration. So my conclusion for now is that i dont know if
this approach is really producing unstable search, but surely it doesnt get
more stable with this.

Also the extensions not only will avoid some kind of horizon problems, they also leading to interesting positions because the searchspace grows, and "not only" one specific line is searched deeper.

Also extensions sum together, for example if you want to search depth 8
and are in a capture sequence, the effective seldepth so to say may be 15
if nearly each capture would be extend. So the remaining depth on height 8 would be 7
The other approach would have only rdp = 4 max, assuming with max extension of 1 per ply. So it would help for horizon perhaps, but would
not really open the eyes in the sense for the searchspace.

Thats my first thoughts about this...let us see what the others say
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Extensions: everywhere or near the tips?

Post by bob »

Cardoso wrote:Hi,
I've been thinking about this. Is there any real benefit to extend a line at ply 2 or 3 or 4... if we ave a remaining depth of say 15 plies?
Shouldn't we only do extensions if we have remaining depth > 4 plies?
Because that is where we are running out of remaining depth and horizon problems occur.

What do you think about this?

Alvaro
I've tried a ton of different ideas over the past 6 months or so. What I found, in general, was that anything that reduced the number of extensions seemed to help, with the exception of the check extension. Now that I have all other extensions removed, I am going to go back and try some runs to see if limiting the check extension, either closer to the root or closer to the tips makes any significant difference...
Cardoso
Posts: 362
Joined: Thu Mar 16, 2006 7:39 pm
Location: Portugal
Full name: Alvaro Cardoso

Re: Extensions: everywhere or near the tips?

Post by Cardoso »

Thanks, I'll be waiting for the results.
This is one thing I really like to clear up in my mind.

Best regards,
Alvaro
Uri Blass
Posts: 10297
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Extensions: everywhere or near the tips?

Post by Uri Blass »

bob wrote:
Cardoso wrote:Hi,
I've been thinking about this. Is there any real benefit to extend a line at ply 2 or 3 or 4... if we ave a remaining depth of say 15 plies?
Shouldn't we only do extensions if we have remaining depth > 4 plies?
Because that is where we are running out of remaining depth and horizon problems occur.

What do you think about this?

Alvaro
I've tried a ton of different ideas over the past 6 months or so. What I found, in general, was that anything that reduced the number of extensions seemed to help, with the exception of the check extension. Now that I have all other extensions removed, I am going to go back and try some runs to see if limiting the check extension, either closer to the root or closer to the tips makes any significant difference...
I wonder if you tried pv extensions.

It means extending the line of the pv of the previous iteration.
based on my memory toga does it.

Uri
User avatar
Zach Wegner
Posts: 1922
Joined: Thu Mar 09, 2006 12:51 am
Location: Earth

Re: Extensions: everywhere or near the tips?

Post by Zach Wegner »

Cardoso wrote:Hi,
I've been thinking about this. Is there any real benefit to extend a line at ply 2 or 3 or 4... if we ave a remaining depth of say 15 plies?
Shouldn't we only do extensions if we have remaining depth > 4 plies?
Because that is where we are running out of remaining depth and horizon problems occur.

What do you think about this?

Alvaro
I've thought about the same concept too, though I haven't experimented with it yet. You must be careful though. If you have an entry from the hash table searched to depth 5, and then you are searching a node to depth 4, it used to be more than enough, but now, the d=5 entry might be equivalent to d=4. Add in fractional extensions, and you can have hash hits with deeper drafts that actually have been searched to shallower depths. This creates a source of search instability which will be propagated all over the tree...
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Extensions: everywhere or near the tips?

Post by Tord Romstad »

bob wrote:I've tried a ton of different ideas over the past 6 months or so. What I found, in general, was that anything that reduced the number of extensions seemed to help, with the exception of the check extension. Now that I have all other extensions removed, I am going to go back and try some runs to see if limiting the check extension, either closer to the root or closer to the tips makes any significant difference...
Have you tried extending checks by just half a ply, like I do in Glaurung? When I watch my engine play, it looks faster and stronger with check extensions limited to half a ply, but as usual, I can't back it up with statistics. I could be wrong.

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

Re: Extensions: everywhere or near the tips?

Post by bob »

Uri Blass wrote:
bob wrote:
Cardoso wrote:Hi,
I've been thinking about this. Is there any real benefit to extend a line at ply 2 or 3 or 4... if we ave a remaining depth of say 15 plies?
Shouldn't we only do extensions if we have remaining depth > 4 plies?
Because that is where we are running out of remaining depth and horizon problems occur.

What do you think about this?

Alvaro
I've tried a ton of different ideas over the past 6 months or so. What I found, in general, was that anything that reduced the number of extensions seemed to help, with the exception of the check extension. Now that I have all other extensions removed, I am going to go back and try some runs to see if limiting the check extension, either closer to the root or closer to the tips makes any significant difference...
I wonder if you tried pv extensions.

It means extending the line of the pv of the previous iteration.
based on my memory toga does it.

Uri
Yes. In my testing that was worse. I don't recall exactly and could do the test again, but it was worse than any of the other extensions I tried... The idea doesn't make any particular sense to me either.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Extensions: everywhere or near the tips?

Post by bob »

Tord Romstad wrote:
bob wrote:I've tried a ton of different ideas over the past 6 months or so. What I found, in general, was that anything that reduced the number of extensions seemed to help, with the exception of the check extension. Now that I have all other extensions removed, I am going to go back and try some runs to see if limiting the check extension, either closer to the root or closer to the tips makes any significant difference...
Have you tried extending checks by just half a ply, like I do in Glaurung? When I watch my engine play, it looks faster and stronger with check extensions limited to half a ply, but as usual, I can't back it up with statistics. I could be wrong.

Tord
Yes. Although I no longer use fractional plies since nothing was better than 1.0 for checks. But I ran a test with the following extensions:

check
one reply to check
mate threat
passed pawn push to 6th and 7th and also just 7th
recapture.

I eliminated recapture quickly and also the passed pawn push. For the other three, i ran a test something like this:

foreach checkdepth (0 1/4 1/2 3/4 1)
foreach onerepdepth (0 1/4 1/2 3/4)
foreach threatdepth (0 1/4 1/2 3/4)
run a one-hour cluster match
end
end
end

I was originally using 1.0, 3/4, 3/4 for the above. The best result was for 10, 0, 0. I then repeated with that set of values a couple of times to make sure I wasn't looking at an oddball result, even with 32,000 games.

The other issue is how you "pre-load" the search depth when you start. I tested with 0, 1/4, 1/2 and 3/4, which means the first iteration is depth+N where N is one of those 4 values. not surprisingly, 0 was best (it doesn't affect the check extensions and delays the extensions caused by the others by at least a ply or two.
Daniel Shawul
Posts: 4185
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: Extensions: everywhere or near the tips?

Post by Daniel Shawul »

I have experimented with it for some time and IMO the search instablity is not that high. I have a "horizon extension" parameter which extends threats (mate/promotion/capture threats) by a full ply. Those could have vaues of fractions of a ply everywhere else but always a full extension is triggered at the horizon however you define it. Once I had depth_left <= 3 as the definition but later I was forced to tone it down to depth_left <= 0, which is basically before going to quiescence search. For recaptures and mate threats I used to have depth_left <= search_depth / 2 , which caused more search instability than the horizon extensions but seemed to improve overall play.

The heavy reductions (by LMR) seems to have reduced the effect of extensions significantly. But IMO a careful extension could still outperform those that chose not to extend at all. I highly doubt that the "extend checks only" rule is not the optimum. One can start from there and add limited extensions one by one. Some have succeeded with checks and heavey captures, pawn pushes etc...

Daniel