EMR based on Null Move threat

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

EMR based on Null Move threat

Post by Michael Sherwin »

A Null Move is tried and failed to cut. We are now starting to iterate through the moves to search deeper. If we are in an early move before LMR and depth is deep enough we can make that move and do a qsearch. If the qsearch returns a score >= beta then the move is a possible solution to the Null Move threat. Reduce the search by a number of ply. Here it is so far in my test.

Code: Select all

      if(reduce == 1) { // no LMR
        if(didNull && depth > 3) {
          qscore = -CaptSearch(-beta, -beta + 1);
          if(qscore >= beta) reduce += 2;
        }
        g->node->score = -Search(-beta, -alpha, depth - reduce, extendBy);
      } else {
        g->node->score = -Search(-alpha - 1, -alpha, depth - reduce, extendBy);
        if(g->node->score > alpha)
          g->node->score = -Search(-beta, -alpha, depth - 1, extendBy);
      }
The results are looking very good so far! :D
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
PK
Posts: 893
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: EMR based on Null Move threat

Post by PK »

Interesting. One thing is worth noting: didNull implies that all the usual conditions for applying null move were met (like not being in check, and possibly eval > beta, depending what you use). It might be useful to refrain from your reduction when a move gives check.

Alternative solution would be to increase existing late move reduction under the same conditions.
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: EMR based on Null Move threat

Post by hgm »

I think this subverts the entire idea of null move. The reason that you can reduce the null move compared to the normal search depth is based on the assumption that the normal search will start with some delaying tactic that postpones any threat 2 ply. What you are doing here is confirm that you indeed have a delaying tactic by trading some valuable piece, and which thus would push the threat that made null move fail low over the horizon, and then reduce anyway rather than extending the horizon (copmpared to the null move search).
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: EMR based on Null Move threat

Post by Michael Sherwin »

hgm wrote:I think this subverts the entire idea of null move. The reason that you can reduce the null move compared to the normal search depth is based on the assumption that the normal search will start with some delaying tactic that postpones any threat 2 ply. What you are doing here is confirm that you indeed have a delaying tactic by trading some valuable piece, and which thus would push the threat that made null move fail low over the horizon, and then reduce anyway rather than extending the horizon (copmpared to the null move search).
The reason that you can reduce null move is because you are giving the opponent two moves in a row to see how much damage can be done. If that damage does not bring score < beta then a beta-cut can be made. Null move is not safe as it brings the horizon closer. However, the extra depth gained in the search more than makes up for that.

If null move fails to cause a cut that means that there is an immediate threat found at the reduced depth of search. As long as you search the "solution" move to the same depth the horizon is the same as in the null move search. I chose a reduction of two additional ply as that is the minimum r_value in null move searching. So the horizon for the "solution" search is often further away than it was in the null move search.

Okay, I can understand that if the "solution" move is a capture that must be met by a capture then that can push the null move threat past the horizon. So maybe do not reduce if the "solution" move is a capture.
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
Gerd Isenberg
Posts: 2250
Joined: Wed Mar 08, 2006 8:47 pm
Location: Hattingen, Germany

Re: EMR based on Null Move threat

Post by Gerd Isenberg »

Sounds like threat reduction rather than (mate) threat extension!

Null Move was refuted by a threat move.
But early (first?) move is not refuted by a capture in qsearch -> reduce early move
(may be there is no good capture, possibly also not considering the quiet (mate) threat move that refuted null move)

Is that the right interpretation of your idea?
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: EMR based on Null Move threat

Post by Michael Sherwin »

Null Move was refuted by a threat move.
TRUE
But early (first?) move is not refuted by a capture in qsearch -> reduce early move
TRUE
Is that the right interpretation of your idea?
YES
(may be there is no good capture, possibly also not considering the quiet (mate) threat move that refuted null move)
There can be a quiet move though it should be discovered in the reduced search as it was found in an even more reduced null move search. However, maybe a mate threat should not be reduced! :D
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
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: EMR based on Null Move threat

Post by Michael Sherwin »

PK wrote:Interesting. One thing is worth noting: didNull implies that all the usual conditions for applying null move were met (like not being in check, and possibly eval > beta, depending what you use).
YES
It might be useful to refrain from your reduction when a move gives check.
If the "solution" move gives check and checks give extensions then the horizon distance is mitigated somewhat.
Alternative solution would be to increase existing late move reduction under the same conditions.
That was the next thing that was in the test que. :)
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
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: EMR based on Null Move threat

Post by Michael Sherwin »

As an amusing corollary I am programming with too little sleep. I rolled back the edits and made some changes but I forgot to add the didNull condition back in.

Code: Select all

      if&#40;reduce == 1&#41; &#123;
        if&#40;depth > 3 && cid == EMPTY&#41; &#123;
          qscore = -CaptSearch&#40;-beta, -beta + 1&#41;;
          if&#40;qscore >= beta&#41; reduce += 2;
        &#125;
        g->node->score = -Search&#40;-beta, -alpha, depth - reduce, extendBy&#41;;
      &#125; else &#123;
        inShort++;
        g->node->score = -Search&#40;-alpha - 1, -alpha, depth - reduce, extendBy&#41;;
        inShort--;
        if&#40;g->node->score > alpha&#41;
          g->node->score = -Search&#40;-beta, -alpha, depth - 1, extendBy&#41;;
I was going to end the test, but:

RomiChess - Yace : 15.0/25 11-6-8 (=1=1011001=1=01==11=1010=) 60% +70

So now I have to let this match conclude to see if my accidental 'new idea' is worth keeping.
:lol:
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
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: EMR based on Null Move threat

Post by hgm »

Michael Sherwin wrote:If null move fails to cause a cut that means that there is an immediate threat found at the reduced depth of search. As long as you search the "solution" move to the same depth the horizon is the same as in the null move search.
That is the point. The horizon is the same. But because you can now play a real move you can use that to postpone the cashing of the threat, by playing a delaying tactic. (E.g. you trade Queens. He has to recapture rather than what he did against the null move.) So you need more depth to see the same threat.

It also seems bad that you don't even do a research at full depth when the reduced search of an early move fails high.
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: EMR based on Null Move threat

Post by Michael Sherwin »

I plan to add the research to see if it makes a difference. But first I need some results to test against.
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