Uri, repeat after me:Uri Blass wrote:Note only that you do not need depth 8/9 to see that Qxb6 does not win a piece and clearly smaller depth is enough.bob wrote:Whatever you do, there are problems to solve. Here's one that is pretty common:gladius wrote:I'm not sure what you mean here. I don't re-search just that move, so if there is a better move than the one that failed low, I will find it. It's not possible to have a fail low again as my window is -infinity. By "rarely", I meant, it should never happen unless there is less than 1% of game time left. Now, this raises the question of whether it is good to always burn the extra time on fail low re-searches, but a lot of strong programs seem to do something similar.bob wrote:Unfortunately that is a _really_ bad idea. How do you know that move is not even worse at this depth? As for it happening rarely, I'll simply point out that it takes just one bad move to lose a game. Over 40-60 moves this will likely happen at least once, and that's all you need to lose that game.gladius wrote: If I run out of time on the fail-low re-search I will play the move that did not fail low, which is typically from currentPly - 2. However, I have some heuristics in time management which give a fail low re-search more time to complete, so this happens rarely.
Ok, I'll give this another try and see if I can get better results than my last test. I probably just used bad window values.bob wrote:yes I do. Classic case is a position where you are winning, but there are lots of ways to lose by getting checkmated. You are at +2, but you can only keep one of the two pawns when you analyze with a deep search. So the real score is going to be around +1. If you drop alpha to -infinity, suddenly you have to search all those forced checkmates against you, burning a ton of time, while if you dropped by one pawn, you would get the true score and still prune any mates against you...
It is easy enough to test the idea, I did and I am using it today. Used it in Cray Blitz 20 years ago as well...
You start a search and until you get very deep you think you are winning some major material advantage. But as you near the end of the search time limit, you discover your opponent didn't really make a blunder like you had thought, and instead of winning a pawn or something, it is really just an even position. But you _thought_ you were winning a pawn, and so finally dropping back to nearly even is a fail-low condition. Using extra time here to try to save that pawn is two-edged. Perhaps you can save it, so that the time used will be well-spent. But more often, especially against computers, you really can't save it, and the extra time used is just wasted.
This is really interesting part of controlling the search, just how much time should you use on any single move?
Here is a cute position that shows the opposite type of problem:
5r1k/6p/1n2Q2p/4p//7P/PP4PK/R1B1q/ w - - 0 1
This was a position reached in Cray Blitz (white) vs Belle (black) at the 1981 ACM computer chess tournament. We were having to run in a "batch mode" because our primary computer was down, which meant (a) no pondering at all; and (b) very shallow searches.
In this position, white is tempted to play Qxb6, which looks like it wins a knight, until you get to depth 8/9 or so. Which we could easily reach back then, but not in "batch mode". The correct move is Bxh6 which leads to a forced draw.
If you use a "that is an easy move" type early search termination, on slow enough hardware, you could conclude that Qxb6 is an obvious move and that your opponent hung a knight. If you search normally, you would discover that Qxb6 loses and that Bxh6 forces a draw by repetition.
So either way, stopping early on easy moves or going longer on harder moves can get you into trouble if you do them at the wrong time or for the wrong reason.
"all plies are _not_ created equal".
Once you get that point, you will stop making posts like this one. We have seen _thousands_ of positions posted here where program A needs M plies, program B needs N plies and program C needs Q plies.
So, exactly what is your point. Here is Crafty's output, which is just as legitimate as any other program you quoted above:
Code: Select all
depth time score variation (1)
1 0.00 5.13 1. Qxb6 (19Knps)
1-> 0.01 5.13 1. Qxb6 (22Knps)
2 0.01 4.90 1. Qxb6 Rf2(22Knps)
2-> 0.01 4.90 1. Qxb6 Rf2(47Knps)
3 0.01 5.09 1. Qxb6 Rf2 2. Be3 Qxa1 3. Bxf2 Qxa2
3-> 0.02 5.09 1. Qxb6 Rf2 2. Be3 Qxa1 3. Bxf2 Qxa2
4 0.02 5.16 1. Qxb6 Rf2 2. Qd8+ Kh7 3. Kg3
4-> 0.02 5.16 1. Qxb6 Rf2 2. Qd8+ Kh7 3. Kg3
5 0.03 5.23 1. Qxb6 Rf1 2. Qd8+ Kh7 3. Qd3+ Kh8
4. b4
5-> 0.03 5.23 1. Qxb6 Rf1 2. Qd8+ Kh7 3. Qd3+ Kh8
4. b4
6 0.03 -1 1. Qxb6 (329Knps)
6 0.03 -3 1. Qxb6 (378Knps)
6 0.03 -M 1. Qxb6 (414Knps)
6 0.04 -0.46 1. Qxb6 Rf1 2. Qd8+ Kh7 3. Qd3+ e4
4. Qxf1 Qxf1
6 0.04 -0.37 1. Bxh6 Qxa1 2. Qxb6 Qxa2 3. Qd6 Rf6
6 0.04 0.90 1. Qe7 Rf1 2. Qd8+ Kh7 3. Qd3+ Kh8
4. Qg3
6-> 0.06 0.90 1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Kg8 6. Qe8+ Kh7
7. Qh5+ Kg8
It then realizes it is not winning, but still thinks Qb6 is best through depth 7. No guesswork, no speculation, just a real search result. Takes a tenth of a second to figure out that Qb6 is not so good...
All of this depends on the program. Cray Blitz needed 7 plies to find the draw, but it did not get anywhere near that due to the conditions we were running it under.
depth 5 is enough for free fruit and free glaurung and even old crafty can see at depth 6 that Qxb6 is bad(but needs depth 9 to find Bxh6)
And _none_ of this was the point. This was about trying to decide whether to use more time when in trouble or not, and whether to use less time on "obvious" moves or not.
It was an example, nothing more, nothing less...
BTW it took Glaurung to depth 8 to get rid of the losing move, which just shows that plies mean different things to different programs...
New game
[d]5r1k/6p1/1n2Q2p/4p3/8/7P/PP4PK/R1B1q3 w - - 0 1
Analysis by Fruit 2.1:
1.Qe6xb6
+- (3.46) Depth: 1/1 00:00:00
1.Qe6xb6 Rf8-f2 2.Qb6-d8+ Kh8-h7
+- (3.11) Depth: 2/8 00:00:00
1.Qe6xb6 Rf8-f2 2.Bc1-e3 Qe1xa1 3.Be3xf2 Qa1xa2
+- (3.17) Depth: 3/8 00:00:00
1.Qe6xb6 Rf8-f1 2.Qb6-d8+ Kh8-h7 3.Qd8-d3+ e5-e4
+- (3.16) Depth: 4/10 00:00:00
1.Qe6xb6 Rf8-f1 2.Qb6-d8+ Kh8-h7 3.Qd8-d3+ e5-e4 4.Qd3xf1 Qe1xf1
-+ (-1.48) Depth: 5/17 00:00:00
1.Bc1xh6 Qe1xa1 2.Qe6-g6 Rf8-f7 3.Qg6xf7 g7xh6
µ (-0.79) Depth: 5/23 00:00:00
New game
5r1k/6p1/1n2Q2p/4p3/8/7P/PP4PK/R1B1q3 w - - 0 1
Analysis by Glaurung 2.0.1:
1.Qe6xb6 e5-e4
+- (4.72) Depth: 2 00:00:00
1.Qe6xb6 Rf8-f2 2.Qb6-d8+ Kh8-h7
+- (4.74) Depth: 3 00:00:00
1.Qe6xb6 Rf8-f1 2.Qb6-d8+ Kh8-h7 3.Qd8-d3+ e5-e4
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