Without the null move observation

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Without the null move observation

Post by hgm »

Gerd Isenberg wrote:.., assuming a simple evaluation (material only + psq) not aware of tempo:
Well, common wisdom has it that 3 tempi are worth a pawn. (Although that might only be true in the opening, and tail off later.)

Now let me ask a question to all engine programmers:

Suppose you were asked to modify your engine to play a Chess variant where null-moving is legal, and every three null moves you make would give you a Pawn in hand, which you would be allowed to drop at any later time on any empty square on your 2nd rank, in stead of an ordinary move.

That should fully (and perhaps over-)compensate the average disadvantage a null move would normally have. So do we all agree that this totally invalidates the NMO?

Now what changes would you make in your QS code to repair it for the NMO becoming invalid? And how would you change your evaluation?
Gerd Isenberg
Posts: 2250
Joined: Wed Mar 08, 2006 8:47 pm
Location: Hattingen, Germany

Re: Without the null move observation

Post by Gerd Isenberg »

hgm wrote:
Gerd Isenberg wrote:.., assuming a simple evaluation (material only + psq) not aware of tempo:
Well, common wisdom has it that 3 tempi are worth a pawn. (Although that might only be true in the opening, and tail off later.)

Now let me ask a question to all engine programmers:

Suppose you were asked to modify your engine to play a Chess variant where null-moving is legal, and every three null moves you make would give you a Pawn in hand, which you would be allowed to drop at any later time on any empty square on your 2nd rank, in stead of an ordinary move.

That should fully (and perhaps over-)compensate the average disadvantage a null move would normally have. So do we all agree that this totally invalidates the NMO?

Now what changes would you make in your QS code to repair it for the NMO becoming invalid? And how would you change your evaluation?
Hehe, that is interesting - three consecutive null moves? May be with four moves in a row I will mate you or at least get some heavy wood, but need to be carefull to don't get mated or forked by the pawn you may drop after three nulls.

I tend to agree standing pat in general is not necessarily related to NMO. But in Chess, with a none tempo aware eval, i.e. in pawn endings, races of passers or rule of the square issues, it is.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Without the null move observation

Post by hgm »

Gerd Isenberg wrote:Hehe, that is interesting - three consecutive null moves? May be with four moves in a row I will mate you or at least get some heavy wood, but need to be carefull to don't get mated or forked by the pawn you may drop after three nulls.
I did not say 'consecutive'! And even then, I would of course not have to announce my moves in advance. For any sequence of 3 non-null moves I would probably be mated if I were to specify them in advance. You remember that famous correspondence game, where the black player after 1. d4 specified

1... g6 2. any Bg7?

The white player of course played

2. Bh6!! Bg7 {as committed} 3. Bxg7! f6 4. Bxh8!

for an easy 1-0. And neither g6 nor Bg7 were null moves...

But what I meant was just accumulating the null moves during the game, like you count checks in the ICS variant 'threechecks' (until the third check you give decides the game in your favor). An immediate win would of course be to big an award for something that can be acheived as easily as 3 null moves, but if people think 1 Pawn for 3 null moves is not enough to make the null move attractive, we could up the award. I am pretty sure that with a pawn-in-hand for every single null move, the null move would virtually always be the best move in tactically quiet positions. Interesting thing is, though, that with only null moves you would never win.
I tend to agree standing pat in general is not necessarily related to NMO. But in Chess, with a none tempo aware eval, i.e. in pawn endings, races of passers or rule of the square issues, it is.
I don't see how that means anything. Excluding the cases where X is not true, guess what??? X is always true! Big deal...

Especially since you seem to exclude cases where the NMO is perfectly valid. Surely in a rule-of-the-squares situation null-moving will be a very unattractive option...

