Searching worse moves first

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: Searching worse moves first

Post by bob »

hgm wrote:In reality it is not much of an advantage at all, if the opponent did not know beforehand that he would be allowed to do two moves in a row. If he did know, he could of course abuse that knowledge to wreck tremendous havoc. But that is not unique to the null move. It holds for almost any move. If I tell my opponent: "It is your turn, but I swear to you that the next move I will play is Qh5", he would be more than happy to wreck his King fortress by playing g6. (That reminds me of the days that people played correspondence chess by snail-mail, and that to save on stamps you could 'pre-move'. The classical mistake was to reply to 1.d4 with "1... g6 2. any Bg7". White then of course played 2. Bh6! to play Bxg7 and Bxh8 on his next two moves. :lol: )

This is not how engines use it, however. If there is no direct threat, passing a turn is often only a very slight disadvantage. Even in the opening, where speed iscomparatively valuable, because the start position is so poorly developed, there is the rule "3 tempi is a Pawn". In most cases losing a tempo will cost much less than 33cP.

So what you are saying does not sound convincing at all. The null move just measures if there are tactical threats that you might risk pushing over the horizon when doing the real moves.
In all the studying of this I have done, I only found one significant benefit. If you hang material early, null-move refutes it quickly and cheaply. If you drop the queen with your move at ply 2, once it is captured at ply=3, you make a move, I pass and greatly reduce the depth, you play again and can't recover the move and we dismiss this worthless branch with much less effort.
User avatar
hgm
Posts: 27795
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Searching worse moves first

Post by hgm »

Indeed, it is very efficient at reducing branches where one side needlessly dropped a Queen, as on most opponent move sequences you can do very many null moves before he recoups that, so that you reapmany times the reduction.

But that does not explain why you can afford the reduction, it is just the observation that reduction makes the search cheap.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Searching worse moves first

Post by bob »

hgm wrote:Indeed, it is very efficient at reducing branches where one side needlessly dropped a Queen, as on most opponent move sequences you can do very many null moves before he recoups that, so that you reapmany times the reduction.

But that does not explain why you can afford the reduction, it is just the observation that reduction makes the search cheap.
the idea is that giving up two moves in a row makes it MUCH easier to lose material, which means a shallower search should see that the null-move doesn't lose enough and still fails high, as opposed to a normal search of real moves which would also not lose enough and still fail high, but at much higher cost.

If you don't lose material after "passing" as verified by an N ply search, it is very unlikely you will lose material by not passing and doing an N+x ply search. Except when passing is the best choice of course...

This was what Beal labeled "the null-move observation".
jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: Searching worse moves first

Post by jwes »

hgm wrote:Indeed, it is very efficient at reducing branches where one side needlessly dropped a Queen, as on most opponent move sequences you can do very many null moves before he recoups that, so that you reapmany times the reduction.

But that does not explain why you can afford the reduction, it is just the observation that reduction makes the search cheap.
You can measure how well it works. In my program, null moves produce cutoffs more than half the times they are tried, and false cutoffs are less than 1/1000 of all cutoffs. YMMV.
User avatar
hgm
Posts: 27795
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Searching worse moves first

Post by hgm »

Sure. I measured something similar in my programs. So what?
User avatar
hgm
Posts: 27795
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Searching worse moves first

Post by hgm »

bob wrote:the idea is that giving up two moves in a row makes it MUCH easier to lose material, which means a shallower search should see that the null-move doesn't lose enough and still fails high, as opposed to a normal search of real moves which would also not lose enough and still fail high, but at much higher cost.

If you don't lose material after "passing" as verified by an N ply search, it is very unlikely you will lose material by not passing and doing an N+x ply search. Except when passing is the best choice of course...

This was what Beal labeled "the null-move observation".
That seems to be what I said. Losing material is tactics. The reason that it is MUCH easier to lose material is that the null move does not initiate any tactics by itself that has to be dealt with first. The opponent can make his shot immediately. Other quiet moves have a similar effect. Except that you never know beforehand which moves are quiet, so that this wisdom is of litle help. Otherwise you would just play a quiet move at reduced depth and fail high on that.

It has nothing to do with "two moves in a row". If the previous move of the opponent would also have been a null move, you could still trust your null moves that fail high to demonstrate at reduced depth that his null move was no good. And he would not have done two moves in a row in that case.
Karlo Bala
Posts: 373
Joined: Wed Mar 22, 2006 10:17 am
Location: Novi Sad, Serbia
Full name: Karlo Balla

Re: Searching worse moves first

Post by Karlo Bala »

hgm wrote:
But that does not explain why you can afford the reduction, it is just the observation that reduction makes the search cheap.
Interesting (philosophical) discussion about why we can reduce depth after the null move. For example, Berliner B* and Botvinnik algorithm (Chess and Long-Range Planning) are based on optimism (threat). The idea is to search deeper along lines where there is some tactical potential. And, how to find optimistic moves? – one way is by doing 2 moves in a row. So, we can look at the null move differently.

Null move heuristics actually extends moves that threaten something. Let me rephrase: Why do we want to extend moves that threaten something?
Best Regards,
Karlo Balla Jr.
Henk
Posts: 7218
Joined: Mon May 27, 2013 10:31 am

Re: Searching worse moves first

Post by Henk »

If there is a threat then there might be a gain (for the opponent) so the value of current evaluation might change more than average so an extension might be justified. Although an extension of three ply is too much on average.