SparkFish-a new open-source strong uci chess engine

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

Lester
Posts: 4
Joined: Wed Nov 18, 2026 4:45 pm
Full name: Charles Everett

SparkFish-a new open-source strong uci chess engine

Post by Lester »

Hi everyone,

I am Lester,
I'd like to introduce SparkFish, a 100% original open-source UCI chess engine written from scratch in C++20.

After the v3.x series, the upcoming SparkFish 4.0 official release will land on November 26 , featuring a brand-new NNUE architecture and heavily tuned search. (A source pre-release is already up on GitHub, and v4.1 with Syzygy, NodeTM, and Best Thread Voting is currently in local testing.)

Key Highlights of SparkFish 4.0:
- 100% Original Codebase: Written from scratch in C++20 with zero borrowed engine code.
- New K32H3 NNUE Architecture: 96-bucket horizontally mirrored input (67,584 dims) -> (1024 -> 512)x2 -> 4 LayerStacks, trained for 120 epochs on 2.0B+ unique positions with SWA.
- Single-Binary Ready: The Windows AVX2 PGO build embeds the 66 MB network now directly into the executable—no external weight configuration needed.
- Search & Features: Lazy SMP, MultiPV, UCI_ShowWDL, Polyglot (.bin) opening books, 150 iterations of SPSA tuning, and Normal / Aggressive / Solid playstyles.
-Estimated CCRl rating:3405

Benchmarks & Live Testing:
- vs SparkFish 3.2.1 (SPRT, 10+0.1): 46 - 7 - 59 (+126.3 +/- 43.7 Elo, 100.0% LOS)
-Score of 4.0 vs Sirius 8.0: 116 - 56 - 133 [0.598] 305
... 4.0 playing White: 71 - 25 - 57 [0.650] 153
... 4.0 playing Black: 45 - 31 - 76 [0.546] 152
... White vs Black: 102 - 70 - 133 [0.552] 305
Elo difference: 69.3 +/- 29.4, LOS: 100.0 %, DrawRatio: 43.6 %
SPRT: llr 2.95 (100.3%), lbound -2.94, ubound 2.94 - H1 was accepted.

- Live on Lichess url=https://lichess.org/@/SparkchessEngine]SparkchessEngine,2824 Blitz / 2877 Rapid / 2740 Bullet

GitHub Repository:
https://github.com/Lester-chess/SparkFi ... ess-Engine

Feedback, bug reports, and gauntlet testing are very welcome—especially ahead of the Nov 26 official release!
User avatar
Eelco de Groot
Posts: 4767
Joined: Sun Mar 12, 2006 2:40 am
Full name:   Eelco de Groot

Re: SparkFish-a new open-source strong uci chess engine

Post by Eelco de Groot »

Windows Defender will not run it unless you override it, but Malwarebytes says okay. If I run in console mode the AVX2 .exe warns it has not found the necessary NNUE and runs with dummy weights, so I downloaded the NNUE from the assets page and now at least UCI is okay:

Code: Select all

SparkFish 3.2.1 by SparkFish Team
info string NNUE file: "custom_1024x2.nnue" loaded and verified (46,210,308 bytes)
uci
id name SparkFish 3.2.1
id author SparkFish Team
option name UCI_Elo type spin default 2721 min 1350 max 3200
option name Hash type spin default 64 min 1 max 4096
option name Threads type spin default 1 min 1 max 256
option name NumaPolicy type combo default System var None var System var BindNode var Interleave
option name MultiPV type spin default 1 min 1 max 16
option name Style type combo default Normal var Normal var Aggressive var Solid
option name Contempt type spin default 0 min -100 max 100
option name Ponder type check default true
option name UCI_ShowWDL type check default true
option name Move Overhead type spin default 200 min 0 max 5000
option name BookPath type string default <empty>
option name EvalFile type string default custom_1024x2.nnue
uciok


All the comments are Chinese but can be translated. I would say there was probably a Chinese AI involved then? Okay success with this release and welcome to the forum, guys!
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
Lester
Posts: 4
Joined: Wed Nov 18, 2026 4:45 pm
Full name: Charles Everett

Re: SparkFish-a new open-source strong uci chess engine

Post by Lester »

Eelco de Groot wrote: ↑Fri Nov 20, 2026 7:56 am Windows Defender will not run it unless you override it, but Malwarebytes says okay. If I run in console mode the AVX2 .exe warns it has not found the necessary NNUE and runs with dummy weights, so I downloaded the NNUE from the assets page and now at least UCI is okay:

Code: Select all

