Skip to content

Commit e2330f1

Browse files
committed
tuning
1 parent c1ccc8f commit e2330f1

13 files changed

Lines changed: 1721 additions & 180 deletions

File tree

‎.github/workflows/games.yml‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
base_ref:
77
description: "Base branch, tag, or commit"
88
required: false
9-
default: "HandcraftedEngine"
9+
default: "test_chesslib"
1010
rounds:
1111
description: "Max rounds for SPRT"
1212
required: false
@@ -18,7 +18,7 @@ on:
1818
output_exec:
1919
description: "Executable output file name"
2020
required: false
21-
default: "chess_engine"
21+
default: "engine"
2222

2323
permissions:
2424
contents: write
@@ -31,14 +31,14 @@ jobs:
3131
steps:
3232
- uses: actions/checkout@v4
3333
with:
34-
path: test_chesslib
34+
path: new
3535

3636
- name: Install deps
3737
run: sudo apt update && sudo apt install -y build-essential cmake
3838

3939
- name: Build new engine
4040
run: |
41-
cd test_chesslib
41+
cd new
4242
mkdir build
4343
cd build
4444
cmake .. -DCMAKE_BUILD_TYPE=Release
@@ -48,7 +48,7 @@ jobs:
4848
uses: actions/upload-artifact@v4
4949
with:
5050
name: new-engine
51-
path: test_chesslib/build/engine
51+
path: new/build/engine
5252

5353

5454
build-base:
@@ -58,14 +58,14 @@ jobs:
5858
- uses: actions/checkout@v4
5959
with:
6060
ref: ${{ github.event.inputs.base_ref }}
61-
path: handcrafted
61+
path: base
6262

6363
- name: Install deps
6464
run: sudo apt update && sudo apt install -y build-essential cmake
6565

6666
- name: Build base engine
6767
run: |
68-
cd handcrafted
68+
cd base
6969
mkdir build
7070
cd build
7171
cmake .. -DCMAKE_BUILD_TYPE=Release
@@ -75,7 +75,7 @@ jobs:
7575
uses: actions/upload-artifact@v4
7676
with:
7777
name: base-engine
78-
path: handcrafted/build/${{ github.event.inputs.output_exec }}
78+
path: base/build/${{ github.event.inputs.output_exec }}
7979

8080

8181
test:
@@ -127,3 +127,4 @@ jobs:
127127
path: |
128128
games.pgn
129129
ratings.txt
130+
results.txt

