Question for Bob Hyatt

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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

Re: Question for Bob Hyatt

Post by bob »

lkaufman wrote:The TT move extension is known to be in Stockfish 1.6, but that's a refinement in Rybka, not what really makes it unique. I agree with you that the extreme focus on the PV is counter-intuitive, and clearly the programming world agrees with you as no one else appears to be doing it aside from the Rybka-derivatives. But the fact is that Rybka 3 was nearly a class above the competition for a year or so, and it is surprising to me that she has found no followers.
It might take time before others try these ideas. First they are buried in an impossibly obtuse source code. And they will take some time to understand. This is not something one can just "read" as you can with my source. You have to munge thru every statement and figure out what it is doing, before moving on, which greatly complicates the task of understanding the thing. I've not had the time, interest, or patience to try, myself.
lkaufman
Posts: 5960
Joined: Sun Jan 10, 2010 6:15 am
Location: Maryland USA

Re: Question for Bob Hyatt

Post by lkaufman »

"One simple way to add some hysteresis to the search would be to use the offset window. The higher the window gets offset after the PV search completes, the harder it will be for a new move to displace the original PV move as best. We tried 0.005 in Cray Blitz to avoid those deep thinks, only to see a +.001 eval increase, to a move that was ordered later in the move list. Often this move would be strategically bad (that's why the static eval ordered it late in the move list) and it would be nothing more than some sort of horizon-effect case where we'd play a bad move that did nothing other than hurt our position. If this window were set to +.05 or even +.1 on today's engines, they would still find ways to win material, but they would miss on the .05 positional increase they could have found without the window limitation."

We already tried this with some value near 0.05, but it hurt. Since we round scores to 0.01, we can't use a value less than that. I suppose we could try 0.01 or 0.02. But I don't think it would be very significant either way. I want something that will have a large effect (good or bad).
CRoberson
Posts: 2055
Joined: Mon Mar 13, 2006 2:31 am
Location: North Carolina, USA

Re: Question for Bob Hyatt

Post by CRoberson »

lkaufman wrote:"One simple way to add some hysteresis to the search would be to use the offset window. The higher the window gets offset after the PV search completes, the harder it will be for a new move to displace the original PV move as best. We tried 0.005 in Cray Blitz to avoid those deep thinks, only to see a +.001 eval increase, to a move that was ordered later in the move list. Often this move would be strategically bad (that's why the static eval ordered it late in the move list) and it would be nothing more than some sort of horizon-effect case where we'd play a bad move that did nothing other than hurt our position. If this window were set to +.05 or even +.1 on today's engines, they would still find ways to win material, but they would miss on the .05 positional increase they could have found without the window limitation."

We already tried this with some value near 0.05, but it hurt. Since we round scores to 0.01, we can't use a value less than that. I suppose we could try 0.01 or 0.02. But I don't think it would be very significant either way. I want something that will have a large effect (good or bad).
I've tried this in Telepath several times over the past 5 years. It results in deeper search, but it has yet to produce measurably stronger play.
I've gotten better at coding it with each attempt and it seems to work better as I improve the eval. Still, a PV bonus doesn't produce
better play for me. In the effort of testing, I did set the PV bonus so high that it did make it play much worse.

Rather entertaining that you mentioned it as it has bubbled back up to #2 on my retest list. It is just behind some retesting of move ordering ideas.
jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: Question for Bob Hyatt

Post by jwes »

lkaufman wrote:"One simple way to add some hysteresis to the search would be to use the offset window. The higher the window gets offset after the PV search completes, the harder it will be for a new move to displace the original PV move as best. We tried 0.005 in Cray Blitz to avoid those deep thinks, only to see a +.001 eval increase, to a move that was ordered later in the move list. Often this move would be strategically bad (that's why the static eval ordered it late in the move list) and it would be nothing more than some sort of horizon-effect case where we'd play a bad move that did nothing other than hurt our position. If this window were set to +.05 or even +.1 on today's engines, they would still find ways to win material, but they would miss on the .05 positional increase they could have found without the window limitation."

We already tried this with some value near 0.05, but it hurt. Since we round scores to 0.01, we can't use a value less than that. I suppose we could try 0.01 or 0.02. But I don't think it would be very significant either way. I want something that will have a large effect (good or bad).
If you make the offset large enough, it will have a large effect (probably bad).
edwardyu
Posts: 34
Joined: Mon Nov 17, 2008 6:58 am

Re: Question for Bob Hyatt

Post by edwardyu »

lkaufman wrote:"One simple way to add some hysteresis to the search would be to use the offset window. The higher the window gets offset after the PV search completes, the harder it will be for a new move to displace the original PV move as best. We tried 0.005 in Cray Blitz to avoid those deep thinks, only to see a +.001 eval increase, to a move that was ordered later in the move list. Often this move would be strategically bad (that's why the static eval ordered it late in the move list) and it would be nothing more than some sort of horizon-effect case where we'd play a bad move that did nothing other than hurt our position. If this window were set to +.05 or even +.1 on today's engines, they would still find ways to win material, but they would miss on the .05 positional increase they could have found without the window limitation."

