<commit_before># Test format: Test name | Board FEN | Move list | Expected answer
# The last two entries are optional depending on the test.

# Basic rules check
move count | start | | 20
move count | start | e4 | 20
illegal position | k7/8/8/8/8/8/8/KP6 w - - 0 1
illegal position | kp6/8/8/8/8/8/8/K7 w - - 0 1

# Castling with attacking piece
all moves legal  |1k6/r7/8/8/8/8/8/R3K2R w KQ   - 0 1 |O-O
all moves legal  |1k6/r7/8/8/8/8/8/R3K2R w KQ   - 0 1 |O-O-O
all moves legal  |1k6/1r6/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O
all moves legal  |1k6/1r6/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O-O
all moves legal  |1k6/2r5/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O
last move illegal|1k6/2r5/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O-O
all moves legal  |1k6/3r4/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O
last move illegal|1k6/3r4/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O-O
last move illegal|1k6/4r3/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O
last move illegal|1k6/4r3/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O-O
last move illegal|1k6/5r2/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O
all moves legal  |1k6/5r2/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O-O
last move illegal|1k6/6r1/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O
all moves legal  |1k6/6r1/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O-O
all moves legal  |1k6/7r/8/8/8/8/8/R3K2R w KQ   - 0 1 |O-O
all moves legal  |1k6/7r/8/8/8/8/8/R3K2R w KQ   - 0 1 |O-O-O

# Pawn captures
all moves legal | k7/8/8/4p3/3P4/8/8/K7 w - - 0 1 | d4e5
all moves legal | k7/8/8/4p3/3P4/8/8/K7 b - - 0 1 | e5d4

# Generating moves with side effects
last move illegal | 2k5/P7/K7/8/8/8/8/8 w - - 0 1 | a8=Q Kb8
last move illegal | 2k5/P7/K7/8/8/8/8/8 w - - 0 1 | a7a8q c8b8

# Pinned pieces tests
pinned piece      | k1KRr3/8/8/8/8/8/8/8 w - - 0 1 | d8 true
pinned piece      | k1KRRr2/8/8/8/8/8/8/8 w - - 0 1 | d8 false
last move illegal | K7/8/8/8/kpP4R/8/8/8 b - c3 0 1 | b4c3
all moves legal   | K7/8/8/8/kpP3BR/8/8/8 b - c3 0 1 | b4c3
last move illegal | K7/8/8/8/kpP3QR/8/8/8 b - c3 0 1 | b4c3
all moves legal   | K7/8/8/8/kpP5/8/8/8 b - c3 0 1 | b4c3
last move illegal | k7/1b6/8/8/8/7r/1Q5b/7K w - - 0 1 | Qh2

# Moves from perft boards
all moves legal   | start | c3 a6 Qa4
last move illegal | start | c3 a6 Qa4 d5
all moves legal   | start | c3 d6 Qa4 Nc6
all moves legal   | start | d3 c6 Bd2 Qa5 Bb4
all moves legal   | start | e3 a6 Qe2
all moves legal   | r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1 | Kf1 Nc4 Bd1
all moves legal   | 8/Pk6/8/8/8/8/6Kp/8 b - - 0 1 | Ka6 Kf1 h1=B a8=Q Bxa8
move count | n1n5/PPPk4/8/8/8/8/4Kppp/5N1N w - - 0 1 | bxa8=Q Nd6 Qb7 gxh1=Q c8=Q | 0 # Checkmate for white
move count | 8/6k1/4b3/8/3N2p1/8/6q1/4n1K1 w - - 10 120 | | 0 # checkmate for black

# More specific checks on board
# Most of these tests were created to address specific
# problems found while programmming.

# Move ambiguity check
last move illegal | start | Nc3 a6 Nf3 b6 Ne4 c6 Ng5

# Unambiguous move check
all moves legal | 2k1K3/8/8/8/8/8/QQ6/Q7 w - - 0 1 | Qa2b1

# En passant pin
last move illegal | 7k/4p3/8/2KP3r/8/8/8/8 b - - 0 1 | e5 dxe6

