bug?
Moderators: hgm, Rebel, chrisw
Re: bug?
(thinking out loud)
The iteration for depth 8 starts with window -143...-93. The result of it is -135.
Iteration for depth 9 starts with window -160...-110.
So the question now is if I understood it correctly: iteration 9 with that -160...-110 window, why is there a move resulting in -110.
The -110 is the result of the aspiration window;hgm wrote:Ah, OK. So the question is where the -110 score comes from in that iteration. If after "Qxa2 Rxa2 b5b4 null" a score of 110 is enough to make white's null move fail high, black must already have had a move that scored -110 for him, either as an alternative for b5b4 or Qxa2. For otherwise beta would still be at 160, and a score of 110 would not be a fail high, so that the null move would be ignored.
Code: Select all
++++START 0 15f0b8764a43cf81 r3k2r/p1p2p2/2n5/qp1Pp1pp/4P3/1QP1NPPb/P2B3P/R3K2R b KQkq - 0 18 -143/-93
info depth 8 seldepth 25 score cp -135 time 1604 nodes 128832 pv c6e7 15f0b8764a43cf81 "r3k2r/p1p2p2/2n5/qp1Pp1pp/4P3/1QP1NPPb/P2B3P/R3K2R b KQkq - 0 18"
++++START 0 15f0b8764a43cf81 r3k2r/p1p2p2/2n5/qp1Pp1pp/4P3/1QP1NPPb/P2B3P/R3K2R b KQkq - 0 18 -160/-110
info depth 9 seldepth 27 score cp -110 time 2474 nodes 199764 pv c6e7 15f0b8764a43cf81
Iteration for depth 9 starts with window -160...-110.
So the question now is if I understood it correctly: iteration 9 with that -160...-110 window, why is there a move resulting in -110.
-
- Posts: 27811
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: bug?
Indeed, for the first d=9 search. There it is a fail high, of another move than Qxa2. Nothing strange there. But the problem is in the re-search you do, with window {-160, 10000}:flok wrote:The -110 is the result of the aspiration window;
Code: Select all
++++START 0 15f0b8764a43cf81 r3k2r/p1p2p2/2n5/qp1Pp1pp/4P3/1QP1NPPb/P2B3P/R3K2R b KQkq - 0 18 -160/-110
info depth 9 seldepth 27 score cp -110 time 2474 nodes 199764 pv c6e7 15f0b8764a43cf81 "r3k2r/p1p2p2/2n5/qp1Pp1pp/4P3/1QP1NPPb/P2B3P/R3K2R b KQkq - 0 18"
++++START 0 15f0b8764a43cf81 r3k2r/p1p2p2/2n5/qp1Pp1pp/4P3/1QP1NPPb/P2B3P/R3K2R b KQkq - 0 18 -160/10000
info depth 9 seldepth 28 score cp -110 time 3507 nodes 287066 pv a5a2 15f0b8764a43cf81 "r3k2r/p1p2p2/2n5/qp1Pp1pp/4P3/1QP1NPPb/P2B3P/R3K2R b KQkq - 0 18"
Re: bug?
The one upping -160 to -110 is the first move of that first depth 9 attempt:
That node starts with -160, -110.
The first move (c6-e7) it tries is bingo:
So at the node with hash 7e70d2d4e2062ecc and fen "r3k2r/p1p1np2/8/3Pp1pp/p1P1P3/4NPPb/P2B3P/R3K2R w KQkq - 0 21" move "a1-b1" gives score 110.
Checking that 7e70d node:
Digging further, the a1b1 move is caused by a null move in 26824e7c75801bfb.
The null move is called with (110, 111).
Code: Select all
15f0b8764a43cf81, a -160 b -110 : r3k2r/p1p2p2/2n5/qp1Pp1pp/4P3/1QP1NPPb/P2B3P/R3K2R b KQkq - 0 18, black
The first move (c6-e7) it tries is bingo:
Code: Select all
trying c6-e7 3cf586c79cee9b23 -110 c6e7 9r3k2r/p1p1np2/8/qp1Pp1pp/4P3/1QP1NPPb/P2B3P/R3K2R b KQkq - 1 19
Code: Select all
info depth 9 seldepth 27 score cp -110 time 2432 nodes 199764 pv
c6e7/-110/search 15f0b8764a43cf81 "r3k2r/p1p2p2/2n5/qp1Pp1pp/4P3/1QP1NPPb/P2B3P/R3K2R b KQkq - 0 18"
c3c4/110/search 3cf586c79cee9b23 "r3k2r/p1p1np2/8/qp1Pp1pp/4P3/1QP1NPPb/P2B3P/R3K2R w KQkq - 1 19"
a5a4/-110/search 3ae7f2e982ef0378 "r3k2r/p1p1np2/8/qp1Pp1pp/2P1P3/1Q2NPPb/P2B3P/R3K2R b KQkq - 0 19"
b3a4/110/search d6dec693171db8ab "r3k2r/p1p1np2/8/1p1Pp1pp/q1P1P3/1Q2NPPb/P2B3P/R3K2R w KQkq - 1 20"
b5a4/-110/search ab12014f2581d757 "r3k2r/p1p1np2/8/1p1Pp1pp/Q1P1P3/4NPPb/P2B3P/R3K2R b KQkq - 0 20"
a1b1/110/search 7e70d2d4e2062ecc "r3k2r/p1p1np2/8/3Pp1pp/p1P1P3/4NPPb/P2B3P/R3K2R w KQkq - 0 21"
c7c6/-95/search 39ddf9b4aa0243b5 "r3k2r/p1p1np2/8/B2Pp1pp/p1P1P3/4NPPb/P6P/R3K2R b KQkq - 1 21"
d5c6/95/search 41c2b5dd22628635 "r3k2r/p3np2/2p5/B2Pp1pp/p1P1P3/4NPPb/P6P/R3K2R w KQkq - 0 22"
Checking that 7e70d node:
Code: Select all
...
move for 0x7e70d2d4e2062eccll/d2-a5: 95 (39ddf9b4aa0243b5)
move for 0x7e70d2d4e2062eccll/a1-b1: 110 (26824e7c75801bfb)
move for 0x7e70d2d4e2062eccll/a1-c1: 60 (b75512e7102cfbdf)
...
7e70d2d4e2062ecc ret with: 110 a1b1 4 r3k2r/p1p1np2/8/3Pp1pp/p1P1P3/4NPPb/P2B3P/R3K2R w KQkq - 0 21
The null move is called with (110, 111).
-
- Posts: 27811
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: bug?
Well, if c6-e7 increased alpha to -110 (which is reasonable) then it becomes best move at that point. If Qxa2 later scores also -110 it is a fail low, and thus an upper bound only. (And indeed its true score should be somewhere around -900.) It should never have been able to replace c6-e7 as best move in the root,and get played.
Re: bug?
So the root, the code around search() should only update the score if new_score > alpha?hgm wrote:Well, if c6-e7 increased alpha to -110 (which is reasonable) then it becomes best move at that point. If Qxa2 later scores also -110 it is a fail low, and thus an upper bound only. (And indeed its true score should be somewhere around -900.) It should never have been able to replace c6-e7 as best move in the root,and get played.
-
- Posts: 2929
- Joined: Sat Jan 22, 2011 12:42 am
- Location: NL
Re: bug?
The score at the root is the score for the best move. This should be an exact score, not a bound.flok wrote:So the root, the code around search() should only update the score if new_score > alpha?hgm wrote:Well, if c6-e7 increased alpha to -110 (which is reasonable) then it becomes best move at that point. If Qxa2 later scores also -110 it is a fail low, and thus an upper bound only. (And indeed its true score should be somewhere around -900.) It should never have been able to replace c6-e7 as best move in the root,and get played.
So it depends a bit on how your search is ordered. If you don't iterate over root moves in your root search, then the result of search() is just the score for the node. If that is not within bounds, you need to research with a wider window.