vincentbab / Belette

An UCI compatible chess engine written in C++
GNU General Public License v3.0
1 stars 1 forks source link

Can find right move but didn't #2

Open tissatussa opened 2 weeks ago

tissatussa commented 2 weeks ago

I just compiled your v3.1.0 dev and let it play a game in CuteChess GUI against another strong engine. It made a draw but could have won the game .. it failed to find the right move in this position :

Belette-no-Qh1

After the game i investigated the concerning position in SCID and it turns out Belette CAN find the right move (Qh1) immediately :

Belette-finds-Qh1

Why did this happen ? I encounter such 'behaviour' with other engines too .. is it a bug in the Hash management ? My gut feeling says so ..


[Event "engine vs engine"]
[Site "Holland @ https://lichess.org/jsws8TaD "]
[Date "2024.09.08"]
[Round "?"]
[White "Belette v3.1.0 dev"]
[Black "4KU v5.1"]
[Result "1/2-1/2"]
[ECO "D20"]
[GameDuration "00:12:44"]
[Opening "Queen's gambit accepted"]
[PlyCount "84"]
[TimeControl "300+3"]

1. d4 {+0.21/31 14s} d5 {-0.17/23 10s} 2. c4 {+0.18/33 13s} dxc4 {-0.40/25 12s}
3. e3 {+0.25/32 15s} c5 {-0.26/25 12s} 4. Bxc4 {+0.35/34 12s} Nf6 {-0.46/24 14s}
5. Nf3 {+0.26/33 13s} Qc7 {-0.52/24 22s} 6. d5 {+0.37/29 12s} a6 {-0.47/26 16s}
7. a4 {+0.43/34 13s} Bf5 {-0.69/25 15s} 8. O-O {+0.52/32 11s}
Nbd7 {-0.57/25 11s} 9. Nc3 {+0.54/34 13s} O-O-O {-0.66/25 27s}
10. Qe2 {+0.52/36 10s} Bg4 {-0.62/29 9.2s} 11. h3 {+0.63/37 16s}
Bxf3 {-0.65/29 21s} 12. Qxf3 {+0.65/34 13s} Ne5 {-0.65/26 6.0s}
13. Qe2 {+0.59/36 11s} g5 {-0.68/26 6.6s} 14. Ba2 {+0.86/31 8.8s}
g4 {-0.89/24 6.5s} 15. hxg4 {+0.99/34 8.7s} Nexg4 {-0.69/27 16s}
16. f4 {+1.34/32 8.6s} Rg8 {-0.55/26 5.8s} 17. e4 {+0.98/32 22s}
Nh5 {-0.84/24 7.7s} 18. Rf3 {+1.27/32 8.8s} Qb6 {-0.82/24 6.0s}
19. a5 {+1.07/34 13s} Qh6 {-0.79/23 4.5s} 20. g3 {+0.95/32 7.0s}
Qg6 {-0.99/22 5.6s} 21. Qg2 {+1.29/31 7.1s} Nhf6 {-0.95/24 17s}
22. e5 {+1.50/31 7.0s} Nd7 {-1.14/24 5.0s} 23. Bd2 {+1.33/30 12s}
h5 {-1.08/22 3.9s} 24. Rc1 {+2.08/30 9.0s} h4 {-0.71/22 3.8s}
25. e6 {+2.23/32 6.5s} fxe6 {-1.93/25 12s} 26. dxe6 {+2.09/35 6.7s}
Nb8 {-2.18/26 26s} 27. Na4 {+2.13/31 6.2s} Bg7 {-2.36/26 12s}
28. f5 {+2.10/32 7.3s} Bd4+ {-1.61/24 8.8s} 29. Kf1 {+2.39/32 5.6s}
Qh5 {-2.05/24 9.5s} 30. Nb6+ {+2.32/33 6.4s} Kc7 {-2.41/21 2.3s}
31. Nd5+ {+2.30/35 9.4s} Rxd5 {-2.35/21 3.3s} 32. Bxd5 {+2.80/32 6.6s}
Kd8 {-3.19/24 5.4s} 33. Bxb7 {+3.40/31 6.0s} h3 {-4.12/24 3.0s}
34. Qe2 {+3.74/32 5.4s} h2 {0.00/29 2.0s} 35. Kg2 {-0.01/40 5.1s}
h1=Q+ {0.00/39 2.0s} 36. Rxh1 {-0.01/52 5.2s} Qxh1+ {0.00/47 2.1s}
37. Kxh1 {+0.01/54 5.6s} Rh8+ {0.00/49 18s} 38. Kg2 {+0.01/65 4.9s}
Rh2+ {0.00/60 1.5s} 39. Kf1 {-0.01/72 4.5s} Rh1+ {0.00/64 2.2s}
40. Kg2 {+0.01/70 5.1s} Rh2+ {0.00/69 2.1s} 41. Kf1 {-0.01/72 4.3s}
Rh1+ {0.00/69 2.4s} 42. Kg2 {+0.01/76 4.5s}
Rh2+ {0.00/75 2.7s, Draw by 3-fold repetition} 1/2-1/2

[ i'm on Xubuntu 22.04 ]

vincentbab commented 2 weeks ago

This could indeed be due to a hash collision in the transposition table. It would really help if you can provide the full input and ouput of the engine for the game to reproduce the bug. You can use the "Debug Log File" option for this purpose

tissatussa commented 2 weeks ago

..the full input and ouput of the engine for the game to reproduce the bug..

i can do that but this game wasn't logged. you never experienced such 'behaviour' yourself ? I use 128 Mb hash