Skip to content

Releases: pkrisz99/Renegade

Renegade 1.1.0

26 Jun 19:00
Compare
Choose a tag to compare

Renegade 1.1.0 (June 26, 2024)

It's been a while, but it's time for another release!

Renegade now features a bigger and much better neural network. The final iteration was trained on over 2.7 billion positions obtained from self-play of various development versions. FRC support was added, and the training dataset now includes a small portion of DFRC games as well.

A few search improvements had been made, but the more notably, a big part of the code was rewritten now that I'm more experienced with engine development. This has little effect on playing strength, but it is good for my sanity, and for everyone who dares to look at the source code, though still plenty of work left to be done in this regard.

As always, huge thanks to everyone who ran tests, tournaments, and to those who helped me and gave me feedback, I appreciate you all!

Changelog

  • Neural net improvements
    • Regenerated the whole dataset, now amounting to over 2.78 billion positions
    • Increased arch size, now (768->1024)x2->1
    • Using QA=255 quantization again with improved order of operations
    • Training with tapered WDL proportion
  • Search improvements
    • Added double extensions
    • Added multicut for non-PV nodes
    • Adjusting reductions in LMR based on cutoff count
    • Changed RFP margin calculations when improving
    • When not improving, reduced move counts before LMP kicks in
    • Reduced default aspiration window size
    • Not performing futility pruning if the history score is high enough
  • Added FRC (and DFRC) support
  • Simplifications
    • No longer reducing less when giving check
    • Removed fallback move ordering method when history score is 0
    • Removed additional en passant threat calculations when previous move was a pawn double push
  • Support for search parameter tuning
  • Performance improvements
    • Using static move lists in move generation
    • Partial insertion sort for faster move ordering
    • Not recalculating the whole hash after a null move
    • More efficient calculation of threats
    • Prefetching for null-move pruning
    • Added a proper (but not great) way of checking
  • Refactored code
    • Saner separation of files
    • Rewritten position handling
  • Updated WDL models

Progression testing: (10s+0.1, Pohl.pgn)

Score of Renegade 1.1.0 vs Renegade 1.0.0: 520 - 87 - 393  [0.717] 1000
...      Renegade 1.1.0 playing White: 417 - 3 - 81  [0.913] 501
...      Renegade 1.1.0 playing Black: 103 - 84 - 312  [0.519] 499
...      White vs Black: 501 - 106 - 393  [0.698] 1000
Elo difference: 161.1 +/- 17.2, LOS: 100.0 %, DrawRatio: 39.3 %

You know the drill, expect less for balanced books and against other engines.

The provided binaries are targeting x86-64-bmi2 (v3 microarchitecture level).

Renegade 1.0.0

13 Jan 19:26
Compare
Choose a tag to compare

Renegade 1.0.0 (January 13, 2024)

After 15 months of development, I'm happy to announce version 1.0.0 of Renegade!

This release introduces NNUE evaluation, resulting in a large jump in playing strength. The medium-sized network was trained purely on self-play, starting with a custom king tropism-only evaluation, hopefully resulting in an interesting style of play. In total, close to a billion positions were generated during training.

A number of search improvements were added as well, alongside some much-needed bug fixes.

Finally, I would like to take this opportunity to thank everyone who helped me during the development of Renegade, providing feedback, and answering the countless questions I had! I've learned so much during the last year, and it improved my programming skills tremendously.

Changelog

  • Implemented a significantly stronger evaluation using NNUE
    • Network arch is 768->512x2->1 (perspective net) with a SCReLU activation
    • Trained on 640 million positions of self-play using bullet
    • Started learning from a king tropism only evaluation
  • Added win-draw-loss model using Stockfish's WDL tool
    • Normalized evaluation scores, 100 cp = 50% chance of winning
  • Search improvements
    • Added singular extensions
    • Added continuation history for ply-1, ply-2 and ply-4
    • Implemented threat history
    • Implemented node time management
    • Reductions for LMR are adjusted depending on history score
    • Doing LMR in check
    • History scores persist between searches
    • No check extensions on root
    • Changes to improving heuristic
    • Breaking out of the moves loop during LMP and futility pruning
    • Prefetching transposition table entries
    • Insta-move when only having one legal move
    • Updated pruning guards and parameters in a lot of places
    • Adjusted time management parameters
  • Added tools for datagen (position generation with self-play for NNUE data)
  • Separate input and search threads
  • Removed support for reading opening books
  • Bugfixes
    • Fixed often incorrect SEE score calculations
    • Fixed a bug where friendly pawns can be taken via en passant after null moves
    • Fixed incorrect history bonuses/penalties

