Skip to content

Commit

Permalink
Bench: 5436643
Browse files Browse the repository at this point in the history
  • Loading branch information
jhonnold committed Sep 28, 2023
1 parent f0d32c7 commit 94d6d6b
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 23 deletions.
11 changes: 0 additions & 11 deletions src/eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@
const int PHASE_VALUES[6] = {0, 3, 3, 5, 10, 0};
const int MAX_PHASE = 64;

void SetContempt(int* dest, int stm) {
int contempt = CONTEMPT;

dest[stm] = contempt;
dest[stm ^ 1] = -contempt;
}

// "Threats" logic to be utilized in search
// idea originating in Koivisto
void Threats(Threat* threats, Board* board, int stm) {
Expand Down Expand Up @@ -113,7 +106,6 @@ Score Evaluate(Board* board, ThreadData* thread) {
Score knownEval = EvaluateKnownPositions(board);
if (knownEval != UNKNOWN) return knownEval;

SearchData* data = &thread->data;
int16_t* stm = board->accumulators[board->stm][board->acc];
int16_t* xstm = board->accumulators[board->xstm][board->acc];

Expand All @@ -122,9 +114,6 @@ Score Evaluate(Board* board, ThreadData* thread) {
// sf cornered bishop in FRC
if (CHESS_960) score += FRCCorneredBishop(board);

// static contempt
score += data->contempt[board->stm];

// scaled based on phase [1, 1.5]
score = (128 + board->phase) * score / 128;

Expand Down
1 change: 0 additions & 1 deletion src/eval.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
extern const int PHASE_VALUES[6];
extern const int MAX_PHASE;

void SetContempt(int* dest, int stm);
void Threats(Threat* threats, Board* board, int stm);
Score Evaluate(Board* board, ThreadData* thread);

Expand Down
2 changes: 1 addition & 1 deletion src/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ DEFS = -DVERSION=\"$(VERSION)\" -DEVALFILE=\"$(EVALFILE)\" -DNDEBUG
# Flags
STD = -std=gnu11
LIBS = -pthread -lm
WARN = -Wall -Wextra -Wshadow -Werror
WARN = -Wall -Wextra -Wshadow

FLAGS = $(STD) $(WARN) -O3 -flto -g $(DEFS)
CFLAGS = $(FLAGS) -march=native
Expand Down
3 changes: 0 additions & 3 deletions src/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ void* Search(void* arg) {
RefreshAccumulator(board->accumulators[WHITE][board->acc], board, WHITE);
RefreshAccumulator(board->accumulators[BLACK][board->acc], board, BLACK);

data->contempt[WHITE] = data->contempt[BLACK] = 0;
SetContempt(data->contempt, board->stm);

// set a hot exit point for this thread
if (!setjmp(thread->exit)) {
int searchStability = 0;
Expand Down
2 changes: 0 additions & 2 deletions src/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ typedef struct {

Move* moves;

int contempt[2];

int de[MAX_SEARCH_PLY]; // double extensions

Move skipMove[MAX_SEARCH_PLY]; // moves to skip during singular search
Expand Down
4 changes: 0 additions & 4 deletions src/uci.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ int MOVE_OVERHEAD = 300;
int MULTI_PV = 1;
int PONDER_ENABLED = 0;
int CHESS_960 = 0;
int CONTEMPT = 12;
volatile int PONDERING = 0;

void RootMoves(SimpleMoveList* moves, Board* board) {
Expand Down Expand Up @@ -228,7 +227,6 @@ void PrintUCIOptions() {
printf("option name Ponder type check default false\n");
printf("option name UCI_Chess960 type check default false\n");
printf("option name MoveOverhead type spin default 300 min 100 max 10000\n");
printf("option name Contempt type spin default 12 min -100 max 100\n");
printf("option name EvalFile type string default <empty>\n");
printf("uciok\n");
}
Expand Down Expand Up @@ -387,8 +385,6 @@ void UCILoop() {
ResetThreadPool(threads);
} else if (!strncmp(in, "setoption name MoveOverhead value ", 34)) {
MOVE_OVERHEAD = min(10000, max(100, GetOptionIntValue(in)));
} else if (!strncmp(in, "setoption name Contempt value ", 30)) {
CONTEMPT = min(100, max(-100, GetOptionIntValue(in)));
} else if (!strncmp(in, "setoption name EvalFile value ", 30)) {
char* path = in + 30;
int success = 0;
Expand Down
1 change: 0 additions & 1 deletion src/uci.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "types.h"

extern int CHESS_960;
extern int CONTEMPT;

void RootMoves(SimpleMoveList* moves, Board* board);

Expand Down

0 comments on commit 94d6d6b

Please sign in to comment.