But I must admit I also did not understand why you posted the Beal quote. What does eval being identical before and after the null move have to do with stand pat or with NMO? Non-null moves could still have arbitrarily high or low scores even in case of a perfectly symmetric eval. And whether the eval is symmetric or completely asymmetric, I could still return it for a stand pat...
Last edited by hgm on Fri Jan 13, 2012 1:40 pm, edited 1 time in total.
User avatar
Desperado
Posts: 879
Joined: Mon Dec 15, 2008 11:45 am

Re: Without the null move observation

Post by Desperado »

Well, all we do is discussing about subtle definitions.
So here are some given by me. Everyone can decide for himself,
what he thinks is useful.

a:
===

BTS = branch termination scheme

Standpat = to decide a handle a situation like it is

NMO = nullmove observation = at least one real move is better than the nullmove

B:
===

Now, building a condition _implicits_ that we dont take
the situation as it is. Therefore the "term" standpat
is wrong for what we do in QS.
The BTS used in QS is based on the NMO, and it requires
a condition. That leads to the conclusion:

BTS on standpat principle != BTS on NMO

C:
===

So an implication of a condition combined with the "term" standpat
is a conflict in itself, depending on definitions of course.

There isnt any problem i see to handle all this in practice.
The only thing, what i want to point out is that we mixing the meaning
of the terms we use, like:

1: sum = a ^ b (wrong)
2: sum = a + b (ok)
3: power = a ^ b (ok)

Best regards, Michael
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Without the null move observation

Post by hgm »

Desperado wrote:Now, building a condition _implicits_ that we dont take
the situation as it is.
I don't see that at all. I will take some positions as the are, and will stand pat only in those positions. Other positions I won't take as they are, and I won't stand pat there (but play a capature in stead).

It could be that you fail to make the distiction between doing something, and thinking about whether you should do it. The conditional is part of the thinking process. The engine has the choice between standing pat or playing a capture. Eventually it will do one or the other, and the conditional has disappeared out of the equation once the decision has been taken. But an engine 'thinks' by exhaustive search: to decide whether it should stand pat or capture, it first calculates what happens when it would stand pat, then what would happen when it captures, and then make a choice which it likes better. Then finally it does one or the other.
Therefore the "term" standpat
is wrong for what we do in QS.
The BTS used in QS is based on the NMO, and it requires
a condition.
This is totally at odds with the meaning that has been established for 'stand pat' in the past 30 years.

But, more importantly: that conventional QS uses a condition is obvious, but I still don't understand why you say it is based on NMO. What do you mean by 'based on'? Isn't that the same as saying: "When the NMO would not hold, we could not use this BTS"? If so, please answer my question about QS for the 'NMO-free' Chess variant I posed above. If not, what do you mean by it???
Gerd Isenberg
Posts: 2250
Joined: Wed Mar 08, 2006 8:47 pm
Location: Hattingen, Germany

Re: Without the null move observation

Post by Gerd Isenberg »

hgm wrote: I did not say 'consecutive'!
Therefor I asked.
hgm wrote:Especially since you seem to exclude cases where the NMO is perfectly valid. Surely in a rule-of-the-squares situation null-moving will be a very unattractive option...

But I must admit I also did not understand why you posted the Beal quote. What does eval being identical before and after the null move have to do with stand pat or with NMO?
Because of the connection of NMO and standing pat in QS in Chess, imho. If doing nothing is good enough to refute your moves at the horizon, due to NMO this is most often correct with more reliable scores backed up to the root. Without the NMO for instance with purely random evaluation, your static eval might be too optimistic and erroneous rather than a "standing pat" lower bound or cutoff in QS.
hgm wrote:Non-null moves could still have arbitrarily high or low scores even in case of a perfectly symmetric eval. And whether the eval is symmetric or completely asymmetric, I could still return it for a stand pat...
For your game, I would think about a the quiescence definition and search and probably use a more pessimistic static evaluation aware of threats with a SUPERSOMA approach in mind.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Without the null move observation

Post by hgm »

