Natural TB

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

Moderators: hgm, Rebel, chrisw

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

Re: Natural TB

Post by Vinvin »

bob wrote:
Laskos wrote:
Vinvin wrote:
Laskos wrote:

Code: Select all

(Avg game length = 8.915 sec)
...
Way to short to be serious. Not shorter than 5 sec/move, please !

The only difference (between Syzygy and natural) should be when there's positions with 5 pieces or less, isn't it ? Because with more than 5 pieces, they play same moves (from the WDL files).
So, natural draw instead of winning games with 5 pieces. What are these positions (if you saved games) ?
I think TBs can be tested at ultra-fast, but it's safer to test at a bit longer tc. Also, as Marco observed, the result for 6-10 men endgames is within error margins, too few games. Yes, I don't know how Natural can be in any way better than Syzygy from more than 5 pieces.

Here are examples of 5-men hard wins, I have several hundred of them, please check these. Natural fails to win copiously on many of them.

8/8/8/8/3n4/6K1/k7/2B2B2 w - -
2B5/6B1/3K4/8/8/8/2kn4/8 w - -
4B3/6n1/8/8/1K5k/8/8/6B1 w - -
8/8/8/8/8/1n6/1k3K1B/1B6 w - -
6n1/8/7k/1K6/7B/5B2/8/8 w - -
8/8/8/6Bk/8/8/K7/5Bn1 w - -
8/3BB3/8/8/4k3/1K6/5n2/8 w - -
6K1/k7/8/8/8/3n1B2/3B4/8 w - -
4k3/8/3n4/8/8/8/4B1K1/B7 w - -
8/4n3/4B3/8/8/4B3/1K6/5k2 w - -
1B3k2/8/8/8/6n1/2K5/8/7B w - -
2k2B2/8/8/8/8/8/6B1/K2n4 w - -
6B1/B3n3/8/8/8/5K2/8/1k6 w - -
3BK3/8/8/5B2/8/5k2/8/n7 w - -
8/1B6/3B4/2K5/8/4n3/2k5/8 w - -
6K1/k7/8/2n1B3/6B1/8/8/8 w - -
1K3B1k/8/8/8/8/5n2/8/5B2 w - -
Are you using a somewhat unusual definition of "copiously"??? IE does this mean easily, or quickly, or with least loss of material? I assume it does not mean that "natural fails to win when it should in many of them?"
I search in dictionaries, "copiously" means "In abundant quantity". It's not a bad word in this context.
(In French it's about the same word for the same meaning : "copieusement" )
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

Re: Natural TB

Post by Michel »

jhellis3 wrote:
But maybe I am misreading it?
Yes, the win/loss values are evaluation biased.
Yes I realize that. But I don't see how that would make the engine postpone a sacrifice to reach a TB position (if it can afford to do so without squandering the win).

I agree that it would make the engine sacrifice as little as possible to reach a TB position. Of course that is in itself already useful.
Of course, you don't have to take my word (or anyone else's :wink: ) for it. Trivial to compile and see for yourself....
Well if it really works then it should not be hard to explain the principle behind it....

PS. I see that you leave it to the hash table to treat the TB evals as bounds. That's a nice trick which makes the resolution of mate blindness even more trivial!
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
jhellis3
Posts: 546
Joined: Sat Aug 17, 2013 12:36 am

Re: Natural TB

Post by jhellis3 »

. But I don't see how that would make the engine postpone a sacrifice to reach a TB position (if it can afford to do so without squandering the win).
Because evaluation is still strongly material based, so if there is a choice between TB win A and TB win B where A doesn't involve a sac and B does, it will generally prefer A. It will also prefer mate scores over either. And because it will resolve mate scores quicker this is more likely to happen... If the alternative is just engine eval based it makes zero sense to choose that over a TB win because eval is not perfect. Now, if one had absolute assurances that the engines built in end-game heuristics would never blow a win, then you could get away with treating them equally or even biasing towards the built in heuristics. But I know for a fact some of the endgame code in SF is not perfect, so it doesn't make any sense to trust that over TBs.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Natural TB

Post by bob »

Modern Times wrote:
bob wrote: Some provide answers without fully understanding the question/problem. Ken Thompson talked about these problems in the 70's. Berliner talked about them in the 80's. We are STILL talking about them today. Just because someone _believes_ they have solved a problem does not make it so. Particularly when knowing how bright the people are/were that worked on this from the beginning, not to mention Stiller and such.
Valid points for sure, but it does not mean that there isn't a solution and that someone else won't find it in future. That is how scientific breakthroughs tend to happen.
Here's a question. How do you solve "the horizon effect"? By your explanation, it should be possible. But the ONLY solution is to either (a) search to the end of the game (impossible) or else (b) develop a 100% accurate threat recognizer so that the evaluation code is never called if there is any tactical threat available. This, too, is impossible. So there is no solution. Just as there is no solution when you have to choose between the two following cases:

