PVS extension up

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
ed

Re: PVS extension up

Post by ed » Sun Jun 24, 2007 11:35 am

Tony wrote:I was wondering how you get 2 moves in a row from hashtable. One of the 2 positions would be a fail low node where you normally don't have a hashmove.

Do you store bestmoves in fail low nodes ? Or do you keep the bestmoves on fail low nodes when they previously were fail highs nodes ?

Tony
I store everything :lol: so the information is just available. Just stack if a move is a PVS move from the hash table.

Ed

ed

Re: PVS extension up

Post by ed » Sun Jun 24, 2007 11:41 am

Uri Blass wrote:I think that it is easy to get 2 moves in a row from hashtable in case that you have an exact score and if I understand correctly pvs extensions are about extending moves that have exact score.

If the pv is 1.e4 e5 2.Nf3 Nc6 then in the next search you can extend the position after 1.e4 e5 2.Nf3 Nc6 by one ply.

I did not try it and maybe I do not understand correctly what Ed means by PVS extensions so I think that some chess examples can help to understand the meaning of it.

Uri
Your second paragraph says it all, that's what's happening.

The advantage of this extension (with the exception code) is that it only extend reasonable well move sequences with hardly any garbage. After all, it's based on the best moves from the hash table which seldom contain garbage.

Ed

ed

Re: PVS extension up

Post by ed » Sun Jun 24, 2007 12:17 pm

ed wrote:
Uri Blass wrote:I think that it is easy to get 2 moves in a row from hashtable in case that you have an exact score and if I understand correctly pvs extensions are about extending moves that have exact score.

If the pv is 1.e4 e5 2.Nf3 Nc6 then in the next search you can extend the position after 1.e4 e5 2.Nf3 Nc6 by one ply.

I did not try it and maybe I do not understand correctly what Ed means by PVS extensions so I think that some chess examples can help to understand the meaning of it.

Uri
Your second paragraph says it all, that's what's happening.

The advantage of this extension (with the exception code) is that it only extend reasonable well move sequences with hardly any garbage. After all, it's based on the best moves from the hash table which seldom contain garbage.

Ed
The above example is not totally correct, consider this PV line:
1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.0-0

1..e5 and 2.Nf3 is a pair (count++)
2.Nf3 and 2..Nc5 is a pair (count++)

etc....

When count=4 extend

Ed

Michael Sherwin
Posts: 3021
Joined: Fri May 26, 2006 1:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: PVS extension up

Post by Michael Sherwin » Sun Jun 24, 2007 1:59 pm

ed wrote:
Michael Sherwin wrote:
ed wrote:When picking up my work again on the chess page I to my astonishment noticed I had forgotten to mention a probable important extension. I am curious how many of you use a similar approach.

http://www.top-5000.nl/authors/rebel/chess840.htm

Ed
Hi Ed,

Yes I have tried that type extention and it was inconclusive.

About extentions in general. When I first released RomiChess it only had a check extention and a mate threat extention and was already a rather strong program. I thought that if now, I were to put in all the right extentions, then it would take another big jump in ELO. However, no further extentions helped. I was getting very frustrated. Then Prof. Hyatt wrote that he was dropping some extentions as modern hardware was so fast that the extentions no longer helped and may even be counter productive. Given my experiance, I tend to agree.

Mike
Hi Mike,

The subject awakened my curiosity and so I ran a quick eng-eng match without the PVS extension. The result was considerable worse than with the default setting (PVS=ON). So it seems the PVS extension is still working.

Ed
Hi Ed,

I will try this extention again and will be very careful to do it the way that you say to do it. Then I will report back.

Mike
I hate if statements. Pawns demand if statements. Therefore I hate pawns.

Ron Murawski
Posts: 397
Joined: Sun Oct 29, 2006 3:38 am
Location: Schenectady, NY
Contact:

Re: PVS extension up

Post by Ron Murawski » Sun Jun 24, 2007 5:42 pm

ed wrote:
ed wrote:
Uri Blass wrote:I think that it is easy to get 2 moves in a row from hashtable in case that you have an exact score and if I understand correctly pvs extensions are about extending moves that have exact score.

If the pv is 1.e4 e5 2.Nf3 Nc6 then in the next search you can extend the position after 1.e4 e5 2.Nf3 Nc6 by one ply.

I did not try it and maybe I do not understand correctly what Ed means by PVS extensions so I think that some chess examples can help to understand the meaning of it.

Uri
Your second paragraph says it all, that's what's happening.

The advantage of this extension (with the exception code) is that it only extend reasonable well move sequences with hardly any garbage. After all, it's based on the best moves from the hash table which seldom contain garbage.

Ed
The above example is not totally correct, consider this PV line:
1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.0-0

1..e5 and 2.Nf3 is a pair (count++)
2.Nf3 and 2..Nc5 is a pair (count++)

etc....

When count=4 extend

Ed
Hi Ed,

