Modern C++20 UCI Chess Engine
v1.3.0 - Search Optimization Release π
- β +109 ELO vs v1.1 baseline
- β Logarithmic LMR formula (configurable)
- β Fixed isPvNode propagation bugs (PV ratio: 20% β 0.02%)
- β Fixed history heuristic (quiet moves only, skip alpha-raising)
- β New search statistics: PV/NonPV node tracking
Previous versions:
- v1.2 - Tablebase support (Syzygy WDL/DTZ probing)
- v1.1 - Arena Release (automated strength testing framework)
- v1.0 - Production Release (cross-platform, CI/CD, 266+ tests)
- v0.7 - YAML configuration framework
- v0.6 - Enhanced search, enhanced logging
# Windows
.\build_windows.ps1 release
# Linux/WSL
./build_wsl.sh release gccSee docs/BUILD_GUIDE.md for complete instructions.
FrankyCPP supports various CLI options beyond the standard UCI mode:
# Information
FrankyCPP --help # Show all options
FrankyCPP --version # Show version
FrankyCPP --ucioptions # Print UCI options
# Configuration Discovery
FrankyCPP --show-config # Show all settings (table)
FrankyCPP --show-config --format yaml # Generate YAML template
FrankyCPP --show-config --format json # Generate JSON for tooling
FrankyCPP --show-config --domain search # Filter by domain
# Testing & Benchmarking
FrankyCPP --perft --startDepth 1 --endDepth 6 # Run perft test
FrankyCPP --bench --benchDepth 12 # Run benchmark
FrankyCPP --testsuite file.epd --tsTime 1000 # Run test suiteNEW in v1.1: Automated testing framework for measuring and tracking engine strength across versions.
# Run all test suites and matches
.\cmake-build-win-release\src\FrankyCPP_v1.1_Arena.exe
# Run test suites only
.\cmake-build-win-release\src\FrankyCPP_v1.1_Arena.exe --testsuites
# View baseline report (all engines side-by-side)
.\cmake-build-win-release\src\FrankyCPP_v1.1_Arena.exe --report
# Compare target engine vs baselines
.\cmake-build-win-release\src\FrankyCPP_v1.1_Arena.exe --cmp FrankyCPP-v1.2-devFeatures:
- π― EPD tactical test suites (WAC, STS, etc.) via external UCI engines
- βοΈ Automated engine matches via cutechess-cli
- π Baseline reports and version comparison with detailed delta analysis
- πΎ JSON result persistence for historical tracking
- π§ Flexible engine configuration (UCI options, command-line args, position isolation)
- π Parallel test execution for faster results
External UCI Engine Testing:
- All test suites use external UCI engines for production-like testing
- Supports any UCI-compliant engine (FrankyCPP, Stockfish, etc.)
- Configure via
config/arena.yamlwithenginePath,uciOptions, and more - Position isolation ensures fair comparisons between versions
Documentation: See docs/arena/ for complete guide:
- Quick Start
- Reporting & Comparison - Baseline reports and version comparison
- External Engine Testing - Comprehensive testing guide
- Configuration Reference
- Result Analysis
- Development Guide
π For comprehensive build instructions, see docs/BUILD_GUIDE.md
| Platform | Compiler | Status | Tests |
|---|---|---|---|
| Windows | MSVC 2022 | β Tested | 266/266 |
| Linux/WSL | GCC 13+ | β Tested | 266/266 |
| Linux/WSL | Clang 18+ | β Tested | 266/266 |
| macOS | Clang 18+ | π Ready | Not tested |
FrankyCPP uses CMake with target-scoped includes and thirdβparty libraries via vcpkg manifest mode.
- C++ Standard: C++20 (std::format, constexpr enhancements, etc.)
- Build System: CMake 3.22+ with Ninja generator
- Package Manager: vcpkg manifest mode
- CI/CD: GitHub Actions (Windows MSVC, Linux GCC/Clang)
- Testing: GoogleTest with 266+ unit tests
- Benchmarking: Google Benchmark for performance testing
- spdlog: v1.15.3 (header-only with C++20 std::format; no separate fmt dependency)
- googletest: v1.14.0
- google benchmark: v1.9.4
Boost components (program_options, serialization) are consumed via vcpkg as well (versions from the vcpkg baseline).
FRANKYCPP_BUILD_TESTS(ON): Build unit tests (GoogleTest)FRANKYCPP_BUILD_BENCHMARKS(ON): Build benchmarks (Google Benchmark)FRANKYCPP_USE_PCH(ON): Enable precompiled headers for FrankyCPPlibENABLE_UNITY_BUILD(OFF): Opt-in Unity/Jumbo builds for faster local compilesSTRICT_WARNINGS(OFF): Treat warnings as errors (/WX) on MSVCENABLE_STD_EXECUTION(ON): DefineHAS_EXECUTION_LIBfor code paths using<execution>ENABLE_BMI2_PEXT(ON): DefineHAS_PEXT; on MSVC also adds/arch:AVX2to FrankyCPPlibENABLE_AVX2(OFF): Adds/arch:AVX2to FrankyCPPlib explicitlyVCPKG_TARGET_TRIPLET(x64-windows-static-md default on MSVC): Override vcpkg triplet if needed
Notes:
- Guard against dynamic vcpkg triplets on Windows: dynamic triplets (e.g.,
x64-windows) are rejected to ensure a DLL-free executable; use a-statictriplet (default isx64-windows-static-md). - LTO/IPO is enabled for Release/RelWithDebInfo/MinSizeRel when supported by the toolchain.
- Library links (PUBLIC):
Boost::serialization,Boost::program_options. Logging uses spdlog header-only with std::format (no fmt linkage). - Build Environment Validation: CMake configuration includes automatic checks for:
- Compiler version and C++20 support
- Required build tools (pkg-config, tar, unzip on Unix)
- vcpkg installation and configuration
- CPU architecture support
For Linux/WSL, use the setup script:
# Validate environment (safe, no system modifications)
./setup_linux_build_env.sh
# Install dependencies (requires sudo, modifies system)
./setup_linux_build_env.sh --install
# Set VCPKG_ROOT in ~/.bashrc for existing vcpkg (e.g., CLion's vcpkg)
./setup_linux_build_env.sh --set-env
# Show help
./setup_linux_build_env.sh --helpDefault behavior is validation-only for safety. Use --install or --set-env explicitly when you want to make changes.
This script:
- Validates (default): Checks all tools, versions, CPU features without making changes
- Installs (--install): Installs essential build tools, optional vcpkg tools, clones and bootstraps vcpkg, adds VCPKG_ROOT to ~/.bashrc
- Sets Env Var (--set-env): Adds VCPKG_ROOT to ~/.bashrc for detected vcpkg (e.g., CLion's installation)
- Detects CI/CD environments and adjusts behavior automatically
- Reports what's missing with installation instructions
- Smart Detection: Automatically detects CLion's vcpkg at
~/.vcpkg-clion/vcpkg
For Windows, use the setup script:
# Validate environment (safe, no system modifications)
.\setup_windows_build_env.ps1
# Install vcpkg (if not already set up)
.\setup_windows_build_env.ps1 -Install
# Set VCPKG_ROOT for existing vcpkg (e.g., CLion's vcpkg)
.\setup_windows_build_env.ps1 -SetEnvVar
# Show help
.\setup_windows_build_env.ps1 -HelpDefault behavior is validation-only for safety. Use -Install or -SetEnvVar explicitly when you want to make changes.
Prerequisites (must be installed manually):
- Visual Studio 2019 16.10+ or Visual Studio 2022 (with "Desktop development with C++" workload)
- CMake 3.16 or higher
- Ninja build system (recommended)
- Git
The script:
- Validates (default): Checks Visual Studio, CMake, vcpkg, build tools
- Installs (-Install): Automatically clones and bootstraps vcpkg to
C:\vcpkg, sets VCPKG_ROOT - Sets Env Var (-SetEnvVar): Sets VCPKG_ROOT for detected vcpkg (e.g., CLion's installation)
- Cannot install Visual Studio, CMake, or Ninja (these require manual installation)
- Smart Detection: Automatically detects CLion's vcpkg at
%USERPROFILE%\.vcpkg-clion\vcpkg
Note: If you use CLion, the script will detect its managed vcpkg. Use -SetEnvVar to make it available for command-line builds, or use -Install to set up a separate system-wide vcpkg at C:\vcpkg.
Convenience script for building on Windows with CMake presets:
# Release build (default)
.\build_windows.ps1
# Debug build
.\build_windows.ps1 debug
# Other configurations
.\build_windows.ps1 relwithdebinfo
.\build_windows.ps1 minsizerel
# Show help
.\build_windows.ps1 -HelpFeatures:
- Uses CMake presets (debug, release, relwithdebinfo, minsizerel)
- Validates VCPKG_ROOT and Visual Studio installation
- Automatically detects CLion's vcpkg if not set
- Builds with parallel compilation
- Runs tests (excluding slow tests)
- Reports build status and executable location
First build: 10-20 minutes (vcpkg dependencies compilation)
Subsequent builds: 1-2 minutes (only project code)
Convenience script for building on Linux/WSL:
# Release build with GCC (default)
./build_wsl.sh
# Debug build with GCC
./build_wsl.sh debug
# Release build with Clang (cross-compiler testing)
./build_wsl.sh release clang
# Debug build with Clang
./build_wsl.sh debug clang
# Show help
./build_wsl.sh --helpFeatures:
- Supports both GCC 13 and Clang 15 compilers
- Uses CMake presets (wsl-debug, wsl-release, wsl-clang-debug, wsl-clang-release)
- Validates VCPKG_ROOT environment variable
- Builds with parallel compilation (ninja)
- Runs tests (excluding slow tests)
- Reports build status and executable location
Prerequisites: Run ./setup_linux_build_env.sh --install first to set up build environment.
To create a distributable release package with executable, books, and configuration:
- Open the Build menu
- Click Install
Note: Install automatically performs a clean rebuild to ensure the release contains the latest code.
Windows:
cmake --install cmake-build-release --config ReleaseLinux/WSL:
cmake --install cmake-build-wsl-releaseNote: The install command automatically cleans and rebuilds the project before packaging to ensure a fresh release.
Release/
βββ FrankyCPP_v1.1/ # Versioned folder (git ignored)
β βββ FrankyCPP_v1.1.exe # Executable
β βββ books/ # Opening books (no cache files)
β β βββ book.txt
β β βββ 8moves_GM_LB.pgn
β β βββ ...
β βββ config/ # Configuration files
β βββ search.yaml
β βββ eval.yaml
β βββ FrankyCPP.cfg
βββ FrankyCPP_v1.1.zip # ZIP archive (git tracked)
Notes:
- Cache files (
*.cache.*.bin) are automatically excluded - Large test files (
superbook*.pgn) are excluded (test-only files, not for distribution) - The versioned folder is ignored by git (build artifact)
- The ZIP file is tracked in git (distribution artifact)
- Version number updates automatically when you bump the project version
If building outside an IDE, initialize the MSVC environment first.
- Open βx64 Native Tools Command Prompt for VS 2022β (or run vcvars64.bat)
- Configure (RelWithDebInfo example):
cmake -S D:\_DEV\FrankyCPP -B D:\_DEV\FrankyCPP\cmake-build-relwithdebinfo -G Ninja -DFRANKYCPP_BUILD_TESTS=ON -DFRANKYCPP_BUILD_BENCHMARKS=OFF- Build:
cmake --build D:\_DEV\FrankyCPP\cmake-build-relwithdebinfo -j 8- Run tests (optional):
ctest -C RelWithDebInfo --test-dir D:\_DEV\FrankyCPP\cmake-build-relwithdebinfo --output-on-failure- Create release package (optional):
cmake --install D:\_DEV\FrankyCPP\cmake-build-relwithdebinfo --config RelWithDebInfoThis creates a versioned release package with filtered books and config files.
CLion users can just reload CMake; the IDE sets up the MSVC environment automatically.
- App:
FrankyCPP_v<major>.<minor> - Arena:
FrankyCPP_v<major>.<minor>_Arena(strength testing framework) - Tests:
FrankyCPP_v<major>.<minor>_Test(whenFRANKYCPP_BUILD_TESTS=ON) - Benchmarks:
FrankyCPP_v<major>.<minor>_Bench(whenFRANKYCPP_BUILD_BENCHMARKS=ON) - Release Package: Use
cmake --installto createRelease/FrankyCPP_v<version>/folder and ZIP (see "Creating a Release Package" section above).
The opening book uses Boost serialization to cache compiled book data in .bin files for faster loading. These cache files are platform-specific and cannot be shared between Windows and Linux due to differences in native type sizes (e.g., sizeof(long)).
Cache file naming:
- Windows:
book.txt.cache.v0.7.win.bin - Linux:
book.txt.cache.v0.7.linux.bin - macOS:
book.txt.cache.v0.7.macos.bin
What happens:
- First run: Opening book is parsed from
.txtor.pgnfiles and a platform-specific.cache.v<version>.<platform>.binfile is created - Subsequent runs: Platform-specific cache file is loaded for faster startup
- Cross-platform: Each platform has its own cache file, no conflicts or regeneration needed
Benefits:
- β No cache regeneration when switching between Windows and Linux builds on same machine
- β Both caches can coexist in the same directory
- β Automatic platform detection
Note: Cache files (*.cache.*.bin) are excluded from version control via .gitignore.