all moves legal | 8/6K1/2k5/5n2/8/8/8/5R2 w - - 0 1 | Rxf5
all moves legal | 7R/8/8/8/1K2p2q/8/5P2/3k4 w - - 0 1 | f4 exf3 Rxh4
all moves legal | 8/8/5r2/8/8/8/8/R3K1k1 w Q - 0 1 | O-O-O Rf1
move count | Q6r/4k3/8/8/8/5b2/8/7K w - - 0 1 | | 1
all moves legal | Q6r/4k3/8/8/8/5b2/8/7K w - - 0 1 | h1g1
all moves legal | k7/8/8/3pP3/2K5/8/8/8 w - d6 0 1 | exd6

all moves legal | K1k5/3P4/8/8/8/8/8/8 b - - 0 1 | # Check Board ctor not tripped by multiple pawn captures
all moves legal | n7/3p4/2k5/2P5/8/8/8/K6Q b - - 0 1 | d5 cxd6 # Correct checking square found after en passant capture

# Promotion to bishop bug ('b' confused with file)
all moves legal | 2R5/5P2/8/7p/3k4/8/1P6/5K2 w - - 0 1 | f7f8b

# Enough material to checkmate
checkmate material | k1K5/8/8/8/8/8/8/8 w - - 0 1 | false
checkmate material | k7/8/8/3pP3/4B3/8/8/7K w - d6 0 1 | true
checkmate material | k1KQ4/8/8/8/8/8/8/8 w - - 0 1 | true
checkmate material | k1KBB3/8/8/8/8/8/8/8 w - - 0 1 | true
checkmate material | k1KB1B2/8/8/8/8/8/8/8 w - - 0 1 | false
checkmate material | k1KBb3/8/8/8/8/8/8/8 w - - 0 1 | true
checkmate material | k1KB1b2/8/8/8/8/8/8/8 w - - 0 1 | false
checkmate material | k1KNn3/8/8/8/8/8/8/8 w - - 0 1 | true
checkmate material | k1KNN3/8/8/8/8/8/8/8 w - - 0 1 | true
checkmate material | k1KNB3/8/8/8/8/8/8/8 w - - 0 1 | true
checkmate material | k1KnB3/8/8/8/8/8/8/8 w - - 0 1 | true
checkmate material | k1KBn3/8/8/8/8/8/8/8 w - - 0 1 | true

# More tests found by chess engine fight
last move illegal | start | g3 c5 c3 Nc6 h4 Qb6 b4 c4 Bg2 Nh6 Na3 Rb8 f3 Rg8 Bb2 f6 Nb1 a6 Kf2
king in check | start | f4 g6 Nf3 h6 d3 c5 b4 a5 bxc5 b5 | false
king in check | start | e4 g5 h3 f6 e5 a6 Rh2 g4 Ne2 g3 f3 d5 | false

# Quiescent tests: test proper resolution of quiescent search
# quiescent | (starting FEN) | (move list) | (expected subsequent moves)
quiescent | start | |  # If there are no captures available, an empty move list is returned
quiescent | start | e4 d5 Nc3 dxe4 | Nxe4
quiescent | 4k3/4r2q/2b5/8/4p3/3P1P2/5N2/4K3 w - - 0 1 | fxe4 | # Not worth recapturing for black
quiescent | 4k3/4r2q/2b5/8/4p3/3Q1P2/5N2/4K3 w - - 0 1 | fxe4 | Bxe4 Nxe4 Rxe4
quiescent | 4k3/4r2q/2b5/5p2/4p1R1/3QKP2/5N2/8 w - - 0 1 | fxe4 | fxe4 Nxe4 Bxe4 Rxe4 Rxe4 Qxe4 Qxe4 Kxe4<commit_msg>Add more board tests<commit_after># Test format: Test name | Board FEN | Move list | Expected answer
# The last two entries are optional depending on the test.

# Basic rules check
move count | start | | 20
move count | start | e4 | 20
illegal position | k7/8/8/8/8/8/8/KP6 w - - 0 1
illegal position | kp6/8/8/8/8/8/8/K7 w - - 0 1