Progression testing: (10s+0.1, noob_4moves.pgn)

Score of Renegade 1.0.0 vs Renegade 0.12.0: 1450 - 7 - 43  [0.981] 1500
...      Renegade 1.0.0 playing White: 727 - 5 - 18  [0.981] 750
...      Renegade 1.0.0 playing Black: 723 - 2 - 25  [0.981] 750
...      White vs Black: 729 - 728 - 43  [0.500] 1500
Elo difference: 685.2 +/- 51.9, LOS: 100.0 %, DrawRatio: 2.9 %

Strength: ~3450 (CCRL Blitz)

The provided binaries are targeting x86-64-bmi2 (v3 microarchitecture level).

Renegade 0.12.0

12 Oct 15:39
Compare
Choose a tag to compare

Renegade 0.12.0 (October 12, 2023)

This version includes a greatly improved search, which should be much faster and less prone to errors. Some additional evaluation terms were also added.

Renegade should finally support different compilers and operating systems.

  • Improved search
    • Switched to a fail-soft principle
    • Added late-move pruning
    • LMR is done in a '3-fold' way, and it is much more aggressive (even more so in non-PV nodes)
    • The age of the entries is considered in the transposition table's replacement policy
    • Draw detection is triggered now on the first repetition, the returned score is randomized (0-2 centipawns)
    • Tightened margins for RFP, and the usage of improving heuristic to make it even narrower
    • Promotion threats (pawn pushes to 6th rank) are no longer generated in quiescence search and they are considered quiet
    • Quiescence search also uses the transposition table
    • Fixed null-move pruning's formula, and returns the evaluation instead of beta
    • Removed PV move following as it loses strength
    • Reordered some pruning and movegen code for efficiency
    • Added some previously missing pruning guards
    • Increased max depth from 32 to 128
  • Improved evaluation
    • Retuned existing evaluation weights
    • Separate PSQTs for passed pawns, and for rooks and kings on open and semi-open files
  • Added support for other compilers and operating systems
    • Clang 16 is the preferred compiler, others may or may not work
    • Added a makefile (based upon the one in Alexandria)
    • Default executables are now compiled with Clang, and should have a better performance
    • Pretty output is only supported on some compilers
    • Should be compliant with OpenBench
  • Changed time management for time controls with an increment
  • Added multithreading support to the internal tuner
  • Bugfixes
    • PV table now should always output correct moves
    • When a search is aborted, it no longer corrupts the transposition table with invalid scores
    • Sometimes forgot to use the best move from the transposition table
  • Many more smaller changes

Progression testing: (10s+0.1, noob_4moves.pgn)

Score of Renegade 0.12.0 vs Renegade 0.11.0: 5638 - 323 - 1339  [0.864] 7300
...      Renegade 0.12.0 playing White: 2802 - 177 - 671  [0.860] 3650
...      Renegade 0.12.0 playing Black: 2836 - 146 - 668  [0.868] 3650
...      White vs Black: 2948 - 3013 - 1339  [0.496] 7300
Elo difference: 321.3 +/- 9.1, LOS: 100.0 %, DrawRatio: 18.3 %

Note:

The provided binaries are targeting x86-64-bmi2 (v3 microarchitecture level).

Renegade 0.11.0

29 May 10:49
Compare
Choose a tag to compare

Renegade 0.11.0 (May 29, 2023)

  • Improved search
    • Added aspiration windows
    • Added static exchange evaluation (and related pruning techniques)
    • More aggressive late-move reductions
    • Added mate distance pruning
    • Check extensions are done at any depth, instead of only at depth 0
    • Removed non-gaining pruning (razoring + delta pruning)
    • Small update to null-move pruning formula
  • Improved speed (roughly 30% nps uplift before other features got added)
    • Optimized hash calculations (no longer using 13% of the processing time!)
    • No longer relying on fully calculated internal attack maps
    • Reduced branching in move generation
  • Improved evaluation
    • Rewritten weight structure, using the S(x, y) notation
    • More nuanced threat calculation
    • Bonus for pawns supported by other pawns
    • Pawn phalanx evaluation
    • Squares attacked by pawns no longer count towards piece mobility
    • Further tuned existing weights
  • Move ordering improvements
    • Captures with a negative SEE moved after quiet moves
  • Made transposition table entries more compact (16 bytes instead of 24)
  • Updated tuner
    • Accommodates the new weight structure
    • Quality of life improvements
  • Internal changes
    • Templated move generation
    • Added method for determining whether a square is attacked
    • Generally trying to use more of the modern C++ features
    • Added functions needed for SEE
    • Lots of clean ups
  • Updated time management for repeating time controls
    • Now it should use more time in the beginning of the game
    • Hopefully I can stop complaining about this in tournaments
  • Pretty output (unless uci command is received)
  • Node counts are incremented on make move (similarly to most engines)
  • Fixed missing staticEval >= beta condition for null-move pruning
  • Fixed search aborting if mate found when not using time constraints
  • Made everything a little less bad

