- License: GNU General Public License v3.0 or later.
- Code is in C (gnu11 = C11 + some GNU extensions), tested only on Linux x86-64.
- Source Code.
- basic commands like “init”, “fen xxxx”, “depth n”, “search”, “pvs”, etc…
- I started with a 0x88 board representation
- But… wanted to switch to bitboard lately
- Today there is a messy mix of the two representations.
A pseudo-legal move generator
- Does not check for some invalid moves (especially king-pinned pieces moves, which could be very expensive). I believe some programs do not do it too, and prefer to see invalid positions at next ply (TODO).
- Still with 0x88 board (needs to be rewritten with bitboards).
- They should be converted into arrays, to allow fast duplication for move_do(), the function which actually makes a move.
- preferred squares for pieces
- mobility
Basic negamax search function
Principal Variation Search (PVS) function
- Alpha-beta pruning
- Basic moves pre-ordering
It makes the PVS/alpha-beta pruning quite decent. For example, a 6 ply depth search gives:
- negamax: 1,196 secs for 125,799 Knodes
- PVS: 14 secs for 1,575 Knodes
- Both make search at a fixed depth (still no quiescence search at terminal nodes).
- Mate/Pat detection (!) Not trivial, as using pseudo-valid moves implies mate/pat detection is late
- Special rules like 50 moves/position repetition
- Play a move, ask engine to play a move
- A standard interface for usual software (like SCID) Probably xboard first, as it looks simpler than UCI.
- Book-keeping of moves during search (did not decide the method).
- Positions hashing / transposition detection
- proper recusive position/moves cleanup in search() and pvs()
- use valgrind to find possible other unfreed memory
- Check which commands are necessary/mandatory.
- This will allow easy testing with common software