We already tried this with some value near 0.05, but it hurt. Since we round scores to 0.01, we can't use a value less than that. I suppose we could try 0.01 or 0.02. But I don't think it would be very significant either way. I want something that will have a large effect (good or bad).
In the latest Stockfish, the futility margin is variaible depends on move-number. Will this cause the PV more focus? Also have anybody try variable delta margin in the QS?
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: Question for Bob Hyatt

Post by Michael Sherwin »

lkaufman wrote:"One simple way to add some hysteresis to the search would be to use the offset window. The higher the window gets offset after the PV search completes, the harder it will be for a new move to displace the original PV move as best. We tried 0.005 in Cray Blitz to avoid those deep thinks, only to see a +.001 eval increase, to a move that was ordered later in the move list. Often this move would be strategically bad (that's why the static eval ordered it late in the move list) and it would be nothing more than some sort of horizon-effect case where we'd play a bad move that did nothing other than hurt our position. If this window were set to +.05 or even +.1 on today's engines, they would still find ways to win material, but they would miss on the .05 positional increase they could have found without the window limitation."

We already tried this with some value near 0.05, but it hurt. Since we round scores to 0.01, we can't use a value less than that. I suppose we could try 0.01 or 0.02. But I don't think it would be very significant either way. I want something that will have a large effect (good or bad).
If there are piece square tables then you can try adding a bonus to the destination square and a penalty to the originating square of the last iterations best move. This should cause the other moves to search faster and the best to remain best given all else being equal.
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through
Uri Blass
Posts: 10280
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Question for Bob Hyatt

Post by Uri Blass »

From my experience in correspondence games
I have many examples when rybka changed her mind after hours but in most of them it was only afrer the score of the pv move went down
something like:
1.xx 1.02/20
1.xx 0.94/21
1.yy 1.04/21

This suggest the following idea to add stability:

Every time that the score of the pv move does not go down in a new iteration reduce the depth of other root moves by one ply.

It means that in the first iteration when the score does not go down you can practically skip the rest of the moves becaue of hash tables.

Example:
Suppose you have the following scores
1.e4 0.10/11
1.e4 0.06/12(score went down so you search 1.d4 and other moves also to depth 12 and suppose you find nothing better than 1.e4)
1.e4 0.07/13

score did not go down
other moves are searched only to depth 12 so they are pruned based on hash tables.


When you get depth 14 you may have
1.e4 0.07/14
again score did not go down but now you cannot prune based on hash so you search other moves to depth 13

If a move fail high at depth 13 you make a research to depth 14 and only if it also fail high at depth 14 you change the main choice.

Uri
lkaufman
Posts: 5960
Joined: Sun Jan 10, 2010 6:15 am
Location: Maryland USA

Re: Question for Bob Hyatt

Post by lkaufman »

This (or some variant of it) sounds to me worthy of a test. I'll propose it to Don. Thanks.
metax
Posts: 344
Joined: Wed Sep 23, 2009 5:56 pm
Location: Germany

Re: Question for Bob Hyatt

Post by metax »

Uri Blass wrote:From my experience in correspondence games
I have many examples when rybka changed her mind after hours but in most of them it was only afrer the score of the pv move went down
something like:
1.xx 1.02/20
1.xx 0.94/21
1.yy 1.04/21

This suggest the following idea to add stability:

Every time that the score of the pv move does not go down in a new iteration reduce the depth of other root moves by one ply.

It means that in the first iteration when the score does not go down you can practically skip the rest of the moves becaue of hash tables.

Example:
Suppose you have the following scores
1.e4 0.10/11
1.e4 0.06/12(score went down so you search 1.d4 and other moves also to depth 12 and suppose you find nothing better than 1.e4)
1.e4 0.07/13

score did not go down
other moves are searched only to depth 12 so they are pruned based on hash tables.


When you get depth 14 you may have
1.e4 0.07/14
again score did not go down but now you cannot prune based on hash so you search other moves to depth 13

If a move fail high at depth 13 you make a research to depth 14 and only if it also fail high at depth 14 you change the main choice.

Uri
I don't like this idea very much. Suppose you have a position with some good quiet positional moves and a tactical shot leadiung to immediate win. In the first iterations, one of the positional moves is the best, so it is a PV. In the next iterations a pretty accurate score for it is calculated. Then it is left to chance in which iteration you will find the tactical shot. For example, if depth 12 is needed to find the move:

1. Positional (+0.20/10)
1. Positional (+0.25/11)
1. Positional (+0.31/12)
1. Positional (+0.38/13)
1. Tactical (+4.48/13)

The assumption 'if I don't get a lower score, the PV is probably the best move' is not fulfilled in tactical positions!
zamar
Posts: 613
Joined: Sun Jan 18, 2009 7:03 am

Re: Question for Bob Hyatt

Post by zamar »

Uri Blass wrote: Every time that the score of the pv move does not go down in a new iteration reduce the depth of other root moves by one ply.

It means that in the first iteration when the score does not go down you can practically skip the rest of the moves becaue of hash tables.
Thank you for sharing this idea Uri... I'm pretty convinced, that it won't work just like that, but I'm going to try some fine tuned version of this in near future :)
If a move fail high at depth 13 you make a research to depth 14 and only if it also fail high at depth 14 you change the main choice.
Here I have more doubts... Hard to believe that it could work...
Joona Kiiski