Regression testing: (time control: 10s+0.1)

Score of Renegade 0.11.0 vs Renegade 0.10.0: 2010 - 240 - 550  [0.816] 2800
...      Renegade 0.11.0 playing White: 1144 - 60 - 196  [0.887] 1400
...      Renegade 0.11.0 playing Black: 866 - 180 - 354  [0.745] 1400
...      White vs Black: 1324 - 926 - 550  [0.571] 2800
Elo difference: 258.8 +/- 13.6, LOS: 100.0 %, DrawRatio: 19.6 %

General notes:

  • With this release I consider most of the low-hanging fruit done
  • Still no stop implementation, sorry LTC Banksia testers :(
  • Strength: ~2700 (based on not-too-accurate gauntlets at 90s+1.5)

Renegade 0.10.0

06 Apr 22:31
Compare
Choose a tag to compare

Renegade 0.10.0 (April 7, 2023)

  • Improved evaluation
    • Tuned most parameters, using 7.1 million positions from the lichess-big3-resolved dataset
    • Added pawn threats
    • Separate early and late game penalties for isolated pawns
    • Passed pawn bonuses depend on the rank
    • Penalty for a passer that is blocked
    • Adjusted king safety scores
    • Changed phase calculations
    • Reduced the number of expensive linear interpolation calls
  • Improved search
    • Enabled late-move reductions
    • Added reverse futility pruning
    • Much more aggressive regular futility pruning
    • Updated null-move pruning formula
    • Added internal iterative deepening
  • Move ordering updates
    • Added history heuristic (albeit with some weird behavior)
    • Cleaned it up a bit
  • Added new commands
    • bench: tests nps on 10 different positions
    • goall: prints the evaluation of all legal moves (optionally takes a parameter, which is how much time (in milliseconds) should be spent on analyzing a move, defaults to 1 second)
  • Fixed a bug in the recognition of KBvKB insufficient material draws
    • Formerly this led to the engine refusing to make moves (returning bestmove 0000)

Regression testing: (time control: 10s+0.1)

Score of Renegade 0.10.0 vs Renegade 0.9.0: 2724 - 319 - 371  [0.852] 3414
...      Renegade 0.10.0 playing White: 1459 - 110 - 139  [0.895] 1708
...      Renegade 0.10.0 playing Black: 1265 - 209 - 232  [0.809] 1706
...      White vs Black: 1668 - 1375 - 371  [0.543] 3414
Elo difference: 304.4 +/- 14.5, LOS: 100.0 %, DrawRatio: 10.9 %

General notes:

  • I plan to slow down development after this release due to the university semester ramping up and generally being quite busy, though I'll keep working on it if I have the time
  • My next goals are not neccesarly strength-gaining, but rather to simplify the existing code (starting with the evaluation which looks horrible right now), finally responding to stop commands, as well as to check whether everything behaves correctly
  • Version for older processors haven't been checked still
  • Strength: ~2450 (according to my own testing, it also might be well off)

Renegade 0.9.0

15 Mar 19:55
Compare
Choose a tag to compare

Renegade 0.9.0 (March 15, 2023)

  • Speed improvements
    • Implemented magic bitboard lookups for sliding pieces
    • Reduced memory allocations in several places, again
    • Optimized variable types
  • New evaluation terms
    • Rooks on open and semi-open files
    • Knight outposts
  • More aggressive pruning
    • Null move pruning search reduced by 3 if depth > 6 (kept at 2 otherwise)
    • Razoring at depth 1 with margin of 300 cp (instead of 400)
    • Futility pruning extended to depth 3 with margin of 300 cp
  • Overhauled transposition table
    • Based on std::vector (no more std::unordered_map)
    • Replacement policy: always if hash is different, otherwise if depth is greater or equal
    • Stores depth and best move
    • Size calculated dynamically based on Hash parameter
    • Use debug hashalloc to show hash information
    • Added Clear Hash option
    • Not yet optimized (uses 24 bytes per entry)
  • Move ordering changes
    • Now based on MVV-LVA instead of material difference
    • Trying PV moves early only on the PV line
    • Uses the best move from the transposition table
  • Collecting more search statistics
    • First move beta cutoff rate, transposition table hit rate
    • Statistics are organized in its own struct
  • Updated method for node counting
    • Now incremented on SearchRecursive() and SearchQuiescence() calls (instead on evaluation)
    • Inflates node counts by about 25%
    • Evaluations are still counted and can be displayed by toggling ExtendedOutput
  • Better compatibility
    • Defaulting to statically linked libraries (shouldn't require external dll's)
    • Providing an exe that should work on older processors (untested, and it seems slightly slower)
  • Minor changes
    • New commands: debug isdraw (shows whether the position is a draw), debug plys (show game ply count), ch (shorthand for Clear Hash)
    • Simplified search code
  • Bugfixes
    • No longer draws in winning positions due to threefold repetitions (hopefully)
    • Fixed and expanded drawn game evaluation

Regression testing results: (time control: 10s+0.1)

Score of Renegade 0.9.0 vs Renegade 0.8.1: 1472 - 200 - 328  [0.818] 2000
...      Renegade 0.9.0 playing White: 744 - 77 - 179  [0.834] 1000
...      Renegade 0.9.0 playing Black: 728 - 123 - 149  [0.802] 1000
...      White vs Black: 867 - 805 - 328  [0.515] 2000
Elo difference: 261.1 +/- 16.8, LOS: 100.0 %, DrawRatio: 16.4 %

General notes:

  • The plan was to speed up the engine, both in nps terms, and make the search more efficient by applying more aggressive pruning to combat the low search depth. Both of these worked, more or less.
  • I've added a exe that hopefully should work with older processors, but I'm unable to verify this. I would like to support a wider range of systems in general, but it's a bigger challenge than I thought.
  • Feel free to ping me if there's any issues.
  • Strength: ~2200

Renegade 0.8.1

13 Feb 00:46
Compare
Choose a tag to compare

Version 0.8.1 (February 13, 2023)

Regression testing results: (time control: 20s+0.2)

Score of Renegade 0.8.1 vs Renegade 0.7.0: 632 - 161 - 207 [0.736]
...      Renegade 0.8.1 playing White: 330 - 63 - 107  [0.767] 500
...      Renegade 0.8.1 playing Black: 302 - 98 - 100  [0.704] 500
...      White vs Black: 428 - 365 - 207  [0.531] 1000
Elo difference: 177.7 +/- 20.9, LOS: 100.0 %, DrawRatio: 20.7 %

General notes:

This update trades speed for better evaluation. The idea is to firstly get good at evaluation, since a lot of pruning I struggle with rely on a static evaluation score. As with any work in progress engine, there can be always some bugs. If you see any weird behavior, or just have a question, feel free to open an issue.

I've also uploaded a compilation that shouldn't require any preinstalled runtime libraries. (I didn't even know they were required to begin with.) Please note, that the performance of this executable have not been tested.

Renegade 0.8.0

12 Feb 22:55
08b7274
Compare
Choose a tag to compare

Version 0.8.0 (February 12, 2023)

This version crahes when reaching depth 20. Please use 0.8.1 instead.

  • Improved search
    • Futility pruning at depths 1 and 2, with margins of 100 and 200 cp respectively
    • Razoring (dropping into early qsearch) at depth 1 with a margin of 400 cp
    • Changed null move pruning conditions
    • Limiting underpromotions in quiescence search
    • Pawn pushes to the 7th rank no longer treated as quiet
    • Move ordering changes
  • Improved evaluation
    • Calculating mobility scores (tapered, disabled at start and quickly gets activated)
    • More complex and somewhat tuned king safety eval
    • More nuanced game phase calculation
    • Evaluation score of likely drawn endgames are divided by 16 (based on an incomplete list of scenarios)
  • Checkmate and stalemate detection is now handled in search (instead of move gen)
    • This should speed up endgames
  • Further optimized memory allocations
  • Better time utilization for repeating time controls
  • Hash table gets reset and deallocated after a detected overallocation
    • Previously the std::unordered_map structure's size would remain higher than the set hash size, and would entirely disable the transposition table until the engine is restarted
    • This was a problem in hash constrained cases (in typically longer time controls)
  • Respecting the weight factor for opening books
    • This should lead to the engine playing fewer unorthodox moves while relying on them
  • Better in-console play support
    • Nicer outputs, changeable computer thinking time, ability to quit
  • fancy or plain commands to make the board drawing output prettier or more compatible
    • For example, with the old Command Prompt one should use plain
  • Fixed occasional stalemates (when capturing the opponent's last piece)

Renegade 0.7.0

15 Jan 20:14
Compare
Choose a tag to compare

Version 0.7.0 (January 15, 2023)

  • Improved evaluation
    • Support for tapered evaluation for all parameters
    • Added penalty for doubled and tripled pawns
    • Tempo bonus for the side to come
    • Bonus for passed pawns
    • Very basic king safety evaluation
    • Less aggressive pawn PSQT values for early game (same as the Simplified Evaluation), weirdly seems to help a lot with branching, and I hate how much improvement this bought
    • Late pawn PSQT remained the same as before
    • Queen material value increased to 950 cp (from 900)
    • PSQT lookup table for black mirrored properly (instead of using 63-i as index)
  • Implementation for Texel's tuning
    • Separate train and test datasets
    • Type tuner to start it
  • Improved speed
    • Quicker checkmate and stalemate checking
    • More efficient memory allocations
    • Generating occupancy lookup tables for quicker access
    • Pregenerated tables for determining the color and type of a piece
    • Storing hash value instead of regenerating it
  • Quiescence search takes promotions and en passant into account
  • Added check extensions
  • Minor changes
    • Time management takes increment into account (albeit quite conservatively)
    • Added debug halfmovecounter and debug fullmovecounter commands
    • Removed timing test from code
    • Method for FEN generation
    • eval, fen and draw commands available without the debug prefix
    • Probably many more things
  • Bugfixes
    • Fixed null move making
    • Fixed seldepth offset
    • Fixed half move counter
    • Mitigation of invalid PV output
    • Fixed double opening book loading
    • Fixed incorrect hashfull reporting (I think)
  • Cleaned up code

Important note for compiling:
Line 84 of Board.cpp should be changed from
Board(starting_fen); to Board(FEN::StartPos);
Probably it hasn't been rebuilt by the compiler

Regression testing results: (time control: 20s+0.2)

Score of Renegade 0.7.0 vs Renegade 0.6.0: 790 - 102 - 108 [0.844]
...      Renegade 0.7.0 playing White: 396 - 53 - 51  [0.843] 500
...      Renegade 0.7.0 playing Black: 394 - 49 - 57  [0.845] 500
...      White vs Black: 445 - 447 - 108  [0.499] 1000
Elo difference: 293.3 +/- 26.5, LOS: 100.0 %, DrawRatio: 10.8 %

Renegade 0.6.0

24 Dec 22:28
Compare
Choose a tag to compare
Renegade 0.6.0 Pre-release
Pre-release

Changelog

Version 0.6.0 (December 24, 2022)

  • Reintroduced quiescence search
    • Better accuracy, but reduces nps
  • Null move pruning
  • Using piece-square tables for the king as well
    • Tapered based on a game phase
  • Game phase calculation
    • 0.0 for having 32 pieces on board
    • 1.0 if 4 or less pieces remain
    • Linearly interpolated inbetween
    • 'debug gamephase' for displaying it
  • Bringing capture moves forward during move ordering
    • 25% less node evaluations needed for the same result
  • Reduced number of memory allocations
    • Slight increase in nps
  • Separated search logic from engine communication
  • Triangular (technically quadratic) PV table
    • Hash table no longer stores PVs
  • Score formatting improvements
    • Proper mate score output
    • Mate score is no longer shifted by 1 when losing
  • Cleaned up perft implementation
    • Separate perft and perftdiv commands
Score of Renegade dev vs Renegade 0.5.1: 148 - 11 - 14 [0.896]
...      Renegade dev playing White: 75 - 6 - 6  [0.897] 87
...      Renegade dev playing Black: 73 - 5 - 8  [0.895] 86
...      White vs Black: 80 - 79 - 14  [0.503] 173
Elo difference: 374.0 +/- 78.6, LOS: 100.0 %, DrawRatio: 8.1 %