VeryChess 0.1.0
Initial public development release of VeryChess. This version establishes the core engine architecture, UCI compatibility, and a basic but functional search and evaluation. Strength is experimental and will improve in future versions.
VeryChess is a UCI chess engine written in C++20, targeting native compiled binaries for macOS (ARM64 primary), Linux, and Windows. It's a classical alpha-beta engine with hand-crafted evaluation — no neural networks, no third-party dependencies, standard library only.
Architecture / Board representation
- Bitboards - one 64-bit integer per [color][piece-type], plus per-color and total occupancy.
- Incremental Zobrist hashing updated on every make/unmake.
- Compact 32-bit move encoding: from | to<<6 | flag<<12, with flags for quiet/capture/double-push/en passant/castling/promotion.
- Attack tables precomputed at startup: knight/king/pawn lookups; sliding pieces (rook/bishop/queen) use a classical fill algorithm over rank/file/diagonal masks — not magic bitboards.
Move generation
- Pseudo-legal generation with separate capture-only generation for quiescence.
- Legality enforced lazily: moves are made, then rejected if they leave the own king in check.
- Validated via perft — exposed both as a CLI subcommand and a UCI debug command, with Kiwipete and other standard positions in the bench set.
Search algorithms
- PVS (Principal Variation Search): full window on first move, null-window scout on the rest.
- Transposition table: probe for cutoffs (non-PV), best-move ordering; depth+age replacement.
- Null-move pruning: R=2–3, disabled in PV / in check / zugzwang-risk (no non-pawn material).
- Late move reductions: reduces late quiet moves, re-searches if they beat alpha.
- Quiescence search: captures-only with stand-pat, avoids the horizon effect.
- Check extensions: +1 ply when a move gives check.
- Mate-distance pruning: tightens the alpha/beta window.
- Move ordering: TT move → MVV-LVA captures → 2 killer moves → history heuristic.
- Draw detection in search: 50-move rule + repetition via the hash history.
Evaluation
Hand-crafted, integer (centipawn), symmetric, returned from the side-to-move's perspective (eval.cpp):
- Material + piece-square tables.
- Phase awareness — separate king PST for middlegame vs endgame, switched on non-pawn material; endgame adds king-centralization and a king-driving term for K+piece vs K mates.
- Bishop pair bonus, simple knight mobility.
- King safety — open-file penalties near a castled king plus a non-linear attacker-weight table over inner/outer king zones.
UCI / functionality
- Commands: uci, isready, ucinewgame, position (startpos/fen + moves), go (depth/movetime/wtime-btime-inc/movestogo/infinite), stop, quit, plus debug perft.
- Time management with soft/hard limits derived from the clock; time checked every 2048 nodes for low overhead.
- Hash option: configurable TT size, default 64 MB, 1 MB–64 GB.
- Standard UCI info output (depth, seldepth, score cp/mate, nodes, nps, time, pv).
Characteristics summary
- Style: classical alpha-beta engine, correctness-first, performance-conscious.
- Strengths: complete modern search-pruning toolkit, clean cache-friendly bitboard design, zero dependencies, fully cross-platform, interruptible threaded search.
- Current limitations / growth areas: single-threaded search (no SMP), classical (non-magic) sliding attacks, untapered hand-crafted eval, no opening book or endgame tablebases, no NNUE.