# Castling with attacking piece
all moves legal  |1k6/r7/8/8/8/8/8/R3K2R w KQ   - 0 1 |O-O
all moves legal  |1k6/r7/8/8/8/8/8/R3K2R w KQ   - 0 1 |O-O-O
all moves legal  |1k6/1r6/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O
all moves legal  |1k6/1r6/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O-O
all moves legal  |1k6/2r5/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O
last move illegal|1k6/2r5/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O-O
all moves legal  |1k6/3r4/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O
last move illegal|1k6/3r4/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O-O
last move illegal|1k6/4r3/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O
last move illegal|1k6/4r3/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O-O
last move illegal|1k6/5r2/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O
all moves legal  |1k6/5r2/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O-O
last move illegal|1k6/6r1/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O
all moves legal  |1k6/6r1/8/8/8/8/8/R3K2R w KQ  - 0 1 |O-O-O
all moves legal  |1k6/7r/8/8/8/8/8/R3K2R w KQ   - 0 1 |O-O
all moves legal  |1k6/7r/8/8/8/8/8/R3K2R w KQ   - 0 1 |O-O-O

# Pawn captures
all moves legal | k7/8/8/4p3/3P4/8/8/K7 w - - 0 1 | d4e5
all moves legal | k7/8/8/4p3/3P4/8/8/K7 b - - 0 1 | e5d4

# Generating moves with side effects
last move illegal | 2k5/P7/K7/8/8/8/8/8 w - - 0 1 | a8=Q Kb8
last move illegal | 2k5/P7/K7/8/8/8/8/8 w - - 0 1 | a7a8q c8b8

# Pinned pieces tests
pinned piece      | k1KRr3/8/8/8/8/8/8/8 w - - 0 1 | d8 true
pinned piece      | k1KRRr2/8/8/8/8/8/8/8 w - - 0 1 | d8 false
last move illegal | K7/8/8/8/kpP4R/8/8/8 b - c3 0 1 | b4c3
all moves legal   | K7/8/8/8/kpP3BR/8/8/8 b - c3 0 1 | b4c3
last move illegal | K7/8/8/8/kpP3QR/8/8/8 b - c3 0 1 | b4c3
all moves legal   | K7/8/8/8/kpP5/8/8/8 b - c3 0 1 | b4c3
last move illegal | k7/1b6/8/8/8/7r/1Q5b/7K w - - 0 1 | Qh2

# Moves from perft boards
all moves legal   | start | c3 a6 Qa4
last move illegal | start | c3 a6 Qa4 d5
all moves legal   | start | c3 d6 Qa4 Nc6
all moves legal   | start | d3 c6 Bd2 Qa5 Bb4
all moves legal   | start | e3 a6 Qe2
all moves legal   | r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1 | Kf1 Nc4 Bd1
all moves legal   | 8/Pk6/8/8/8/8/6Kp/8 b - - 0 1 | Ka6 Kf1 h1=B a8=Q Bxa8
move count | n1n5/PPPk4/8/8/8/8/4Kppp/5N1N w - - 0 1 | bxa8=Q Nd6 Qb7 gxh1=Q c8=Q | 0 # Checkmate for white
move count | 8/6k1/4b3/8/3N2p1/8/6q1/4n1K1 w - - 10 120 | | 0 # checkmate for black

# More specific checks on board
# Most of these tests were created to address specific
# problems found while programmming.

# Move ambiguity check
last move illegal | start | Nc3 a6 Nf3 b6 Ne4 c6 Ng5

# Unambiguous move check
all moves legal | 2k1K3/8/8/8/8/8/QQ6/Q7 w - - 0 1 | Qa2b1

# En passant pin
last move illegal | 7k/4p3/8/2KP3r/8/8/8/8 b - - 0 1 | e5 dxe6

