Chess environments for reinforcement learning I want to try some reinforcement learning techniques (borrowed from AlphaZero, etc.) and so I need a chess environment in order to run games.

I code in python, so I found python-chess but unfortunately it is too slow to generate a large amount of games. Playing 100 games with random moves (average length of ~400 moves for a random game) takes 8 seconds, which doesn't scale to higher orders of magnitude well. My profiling shows that over 99.9% of the time taken is with the library as opposed to other code, so I can't optimize any further.

Is there already an existing chess environment that is faster than this in python?
Generating high volume of data directly in an interpreting Python environment is a bad idea. Furthermore, the python-chess package is not made for high performance; the package is not a wrapper for native C/C++.

If you want to generate hundreds and thousands of games quickly, you don't have any reason for avoiding native coding such as C++. Take the Stockfish code base, modify it for making games. That was what the Leela project had done, and it worked!

Please consider going into C++. Mutlit-threading if you haven't done it already.