Skip to content

Releases: kelseyde/calvin-chess-engine

6.1.1

04 Jun 17:22

Choose a tag to compare

Bugfix release.

In my infinite wisdom I decided to refactor my FEN parsing code, which inadvertently broke position fen <fen> moves, which is a pre-requisite for (D)FRC games. Therefore I'm releasing a fix before CCRL FRC testing starts again this week.

The strength gains since 6.1.0 are entirely from search patches, amounting to roughly 20 STC elo.

Elo   | 20.82 +- 6.68 (95%)
Conf  | 8.0+0.08s Threads=1 Hash=8MB
Games | N: 3008 W: 842 L: 662 D: 1504
Penta | [13, 278, 763, 416, 34]
https://kelseyde.pythonanywhere.com/test/747/

The results at FRC, however, look much more promising:

Elo   | 1199.83 +- 0.00 (95%)
Conf  | 8.0+0.08s Threads=1 Hash=8MB
Games | N: 3100 W: 3100 L: 0 D: 0
Penta | [0, 0, 0, 0, 1550]
https://kelseyde.pythonanywhere.com/test/746/

πŸ› Bugfix

  • Fix position fen <fen> moves (#383)

πŸ” Search

  • Reduce depth on alpha raise (#359)
  • Dynamic policy move ordering (#361)
  • Re-write PVS (#362)
  • Update conthist in LMR re-search (#363)
  • Bad noisy futility pruning (#368)
  • Use static eval in LMP threshold (#369)
  • Secondary TT aging (#380)
  • Separate 'good' and 'bad' quiets in movepicker (#381)

How to run

To run the jar file, you will need to enable the Vector API package which Calvin uses for SIMD, via this command:

java --add-modules jdk.incubator.vector -jar path/to/calvin-chess-engine-6.1.1.jar

For CCRL testers who use ChessGUI, please also download the calvin-wrapper.jar file and place it in the same folder as the calvin jar. When loading Calvin in ChessGUI, pass this file instead of the engine jar. This wrapper allows you to run Calvin without passing in the required JVM args (which ChessGUI does not support).

--

And finally, many thanks to the kind people who have tested Calvin, and to those who have offered their advice and expertise in the chess programming Discord channels!

6.1.0

10 May 21:13

Choose a tag to compare

Calvin 6.1.0 comes with a bigger and better neural network, and many small tweaks to search.

Tests against the previous release suggest a strength increase of around 70 elo LTC / 80 elo STC:

LTC (40+0.4): Elo | 70.58 +- 7.31
STC (8+0.08): Elo | 79.61 +- 7.42

Last release I predicted that Calvin 6.0.0 would break 3600 CCRL Blitz, completely underestimating the elo compression at the top of the rating lists. For this release I will make exactly the same mistake all over again, and claim that Calvin should now be around 3600 CCRL Blitz πŸ˜„

πŸ” Search

  • Complexity LMR (#357)
  • Prior countermove bonus (#333)
  • NMP verification search (#323)
  • Hindsight LMR extension (#351)
  • Guard recaptures in Q-search (#320)
  • Scale futility margin based on move count (#336)
  • Allow history pruning in PV nodes (#319)
  • Increase LMR if previous node failed high (#349)
  • Reduce LMR if node was ever a PV node (#329)
  • No LMR for good noisies (#314)
  • Allow LMR for good noisies when !ttpv (#358)
  • Stop allowing noisy killers (#322)
  • Return fail medium for Q-search fail high (#337)
  • Reduce aspiration window widening factor (#334)
  • Decrease correction history scale (#316)
  • Add conthist to search history score (#318)
  • SPSA tunes (#325, #356)

βš–οΈ Evaluation

  • New net, add feature factoriser (#341)
  • New net, 4 -> 6 input buckets (#345)
  • New net, 6 -> 8 input buckets (#346)

⚑ Performance

  • Use SIMD for accumulator copies (#332)
  • Screlu speedup (#326)
  • Repetition detection speedup (#327)
  • Fused accumulator refreshes (#353)

How to run

To run the jar file, you will need to enable the Vector API package which Calvin uses for SIMD, via this command:

java --add-modules jdk.incubator.vector -jar path/to/calvin-chess-engine-6.1.0.jar

For CCRL testers who use ChessGUI, please also download the calvin-wrapper.jar file and place it in the same folder as the calvin jar. When loading Calvin in ChessGUI, pass this file instead of the engine jar. This wrapper allows you to run Calvin without passing in the required JVM args (which ChessGUI does not support).

--

And finally, many thanks to the kind people who have tested Calvin, and to those who have offered their advice and expertise in the chess programming Discord channels!

6.0.0

02 Mar 17:28

Choose a tag to compare

This major release of Calvin aims to achieve two significant milestones:

  • Reaching an elo rating of 3600 (CCRL Blitz).
  • Establishing Calvin as the strongest Java chess engine in the world.

Calvin 6.0.0 does not feature a new neural network or any improvements to the evaluation function. Instead, all the strength gains were found in search - the most notable being singular extensions.

Tests against the previous release suggest a strength increase of around 93 elo LTC / 67 elo STC:

LTC (40+0.4): Elo | 93.39 +- 5.84
STC (8+0.08): Elo | 67.19 +- 6.13

Those improvements give Calvin 6.0.0 an estimated rating of 3600 CCRL Blitz.

The strongest Java chess engine

I ran some tests againt Serendipity, the current top Java engine. The results show that Calvin is now significantly stronger:

LTC (40+0.4): Elo | 51.79 +- 14.33
STC (8+0.08): Elo | 71.19 +- 18.94

Therefore Calvin is (as far as I am aware) the new top Java engine in the world!

πŸ” Search Improvements

  • Singular extensions (#115)
  • Double extensions (#305)
  • Negative extensions (#306)
  • Double negative extensions (#310)
  • Fix corrhist updates (#286 / #287)
  • Use history score in PVS SEE pruning (#284)
  • Fix cutnode usage (#309)
  • Cutnode LMR (#310)
  • Futility LMR (#304)
  • Do IIR when TT depth is shallow (#312)
  • Write to TT in Q-search stand-pat beta cutoff (#298)
  • Only skip SEE pruning for good noisies (#297)
  • SPSA tune (#301)

How to run

To run the jar file, you will need to enable the Vector API package which Calvin uses for SIMD, via this command:

java --add-modules jdk.incubator.vector -jar path/to/calvin-chess-engine-6.0.0.jar

For CCRL testers who use ChessGUI, please also download the calvin-wrapper.jar file and place it in the same folder as the calvin jar. When loading Calvin in ChessGUI, pass this file instead of the engine jar. This wrapper allows you to run Calvin without passing in the required JVM args (which ChessGUI does not support).

--

And finally, many thanks to the kind people who have tested Calvin, and to those who have offered their advice and expertise in the chess programming Discord channels!

5.1.0

16 Jan 13:16

Choose a tag to compare

Calvin 5.1.0 brings significant improvements in both search and evaluation.

Calvin has a bigger and better neural network, with a hidden layer size of 1024 and 4 king buckets, horizontally mirrored.

In search, the biggest improvement was fixing Calvin's bugged SEE algorithm, which enabled many search and move ordering techniques.

Tests against the previous release suggest a strength increase of 124 elo LTC / 106 elo STC:

Elo   | 124.80 +- 7.10 (95%)
Conf  | 40.0+0.40s Threads=1 Hash=64MB
Games | N: 4000 W: 1801 L: 423 D: 1776
Penta | [6, 139, 620, 941, 294]
Elo   | 105.98 +- 7.84 (95%)
Conf  | 8.0+0.08s Threads=1 Hash=8MB
Games | N: 4008 W: 1855 L: 669 D: 1484
Penta | [46, 157, 702, 763, 336]

This puts Calvin's estimated rating somewhere between 3400-3500.

βš–οΈ Evaluation

  • New net, (768x4->1024)x2->1, horizontally mirrored, screlu, 2.7 billion positions (#270)
  • Finny tables for faster accumulator refreshes (#270)

πŸ” Search

  • Improved SEE algorithm (#236)
  • PVS SEE quiet pruning (#193)
  • PVS SEE noisy pruning (#237)
  • Cut-node IIR (#268)
  • Use cut-node in TT cutoff condition (#269)
  • Use TT hit in NMP condition (#271)
  • Stop excluding killers + promos from history bonuses (#252)
  • Remove history ageing (#260)
  • Don't correct static eval if ttMove != null (#267)
  • Tweak aspiration windows (#272)
  • Stop doing futility pruning in check (#273)
  • Always overwrite TT entry if we have an exact score (#230)
  • Don't drop into Q-search when in check (#274)
  • Increase LMP depth (#275)
  • History bonus if when bestScore > beta + margin (#278)
  • Do check extension inside the move loop (#279)

πŸ”’ Move ordering

  • Use SEE for good/bad noisy move ordering (#238)
  • Use negative pawn threshold for SEE move ordering (#239)
  • Use capthist score in SEE threshold (#249)

πŸ› Bugfix

  • Stop excluding killers + promos from history bonuses (#252)
  • Include positions before root in repetition detection (#259)

How to run

To run the jar file, you will need to enable the Vector API package which Calvin uses for SIMD, via this command:

java --add-modules jdk.incubator.vector -jar path/to/calvin-chess-engine-5.1.0.jar

For CCRL testers who use ChessGUI, please also download the calvin-wrapper.jar file and place it in the same folder as the calvin jar. When loading Calvin in ChessGUI, pass this file instead of the engine jar. This wrapper allows you to run Calvin without passing in the required JVM args (which ChessGUI does not support).

--

And finally, many thanks to the kind people who have tested Calvin, and to those who have offered their advice and expertise in the chess programming Discord channels!

5.0.2

16 Nov 08:50

Choose a tag to compare

This is another bugfix release to address some crashes and other issues that arose during testing of 5.0.0 and 5.0.1.

The main bugfix prevents Calvin crashing during very long games, where the number of ply exceeds Calvin's maximum ply of 256. Other fixes are to disable pretty print for tournament runners/GUIs (it is now disabled as soon as receiving a 'uci' command), and finally to always return a random legal move as last resort when encountering a crash.

It also includes some unrelated strength-gaining changes that I merged in the past weeks.

  • πŸ› Don't increment ply when applying UCI moves (#225)
  • πŸ› Disable pretty print for tournament runners (#226)
  • πŸ” Apply futility reductions to 'bad noisies' (#224)
  • πŸ” Overwrite TT entries where depth >= ttDepth - 4 (#229)

Tests suggest the bugfixes and search patches amount to a gain of 25 elo (LTC):

Score of Calvin DEV vs Calvin: 774 - 485 - 2741  [0.536] 4000
...      Calvin DEV playing White: 660 - 47 - 1293  [0.653] 2000
...      Calvin DEV playing Black: 114 - 438 - 1448  [0.419] 2000
...      White vs Black: 1098 - 161 - 2741  [0.617] 4000
Elo difference: 25.1 +/- 6.0, LOS: 100.0 %, DrawRatio: 68.5 %

Thank you to testers for pointing out these crashes + bugs!

How to run

Calvin is available for download as a Java jar file, or as a standalone Windows executable.

To run the jar file, you will need to enable the Vector API package which Calvin uses for SIMD, via this command:

java --add-modules jdk.incubator.vector -jar path/to/calvin-chess-engine-5.0.1.jar

5.0.1

12 Nov 06:49

Choose a tag to compare

This is a bugfix release to address some crashes caused by hitting the max search ply limit (256).

As well as a patch for this bug, this release includes a couple of elo-gaining changes that I stumbled across in the last couple of days.

LTC test vs v5.0.0 indicates a strength gain of around 13 elo:

Score of Calvin DEV vs Calvin: 819 - 669 - 2512  [0.519] 4000
Elo difference: 13.0 +/- 6.6, LOS: 100.0 %, DrawRatio: 62.8 %
  • πŸ” Write to TT in Q-search (#220)
  • πŸ” Stop extending late moves with a good history score (#219)
  • πŸ› Reset ply counter to zero after applying UCI moves (#221)
  • πŸ› In case of engine crash, play random legal move (#222)

How to run

Calvin is available for download as a Java jar file, or as a standalone Windows executable.

To run the jar file, you will need to enable the Vector API package which Calvin uses for SIMD, via this command:

java --add-modules jdk.incubator.vector -jar path/to/calvin-chess-engine-5.0.1.jar

5.0.0

10 Nov 17:56

Choose a tag to compare

The first major release of Calvin since NNUE brings with it support for FRC (Fischer Random Chess) and DFRC (Double Fischer Random Chess)!

In addition, a new neural network and multiple enhancements to Calvin's search algorithm bring a significant strength increase of around 115 elo (LTC):

Score of Calvin DEV vs Calvin: 1839 - 563 - 1598  [0.659] 4000
Elo difference: 114.8 +/- 8.5, LOS: 100.0 %, DrawRatio: 40.0 %

These results, combined with tests against other engines of similar strength, suggest an estimated rating of around 3400.

β™ŸοΈ FRC/DFRC (#217)

FRC, also known as Chess960, follows the same rules as standard chess, except the positions of the pieces on the players' home ranks are randomised, following certain rules:

  • The king must still be between the rooks,
  • The bishops must still be on squares of opposite colour,
  • White and black's pieces must be mirrored.

This leads to 960 possible starting positions, including the standard chess starting position. DFRC drops the last rule, meaning white and black can start with asymmetrical pieces.

FRC is interesting from a standpoint of a human player, since gaining an advantage through opening memorisation is effectively impossible - the player must instead rely entirely on their own creativity and skill over the board. And it's an interesting challenge for a chess programmer, since it requires that the board representation and move generation logic is much more abstract, with dynamic starting positions of the pieces and more fluid castling logic.

FRC/DFRC can be enabled via the UCI_Chess960 option.

βš–οΈ Evaluation

  • New net, 768 hidden layer, screlu, 1.2 billion positions #178

πŸ” Search

  • Pawn correction history (#74)
  • Non-pawn correction history (#163)
  • RFP quiet reductions (#209, #213)
  • FP quiet reductions (#211, #214)
  • TT non-cutoff extension (#172)
  • Capthist late move reductions (#180)
  • Don't TT cut in PV qsearch nodes (#184)
  • NMP eval-based reductions (#190)
  • Store staticEval early in TT (#208)
  • Don't check TT entry depth in qsearch (#216)
  • SPSA tune (#158)

πŸ”’ Move ordering

  • Increase history bonus if staticEval > alpha (#148)

⚑ Performance

  • Compress TT entry (#161)

πŸ’¬ Communication

  • UCI hashfull support (#151)
  • Pretty print support (#147)

How to run

Calvin is available for download as a Java jar file, or as a standalone Windows executable.

To run the jar file, you will need to enable the Vector API package which Calvin uses for SIMD, via this command:

java --add-modules jdk.incubator.vector -jar path/to/calvin-chess-engine-5.0.0.jar

4.3.0

05 Oct 19:09
4b43a99

Choose a tag to compare

Calvin 4.3.0 brings significant improvements to Calvin's evaluation function, as well as a grab bag of small gains in search and move ordering.

For evaluation Calvin uses a new neural net, with an increased hidden size of 512, trained on 950 million positions. Calvin also now uses a new activation function, switching from crelu to screlu - which brought a very significant strength jump.

In search, Calvin uses some new pruning techniques, including history pruning, history-based late move reductions, capture late move reductions, and razoring.

Test results from self-play suggest a new elo rating about 100 higher than the previous release:

STC (8+0.08):

Score of Calvin DEV vs Calvin: 655 - 234 - 611  [0.640] 1500
Elo difference: 100.2 +/- 13.7, LOS: 100.0 %, DrawRatio: 40.7 %

LTC (30+0.3):

Score of Calvin DEV vs Calvin: 214 - 57 - 229  [0.657] 500
Elo difference: 112.9 +/- 22.5, LOS: 100.0 %, DrawRatio: 45.8 %

These results, combined with tests against other engines of similar strength, suggest an estimated rating of around 3250 - 3300.

βš–οΈ Evaluation

  • Switch to screlu activation function (#122)
  • Increase hidden layer size -> 512 (#138)
  • Significant NNUE code refactor (#137)

πŸ” Search

  • History pruning (#127)
  • History reductions (#139)
  • Capture late move reductions (#142)
  • TT eval correction (#146)
  • Razoring (#131)
  • SPSA tunes (#144, #145)

πŸ”’ Move ordering

  • Only update quiet history on fail high (#113)
  • Only update capture history on fail high (#114)
  • 2-ply continuation history (#104)

⚑ Performance

  • Call garbage collector on UCI newgame (#112)
  • Optimise MovePicker (#129)

How to run

Please download one of the jar files from this release. There are two release jars: calvin-chess-engine and calvin-chess-engine-no-simd. The no-simd release is specifically for CCRL testers: since ChessGUI does not support passing Java opts to a jar file, the Vector API which Calvin uses for NNUE must be disabled.

For the standard calvin-chess-engine release, Calvin can be started by running the command:

java --add-modules jdk.incubator.vector -jar path/to/calvin-chess-engine-4.3.0.jar

For the CCRL calvin-chess-engine-no-simd release, the Java opt can be ommited:

java -jar path/to/calvin-chess-engine-no-simd-4.3.0.jar

4.2.0

19 Sep 07:22

Choose a tag to compare

Calvin 4.2.0 brings a strength increase of around 80 elo, with improvements in a few areas, in particular evaluation and move ordering.

It features a new neural net, with an increased hidden layer size of 384 trained on 470 million positions - as well as eval scaling based on the remaining material on the board. For move ordering, 1-ply conthist has been added, along with a complete re-write of the MovePicker and HistoryTable code.

The primary reason for this release though is to fix a bug that was discovered during CCRL matches, where Calvin would hang when sent a negative time by the match runner. This is apparently a common issue, and so I'm joining a long list of devs who have scrambled to fix it πŸ˜„

LTC: Elo difference: 80.6 +/- 23.9
STC: Elo difference: 82.1 +/- 23.4
Estimated strength: 3200

βš–οΈ Evaluation

  • New net: 384 HL size, 470m fens (#108)
  • Material eval scaling (#72)
  • Optimise NNUE inference / accumulator updates (#73)

πŸ”’ Move ordering

  • 1-ply conthist (#97)
  • Apply malus to all quiets that don't raise alpha (#83)
  • Clear ply + 1 killers every node (#80)

πŸ” Search

  • Use improving heuristic in RFP (#79)
  • Add fail-high aspiration depth reduction (#82)
  • Use fail-soft in quiescence (#89)
  • Tweak LMR (#93)
  • Quiescence search futility pruning (#95)

βŒ› Time management

πŸ› Bugfix

  • Fix negative time CCRL bug (#98)
  • Stop calling movegen twice when in check (#71)

How to run

Please download one of the jar files from this release. There are two release jars: calvin-chess-engine and calvin-chess-engine-no-simd. The no-simd release is specifically for CCRL testers: since ChessGUI does not support passing Java opts to a jar file, the Vector API which Calvin uses for NNUE must be disabled.

For the standard calvin-chess-engine release, Calvin can be started by running the command:

java --add-modules jdk.incubator.vector -jar path/to/calvin-chess-engine-4.2.0.jar

For the CCRL calvin-chess-engine-no-simd release, the Java opt can be ommited:

java -jar path/to/calvin-chess-engine-no-simd-4.2.0.jar

4.1.0

04 Sep 18:40

Choose a tag to compare

Calvin 4.1.0

Calvin 4.1.0 brings major improvements to time management and move ordering, many minor enhancements to search, and a very embarrassing bugfix.

Results from self-play suggest a strength jump of around 110-140 elo and an estimated CCRL strength of at least 3100.

STC: Elo difference: 116.8 +/- 20.7
LTC: Elo difference: 140.9 +/- 28.2

πŸ› Very embarrassing bugfix

On the one hand I am ashamed. On the other hand, this was the easiest free elo ever.

  • Stop searching first PV node with a null window (#69)

⏳ Time management

Implemented soft/hard time limits. The soft limit is checked at the start of each ID loop to determine whether a new iteration should be started. This saves a lot of unnecessary time from unfinished searches. The soft limit is also scaled using two heuristics: best move stability and eval stability.

  • Add soft/hard time limit (#54)
  • Add best move stability (#56)
  • Add eval stability (#59)

πŸ”’ Move ordering

Added a history malus, meaning a penalty, for all quiets that did not fail high. And history bonuses are adjusted by a 'gravity' formula that scales up bonuses when the fail high was unexpected, and scales them down when it was expected.

  • Add history malus (#64)
  • Add history gravity (#65)
  • Add MovePicker.skipQuiets (#68)

πŸ” Search

Just a bunch of random, tiny tweaks to search, resulting from trying stuff out and getting lucky.

  • Don't do IIR in check, and only when TT move is null (#49)
  • Move LMP before search extensions (#50)
  • Allow RFP at depth 5 (#51)
  • Don't expand aspiration window on the side that didn't fail (#52)
  • Futility prune before makeMove, allow FP for checks (#53)
  • Use best move from partial search (#55)
  • Don't TT cut in PV nodes (#57)
  • Increase NMP reduction (#63)
  • Allow full LMR reduction when in check (#67)

⚑ Minor optimisations

  • Fix TT mate scores and optimise TT (#62)
  • Optimise move sorting in MovePicker (#61)

βš™οΈ Refactoring / Quality of life

  • Significantly refactor and improve UCI code (#60)
  • Significantly refactor history/killer/move ordering code (#66)
  • Add bench (#60)

How to run

Please download one of the jar files from this release. There are two release jars: calvin-chess-engine and calvin-chess-engine-no-simd. The no-simd release is specifically for CCRL testers: since ChessGUI does not support passing Java opts to a jar file, the Vector API which Calvin uses for NNUE must be disabled.

For the standard calvin-chess-engine release, Calvin can be started by running the command:

java --add-modules jdk.incubator.vector -jar path/to/calvin-chess-engine-4.1.0.jar

For the CCRL calvin-chess-engine-no-simd release, the Java opt can be ommited:

java -jar path/to/calvin-chess-engine-no-simd-4.1.0.jar