Skip to content

Commit

Permalink
Tune eval parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
mhonert committed Jul 25, 2020
1 parent 46e5eb4 commit b1ce305
Show file tree
Hide file tree
Showing 12 changed files with 914 additions and 277 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ public/as-api.wasm.map

# PGN files
**/pgn/*

# FEN files
**/fen/*
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ This project is licensed under the GNU General Public License - see the [LICENSE
### Attributions
* Images for the chess pieces come from [Wikimedia Commons](https://commons.wikimedia.org/wiki/Category:SVG_chess_pieces)
* The opening book was generated from a selection of chess games from the [FICS Games Database](https://www.ficsgames.org)
* A set of 725000 [test positions](https://bitbucket.org/zurichess/tuner/downloads/) collected by the author of Zurichess was used to tune all evaluation parameters
15 changes: 7 additions & 8 deletions artifacts/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@

This release contains many small improvements, but the largest ELO gain came from the new mobility evaluation :cartwheeling:
This release focussed on tuning the evaluation function :balance_scale:
> The Web App version of **Wasabi Chess** can be played [**here**](https://mhonert.github.io/chess).
## Changes
- Add mobility evaluation
- UCI: output mate distance as score when a mate was found
- Evaluation: provide bonus for pawns covering pawns and knights
- Adjust piece and move ordering values
- Slightly increase LMR threshold
- Simplify and tune futility margin calculation
- Directly jump to quiescence search for futile positions at depth 1
- New tuning tool
- Tuned all evaluation parameters
- Replaced simple mobility score calculation with mobility score table
- Replaced simple king safety calculation with king threat score table
- Improved game phase calculation for tapered eval
- Added endgame piece square tables

## Installation
- Download and unpack the archive for your platform (Linux or Windows 8/10)
Expand Down
2 changes: 1 addition & 1 deletion assembly/__tests__/board.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ describe('King threats', () => {
const board: Board = fromFEN("2kr4/ppp5/2n5/5p2/1Pb1P3/P4P2/1BP1RKrq/R7 w - - 0 28")

board.getMaterialScore()
expect(board.getMaterialScore() - board.getScore()).toBeGreaterThan(90, "King threat penalty is not high enough")
expect(board.getMaterialScore() - board.getScore()).toBeGreaterThan(70, "King threat penalty is not high enough")
});
});

Expand Down
6 changes: 3 additions & 3 deletions assembly/__tests__/engine.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ describe('Finds moves', () => {
]);
board.increaseHalfMoveCount();

board.performEncodedMove(findBestMoveIncrementally(board, BLACK, 11, 0));
board.performEncodedMove(findBestMoveIncrementally(board, WHITE, 3, 0));
board.performEncodedMove(findBestMoveIncrementally(board, BLACK, 5, 0));
board.performEncodedMove(findBestMoveIncrementally(board, BLACK, 13, 0));
board.performEncodedMove(findBestMoveIncrementally(board, WHITE, 5, 0));
board.performEncodedMove(findBestMoveIncrementally(board, BLACK, 9, 0));
board.performEncodedMove(findBestMoveIncrementally(board, WHITE, 3, 0));
board.performEncodedMove(findBestMoveIncrementally(board, BLACK, 1, 0));

Expand Down
2 changes: 1 addition & 1 deletion assembly/bitboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const BLACK_QUEEN_SIDE_CASTLING_BIT_PATTERN: u64 = 0b00000000_00000000_00
export const LIGHT_COLORED_FIELD_PATTERN: u64 = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
export const DARK_COLORED_FIELD_PATTERN: u64 = 0b10101010_10101010_10101010_10101010_10101010_10101010_10101010_10101010;

const KING_DANGER_ZONE_SIZE: i32 = 3;
export const KING_DANGER_ZONE_SIZE: i32 = 2;

function isBorder(boardPos: i32): bool {
if (boardPos < 21 || boardPos > 98) {
Expand Down
Loading

0 comments on commit b1ce305

Please sign in to comment.