Natural TB

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

Re: Natural TB

Post by Michel »

Michel wrote:
Probably the only thing that would work is going to multipv = 2 in such a situation...
Or perhaps more generically, not raising alpha at root when a move returns TBwin and beta=>TBwin?

It seems hard to justify this theoretically though...
That description is of course too simplistic. I am assuming a simple aspiration search where the root window is just made bigger on fail high/low. SF does more funky stuff.
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
syzygy
Posts: 5563
Joined: Tue Feb 28, 2012 11:56 pm

Re: Natural TB

Post by syzygy »

Michel wrote:
Probably the only thing that would work is going to multipv = 2 in such a situation...
Or perhaps more generically, not raising alpha at root when a move returns TBwin and beta=>TBwin?

It seems hard to justify this theoretically though...
Once the game has been won (TBwin returned) one can of course afford any luxury, theoretically sound or not.

Doing it only at the root is only a partial solution. It should be done at every PV node. We don't want to see Qxf6 halfway the PV, I suppose...
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

Re: Natural TB

Post by Michel »

Doing it only at the root is only a partial solution. It should be done at every PV node. We don't want to see Qxf6 halfway the PV, I suppose...
Well such a line would still return TBwin at root. So alpha would not be raised.
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

Re: Natural TB

Post by Michel »

Michel wrote:
Doing it only at the root is only a partial solution. It should be done at every PV node. We don't want to see Qxf6 halfway the PV, I suppose...
Well such a line would still return TBwin at root. So alpha would not be raised.
I guess the line could be good. So probably doing things in deeper PV nodes would be better. If it does not lead to search explosion.
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Natural TB

Post by hgm »

Note that PROBE_OFF does not mean you should entirely go without probing. Probes with the 'wrong' result (i.e. draws or losses for the side with the proven win) can of course be used to immediately cut off the branch. Probes with the desired result to inferior tables should be ignored, however. And probes to superior tables with the desired result should only lead to an immediate cutoff if they specify a win for the side to move. Not if they specify a loss. Otherwise you would still cut after Qxf6 if you had 7-men tables, as KQRRKBB is superior to KQRRKBBN. But since the opponent will use its turn to recapture Kxf6, by the time it is your move you will be in KRRKBB, which is inferior to KQRRKBBN, so that the winning probe will be ignored.

So the only effect of PROBE_OFF should be
* ignore TB wins for the winning side in inferior tables
* ignore TB losses for the losing side when that side is to move

If you also probe in QS, the second case should affect the stand-pat score, however, as stand-pat would leave us in the superior table.

So the PROBE_OFF state actually involves remembering who is the winning side, and what is considered inferior.
syzygy
Posts: 5563
Joined: Tue Feb 28, 2012 11:56 pm

Re: Natural TB

Post by syzygy »

hgm wrote:So the PROBE_OFF state actually involves remembering who is the winning side, and what is considered inferior.
And that is a lot of code to get right...

Already writing down a formal definition of "inferior" seems pretty tricky. What do you compare it to? Exchanging into KNNvKP might be excellent and it might be silly, depending on the "stable" position where the side having the advantage gets to make the choice of how to continue.
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Natural TB

Post by hgm »

Doesn't look very complex to me:

Code: Select all

int winning, rootMaterial;

Search(...)
{
  score = ProbeEGT();

#ifdef NATURAL
  if(score == TB_WIN) {
    if&#40;stm == winning && material < rootMaterial&#41; score = MISS;
  &#125; else if&#40;score == TB_LOSS&#41;
    if&#40;xstm == winning&#41; score == MISS;
  &#125;
#endif

  if&#40;score != MISS&#41; return score;
  // normal search
  ...
&#125;
You just remember the material evaluation in the root. PROBE_ON is achieved by setting winning = NONE, which reduces the above code to a no-op. For PROBE_OFF you set 'winning' to the side-to-move in the root. That will ignore all winning EGT probes in tables with material inferior to that in the root when the winning side has the move, and ignore all losing EGT probes when the losing side has themove (because the loss might be based on an immediate conversion to an inferior table, even if at the moment the material is superior). This is needed to avoid Sactifices of the Q x protected N type, which lead to a superiorwin before the recapture.

That will suppress
User avatar
Nordlandia
Posts: 2821
Joined: Fri Sep 25, 2015 9:38 pm
Location: Sortland, Norway

Re: Natural TB

Post by Nordlandia »

How to update my Syzygy to Natural TBs?

Please :oops:
Vinvin
Posts: 5228
Joined: Thu Mar 09, 2006 9:40 am
Full name: Vincent Lejeune

Re: Natural TB

Post by Vinvin »

Nordlandia wrote:How to update my Syzygy to Natural TBs?

Please :oops:
The files don't change.
It's the program who search the positions in a different manner.
User avatar
Nordlandia
Posts: 2821
Joined: Fri Sep 25, 2015 9:38 pm
Location: Sortland, Norway

Re: Natural TB

Post by Nordlandia »

It is possbile to precatch 5-Men into RAM before game/analyze.

type C:\wdl345\*.rtbw > NUL

http://pastebin.com/bKYqyEDY