Bitboards in Rust
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
tests
.gitignore
.travis.yml
Cargo.toml
LICENSE
README.md
perf_record
valgrind.sh
watchman.sh

README.md

Bitboard

Bitboards in Rust.

Build Status Coverage Status crates.io Maintenance Status

Summary

Bitboards are a datastructure used in various sorts of boardgame AI to represent boardgame state. Their primary appeal is that they are cache conscious and primarily interacted with via simple binary logic operations (AND, OR, NOT, etc), and thus most operations translate to very few instructions, and usually just the same instruction executed repeatedly. This means they're very very fast.

The Bitboards in this project are implemented in Rust as contiguous chunks of memory. Size is statically determined via the type system (using the typenum library).

What this means practically is two things.

  1. You will get every bit of that delicious cache consciousness.
  2. You will have compile-time guarantee's that when combining two bitboards, the combination is valid inasmuch as bitboard sizes are concerned.

What's in this Repo

  • Bitboard implementation with a reasonably nice API for creating, combining, and otherwise using them.
  • Lots of tests.
  • Benchmarks
  • An N-Queens Solver example of how to use bitboards.
  • Some lovely documentation.

What's not in this repo

  • The secret to life.
  • My recipe for baguette, based on Julia Child's recipe.
  • Any kind of advanced bitboards (no rotated / magic bitboards), or functionality to support them directly, yet.
    • These will probably come in some day soonish, as I need them for other projects consuming this crate

What I think would be cool in this repo

  • Maybe some tooling for dealing with sets of bitboards / doing those queries efficiently / generally managing a set of bitboards.
    • The purpose of this repo is to support a future project of mine, so I suspect features I need will filter backward.