jacobbl wrote:Hm...
This was a bit painful reading.
My engine (Sjakk) finds the solution at depth 19, but I think that's just luck, because the evaluation doesn't rise before depth 23. But what's nagging me is that I need 16,11 seconds to find it. And I'm using hash tables. I know my engine is slow (written in Visual Basic, and probably not a very good code either....), but on this test it's doing about 243 kN/s. If I understand you correctly I should have reached depth 23 much faster.
What am I doing wrong? Bugs in the hash tables? Bad move ordering? something else?
I'd be greatful for any sugestions.
Rule out minor things like move ordering or evaluation - I think only material matters. Very likely (as this is supposed to test TT hashing) it is a simple hash bug.
depth 19 score cp +302 time 395 msec nodes 70203 nps 177729 pv 1.Kd5 Kc7 2.Ke5 Kc8 3.Kd4 Kd8 4.Ke5 Kc7
depth 20 score cp +302 time 435 msec nodes 80327 nps 184659 pv 1.Kd5 Kc7 2.Ke5 Kc8 3.Kd4 Kd8 4.Ke5 Kc7
depth 21 score cp +803 time 606 msec nodes 176285 nps 290899 pv 1.c7 Kxc7 2.Ke7 Kc8 3.Kd6 Kb7 4.Kd7 Kb8 5.Kc6 Kc8 6.Kxb6 Kd7 7.Kb7 Ke7 8.Kc8 Ke6 9.Kc7 Ke5 10.b6
depth 22 score cp +990 time 1324 msec nodes 796795 nps 601808 pv 1.c7 Kxc7 2.Ke7 Kc8 3.Kd6 Kb7 4.Kd7 Kb8 5.Kc6 Ka7 6.Kc7 Ka8 7.Kxb6 Kb8 8.Ka6 Kc7 9.Ka7 Kd7 10.b6 Kd6 11.b7 Kc5 12.b8Q Kd5
depth 23 score cp +1005 time 1917 msec nodes 1539358 nps 803003 pv 1.c7 Kxc7 2.Ke7 Kc8 3.Kd6 Kb7 4.Kd7 Kb8 5.Kc6 Ka7 6.Kc7 Ka8 7.Kxb6 Kb8 8.Ka6 Kc7 9.Ka7 Kd6 10.b6 Ke5 11.b7 Ke4 12.b8Q
My program Cowrie finds the correct move
c7 in 0.6 seconds at depth 21 with the score jumping from +3.0 to +8.0. The nps was not high, just 290000 nps.
I think Anthony Cozzie of Zappa once said chess programming is a struggle against bugs and my experience seems to convince me that it is so. I have tons of asserts and it troubles me if I cannot understand why they are triggered. I have to clear every single asserts before I am at ease to proceed - there is no motivation to try to get more elo when there are still uncleared bugs.
Unless one is an above average programmer, expect bugs in your program. The most important areas to debug:-
1) evaluation color symmetry test - a must- have.
2) following PV/ pv nodes and collecting the triangular pv[ply][ply].
3) collecting the best move - seems simple (just a single move) but critical and may be
bug-prone.
There are much more ways to introduce bugs than we can list.
Rasjid