Null move alterative in endgames

Discussion of chess software programming and technical issues.

Moderator: Ras

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

Re: Null move alterative in endgames

Post by bob »

lkaufman wrote:[quote="bob"

This discussion makes no sense. The "null-move observation" (that giving the opponent two moves in a row is such a powerful advantage, if he can't do any damage to me, my position is effectively winning. And that advantage is so powerful, I don't need nearly as deep a search to see that his two moves can't hurt me."

What does that have to do with something other than a null-move? I am mystified...
I'm surprised that you don't see this Bob. The player who makes the reversed move has in effect made TWO null-moves, so it should be much safer to reduce than after just one null-move. I am pretty sure that this algorithm would be in every program now if for some reason null move didn't work. But I think that the concensus is that null move helps except in pawn endings, so the question here is whether this new idea is powerful enough to work even in pawn endings. I think it should be so. We should definitely test it in Komodo.[/quote]

Two null moves in a row does nothing, the way this would work. Because you don't have a case where the second can refute the first... Which is what would happen in a mutual zugzwang position. But here, I just unmake my last move. What makes that equivalent to two null-moves played on separate plies???

I don't see how it will do anything at all. Key of null move is the null-move observation + the reduced depth search needed to prove that even two consecutive moves can't damage my position...

If you think it would work, by all means try it. It just doesn't make sense to me from a theoretical or practical point of view, however.
lkaufman
Posts: 6297
Joined: Sun Jan 10, 2010 6:15 am
Location: Maryland USA
Full name: Larry Kaufman

Re: Null move alterative in endgames

Post by lkaufman »

There are two problems with null move in pawn endings. First, I may be a pawn up and under no threat, but due to zugzwang I must make a fatally damaging move. This algorithm fixes this problem, because we must make a real move, and then retract it, which almost proves that we were not in Zugzwang, because in a real Zugzwang you would scarcely be able to move back to your previous square without suffering harm.
The second problem in pawn endings is that it is not unusual to have long-term threats, simply because the kings and pawns all move one square at a time (usually). These situations have nothing to do with zugzwang; the right to pass doesn't help. Here the algorithm will sometimes do no better than null move, but it will help in cases where the side who is ahead has delaying moves available, because with this algorithm he effectively "passed" twice instead of once.
So in both cases it is much safer than null move. The only question in my mind is whether it will save enough time to be worthwhile. I don't expect a big gain from this, maybe just one elo or so. It may be too small to measure. I'll bet you could measure it in Crafty with your massive test resources.
Aleks Peshkov
Posts: 991
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia
Full name: Aleks Peshkov

Re: Null move alterative in endgames

Post by Aleks Peshkov »

lkaufman wrote:So in both cases it is much safer than null move. The only question in my mind is whether it will save enough time to be worthwhile. I don't expect a big gain from this, maybe just one elo or so.
There are positions where null-move makes impossible to find the right solution regardless of spent time. LMR and "legal null move" does not suffer from it, so they are better at least in analysis mode.
lkaufman
Posts: 6297
Joined: Sun Jan 10, 2010 6:15 am
Location: Maryland USA
Full name: Larry Kaufman

Re: Null move alterative in endgames

Post by lkaufman »

Aleks Peshkov wrote:
lkaufman wrote:So in both cases it is much safer than null move. The only question in my mind is whether it will save enough time to be worthwhile. I don't expect a big gain from this, maybe just one elo or so.
There are positions where null-move makes impossible to find the right solution regardless of spent time. LMR and "legal null move" does not suffer from it, so they are better at least in analysis mode.
You are comparing your algorithm to traditional null move. But most programs don't use null move in pawn endings. The proper comparison for pawn endings is between your algorithm and no null move. I think your idea should bring a noticeable speedup in pawn endings, at almost no cost. It might be worth 50 elo in pawn endings. Unfortunately that translates to only one or two elo in actual play. Similarly in analysis of pawn endings it may bring a noticeable benefit, but it is rare to encounter a pawn ending which a computer in analysis mode can't solve correctly.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Null move alterative in endgames

Post by bob »

lkaufman wrote:There are two problems with null move in pawn endings. First, I may be a pawn up and under no threat, but due to zugzwang I must make a fatally damaging move. This algorithm fixes this problem, because we must make a real move, and then retract it, which almost proves that we were not in Zugzwang, because in a real Zugzwang you would scarcely be able to move back to your previous square without suffering harm.
The second problem in pawn endings is that it is not unusual to have long-term threats, simply because the kings and pawns all move one square at a time (usually). These situations have nothing to do with zugzwang; the right to pass doesn't help. Here the algorithm will sometimes do no better than null move, but it will help in cases where the side who is ahead has delaying moves available, because with this algorithm he effectively "passed" twice instead of once.
So in both cases it is much safer than null move. The only question in my mind is whether it will save enough time to be worthwhile. I don't expect a big gain from this, maybe just one elo or so. It may be too small to measure. I'll bet you could measure it in Crafty with your massive test resources.
There are other issues. I make a move, you make a move, I "unmake" my last move. I just guaranteed that the score for your move will not be less than the draw score, because you can ALWAYS unmake your move too, and that is a repetition.

That is just one problem. Much more sensible, in my opinion, is to just turn null move off when the probability of zugzwang positions climbs above some threshold...
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Null move alterative in endgames

Post by bob »

Aleks Peshkov wrote:
lkaufman wrote:So in both cases it is much safer than null move. The only question in my mind is whether it will save enough time to be worthwhile. I don't expect a big gain from this, maybe just one elo or so.
There are positions where null-move makes impossible to find the right solution regardless of spent time. LMR and "legal null move" does not suffer from it, so they are better at least in analysis mode.
Two questions. If you "unmake" are you still going to do a reduced-depth (R=3 or whatever) search? If so, are you sure that unmaking a move is such a bad thing that a shallow search can prove that if the "unmaking a move" is still ok for me, I am winning?

What about the rather obvious repetition problem?

At ply=N I make a move. At N+1 you make a move. And N+2 I unmake my move. You can now instantly limit the score at N+3 to be no less than a draw score, because if you unmake your move, we have a repetition. Seems to be a problem to me.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Null move alterative in endgames

Post by bob »

lkaufman wrote:
Aleks Peshkov wrote:
lkaufman wrote:So in both cases it is much safer than null move. The only question in my mind is whether it will save enough time to be worthwhile. I don't expect a big gain from this, maybe just one elo or so.
There are positions where null-move makes impossible to find the right solution regardless of spent time. LMR and "legal null move" does not suffer from it, so they are better at least in analysis mode.
You are comparing your algorithm to traditional null move. But most programs don't use null move in pawn endings. The proper comparison for pawn endings is between your algorithm and no null move. I think your idea should bring a noticeable speedup in pawn endings, at almost no cost. It might be worth 50 elo in pawn endings. Unfortunately that translates to only one or two elo in actual play. Similarly in analysis of pawn endings it may bring a noticeable benefit, but it is rare to encounter a pawn ending which a computer in analysis mode can't solve correctly.
I still believe that because of the repetition problem it is going to hurt, not help...
User avatar
marcelk
Posts: 348
Joined: Sat Feb 27, 2010 12:21 am

Re: Null move alterative in endgames

Post by marcelk »

bob wrote: There are other issues. I make a move, you make a move, I "unmake" my last move. I just guaranteed that the score for your move will not be less than the draw score, because you can ALWAYS unmake your move too, and that is a repetition.
Only in half of the cases and only if you MAKE it a repetition. You can always flag the unmove as irreversible, this was already addressed above.
The existence of issues doesn't make an idea invalid.
That is just one problem. Much more sensible, in my opinion, is to just turn null move off when the probability of zugzwang positions climbs above some threshold...
The rule that applies here is that one good measurement means more than a thousand expert opinions. With new ideas it is best to look with an open mind at what is potentially in it instead of focussing on bears on the road. If intuition were our guide there would not be 3000+ elo engines today.

Some programs flag the null move as irreversible, as intuition dictates. Some other don't bother and don't seem to suffer...
Some programs switch off null move in the end games, as intuition dictates. Some others don't bother and don't seem to suffer...
Some programs probe EGTs in the endgame, as intuition dictates. Some others don't bother and don't seem to suffer...
Some programs have singular extensions as intuition dictates. Some others don't bother and don't seem to suffer...
Some programs have lazy evaluation, as intuition dictates. Some others don't bother and don't seem to suffer...
lkaufman
Posts: 6297
Joined: Sun Jan 10, 2010 6:15 am
Location: Maryland USA
Full name: Larry Kaufman

Re: Null move alterative in endgames

Post by lkaufman »

bob wrote:
lkaufman wrote:
Aleks Peshkov wrote:
lkaufman wrote:So in both cases it is much safer than null move. The only question in my mind is whether it will save enough time to be worthwhile. I don't expect a big gain from this, maybe just one elo or so.
There are positions where null-move makes impossible to find the right solution regardless of spent time. LMR and "legal null move" does not suffer from it, so they are better at least in analysis mode.
You are comparing your algorithm to traditional null move. But most programs don't use null move in pawn endings. The proper comparison for pawn endings is between your algorithm and no null move. I think your idea should bring a noticeable speedup in pawn endings, at almost no cost. It might be worth 50 elo in pawn endings. Unfortunately that translates to only one or two elo in actual play. Similarly in analysis of pawn endings it may bring a noticeable benefit, but it is rare to encounter a pawn ending which a computer in analysis mode can't solve correctly.
I still believe that because of the repetition problem it is going to hurt, not help...
Well, no need to speculate. Don plans to implement it tonite so I may have some results tomorrow.
lkaufman
Posts: 6297
Joined: Sun Jan 10, 2010 6:15 am
Location: Maryland USA
Full name: Larry Kaufman

Re: Null move alterative in endgames

Post by lkaufman »

bob wrote:
Aleks Peshkov wrote:
lkaufman wrote:So in both cases it is much safer than null move. The only question in my mind is whether it will save enough time to be worthwhile. I don't expect a big gain from this, maybe just one elo or so.
There are positions where null-move makes impossible to find the right solution regardless of spent time. LMR and "legal null move" does not suffer from it, so they are better at least in analysis mode.
Two questions. If you "unmake" are you still going to do a reduced-depth (R=3 or whatever) search? If so, are you sure that unmaking a move is such a bad thing that a shallow search can prove that if the "unmaking a move" is still ok for me, I am winning?

What about the rather obvious repetition problem?

At ply=N I make a move. At N+1 you make a move. And N+2 I unmake my move. You can now instantly limit the score at N+3 to be no less than a draw score, because if you unmake your move, we have a repetition. Seems to be a problem to me.
Is there any reason you can't explicitly tell the program to ignore such repetitions? Since I don't write the code myself, I don't know how difficult that will be, but I already mentioned the need for this to Don and he didn't indicate that it would be a problem for him.