These reviews are from Crev, a distributed system for code reviews. To add your review, set up cargo-crev.

The current version of Shakmaty is 0.20.4.

0.20.1 (older version) Rating: Positive Thoroughness: High Understanding: High

by niklasf on 2021-10-16

This is a self-assessment. I am the author of this crate.

Soundness: I am highly confident in soundness. Unfortunately, I could not avoid two kinds of unsafe blocks, without major performance impact. Instead, all preconditions are explained thoroughly in comments and asserted with debug assertions.

(1) The optimizer does not reliably elide bounds checks based on the assumption that u64::trailing_zeros() will never be larger than 63. This is important in many hot loops.

(2) The perfect hash function for attack lookups always stays within bounds. This technique is called Magic Bitboards, widely used and very well understood in the chess community. When selecting magic factors, exactly this assumption is tested for all possible inputs.

Correctness: For move generation in standard chess, confidence is based on a large test suite of randomly generated, as well as historical and tricky positions, so called perft tests. The numbers are shared in the chess community and compared across a wide array of implementations.

I am gradually less confident in other features, especially chess variants, simply because they are less popular and played less often, and Zobrist hashing, a recent feature addition.

The library has been used to parse 1 billion recorded real world games (https://database.lichess.org). Some bugs have been found, but in the source of the data, not this library.

For handling of input formats (FEN, SAN, UCI) I reviewed the code thoroughly and used fuzz testing to ensure absence of DOS/panics.

0.18.0 (older version) Rating: Positive Thoroughness: High Understanding: High

by niklasf on 2021-02-24

Show review…

Previous review still applies for this new release.

0.17.2 (older version) Rating: Positive Thoroughness: High Understanding: High

by niklasf on 2021-02-08

Show review…

Previous review still applies for this new release.

0.17.1 (older version) Rating: Positive Thoroughness: High Understanding: High

by niklasf on 2021-01-01

Show review…

Previous review still applies for this new release.

0.16.2 (older version) Rating: Positive Thoroughness: High Understanding: High

by niklasf on 2020-02-27

Show review…

Implements chess and chess variant rules and operations.

This is a self-assessment. I am the author of this crate.

Soundness: I am highly confident in soundness. Unfortunately, I could not avoid two kinds of unsafe blocks, without major performance impact. Instead, all preconditions are explained thoroughly in comments and asserted with debug assertions.

(1) The optimizer does not reliably elide bounds checks based on the assumption that u64::trailing_zeros() will never be larger than 63. This is important in many hot loops.

(2) The perfect hash function for attack lookups always stays within bounds. This technique is called Magic Bitboards, widely used and very well understood in the chess community. When selecting magic factors, exactly this assumption is tested for all possible inputs.

Correctness: For move generation in standard chess, confidence is based on a large test suite of randomly generated, as well as historical and tricky positions, so called perft tests. The numbers are shared in the chess community and compared across a wide array of implementations.

I am gradually less confident in other features, especially chess variants, simply because they are less popular and played less often.

The library has been used to parse 1 billion recorded real world games (https://database.lichess.org). Some bugs have been found, but in the source of the data, not this library.

For handling of input formats (FEN, SAN, UCI) I reviewed the code thoroughly and used fuzz testing to ensure absence of DOS/panics.