Gerd Isenberg wrote:Because of the connection of NMO and standing pat in QS in Chess, imho. If doing nothing is good enough to refute your moves at the horizon, due to NMO this is most often correct with more reliable scores backed up to the root. Without the NMO for instance with purely random evaluation, your static eval might be too optimistic and erroneous rather than a "standing pat" lower bound or cutoff in QS.
I guess this begs indeed a clarification of the definition of 'stand pat': is it returning the current (generally tempo-aware) evaluation, or is it returning that evaluation for the opponent (or perhaps the average of the two)?

I am not aware of any engine that would return the score for the opponent (i.e. after null move) in QS. And I am pretty sure all these authors still consider what they are doing a regular stand-pat. So can we agree that 'stand pat' means returning the evaluation with your own side to move, with possible tempo-dependent terms (such as the rule of squares) in it?
hgm wrote:For your game, I would think about a the quiescence definition and search and probably use a more pessimistic static evaluation aware of threats with a SUPERSOMA approach in mind.
Well, to pre-empt the purists, who would (justly) claim a null move that earns you some rights is not truly a null move, I will have to adapt the rules a little. So let's say that for every third non-capture you play, you must delete a Pawn from your own hand (or when that is not possible, give the opponent one in hand). Then there is no need to actually allow null moving in the game either. This should make non-captures sufficiently unattractive compared to a true null move (i.e. just switching side to move).

Actually I don't think it would require any change in QS at all (you would still want to accurately the outcome of tactics, and the captures have no side effects, so QS will be as accurate as always), and the eval only very little. Of course you would count Pawns in hand as material (but at about the same value as on-board Pawns, as the possibilities to drop them are so limited), but as you know that in the real game the number of non-captures for both side will approximately balance, (there are already plenty other reasons why you would not want your opponent to make many more captures than you do...), there is no great need to depreciate non-captures. Just add some 33 cP to all piece values. And perhaps a term that awards you how much closer you are to getting the next Pawn than your opponent is (which will obviously be a tempo-dependent term).
Gerd Isenberg
Posts: 2250
Joined: Wed Mar 08, 2006 8:47 pm
Location: Hattingen, Germany

Re: Without the null move observation

Post by Gerd Isenberg »

hgm wrote: I am not aware of any engine that would return the score for the opponent (i.e. after null move) in QS. And I am pretty sure all these authors still consider what they are doing a regular stand-pat.
Guess Don Beal used it in BCP, as described in his General QS paper in 1989/90/99. Don Dailey discussed this as well, may be it is used in Komodo?

Don Beal's QUISCE in Pseudo C ("The Nature of Minimax Search" page 108):

Code: Select all

int QUISCE (int lower, int upper) {
   makenull();
   int bestv = -evaluate(-upper, -lower);
   unmakenull();
   for each move m do {
      if ( bestv >= upper ) return bestv;
      make(m);
      bestv = max (bestv, -QUISCE(-upper, -lower));
      unmake(m);
   }
   return bestv;
}
The reader may have already noticed that QUISCE, when using material balance as the evaluation function, will search all (or potentially all) moves at nonterminal nodes - not merely capture moves - despite an earlier claim that this quiescence mechanism would produce a capture tree. What will happen is that noncaptures will indeed be searched by QUISCE, but will always terminate after a cut-off after the null move at the next ply. The single ply of search-and-reject behavior for all noncaptures creates a 1-ply 'fringe' around a capture tree skeleton. The fringe could be optimized away in an implementation specialized to a capture search. The essential requirement for optimizing away the fringe for QUISCE is that an incremental change to the evaluation function can be computed without actually making the move ...
hgm wrote: So can we agree that 'stand pat' means returning the evaluation with your own side to move, with possible tempo-dependent terms (such as the rule of squares) in it?
Yes, that is what most do, specially with passers, rule of the square, with the decisive tempo involved.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Without the null move observation

Post by hgm »

Code: Select all

