Since you’re here...

We hope you will consider supporting us today. We need your support to continue to exist, because good entries are more and more work time. Every reader contribution, however big or small, is so valuable. Support "Chess Engines Diary" even a small amount– and it only takes a minute. Thank you.
============================== My email: jotes@go2.pl



Deep Becky 1.2 - new version chess engine


Deep Becky - UCI chess engine
Author: Diogo de Oliveira Almeida

Deep Becky was born from a simple question: "Can AI create a functional UCI chess engine from scratch?"
Development began around July 2025 using conversations with ChatGPT to create the C++ code. The AI wrote 100% of the code while I provided guidance, testing, feedback, and strategic decisions about next steps.
The path was quite challenging - copying code from chat conversations to Notepad, attempting to compile, facing countless compilation errors, and when it finally compiled, dealing with recognition issues in Fritz. After many attempts and corrections, going through engines that weren't recognized, didn't make moves, or made illegal moves, I finally achieved functional code that respects all chess rules.

Deep Becky 1.2 what's new?

Deep Becky 1.2 is a major architectural restructure and search upgrade over version 1.1. The codebase was split from 8 files into 25 files with proper header/implementation separation and dedicated modules for each subsystem.

Highlights

Architecture

  • Full restructure into 25 source files with proper H/CPP separation and C++ namespaces
  • Dedicated modules: PositionSearchEvalMovePickerTranspositionTableTimeManagementUCI
  • GPL v3 license headers on all source files

Search

  • Pre-computed logarithmic LMR reduction table (Reductions[64][64]) with PV/improving/killer adjustments
  • Razoring at depth ≤ 1 when static eval is far below alpha
  • Reverse futility pruning (static null move pruning) at depth < 5
  • Internal Iterative Deepening (IID) at depth ≥ 6 when no TT move is available
  • Late move pruning — quiet moves beyond a count threshold are pruned at shallow depths
  • Futility pruning at child node — quiet moves where eval + margin can't reach alpha
  • SEE pruning for captures — losing exchanges pruned at shallow depths
  • Capture extension for sacrifice detection (SEE < 0 captures that deserve deeper analysis)
  • Dynamic contempt scaling from 20 to 200 cp based on evaluation advantage
  • Minimum depth guarantee — always completes at least 4 iterations before stopping
  • Mate finding optimization — requires stable best move before stopping on forced mate

Time Management

  • New Stockfish-style TimeManagement class with optimum/maximum time allocation
  • Stability adjustment — extends time when best move keeps changing
  • Score-drop adjustment — extends time when evaluation drops between iterations
  • Obvious move detection — plays instantly with only 1-2 legal moves or simple recaptures
  • Game phase awareness — different allocation for opening, middlegame, and endgame

Transposition Table

  • Dynamic Hash sizing via UCI option setoption name Hash value N (1–4096 MB)
  • Cache-aligned allocation for optimal CPU cache performance
  • Memory prefetching (prefetch()) before probing
  • hashfull reported in UCI info output

Bitboard Infrastructure

  • BETWEEN_BB[64][64]LINE_BB[64][64]RAY_BB[64][8] tables
  • Pin-aware legal move generation using checkersBB()pinnedBB()blockersForKing()
  • Optimized double-check handling (only king moves generated)

Evaluation

  • Pawn hash table (65536 entries) — caches pawn structure evaluation
  • Lazy evaluation — skips detailed eval when material advantage > ±2000 cp (never in endgames)

UCI & Build

  • setoption name Hash value N support
  • perft command with divide output
  • SSE4.2 profile added, PGO training with 6 diverse positions
  • Cross-platform Makefile (MSYS2 + Windows CMD)

Result

Version 1.2 represents a significant leap in both code quality and playing strength. The modular architecture enables faster development, while the many new pruning techniques and professional time management allow the engine to search deeper and play more efficiently under time pressure.

Build Notes

  • MSYS2 MinGW-w64: makemake PROFILE=bmi2make pgo PROFILE=bmi2
  • Windows CMD + MinGW: mingw32-makemingw32-make PROFILE=bmi2
  • MSVC: cl /O2 /std:c++17 /DNDEBUG /MT main.cpp magic.cpp bitboard.cpp position.cpp movegen.cpp evaluate.cpp search.cpp tt.cpp uci.cpp timeman.cpp movepick.cpp /Fe:deepbecky-v1.2-windows-x64.exe /link /LTCG


Comments