hgm wrote:Well, this then explains why other engines do not have similar problems. I once did this accidentally, and it was very destructive. I would also not expect it to be a good idea. For one, it is illogical to make the searching of a move dependent on if you happen to have a hash hit or not. If the bound type makes the score valid, you would have a hash cut-off, as any draft satisfies QS. If it is an upper-bound, you will have no move. That only leaves the case of a bad lower bound (below beta).
All the hash tells you in that case is that there exists a move that you normally would not search (no surprise in QS), and that this move can either fail low or high when you search it with the new window. There is little reason to suspect that it would be better than its bound, and if it is not, it will fail low, and you would have wasted your time on it.
I've given up on trying to repair Uri's position or similar ones with all those pawns on the seventh rank. It is not worth it, I amputed half the qsearch, do only two promotions in every qsearch position (I know that really makes not much difference), applied Marco's patch and tried to limit extensions a bit and I still only get the first one ply output
[D]4K3/1PPPPPPP/8/8/8/8/1ppppppp/4k3 w - -
Engine: Rainbow Serpent 1.6.3s(dc) Build 73 (Athlon 2009 MHz, 128 MB)
by Tord Romstad, Marco Costalba, Joona Kiiski Modifications: Dann Corbit
1.00 0:00 +8.08 1.h8Q (9.209) 65
best move: h7-h8Q time: 3:08.156 min n/s: 878.602 nodes: 165.301.239
This is good enough for a testsuite, it will at least produce output.
Part of the problem is there is an extension in Rainbow Serpent for every queenswap and I assume there that usually you only have one pair of queens. I can test if there are still more queens left on the bord after one exchange but really it does not seem worth it.
a) The qsearch may still explode, if you try all Queen promotions there and all the possible exchanges after them.
b) These are such fabricated positions you will never see them in a game.
Marco's patch did not seem to help in Uri's position, not for Rainbow Serpent. When I tried it in another position I think it may actually not be such a good idea (to apply the patch), I kind of fancy this hash moves in qsearch as an idea! I must admit I do not really understand the counterarguments I can't wrap my head around it, I gave up there
This was the opening position with Marco's patch and several other qsearch limitations inserted:
[D]rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -
Engine: Rainbow Serpent 1.6.3s(dc) Build 69 (Athlon 2009 MHz, 128 MB)
by Tord Romstad, Marco Costalba, Joona Kiiski Modifications: Dann Corbit
1.00 0:00 +0.72 1.Nf3 (20) 0
2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3 Qxe4+ 6.Be2 Bf5 7.Na3 Nc6
8.O-O O-O-O 9.Bd3 Qg4 10.h3 (6.056.936) 496
16.01 0:24 +0.48 1.e4 e5 2.Nf3 Nf6 3.Nxe5 d6 4.Nf3 Nxe4
5.Nc3 Nxc3 6.dxc3 d5 7.Be3 Be7
8.Bb5+ c6 9.Bd3 Nd7 10.O-O O-O
11.Re1 Nc5 (11.931.430) 496
17.01 0:32 +0.28-- 1.e4 e5 2.Nf3 Nf6 3.Nxe5 Qe7 4.d4 Nc6
5.Nc3 Nxe5 6.dxe5 Qxe5 7.f4 Qe6
8.Qd4 b6 9.Bc4 Bc5 (16.370.314) 497
18.01 0:58 +0.44 1.e4 e5 2.Nf3 Nf6 3.Nxe5 Qe7 4.d4 Nc6
5.Nc3 Nxe5 6.dxe5 Qxe5 7.f4 Qe6
8.Qd4 b6 9.Bc4 Bc5 10.Qxc5 bxc5
11.Bxe6 fxe6 12.e5 Nd5 13.Nxd5 exd5
14.Kf2 (28.816.941) 496
19.01 2:05 +0.44 1.e4 e5 2.Nf3 Nf6 3.Nxe5 Qe7 4.d4 Nc6
5.Bf4 Nxe5 6.Bxe5 Nxe4 7.Qe2 d5 8.f3 Nd6
9.Nc3 Be6 10.O-O-O O-O-O 11.Nb5 Kb8
12.Nxd6 cxd6 (62.782.302) 500
20.01 8:40 +0.48 1.e4 e5 2.Nf3 Nf6 3.Nxe5 Qe7 4.Nf3 Nxe4
5.Be2 Nc6 6.Nc3 Nxc3 7.dxc3 d6 8.Be3 Bd7
9.O-O O-O-O 10.Re1 a6 11.b4 d5 12.c4 dxc4
13.c3 (264.838.312) 509
best move: e2-e4 time: 8:44.984 min n/s: 509.101 nodes: 267.270.158
This is okay but 3... Qe7 is a bit antipositional opening. Without the patch Rainbow Serpent eventually plays the French in some absurd quick exchange variation, well okay that was not really Grandmaster quality either...
I like the Stockfish idea of being able to insert some quiet moves in qsearch tactics, if these seem proven in the transposed positions and provided you can play a sequence of TT moves that make sense. Maybe if you would limit it to moves of a certain positive depth that would be more along this idea, but then it would not really find a lot of TT moves anymore.
Eelco