Isn't this the same as saying "extend the pv line by one ply at ply 8"?
And now, since your counter is reset to zero:
  • * If the pv does not change, the next possible extension would occur at ply 16.
    * If the pv *did* change, let's say at ply 3, then the next pv extension would occur at ply 3+8 = 11.
Ron

Tony

Re: PVS extension up

Post by Tony » Sun Jun 24, 2007 5:59 pm

Ron Murawski wrote:
ed wrote:
ed wrote:
Uri Blass wrote:I think that it is easy to get 2 moves in a row from hashtable in case that you have an exact score and if I understand correctly pvs extensions are about extending moves that have exact score.

If the pv is 1.e4 e5 2.Nf3 Nc6 then in the next search you can extend the position after 1.e4 e5 2.Nf3 Nc6 by one ply.

I did not try it and maybe I do not understand correctly what Ed means by PVS extensions so I think that some chess examples can help to understand the meaning of it.

Uri
Your second paragraph says it all, that's what's happening.

The advantage of this extension (with the exception code) is that it only extend reasonable well move sequences with hardly any garbage. After all, it's based on the best moves from the hash table which seldom contain garbage.

Ed
The above example is not totally correct, consider this PV line:
1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.0-0

1..e5 and 2.Nf3 is a pair (count++)
2.Nf3 and 2..Nc5 is a pair (count++)

etc....

When count=4 extend

Ed
Hi Ed,

Isn't this the same as saying "extend the pv line by one ply at ply 8"?
And now, since your counter is reset to zero:
  • * If the pv does not change, the next possible extension would occur at ply 16.
    * If the pv *did* change, let's say at ply 3, then the next pv extension would occur at ply 3+8 = 11.
Ron
That was basicly what I meant. I didn't see what having a hashmove had to do with it. Just counting the amount of pv nodes in a row should do it so I was wondering if this hash move count added something.

Tony

Uri Blass
Posts: 8378
Joined: Wed Mar 08, 2006 11:37 pm
Location: Tel-Aviv Israel

Re: PVS extension up

Post by Uri Blass » Sun Jun 24, 2007 6:25 pm

Ron Murawski wrote:
ed wrote:
ed wrote:
Uri Blass wrote:I think that it is easy to get 2 moves in a row from hashtable in case that you have an exact score and if I understand correctly pvs extensions are about extending moves that have exact score.

If the pv is 1.e4 e5 2.Nf3 Nc6 then in the next search you can extend the position after 1.e4 e5 2.Nf3 Nc6 by one ply.

I did not try it and maybe I do not understand correctly what Ed means by PVS extensions so I think that some chess examples can help to understand the meaning of it.

Uri
Your second paragraph says it all, that's what's happening.

The advantage of this extension (with the exception code) is that it only extend reasonable well move sequences with hardly any garbage. After all, it's based on the best moves from the hash table which seldom contain garbage.

Ed
The above example is not totally correct, consider this PV line:
1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.0-0

1..e5 and 2.Nf3 is a pair (count++)
2.Nf3 and 2..Nc5 is a pair (count++)

etc....

When count=4 extend

Ed
Hi Ed,

Isn't this the same as saying "extend the pv line by one ply at ply 8"?
And now, since your counter is reset to zero:
  • * If the pv does not change, the next possible extension would occur at ply 16.
    * If the pv *did* change, let's say at ply 3, then the next pv extension would occur at ply 3+8 = 11.
Ron
I do not see how you get 8

1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.0-0

1.e4 e5 is a pair(count++)
1..e5 and 2.Nf3 is a pair (count++)
2.Nf3 and 2..Nc6 is a pair (count++)
Nc6 3.Bb5 is a pair(count++)

You extend by one ply in the 5th ply of the pv.

Uri

Ron Murawski
Posts: 397
Joined: Sun Oct 29, 2006 3:38 am
Location: Schenectady, NY
Contact:

Re: PVS extension up

Post by Ron Murawski » Sun Jun 24, 2007 9:11 pm

Uri Blass wrote:
Ron Murawski wrote:
ed wrote:
ed wrote:
Uri Blass wrote:I think that it is easy to get 2 moves in a row from hashtable in case that you have an exact score and if I understand correctly pvs extensions are about extending moves that have exact score.

If the pv is 1.e4 e5 2.Nf3 Nc6 then in the next search you can extend the position after 1.e4 e5 2.Nf3 Nc6 by one ply.

I did not try it and maybe I do not understand correctly what Ed means by PVS extensions so I think that some chess examples can help to understand the meaning of it.

Uri
Your second paragraph says it all, that's what's happening.

The advantage of this extension (with the exception code) is that it only extend reasonable well move sequences with hardly any garbage. After all, it's based on the best moves from the hash table which seldom contain garbage.

Ed
The above example is not totally correct, consider this PV line:
1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.0-0

1..e5 and 2.Nf3 is a pair (count++)
2.Nf3 and 2..Nc5 is a pair (count++)

etc....

When count=4 extend

Ed
Hi Ed,

Isn't this the same as saying "extend the pv line by one ply at ply 8"?
And now, since your counter is reset to zero:
  • * If the pv does not change, the next possible extension would occur at ply 16.
    * If the pv *did* change, let's say at ply 3, then the next pv extension would occur at ply 3+8 = 11.