(1) sacrificing your queen takes you into a won 6 piece ending, but one which is harder to win than keeping the queen on. Unfortunately, you can't search nearly deep enough to see the win with the queen kept on the board, so transitioning to the egtb win is the only winning option you can see;

(2) keeping your queen, knowing that the sac wins, and NOT knowing that keeping the queen on doesn't draw or lose.

There's not any way to solve that, nor is there any reason to spend time trying to solve it. The goal is to win the game.
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

Re: Natural TB

Post by Michel »

Because evaluation is still strongly material based, so if there is a choice between TB win A and TB win B where A doesn't involve a sac and B does, it will generally prefer A.
Yes this is perfectly clear (as I wrote in my earlier post). But the interesting situation is when the sacrifice can be postponed without sacrificing the win. I don't think your patch handles this.

As Evert was saying you could do this with a multipv search (which you would only do if you are already in a won position).

Say move 1 is a sacrifice leading to a TB won position and move 2 is a non-sacrifice where the search reveals it can still be converted into a TB win through a later sac (and not yet to a mate). Then in "natural play" you would prefer move 2. Indeed it may bring solution nearer which does not involve any sac at all.

I am not at all talking about engine heuristics here (perhaps the confusion comes from the fact I first mistakenly thought that SF's KNOWN_WIN was really a proven win but this is of course not true).
Last edited by Michel on Thu Jun 02, 2016 8:17 pm, edited 4 times in total.
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
jhellis3
Posts: 546
Joined: Sat Aug 17, 2013 12:36 am

Re: Natural TB

Post by jhellis3 »

There's not any way to solve that, nor is there any reason to spend time trying to solve it.
Because there is nothing to solve. You just created a strawman. No sane entity would take an unknown win % chance over a 100% win chance.

=======================
<personal attack removed by moderators> Please keep the discussion on a respectful level.
=======================
jhellis3
Posts: 546
Joined: Sat Aug 17, 2013 12:36 am

Re: Natural TB

Post by jhellis3 »

But the interesting situation is when the sacrifice can be postponed without sacrificing the win.
How can you know with 100% certainty you are not sacrificing the win? The only way I am aware of is mate or perfect heuristics. If you have a perfect heuristic, then you can just score it higher than the TB bonus (there is some wiggle room). But that would require modifying SF's code and painstakingly validating each individual heuristic. If you want to invest that time, it is certainly doable. But I am satisfied with the results I have achieved.
I am not at all talking about engine heuristics here
You have to be. There are only 3 sources of Eval: heuristics, mate, TBs. Mate is preferred over TBs so the only thing left is either general eval (a heuristic) or specific end-game heuristics.... either way....
Then in "natural play" you would prefer move 2.
Which is exactly what the code does... I don't understand your confusion here?
Last edited by jhellis3 on Thu Jun 02, 2016 8:19 pm, edited 1 time in total.
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

Re: Natural TB

Post by Michel »

Which is exactly what the code does... I don't understand your confusion here?
Ok can you explain then why your code would prefer the later sac over the immediate sac? Assuming that they both lead to the same type of TB position?
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
jhellis3
Posts: 546
Joined: Sat Aug 17, 2013 12:36 am

Re: Natural TB

Post by jhellis3 »

Ok can you explain then why your code would prefer the later sac over the immediate sac
Sorry I didn't see the second move was also a sac.

Now if the end positions evaluate exactly the same it will obviously pick the quicker path to the TBs because there is less chance you have pruned something on the path there.... And this is obviously natural behavior for any entity, because there is no point in delaying an equally good win.

However, by delaying the sac and remaining material up there is the chance that the position can be further improved making the secondary sac either not needed or of a less severe nature or possibly even seeing mate, in which case there is a good chance it will go for option 2.

But I strongly disagree that move 2, in your scenario, is natural at all given the eval after the sac is exactly the same. No sane entity is going to say well I can win this way in 2 moves, or I can win the exact same way in 20 moves and choose the 20...
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

Re: Natural TB

Post by Michel »

But I strongly disagree that move 2, in your scenario is natural at all, given the eval after the sac is exactly the same. No sane entity is going to say well I can win this way in 2 moves, or I can win the exact same way in 20 moves and choose the 20...
Ok it seems we have reached some kind of agreement on what your patch does exactly. Quite a lot actually for only a few lines of code!

About naturalness of move 2. The point is that by not playing the immediate sacrifice (and doing some other useful move instead) you may bring a win nearer which may ultimately not involve any sacrifice at all. I guess humans would then regard the actual game play as more natural.

But I have no strong feelings about this. As many people have said already it doesn't make much sense to invest a lot of effort in winning an already won game in a slightly nicer way (and the meaning of nicer here is debatable anyway).
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.