-
-
Notifications
You must be signed in to change notification settings - Fork 512
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
difference between "board.copy()" and "copy.deepcopy(board)"? #48
Comments
This is very strange, as I hook into deepcopy to make it an alias for python-chess/chess/__init__.py Line 3495 in e5dee27
Perhaps some race condition or timing issue ... |
in think() from picochess.py: If its "engine.position(game.copy())" I crushing with lots(!) of error messages like so: If its "engine.position(copy.deepcopy(game))" no problem...working. We had this problem already, at the beginning of your uci-new-engine rewrite. The solution been, to give a copy of game inside the engine. Somehow, copy() not working like the python version. If y want, y can try out yrsf: |
This is definitely just a difference in timing.
I'll keep this issue open as reminder for looking into thread safe boards. |
I believe this issue is not solved. Looking for workaround for more than a week. |
@jackalsh: The UCI interface is not thread-safe. You'll have to ensure the board is not modified until If it still doesn't work, a minimal reproducible example would be helpful. I didn't suggest to use deepcopy (as it does not reliably solve thread-safety issues), but at least there should be no functional difference between |
I found some workaround, which is enough for me. |
Are you using |
Indeed, yes, I have something like |
Yeah, I was looking for writing code. |
Its not as simple, because we use database as a backend for the script. Code itself will not be as useful. If you want, I will send you a code, but there is nothing special in it. |
With one year worth of changes and me being unable to reproduce this (from the start), it's probably best to make a new issue if this problem persists. |
Hello,
I thinked, they behave same. But if i use "copy()" in thinking(game). i get back the old problem with ghost boards (and the calc. is wrong). Using a deepcopy of board, working - like before. Changed it back.
basically a uci_engine.position(game.copy()) or (copy.deepcopy(game)) - one working the other not.
The text was updated successfully, but these errors were encountered: