Question for Bob Hyatt

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Uri Blass
Posts: 10282
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Question for Bob Hyatt

Post by Uri Blass »

metax wrote:
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!
I know that is not always correct
Every reduction can be wrong in part of the cases.

The point is that it may be more important in games to find better positional moves and not to find tactical wins.

The program may go one ply deeper so the score goes down and it may be enough for it to find a better positional move.

Uri
Uri Blass
Posts: 10282
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Question for Bob Hyatt

Post by Uri Blass »

zamar wrote:
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...
I also had more doubts about the second idea but it clearly help the program to change her mind less often and the discussion was about ways to cause chess programs to do it.

Unlike you I am not convinced that my idea does not work as it is but I am also not convinced that the opposite is correct.

I thought about variants to do more aggresive reductions(and also reduce
2 plies at some point if the score continue not to go down) but decided not to mention it to make the idea more simple and if 1 ply does not work then there is no point to discuss about more plies.


Uri
metax
Posts: 344
Joined: Wed Sep 23, 2009 5:56 pm
Location: Germany

Re: Question for Bob Hyatt

Post by metax »

I think not too much time can be saved by extremely reducing the alternatives to the PV at the root, as the null-window search of most programs is very efficient anyway.
metax
Posts: 344
Joined: Wed Sep 23, 2009 5:56 pm
Location: Germany

Re: Question for Bob Hyatt

Post by metax »

The cost (not finding good tactical moves) of reducing even more than one ply at the root may be higher than the few nodes saved by the reductions.
Uri Blass
Posts: 10282
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Question for Bob Hyatt

Post by Uri Blass »

metax wrote:I think not too much time can be saved by extremely reducing the alternatives to the PV at the root, as the null-window search of most programs is very efficient anyway.
I think that many bad alternatives at the root are not pruned by null move pruning and have a threat so I disagree with this opinion.

Edit:I see that you talk about null window and not about null move pruning but I still think that significant time is spent on other moves

I think that for many programs something near to half of the time is spent not at the pv move and saving even only 20% of the time may be productive.

Edit 2:the claim that the cost may is high is not supported by rybka because rybka is the best and seems to reduce heavily non root moves.

Uri
metax
Posts: 344
Joined: Wed Sep 23, 2009 5:56 pm
Location: Germany

Re: Question for Bob Hyatt

Post by metax »

Uri Blass wrote:I think that many bad alternatives at the root are not pruned by null move pruning and have a threat so I disagree with this opinion.

Edit:I see that you talk about null window and not about null move pruning but I still think that significant time is spent on other moves

I think that for many programs something near to half of the time is spent not at the pv move and saving even only 20% of the time may be productive.

Edit 2:the claim that the cost may is high is not supported by rybka because rybka is the best and seems to reduce heavily non root moves.

Uri
I am not sure whether this behaviour is achieved by reducing heavily at the root. You can also reduce the time spent on the non-PV moves at the root by pruning and/or reducing heavily in non-PV-nodes not at the root.
lkaufman
Posts: 5960
Joined: Sun Jan 10, 2010 6:15 am
Location: Maryland USA

Re: Question for Bob Hyatt

Post by lkaufman »

Reducing heavily in non-PV nodes not at the root will also cause the time spent on the PV to increase (we see this in Doch), but Uri's idea will cause the characteristic Rybka-behavior of sticking with the same move from iteration to iteration most of the time, so it is worth a test.
metax
Posts: 344
Joined: Wed Sep 23, 2009 5:56 pm
Location: Germany

Re: Question for Bob Hyatt

Post by metax »

lkaufman wrote:Reducing heavily in non-PV nodes not at the root will also cause the time spent on the PV to increase (we see this in Doch), but Uri's idea will cause the characteristic Rybka-behavior of sticking with the same move from iteration to iteration most of the time, so it is worth a test.
It will rather decrease the time spent on the non-PV moves until a given iteration than increase the time spent on the PV move, but the result is the same: The percentage of time spent on the PV move will increase. Uri's idea is of course worth a test.

@Uri: When would you want to reduce more than one ply then? This seems rather dangerous...
Uri Blass
Posts: 10282
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Question for Bob Hyatt

Post by Uri Blass »

metax wrote:
lkaufman wrote:Reducing heavily in non-PV nodes not at the root will also cause the time spent on the PV to increase (we see this in Doch), but Uri's idea will cause the characteristic Rybka-behavior of sticking with the same move from iteration to iteration most of the time, so it is worth a test.
It will rather decrease the time spent on the non-PV moves until a given iteration than increase the time spent on the PV move, but the result is the same: The percentage of time spent on the PV move will increase. Uri's idea is of course worth a test.

@Uri: When would you want to reduce more than one ply then? This seems rather dangerous...
Maybe when the score increase go up again and again or when the score of the root move is a winning score.

When you have evaluation of +3.00 it is more important to extend the pv move to be sure that it does not go down and it is less important to find a better move because even if you do not play the best move you will probably win.

Uri
metax
Posts: 344
Joined: Wed Sep 23, 2009 5:56 pm
Location: Germany

Re: Question for Bob Hyatt

Post by metax »

Uri Blass wrote:Maybe when the score increase go up again and again or when the score of the root move is a winning score.

When you have evaluation of +3.00 it is more important to extend the pv move to be sure that it does not go down and it is less important to find a better move because even if you do not play the best move you will probably win.

Uri
Well, that's really an idea worth further investigation, although when the score is winning score the alternatives don't need much time anyway....