IronPhoenix is a high-performance 4-player chess Teams engine written in modern C++20.
It is built around the chess.com-style 4PC cross board, team-aware search, fast move generation, handcrafted evaluation, and PhoenixNet, a purpose-built NNUE evaluator for four-player Teams chess.
โค๏ธ Built with love by Nick.
IronPhoenix is designed for 4-player Teams chess:
- Red + Yellow vs Blue + Green
- Turn order: Red โ Blue โ Yellow โ Green
- 14ร14 cross-shaped board
- 160 playable squares
- Team-aware king safety and terminal king-capture handling
- Four-player castling, promotion, en-passant, and move-generation rules
- Four-player FEN parsing and position setup
The engine evaluates positions from the side-to-move team perspective: positive scores favor the team whose player is currently moving.
IronPhoenix includes a modern alpha-beta search stack designed specifically for four-player Teams chess:
- Negamax / PVS-style search
- Quiescence search
- Aspiration Windows
- Transposition tables
- History-based move ordering
- Static Exchange Evaluation (SEE)
- Late Move Reductions (LMR)
- Late Move Pruning (LMP)
- Search pruning and reductions
- Iterative deepening
- Principal variation reporting
- Time / depth search limits
- MultiPV root search
MultiPV=1 keeps the normal single-PV search path. Higher values use the dedicated MultiPV root search.
setoption name MultiPV value 4
go depth 8
IronPhoenix supports two evaluation paths.
The HCE currently provides the engine's deterministic fallback and PhoenixNet teacher foundation, including:
- Material
- Mobility
- Team-relative scoring
PhoenixNet is IronPhoenix's native neural evaluator.
Current PhoenixNet v1 architecture:
- 65,280 sparse input features
- 17 king buckets
- 4 relative piece colors
- 6 piece types
- Own-king feature stream
- Partner-king feature stream
- 128-wide shared feature transformer
256 โ 32 โ 32 โ 1dense network- Centipawn-like side-to-move-team output
If ironphoenix.nnue is available beside the executable, IronPhoenix loads it automatically. Otherwise it falls back to HCE.
For the full PhoenixNet architecture, dataset format, training flow, export format, append/resume support, and generator options, see ๐ง PhoenixNet NNUE documentation.
- CMake 3.24+
- A C++20 compiler
- Visual Studio / MSVC, Clang, or GCC
- Threads support
From the project root:
cmake -S . -B build -DIRONPHOENIX_BUILD_DATASET_GENERATOR=ON
cmake --build build --config ReleaseTo build only the engine:
cmake --build build --config Release --target ironphoenixTo build only the PhoenixNet dataset generator:
cmake --build build --config Release --target ironphoenix_datasetIf you are using the Visual Studio CMake x64-release layout used during development:
cmake --build out\build\x64-release --target ironphoenix
cmake --build out\build\x64-release --target ironphoenix_datasetLaunch the engine executable and enter UCI-style commands:
uci
isready
position startpos
go depth 8
Enable MultiPV:
setoption name MultiPV value 4
position startpos
go depth 8
Useful engine options include:
setoption name Hash value 256
setoption name MultiPV value 4
setoption name Clear Hash
The project builds a native dataset generator:
ironphoenix_dataset
It generates self-play positions using the engine search as a teacher and stores the exact sparse features consumed by PhoenixNet.
ironphoenix_dataset.exe --positions 500000 --depth 8 --workers 8 --hash 16 --random-plies 8 --skip-plies 12 --sample-every 3 --exploration 0.15 --exploration-multipv 4 --exploration-temperature 120 --exploration-max-loss 250 --dedup --output "..\..\..\nnue\phoenix-v1.ipd"The generator supports:
- Parallel self-play workers
- Controlled MultiPV exploration
- Single-PV search for non-exploration positions
- NNUE-feature deduplication
- Randomized opening plies
- Native compact
.ipddatasets - Safe append mode
- Resume-to-total mode
- Graceful
Ctrl+Cstopping - Recovery of complete records from older interrupted runs
- Progress reporting every 10 saved positions
Press Ctrl+C once. The generator stops active searches, joins its workers, flushes records, and commits the current dataset count.
Resume toward a total target:
ironphoenix_dataset.exe --resume --positions 500000 --depth 8 --workers 8 --hash 16 --dedup --output "..\..\..\nnue\phoenix-v1.ipd"If the file already contains 50,000 positions, this produces only the remaining 450,000.
Create a Python environment:
py -m venv nnue\.venv
.\nnue\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install torch numpyTrain:
python nnue\train.py nnue\phoenix-v1.ipd `
--epochs 20 `
--batch-size 1024 `
--lr 0.001 `
-o nnue\phoenixnet-v1.ptExport to the native IronPhoenix NNUE format:
python nnue\export.py nnue\phoenixnet-v1.pt `
-o ironphoenix.nnue `
--output-scale 400Place ironphoenix.nnue beside ironphoenix.exe and start the engine. A successful load prints:
PhoenixNet loaded: ironphoenix.nnue
IronPhoenix/
โโโ include/ironphoenix/ # Public engine headers
โโโ src/ # Engine implementation
โโโ tools/ # Dataset generation tools
โโโ tests/ # Correctness tests and benchmarks
โโโ nnue/ # PhoenixNet model, trainer, exporter, docs
โโโ CMakeLists.txt # Build configuration
โโโ README.md # Project overview
IronPhoenix is under active development. Current and planned work includes:
- Stronger handcrafted evaluation terms
- Larger and more diverse PhoenixNet datasets
- Incremental NNUE accumulators
- Quantized NNUE weights
- SIMD / AVX2 inference
- Search tuning and SPRT testing
- Opening-book / explorer integration
- Continued search-performance work
PhoenixNet v1 intentionally keeps a straightforward full-refresh inference path as a correctness baseline before aggressive optimization.
IronPhoenix is developed by Nick / KnightStackSys as a dedicated high-performance engine for 4-player Teams chess.
๐ฅ Build. Search. Learn. Rise.