SparkFish 3.2.1 by SparkFish Team
info string NNUE file: "custom_1024x2.nnue" loaded and verified (46,210,308 bytes)
uci
id name SparkFish 3.2.1
id author SparkFish Team
option name UCI_Elo type spin default 2721 min 1350 max 3200
option name Hash type spin default 64 min 1 max 4096
option name Threads type spin default 1 min 1 max 256
option name NumaPolicy type combo default System var None var System var BindNode var Interleave
option name MultiPV type spin default 1 min 1 max 16
option name Style type combo default Normal var Normal var Aggressive var Solid
option name Contempt type spin default 0 min -100 max 100
option name Ponder type check default true
option name UCI_ShowWDL type check default true
option name Move Overhead type spin default 200 min 0 max 5000
option name BookPath type string default <empty>
option name EvalFile type string default custom_1024x2.nnue
uciok


All the comments are Chinese but can be translated. I would say there was probably a Chinese AI involved then? Okay success with this release and welcome to the forum, guys!
i used Gemini4 argon to help me do some coding task,i spent a lot of time to test and train nnue
SSTATHIS
Posts: 99
Joined: Tue Jun 22, 2010 7:55 pm

Re: SparkFish-a new open-source strong uci chess engine

Post by SSTATHIS »

What happened to version 2.0?
Lester
Posts: 4
Joined: Wed Nov 18, 2026 4:45 pm
Full name: Charles Everett

Re: SparkFish-a new open-source strong uci chess engine

Post by Lester »

SSTATHIS wrote: ↑Fri Nov 20, 2026 11:18 am What happened to version 2.0?
SparkFish used Stockfish 11 source code to built sparkfish 2.0 hce.Then later i decided to develop my fully original engine,so,sparkfish2.0HCE(used to be called Sparkchess 2.0) was deleted from github.i uses 3.0 to name my new NNUE engine,and then changed name to Sparkfish.
Now the sparkfish versions in github releases are all developed by myself,with Gemini in assistance,providing some coding help.
Lester
Posts: 4
Joined: Wed Nov 18, 2026 4:45 pm
Full name: Charles Everett

Re: SparkFish-a new open-source strong uci chess engine

Post by Lester »

Since some of you noticed the version gap (why we jumped from v1.4 to v3.0) , I'd like to share the full origin story of SparkFish. It has been a crazy journey of hitting walls, making mistakes, and finally finding the right path.

1.0 to 1.3: The First Spark and Initial Lichess Bot Battles
During the Mid-Autumn Festival, I was on vacation without my computer. I wanted a 1600-1700 Elo sparring partner to regain my chess form. I used Gemini's beta "Task" feature to construct the very first version, "Sparkchess 1.0". It was a basic UCI engine with a simple hybrid of NNUE and Classical evaluation.

After registering a Lichess Bot, I analyzed its games and found the NNUE was chaotic. So I tried to train my own NNUE—a tiny 512-dimensional HalfKP with no King buckets. I just let it self-play 3,000 games without any data cleaning. As you can imagine, the result was a complete failure.

1.4: The Turning Point - Texel Tuning and SPRT
I returned to HCE development. I learned about Texel tuning from the Chess Programming Wiki and used a Quiet labeled.epd dataset to optimize piece values. Then, I discovered Cutechess-cli and SPRT, which changed everything. The Texel-tuned version was nearly 100 Elo stronger. I released v1.4.1.

The "Lost" 2.0 Phase: A Temporary Compromise
After v1.4.1, I hit a massive bottleneck. Spending 10 hours a day with zero results destroyed my confidence. So, I compromised. I took Stockfish 11's source code, added Texel tuning, and released it as v2.0. I even renamed my GitHub repo to "a fork of stockfish".

But staring at the daily win streaks on Lichess, I felt zero sense of accomplishment. I realized I didn't want to be just a fork; I wanted my own engine.

3.0 to 4.0: Starting Over and the Rebirth
I deleted the entire 2.0 series and wiped all SF11 code. I decided to build a pure NNUE engine from scratch using only 6 core source files. I dove deep into modern training pipelines using nnue-pytorch and HalfKAv2 (512-dim). When my first truly original engine showed a massive leap in SPRT, the lost sense of achievement finally returned.

I subsequently released 3.0, 3.1, and 3.2.1. I designed the SparkFish logo, built the official website, and today, SparkFish 4.0features the 96-bucket K32H3 network, reaching 2870+ on Lichess, scheduled for release on Thanksgiving (Nov 26).

Thank you to the open-source community (Stockfish data, NNUE pioneers) for making a solo developer's dream possible. I look forward to your feedback on v4.0!

Best regards,
Lester
User avatar
Sylwy
Posts: 5498
Joined: Fri Apr 21, 2006 4:19 pm
Location: IAȘI - the historical capital of MOLDOVA
Full name: Silvian Rucsandescu

Re: SparkFish-a new open-source strong uci chess engine

Post by Sylwy »

Just compiled ! :lol:

Image