‎CMakeLists.txt‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ FetchContent_Declare(
1818
)
1919
set(BUILD_GAVIOTA OFF CACHE BOOL "Enable Gaviota TB probing" FORCE)
2020
FetchContent_MakeAvailable(chesslib tbprobe)
21-
add_executable(engine "main.cpp" "timeman.cpp" "timeman.h" "eval.h" "eval.cpp" "tune.h" "ucioption.h" "tune.cpp" "ucioption.cpp" "tt.h" "tt.cpp" "uci.cpp" "uci.h" "search.h" "search.cpp" "score.h" "score.cpp" "movepick.h" "movepick.cpp" "tb.h" "tb.cpp" "Weights.h")
21+
add_executable(engine "main.cpp" "timeman.cpp" "timeman.h" "eval.h" "eval.cpp" "tune.h" "ucioption.h" "tune.cpp" "ucioption.cpp" "tt.h" "tt.cpp" "uci.cpp" "uci.h" "search.h" "search.cpp" "score.h" "score.cpp" "movepick.h" "movepick.cpp" "tb.h" "tb.cpp" "Weights.h" "tune_cmd.h" "tune_cmd.cpp")
2222
target_link_libraries(engine PRIVATE chesslib syzygy_probe)
2323
target_include_directories(engine PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${chesslib_SOURCE_DIR})
2424
execute_process(
@@ -45,5 +45,15 @@ else()
4545
endif()
4646

4747
message(STATUS "Build Version: ${BUILD_VERSION}")
48-
add_definitions(-DBUILD_VERSION="${BUILD_VERSION}")
49-
48+
target_compile_definitions(engine PRIVATE BUILD_VERSION="${BUILD_VERSION}")
49+
option(ENGINE_TUNING "enable Texel tuning (requires csv-parser)" OFF)
50+
if (ENGINE_TUNING)
51+
FetchContent_Declare(
52+
csv
53+
GIT_REPOSITORY https://github.com/vincentlaucsb/csv-parser.git
54+
GIT_TAG master
55+
)
56+
FetchContent_MakeAvailable(csv)
57+
target_link_libraries(engine PRIVATE csv)
58+
target_compile_definitions(engine PRIVATE USE_CSV_PARSER)
59+
endif()

‎Makefile‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# :( openbench and fishtest require make
2+
TARGET = engine
3+
4+
CXX ?= g++
5+
CXXFLAGS ?= -std=c++17 -Wall -Wextra
6+
OPTFLAGS ?= -O3
7+
ifeq ($(LTO), yes)
8+
OPTFLAGS += -flto
9+
endif
10+
ifeq ($(debug),no)
11+
CXXFLAGS += -DNDEBUG
12+
endif
13+
ARCH ?= native
14+
15+
ifeq ($(ARCH), native)
16+
CXXFLAGS += -march=native -mtune=native
17+
endif
18+
ifeq ($(ARCH), avx2)
19+
CXXFLAGS += -march=haswell -mavx2 -mbmi -mbmi2 -msse4.1
20+
endif
21+
ifeq ($(ARCH), bmi2)
22+
CXXFLAGS += -mbmi2
23+
endif
24+
ifeq ($(ARCH), sse41)
25+
CXXFLAGS += -msse4.1
26+
endif
27+
ifeq ($(ARCH), x86-64)
28+
CXXFLAGS += -march=x86-64
29+
endif
30+
deps:
31+
test -d deps/chesslib || git clone https://github.com/winapiadmin/chesslib deps/chesslib
32+
test -d deps/tbprobe || git clone https://github.com/winapiadmin/tb_probing_tool deps/tbprobe
33+
SRCS = $(wildcard *.cpp) $(wildcard deps/chesslib/*.cpp) $(wildcard deps/tbprobe/*.cpp)
34+
OBJS = $(SRCS:.cpp=.o)
35+
36+
all: deps $(TARGET)
37+
38+
$(TARGET): $(OBJS)
39+
$(CXX) $(CXXFLAGS) $(OPTFLAGS) -o $(TARGET) $(OBJS)
40+
41+
%.o: %.cpp
42+
$(CXX) $(CXXFLAGS) $(OPTFLAGS) -Ideps/chesslib -Ideps/tbprobe/syzygy -c $< -o $@
43+
44+
clean:
45+
rm -f $(OBJS) $(TARGET)

‎Weights.h‎

Lines changed: 118 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,38 @@
22
#define WEIGHTS_H
33
#include "eval.h"
44
namespace engine::eval {
5-
Value tempo = 29;
6-
Value PawnValue = 82;
7-
Value KnightValue = 284;
8-
Value BishopValue = 304;
9-
Value RookValue = 461;
10-
Value QueenValue = 901;
11-
Value fianchettoBonus = 24;
12-
Value trappedBishopPenalty = 26;
13-
Value centerWeight = 2;
14-
Value mopUpKingDistWeight = 4;
15-
Value mopUpEdgeDistWeight = 17;
16-
Value spaceWeight = 1;
17-
Value bishopPairMg = 13;
18-
Value bishopPairEg = 23;
19-
Value rookOpenFileMg = 30;
20-
Value rookOpenFileEg = 25;
21-
Value rookSemiOpenFileMg = 20;
22-
Value rookSemiOpenFileEg = 17;
23-
Value doubledPawnMg = 7;
24-
Value doubledPawnEg = 18;
25-
Value isolatedPawnMg = 4;
26-
Value isolatedPawnEg = 14;
27-
Value kingShelterBaseMg = 18;
28-
Value kingShelterBaseEg = 4;
29-
Value kingShelterDecayMg = 4;
30-
Value kingShelterDecayEg = 1;
31-
Value kqkDistWeight = 17;
32-
Value kqkEdgeWeight = 18;
33-
Value krkDistWeight = 1;
34-
Value krkEdgeWeight = 9;
35-
Value kpkWeight = 15;
36-
Value mgMobilityCnt[7][8] = {
5+
inline Value tempo = 29;
6+
inline Value PawnValue = 82;
7+
inline Value KnightValue = 284;
8+
inline Value BishopValue = 304;
9+
inline Value RookValue = 461;
10+
inline Value QueenValue = 901;
11+
inline Value fianchettoBonus = 24;
12+
inline Value trappedBishopPenalty = 26;
13+
inline Value centerWeight = 2;
14+
inline Value mopUpKingDistWeight = 4;
15+
inline Value mopUpEdgeDistWeight = 17;
16+
inline Value spaceWeight = 1;
17+
inline Value bishopPairMg = 13;
18+
inline Value bishopPairEg = 23;
19+
inline Value rookOpenFileMg = 30;
20+
inline Value rookOpenFileEg = 25;
21+
inline Value rookSemiOpenFileMg = 20;
22+
inline Value rookSemiOpenFileEg = 17;
23+
inline Value doubledPawnMg = 7;
24+
inline Value doubledPawnEg = 18;
25+
inline Value isolatedPawnMg = 4;
26+
inline Value isolatedPawnEg = 14;
27+
inline Value kingShelterBaseMg = 18;
28+
inline Value kingShelterBaseEg = 4;
29+
inline Value kingShelterDecayMg = 4;
30+
inline Value kingShelterDecayEg = 1;
31+
inline Value kqkDistWeight = 17;
32+
inline Value kqkEdgeWeight = 18;
33+
inline Value krkDistWeight = 1;
34+
inline Value krkEdgeWeight = 9;
35+
inline Value kpkWeight = 15;
36+
inline Value mgMobilityCnt[7][8] = {
3737
{ 4, -1, 5, -1, -5, 3, 0, -3 },
3838
{ -7, -10, 7, -4, -7, 1, -5, -2 },
3939
{ -1, -8, -6, -3, 2, -2, 1, 7 },
@@ -42,7 +42,7 @@ Value mgMobilityCnt[7][8] = {
4242
{ -9, -1, -7, 2, -2, -7, -5, 2 },
4343
{ -4, -5, -9, -5, -3, -6, 5, -3 }
4444
};
45-
Value egMobilityCnt[7][8] = {
45+
inline Value egMobilityCnt[7][8] = {
4646
{ -8, -2, -3, 7, -4, 2, -1, -4 },
4747
{ -7, -8, -8, 3, -4, -3, 2, -9 },
4848
{ 3, -3, -10, -5, -2, -10, -4, 7 },
@@ -51,52 +51,90 @@ Value egMobilityCnt[7][8] = {
5151
{ -10, -2, -10, -2, -5, -3, 0, 0 },
5252
{ -10, 8, 7, 5, 5, 3, -1, 1 }
5353
};
54-
Value kingTropismMg[7] = { 13, 14, 6, -5, 5, 12, 6 };
55-
Value kingTropismEg[7] = { -9, -13, 3, 5, -2, 19, 4 };
56-
Value passedBonusMg[7] = { 0, 4, 13, 73, 131, 165, 39 };
57-
Value passedBonusEg[7] = { 0, 66, 59, 96, 158, 185, 22 };
58-
Value mg_knight_table[64] = { 1, -5, 8, -21, -11, -2, -24, -2, 23, 21, 13, 2, 4, -17, -7, 4,
59-
-5, -15, -8, 14, 19, -2, 2, -25, -13, 15, -1, -1, 5, -18, 5, 6,
60-
-1, -13, 1, 17, -24, -13, 14, 19, -10, 6, 1, 16, -13, -18, 8, 24,
61-
14, -21, -8, -21, -15, -1, -1, 8, -17, 22, -18, 6, -11, -4, -9, -7 };
62-
Value mg_bishop_table[64] = { 3, 21, -23, 16, 5, -20, 7, -4, 14, -15, 21, -11, 7, 2, -4, 19, -5, -4, 22, 11, 15, 25,
63-
20, -9, -3, -4, 20, 21, 10, 11, -4, -21, 9, 9, 10, 5, -3, 0, 16, 23, -1, 5, -10, -12,
64-
9, -24, -9, -10, 5, -17, -8, 5, 4, -3, 6, -4, 1, 2, 20, -4, 9, 3, -20, -22 };
65-
Value mg_rook_table[64] = { -10, 20, -13, 18, 12, -3, 13, -25, -11, 3, 10, -4, 7, 13, -24, 5,
66-
-3, -7, -19, -3, 4, -6, 13, 13, 11, 20, 16, -6, 14, -15, -16, -15,
67-
3, 7, 14, -10, -7, 20, -15, 10, 25, 1, 3, -14, 22, 5, 1, -12,
68-
-20, -13, 22, -9, 11, -2, -15, -11, 22, -14, -10, 5, 0, 9, -20, -13 };
69-
Value mg_king_table[64] = { 11, -12, -10, -19, 5, -6, -2, -10, 19, 13, -7, -3, -7, 8, -21, -24,
70-
-5, 16, 19, 2, -21, -14, 11, -16, -12, -13, -18, 14, -23, -14, 16, -5,
71-
-16, 0, -21, -12, -2, 14, -16, 17, 11, -10, 21, 14, -5, -15, 19, 13,
72-
8, -21, -13, 4, 1, 1, 16, 13, -8, 13, 6, -20, -4, 3, 8, -2 };
73-
Value mg_queen_table[64] = { -2, -2, 4, 11, 9, -2, 0, -5, 14, -2, -11, 14, -13, -11, -3, -21, 7, -14, -4, -6, -3, -16,
74-
-4, -11, -2, 9, -16, 6, -6, -12, -14, -7, -4, -22, -12, 6, 21, -4, -6, -5, -6, -7, -4, 2,
75-
13, 11, -8, 14, 18, -5, -25, 22, -14, 18, -3, 9, -13, 21, 15, -21, 13, 7, -9, 3 };
76-
Value eg_knight_table[64] = { -13, 25, -3, 3, -7, 18, -21, 3, -1, 15, -13, 3, -16, 15, -5, 8,
77-
-11, -12, 22, 14, 10, 20, 9, -6, -10, 2, -13, -7, -17, 2, 18, -19,
78-
7, 12, -23, 17, -5, 17, 10, -7, -18, -2, -10, -14, 20, 15, -13, 18,
79-
9, -8, -13, 12, 20, 17, 16, 25, 18, 20, 5, 10, -10, 2, 0, 8 };
80-
Value eg_bishop_table[64] = { -19, -12, -9, -5, 9, -14, -11, 6, -10, -10, 6, -3, 13, -18, -6, 2,
81-
25, 4, 9, -16, -3, -9, 1, 7, 3, -20, -3, 9, -20, -3, 21, 3,
82-
-8, 10, 4, -11, -8, -18, -13, 0, 10, 17, 14, -18, 21, 11, 18, 0,
83-
-16, 4, 3, 17, -9, -16, -25, -2, -17, -5, -5, 19, 12, -3, -11, -13 };
84-
Value eg_rook_table[64] = { -21, -24, 12, -12, -11, 15, -17, -22, -14, -22, -18, -5, -9, -7, 23, -2,
85-
-1, 9, 18, 3, 4, -19, 20, -21, -15, -21, 9, -11, -2, 4, -8, 15,
86-
-6, 13, -6, -10, -3, 12, 16, -18, -19, -19, 23, 3, -14, -23, 3, 15,
87-
18, -6, -24, 21, 18, 3, -2, 17, 8, 13, -11, -13, 0, -16, -4, -10 };
88-
Value eg_king_table[64] = { -14, 17, 13, -10, -15, 3, -8, -3, 19, 19, -2, 6, -2, 7, -7, -7, 21, 10, 17, -21, 0, 15,
89-
-6, -9, -7, 24, 8, 0, 17, 12, -4, -6, 8, -16, 19, 0, 9, 20, 18, 12, -12, -2, -4, -14,
90-
21, 2, -6, -5, 17, -2, -3, -9, -1, -23, 7, -14, 9, 2, 22, -20, 3, 22, -10, 2 };
91-
Value eg_queen_table[64] = { -7, -3, 13, 11, 2, 17, 2, -19, 12, -5, -2, -11, 2, -7, 19, 2,
92-
-1, 15, 19, 1, 15, 8, -19, -6, -14, -25, -8, 22, 4, -22, -10, 20,
93-
3, -1, -3, -17, 12, -3, -4, -4, -7, 16, -18, -22, -2, -11, 4, -14,
94-
-7, -15, -8, 9, 20, 8, -2, -1, 8, 18, 20, -23, -12, -8, 6, -11 };
95-
Value mg_pawn_table[56] = { 0, 0, 0, 0, 0, 0, 0, 0, -16, 4, 6, -22, -16, -20, 4, -13, 2, -24, -12,
96-
-7, -3, -11, -5, 6, -15, -9, 2, -14, 2, -18, -7, -10, 1, 15, -7, -6, 22, -13,
97-
-6, 2, -16, -9, 14, -2, 23, -18, 8, 6, -2, -8, -1, -4, -10, -1, 18, -12 };
98-
Value eg_pawn_table[56] = { 0, 0, 0, 0, 0, 0, 0, 0, -4, 1, -2, -5, -20, 13, -17, -2, 2, 24, 12,
99-
-14, -4, 2, -17, -4, 15, -9, 8, 11, -24, -4, -14, -10, -13, -11, -6, -17, -4, 17,
100-
-14, -3, -17, -19, -10, -19, -23, 9, 13, -3, -7, -5, -9, 21, 8, -17, 7, 13 };
54+
inline Value kingTropismMg[7] = { 13, 14, 6, -5, 5, 12, 6 };
55+
inline Value kingTropismEg[7] = { -9, -13, 3, 5, -2, 19, 4 };
56+
inline Value passedBonusMg[7] = { 0, 4, 13, 73, 131, 165, 39 };
57+
inline Value passedBonusEg[7] = { 0, 66, 59, 96, 158, 185, 22 };
58+
inline Value mg_knight_table[64] = { 1, -5, 8, -21, -11, -2, -24, -2, 23, 21, 13, 2, 4, -17, -7, 4,
59+
-5, -15, -8, 14, 19, -2, 2, -25, -13, 15, -1, -1, 5, -18, 5, 6,
60+
-1, -13, 1, 17, -24, -13, 14, 19, -10, 6, 1, 16, -13, -18, 8, 24,
61+
14, -21, -8, -21, -15, -1, -1, 8, -17, 22, -18, 6, -11, -4, -9, -7 };
62+
inline Value mg_bishop_table[64] = { 3, 21, -23, 16, 5, -20, 7, -4, 14, -15, 21, -11, 7, 2, -4, 19, -5, -4, 22, 11, 15, 25,
63+
20, -9, -3, -4, 20, 21, 10, 11, -4, -21, 9, 9, 10, 5, -3, 0, 16, 23, -1, 5, -10, -12,
64+
9, -24, -9, -10, 5, -17, -8, 5, 4, -3, 6, -4, 1, 2, 20, -4, 9, 3, -20, -22 };
65+
inline Value mg_rook_table[64] = { -10, 20, -13, 18, 12, -3, 13, -25, -11, 3, 10, -4, 7, 13, -24, 5,
66+
-3, -7, -19, -3, 4, -6, 13, 13, 11, 20, 16, -6, 14, -15, -16, -15,
67+
3, 7, 14, -10, -7, 20, -15, 10, 25, 1, 3, -14, 22, 5, 1, -12,
68+
-20, -13, 22, -9, 11, -2, -15, -11, 22, -14, -10, 5, 0, 9, -20, -13 };
69+
inline Value mg_king_table[64] = { 11, -12, -10, -19, 5, -6, -2, -10, 19, 13, -7, -3, -7, 8, -21, -24,
70+
-5, 16, 19, 2, -21, -14, 11, -16, -12, -13, -18, 14, -23, -14, 16, -5,
71+
-16, 0, -21, -12, -2, 14, -16, 17, 11, -10, 21, 14, -5, -15, 19, 13,
72+
8, -21, -13, 4, 1, 1, 16, 13, -8, 13, 6, -20, -4, 3, 8, -2 };
73+
inline Value mg_queen_table[64] = { -2, -2, 4, 11, 9, -2, 0, -5, 14, -2, -11, 14, -13, -11, -3, -21, 7, -14, -4, -6, -3, -16,
74+
-4, -11, -2, 9, -16, 6, -6, -12, -14, -7, -4, -22, -12, 6, 21, -4, -6, -5, -6, -7, -4, 2,
75+
13, 11, -8, 14, 18, -5, -25, 22, -14, 18, -3, 9, -13, 21, 15, -21, 13, 7, -9, 3 };
76+
inline Value eg_knight_table[64] = { -13, 25, -3, 3, -7, 18, -21, 3, -1, 15, -13, 3, -16, 15, -5, 8,
77+
-11, -12, 22, 14, 10, 20, 9, -6, -10, 2, -13, -7, -17, 2, 18, -19,
78+
7, 12, -23, 17, -5, 17, 10, -7, -18, -2, -10, -14, 20, 15, -13, 18,
79+
9, -8, -13, 12, 20, 17, 16, 25, 18, 20, 5, 10, -10, 2, 0, 8 };
80+
inline Value eg_bishop_table[64] = { -19, -12, -9, -5, 9, -14, -11, 6, -10, -10, 6, -3, 13, -18, -6, 2,
81+
25, 4, 9, -16, -3, -9, 1, 7, 3, -20, -3, 9, -20, -3, 21, 3,
82+
-8, 10, 4, -11, -8, -18, -13, 0, 10, 17, 14, -18, 21, 11, 18, 0,
83+
-16, 4, 3, 17, -9, -16, -25, -2, -17, -5, -5, 19, 12, -3, -11, -13 };
84+
inline Value eg_rook_table[64] = { -21, -24, 12, -12, -11, 15, -17, -22, -14, -22, -18, -5, -9, -7, 23, -2,
85+
-1, 9, 18, 3, 4, -19, 20, -21, -15, -21, 9, -11, -2, 4, -8, 15,
86+
-6, 13, -6, -10, -3, 12, 16, -18, -19, -19, 23, 3, -14, -23, 3, 15,
87+
18, -6, -24, 21, 18, 3, -2, 17, 8, 13, -11, -13, 0, -16, -4, -10 };
88+
inline Value eg_king_table[64] = { -14, 17, 13, -10, -15, 3, -8, -3, 19, 19, -2, 6, -2, 7, -7, -7, 21, 10, 17, -21, 0, 15,
89+
-6, -9, -7, 24, 8, 0, 17, 12, -4, -6, 8, -16, 19, 0, 9, 20, 18, 12, -12, -2, -4, -14,
90+
21, 2, -6, -5, 17, -2, -3, -9, -1, -23, 7, -14, 9, 2, 22, -20, 3, 22, -10, 2 };
91+
inline Value eg_queen_table[64] = { -7, -3, 13, 11, 2, 17, 2, -19, 12, -5, -2, -11, 2, -7, 19, 2,
92+
-1, 15, 19, 1, 15, 8, -19, -6, -14, -25, -8, 22, 4, -22, -10, 20,
93+
3, -1, -3, -17, 12, -3, -4, -4, -7, 16, -18, -22, -2, -11, 4, -14,
94+
-7, -15, -8, 9, 20, 8, -2, -1, 8, 18, 20, -23, -12, -8, 6, -11 };
95+
inline Value mg_pawn_table[56] = { 0, 0, 0, 0, 0, 0, 0, 0, -16, 4, 6, -22, -16, -20, 4, -13, 2, -24, -12,
96+
-7, -3, -11, -5, 6, -15, -9, 2, -14, 2, -18, -7, -10, 1, 15, -7, -6, 22, -13,
97+
-6, 2, -16, -9, 14, -2, 23, -18, 8, 6, -2, -8, -1, -4, -10, -1, 18, -12 };
98+
inline Value eg_pawn_table[56] = { 0, 0, 0, 0, 0, 0, 0, 0, -4, 1, -2, -5, -20, 13, -17, -2, 2, 24, 12,
99+
-14, -4, 2, -17, -4, 15, -9, 8, 11, -24, -4, -14, -10, -13, -11, -6, -17, -4, 17,
100+
-14, -3, -17, -19, -10, -19, -23, 9, 13, -3, -7, -5, -9, 21, 8, -17, 7, 13 };
101+
inline Value developedMg = 10;
102+
inline Value developedEg = 5;
103+
inline Value outpostBonusKnight[2] = { 15, 30 };
104+
inline Value outpostBonusBishop[2] = { 10, 20 };
105+
inline Value kingProtector[6][2] = {
106+
{ 0, 0 },
107+
{ 8, 12 },
108+
{ 5, 10 },
109+
{ 10, 15 },
110+
{ 3, 5 },
111+
{ 0, 0 }
112+
};
113+
inline Value threatByMinor[7][2] = {
114+
{ 0, 0 },
115+
{ 0, 0 },
116+
{ 15, 25 },
117+
{ 15, 25 },
118+
{ 25, 35 },
119+
{ 35, 50 }
120+
};
121+
inline Value threatByRook[7][2] = {
122+
{ 0, 0 },
123+
{ 0, 0 },
124+
{ 10, 15 },
125+
{ 10, 15 },
126+
{ 20, 25 },
127+
{ 25, 35 }
128+
};
129+
inline Value hangingScore = 60;
130+
inline Value overloadScore = 25;
131+
inline Value threatByRankScore = 10;
132+
inline Value minorImWt = 25;
133+
inline Value bishopImWt = 10;
134+
inline Value rookImWt = 15;
135+
inline Value queenImWt = 40;
136+
inline Value rammedPawnPenalty = 10;
137+
inline Value rookOnSeventhBonus = 20;
138+
inline Value earlyQueenPenalty = 15;
101139
} // namespace engine::eval
102140
#endif

0 commit comments

Comments
 (0)