Ron
I do not see how you get 8

1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.0-0

1.e4 e5 is a pair(count++)
1..e5 and 2.Nf3 is a pair (count++)
2.Nf3 and 2..Nc6 is a pair (count++)
Nc6 3.Bb5 is a pair(count++)

You extend by one ply in the 5th ply of the pv.

Uri
Hi Uri,

Now that I re-read what Ed wrote I think you might be right. Ed confused me when he said "1..e5 and 2.Nf3 is a pair (count++)". I took that to mean two plies of pv would be considered one move and cause one increment to his counter.

It's either what I previously wrote or it's:
"extend the pv line by one ply at ply 4"?
Now, since your counter is reset to zero:
  • * If the pv does not change, the next possible extension would occur at ply 8.
    * If the pv *did* change, let's say at ply 3, then the next pv extension would occur at ply 3+4 = 7.
It would be good if Ed clears up this misunderstanding.

Ron

Michael Sherwin
Posts: 3021
Joined: Fri May 26, 2006 1:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: PVS extension up

Post by Michael Sherwin » Sun Jun 24, 2007 10:12 pm

Michael Sherwin wrote:
ed wrote:
Michael Sherwin wrote:
ed wrote:When picking up my work again on the chess page I to my astonishment noticed I had forgotten to mention a probable important extension. I am curious how many of you use a similar approach.

http://www.top-5000.nl/authors/rebel/chess840.htm

Ed
Hi Ed,

Yes I have tried that type extention and it was inconclusive.

About extentions in general. When I first released RomiChess it only had a check extention and a mate threat extention and was already a rather strong program. I thought that if now, I were to put in all the right extentions, then it would take another big jump in ELO. However, no further extentions helped. I was getting very frustrated. Then Prof. Hyatt wrote that he was dropping some extentions as modern hardware was so fast that the extentions no longer helped and may even be counter productive. Given my experiance, I tend to agree.

Mike
Hi Mike,

The subject awakened my curiosity and so I ran a quick eng-eng match without the PVS extension. The result was considerable worse than with the default setting (PVS=ON). So it seems the PVS extension is still working.

Ed
Hi Ed,

I will try this extention again and will be very careful to do it the way that you say to do it. Then I will report back.

Mike
PVS extention, a quick test.

I have not gotten as far as the "careful" testing yet and would not be making this report if the results of the "quick" testing were not positive.

Code: Select all

if(h->p && h->p->m != noMove.m) extendBy += 25; // one-fourth ply

Code: Select all

// This is the RomiChess extention/reduction method.
 
if(extendBy >= 100) {
  depth++;
  extendBy -= 100;
} else
if&#40;extendBy <= -100&#41; &#123;
  depth--;
  extendBy += 100;
&#125;
Having added the top line of code to RomiChess I can say that the early indication is that it is very helpful!

After 10 games (way to few) versus Hamsters 0.2 it is RomiChess +8 -2 =0! And Romi had a won game during one of the games that she lost, but succumbed to a king-attack to which she is still vulnerable. This is a new record for Romi in the first 10 games versus Hamsters 0.2.

The evaluation function in RomiChess has been improved some. This may be why this extention, now has a positive effect. It searches deeper in critical lines, while only costing one ply of search. In a previous version with a worse evaluation the results were inconclusive and most likely suffered as much from what it missed in the lost ply as what it found in the extensions. Also since then the search has been improved thus RomiChess has a ply or two to 'burn' that she did not have before.

Still, if the PVS extension can be intelligently restricted so as not to cost that extra ply then the gain could be really big for RomiChess, as it is already looking very, 'kick-ass'!

...

Second quick test.

Code: Select all

if&#40;extendBy < 100 && h->p && h->p->depth + 2 >= depth && h->p->m != noMove.m&#41; extendBy += 25;
Only partially extend if an extension is not about to be triggered and only if the hash depth makes the hash move very relevant.

RomiChess vs. Hamsters 0.2, Romi +7 -0 =3. Zero losses! A second new record in one day. And two of the draws were from won positions that because of the lack of material based draw detection, Romi did not know how to win.

So like Ed indicated, you get some really powerful extensions with out extending a lot of garbage!

Score now, Romi +9 -0 =3. This is getting fun, so maybe I will make some more quick test! :D

Sorry, make that +10 -0 =3! :D :D
I hate if statements. Pawns demand if statements. Therefore I hate pawns.

Alessandro Scotti

Re: PVS extension up

Post by Alessandro Scotti » Sun Jun 24, 2007 10:39 pm

Michael Sherwin wrote:After 10 games (way to few) versus Hamsters 0.2 it is RomiChess +8 -2 =0! And Romi had a won game during one of the games that she lost, but succumbed to a king-attack to which she is still vulnerable. This is a new record for Romi in the first 10 games versus Hamsters 0.2.
Ah-ah! But I am reading this thread as well! :lol:

Post Reply