Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluation Blindness to forced 3-fold repetition #1466

Closed
Mr-Twave opened this issue Dec 3, 2020 · 7 comments
Closed

Evaluation Blindness to forced 3-fold repetition #1466

Mr-Twave opened this issue Dec 3, 2020 · 7 comments
Labels
bug Something isn't working release blocker Bugs which block releases

Comments

@Mr-Twave
Copy link

Mr-Twave commented Dec 3, 2020

BUG REPORT

https://www.chess.com/computer-chess-championship#event=ccc-blitz-championship-2020-semifinals&game=435

The link I posted for whatever reason now breaks. Here's the PGN.

[Site "?"]
[Date "2020.12.02"]
[Round "1"]
[White "Lc0"]
[Black "Stockfish Classic"]
[Result "1/2-1/2"]
[ECO "A00"]
[GameDuration "00:13:46"]
[GameEndTime "2020-12-02T16:50:19.782 PST"]
[GameStartTime "2020-12-02T16:36:33.079 PST"]
[Opening "Mieses Opening"]
[PlyCount "90"]
[TimeControl "300+5"]

1. d3 e6 2. Be3 Bd6 3. Nc3 Nh6 4. Qd2 O-O 5. O-O-O Kh8 6. Kb1 Re8 7. Ka1 Bf8 8.
Qe1 Ng8 9. Bc1 Nf6 10. Nb1 Ng8 11. c3 f5 12. a3 d6 13. Nf3 Bd7 14. d4 Ba4 15.
Ng5 Qd7 16. Rd3 h6 17. e4 Nc6 18. Rh3 Na5 19. Nd2 Nf6 20. Bd3 c5 21. dxc5 dxc5
22. Bb1 Kg8 23. Ngf3 Nxe4 24. Nxe4 Nb3+ 25. Ka2 Qd5 26. Bxh6 Nd2+ 27. Ka1 Nb3+
28. Ka2 e5 29. Bg5 Nc1+ 30. Ka1 Nb3+ 31. Ka2 Nd4+ 32. c4 Qxc4+ 33. Ka1 Nb3+ 34.
Ka2 Nd2+ 35. Ka1 Nb3+ 36. Ka2 fxe4 37. Qxe4 Nc1+ 38. Ka1 Nb3+ 39. Ka2 Nd4+ 40.
Ka1 Bc2 41. Qh4 Nb3+ 42. Ka2 Nc1+ 43. Ka1 Nb3+ 44. Ka2 Nd4+ 45. Ka1 Nb3+ 1/2-1/2

Expected behavior: +0.00 evaluation, because there is a rather immediate 3-fold repetition that one side can force.
Observed behavior: +6.32 evaluation (I believe that there are lots of nodes that are already searched because of what is in the PV, and what the node graph says.) r3rbk1/pp4p1/8/2p1p1B1/b1q1Q3/P4N1R/1P3PPP/KBn4R b - - 2 38

Lc0 version
v26.3 with demux backend

Lc0 parameters
Command line, if not default.
image
image

Hardware
CCC uses 4 2080 GPUs if I remember correctly.

Lc0 logs
I'm afraid that you'd have to ask the CCC people for logs.

@Naphthalin
Copy link
Contributor

Thanks for the report. A similar thing happened in the Lc0 vs SFC bonus 3 in TCEC, and the reason seems to be a bad interaction of time manager and reverting twofold draw visits at root where we haven't fully decided yet what the actually intended behavior is, and how this should be done in the code.

@Naphthalin Naphthalin added bug Something isn't working release blocker Bugs which block releases labels Dec 3, 2020
@Mr-Twave
Copy link
Author

Mr-Twave commented Dec 31, 2020

r3rbk1/pp4p1/8/2p1p1B1/b1q1Q3/P4N1R/1P3PPP/KBn4R b - - 2 38
image
image
image
image
Then, after Ka1 Nb3 lc0 uses only 2 nodes to evaluate the position correctly.
image

There's some more info on what the issue actually entails. 8.4K nodes was spent on this move, however the 3-fold was somehow still completely unexpected.

I'm not entirely sure about this, but should there be a value head which predicts the existence of imminent perpetuals, and search should be broadened if both the value of the best child and parent 3-fold prediction head disagree? Or is there a more fundamental bug associated with this?

@Naphthalin
Copy link
Contributor

Thanks for the additional details. It is a side effect of our current twofold draw implementation and will be dealt with at some point.

@Naphthalin
Copy link
Contributor

#1513 is an attempt to fix the cause of this issue.

@Mr-Twave
Copy link
Author

This issue has been open for a good while now-is this issue even possible to solve, if it hasn't been?

@Naphthalin
Copy link
Contributor

This issue has been open for a good while now-is this issue even possible to solve, if it hasn't been?

The specific 3fold-blindness isn't yet resolved, as #1513 wasn't merged yet, at least partially due to the implications of having to deal with an insonsistent search tree. In other words, there isn't a solution without any side effects, but I personally think it's more important that this issue is resolved even if it causes an inconvenience somewhere else.

@Naphthalin
Copy link
Contributor

It's unlikely that this will get addressed in Lc0 master, as the DAG version playing matches etc has a different draw heuristic and separate problems from GHI. If anyone wants to use master and is bothered by this behaviour, apply the patch from #1513.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working release blocker Bugs which block releases
Projects
None yet
Development

No branches or pull requests

2 participants