Skip to content

Latest commit

 

History

History
 
 

README.md

Minigo C++ implementation

This directory contains a in-developent C++ port of Minigo.

Set up

The C++ Minigo port uses the Bazel build system. It depends on the Tensorflow C++ libraries, but we have not yet set up Bazel WORKSPACE and BUILD rules to automatically download and configure Tensorflow so (for now at least) you must perform a manual step to build the library:

./cc/configure_tensorflow.sh

This will automatically perform the first steps of Installing Tensorflow from Sources but instead of installing the Tensorflow package, it extracts the generated C++ headers into the cc/tensorflow subdirectory of the repo. The script then builds the required Tensorflow shared libraries and copies them to the same directory. The tensorflow cc_library build target in cc/BUILD pulls these header & library files together into a format the Bazel understands how to link against.

Running the unit tests

bazel test cc:all

Design

The general structure of the C++ code tries to follow the Python code where appropriate, however a lot of the implementation details are different for performance reasons. In particular, the logic that handles the board state strives for a small memory footprint and eschews data structures more sophisticated than a simple array in an effort to minimize memory allocations and maximize cache locality of data. In doing so, the implementation is kept fairly simple (there is no need for a LibertyTracker) and at the time of writing performance of the Position code was more than 450x that of its Python counterpart.

Style guide

The C++ code follows Google's C++ style guide and we use cpplint to delint.