int QUISCE (int lower, int upper) {
   makenull();
   int bestv = -evaluate(-upper, -lower);
   unmakenull();
   for each move m do {
      if ( bestv >= upper ) return bestv;
      make(m);
      bestv = max (bestv, -QUISCE(-upper, -lower));
      unmake(m);
   }
   return bestv;
}
Interesting BTS. But I guess that with the evaluation being purely material (and not even PST), the distinction between own eval and minus opponent eval is only a formal one. Even with PST (which would not yet break eval symmetry) I don't see how this converges. Many non-captures could get enough PST points to push them above alpha, so that the null-move reply would not fail high at all...

I would be surprised if this engine was very strong!
Gerd Isenberg
Posts: 2250
Joined: Wed Mar 08, 2006 8:47 pm
Location: Hattingen, Germany

Re: Without the null move observation

Post by Gerd Isenberg »

hgm wrote:

Code: Select all

int QUISCE (int lower, int upper) {
   makenull();
   int bestv = -evaluate(-upper, -lower);
   unmakenull();
   for each move m do {
      if ( bestv >= upper ) return bestv;
      make(m);
      bestv = max (bestv, -QUISCE(-upper, -lower));
      unmake(m);
   }
   return bestv;
}
Interesting BTS. But I guess that with the evaluation being purely material (and not even PST), the distinction between own eval and minus opponent eval is only a formal one. Even with PST (which would not yet break eval symmetry) I don't see how this converges. Many non-captures could get enough PST points to push them above alpha, so that the null-move reply would not fail high at all...

I would be surprised if this engine was very strong!
At least Don Beal experimented with generalized Null move QS inside his Z8000 BCP framework, and reported good results in WAC in his paper, better than BELLE ;-)
Another quote from his paper:
Also note that the function evaluate could itself be a search. Thus to obtain a second-order null-move quiescence search, QUIESCE1 would be defined with evaluate = material balance, QUIESCE2 would be defined with evaluate = QUIESCE1.
Image

Code: Select all

[Event "4th World Computer Chess Championship"]
[Site "New York, USA"]
[Date "1983.10.22"]
[Round "1"]
[White "Cray Blitz"]
[Black "BCP"]
[Result "1-0"]

1. e4 c5 2. Nf3 Nf6 3. e5 Nd5 4. Nc3 e6 5. Nxd5 exd5 6. d4 Nc6 7. dxc5 Bxc5 8. Qxd5 Qb6 9. Qd2 O-O 10. Bc4 Re8
11. O-O Nxe5 12. Nxe5 Rxe5 13. Qf4 Qf6 14. Qxf6 gxf6 15. Kh1 d5 16. f4 Rh5 17. Be2 Rh4 18. Bf3 d4 19. g3 Rh3
20. f5 Kg7 21. Kg2 Rh6 22. Bxh6+ Kxh6 23. Bd5 Kg7 24. Rad1 a5 25. Kh1 Ra6 26. Be4 b5 27. Rfe1 Bd7 28. Rd2 Bc6
29. Bxc6 Rxc6 30. Re8 Bb6 31. Rb8 b4 32. Rb7 Kf8 33. Re2 Bc7 34. g4 Rc5 35. Ra7 Bb6 36. Ra6 Rc6 37. Rd2 Rd6
38. Rd3 Kg7 39. c3 Kg8 40. a4 Kg7 41. cxb4 axb4 42. a5 Bc5 43. Rxd6 Bxd6 44. Rxd4 Bc5 45. Rd5 Be3 46. Rd3 Bc5
47. Rd7 Be3 48. a6 h5 49. gxh5 Kf8 50. Rd3 Bc5 51. Rg3 Ke8 52. h6 Bd6 53. a7 Ke7 54. Rd3 Bc7 55. a8=Q Bd6
56. h7 b3 57. Qb7+ Ke8 58. h8=Q+ Bf8 59. Qe4# 1-0