Building RedxChess: A Neural-Network Chess Engine with Bitboard Move Generation

Leader posted 1 min read

Chess engines sit at a fun intersection — they're a classic AI problem with decades of refinement, but they're also a playground for modern techniques. I wanted to build something that respected the old guard (Stockfish-style search) while leaning on neural-network evaluation for positional judgment. The result is RedxChess, a UCI-compatible engine you can play against in the browser: https://topstar-ai.github.io/play
The stack

Python + C++: Python for the orchestration, training, and UCI protocol layer. C++ for the hot path — move generation and search.
Bitboards: Each piece type gets a 64-bit integer where set bits represent occupied squares. Move generation becomes bitwise math instead of array iteration, which is dramatically faster.
Neural-network evaluation: Replaces hand-tuned material + positional heuristics. The network scores positions; the search tree uses those scores.
UCI protocol: Standard interface, so the engine plugs into any UCI-compatible GUI (Arena, Cute Chess, lichess-bot, etc.).

Search techniques
The engine implements the modern toolkit:

Alpha-beta pruning with quiescence search to avoid the horizon effect on tactical positions
Null-move pruning — assume the opponent passes; if we're still winning, the branch is likely refutable
Late-move reductions (LMR) — search later moves at shallower depth, since they're statistically less likely to be best

What I learned

Bitboards aren't just a performance trick — they make certain rules (attacks, pins, castling rights) cleaner to express than mailbox representations.
Wiring a neural net into the search is mostly a latency problem. Evaluation calls dominate runtime, so batching and quantization matter as much as the architecture.
UCI is delightfully boring. Once it works, every chess tool in the world becomes a debugger.

Try it
Play here: https://topstar-ai.github.io/play
Happy to dig into any of the search or evaluation details in the comments. If you've built an engine, I'd love to hear what you'd do differently.

chess-engine, ai, python, cpp, neural-networks, bitboards, game-development

More Posts

Tuesday Coding Tip 02 - Template with type-specific API

Jakub Neruda - Mar 10

Tuesday Coding Tip 06 - Explicit template instantiation

Jakub Neruda - Apr 7

I’m a Senior Dev and I’ve Forgotten How to Think Without a Prompt

Karol Modelski - Mar 19

Dashboard Operasional Armada Rental Mobil dengan Python + FastAPI

Masbadar - Mar 12

I Wrote a Script to Fix Audible's Unreadable PDF Filenames

snapsynapseverified - Apr 20
chevron_left

Related Jobs

View all jobs →

Commenters (This Week)

3 comments
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!