all moves legal | 8/6K1/2k5/5n2/8/8/8/5R2 w - - 0 1 | Rxf5
all moves legal | 7R/8/8/8/1K2p2q/8/5P2/3k4 w - - 0 1 | f4 exf3 Rxh4
all moves legal | 8/8/5r2/8/8/8/8/R3K1k1 w Q - 0 1 | O-O-O Rf1
move count | Q6r/4k3/8/8/8/5b2/8/7K w - - 0 1 | | 1
all moves legal | Q6r/4k3/8/8/8/5b2/8/7K w - - 0 1 | h1g1
all moves legal | k7/8/8/3pP3/2K5/8/8/8 w - d6 0 1 | exd6

all moves legal | K1k5/3P4/8/8/8/8/8/8 b - - 0 1 | # Check Board ctor not tripped by multiple pawn captures
all moves legal | n7/3p4/2k5/2P5/8/8/8/K6Q b - - 0 1 | d5 cxd6 # Correct checking square found after en passant capture

# Promotion to bishop bug ('b' confused with file)
all moves legal | 2R5/5P2/8/7p/3k4/8/1P6/5K2 w - - 0 1 | f7f8b

# Enough material to checkmate
checkmate material | k1K5/8/8/8/8/8/8/8 w - - 0 1 | false
checkmate material | k7/8/8/3pP3/4B3/8/8/7K w - d6 0 1 | true
checkmate material | k1KQ4/8/8/8/8/8/8/8 w - - 0 1 | true
checkmate material | k1KBB3/8/8/8/8/8/8/8 w - - 0 1 | true
checkmate material | k1KB1B2/8/8/8/8/8/8/8 w - - 0 1 | false
checkmate material | k1KBb3/8/8/8/8/8/8/8 w - - 0 1 | true
checkmate material | k1KB1b2/8/8/8/8/8/8/8 w - - 0 1 | false
checkmate material | k1KNn3/8/8/8/8/8/8/8 w - - 0 1 | true
checkmate material | k1KNN3/8/8/8/8/8/8/8 w - - 0 1 | true
checkmate material | k1KNB3/8/8/8/8/8/8/8 w - - 0 1 | true
checkmate material | k1KnB3/8/8/8/8/8/8/8 w - - 0 1 | true
checkmate material | k1KBn3/8/8/8/8/8/8/8 w - - 0 1 | true

# More tests found by chess engine fight
last move illegal | start | g3 c5 c3 Nc6 h4 Qb6 b4 c4 Bg2 Nh6 Na3 Rb8 f3 Rg8 Bb2 f6 Nb1 a6 Kf2
king in check | start | f4 g6 Nf3 h6 d3 c5 b4 a5 bxc5 b5 | false
king in check | start | e4 g5 h3 f6 e5 a6 Rh2 g4 Ne2 g3 f3 d5 | false
last move illegal | 8/2r5/4Kn2/1kqRn3/2bNP3/P6P/8/5B2 b - - 13 65 | Qxd4
last move illegal | 2R5/7r/4P1k1/2B5/3KB2N/8/5n2/8 b - - 7 138 | Nxe4
last move illegal | 2R5/7r/4P1k1/2B5/3KB2N/8/5n2/8 b - - 7 138 | Rxh4

# Quiescent tests: test proper resolution of quiescent search
# quiescent | (starting FEN) | (move list) | (expected subsequent moves)
quiescent | start | |  # If there are no captures available, an empty move list is returned
quiescent | start | e4 d5 Nc3 dxe4 | Nxe4
quiescent | 4k3/4r2q/2b5/8/4p3/3P1P2/5N2/4K3 w - - 0 1 | fxe4 | # Not worth recapturing for black
quiescent | 4k3/4r2q/2b5/8/4p3/3Q1P2/5N2/4K3 w - - 0 1 | fxe4 | Bxe4 Nxe4 Rxe4
quiescent | 4k3/4r2q/2b5/5p2/4p1R1/3QKP2/5N2/8 w - - 0 1 | fxe4 | fxe4 Nxe4 Bxe4 Rxe4 Rxe4 Qxe4 Qxe4 Kxe4
{'fraction_non_alphanumeric': 0.1402551775147929, 'fraction_numerical': 0.16863905325443787, 'mean_word_length': 2.284846644397206, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2064554', 'n_tokens_mistral': 6124, 'n_tokens_neox': 5758, 'n_words': 1546}