Skip to content

Commit

Permalink
Update Pyrrhic; Advise to not look ahead mmap'ed TB files
Browse files Browse the repository at this point in the history
Follows discussions that resulted from TCEC's use of 7-man TB. This is the only noticable differenc between Stockfish's implementation, and the implementation of many other engines. This patch was pointed out by Aloril, and I found the conversation that lead to it.

Rubi author claims to have found success in this patch, as have others. I am unable to verify that on my own local machines. However, there is no particular downside to this code.

NO FUNCTIONAL CHANGE

BENCH : 3,808,521
  • Loading branch information
AndyGrant committed Dec 29, 2022
1 parent 83bba5b commit 15b5d72
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/pyrrhic/tbchess.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,3 +427,4 @@ bool pyrrhic_legal_move(const PyrrhicPosition *pos, PyrrhicMove move) {
PyrrhicPosition pos1;
return pyrrhic_do_move(&pos1, pos, move);
}

6 changes: 6 additions & 0 deletions src/pyrrhic/tbprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ static void *map_file(FD fd, map_t *mapping)
*mapping = statbuf.st_size;
void *data = mmap(NULL, statbuf.st_size, PROT_READ,
MAP_SHARED, fd, 0);

#if defined(MADV_RANDOM)
madvise(data, statbuf.st_size, MADV_RANDOM);
#endif

if (data == MAP_FAILED) {
perror("mmap");
return NULL;
Expand Down Expand Up @@ -2107,3 +2112,4 @@ static uint16_t probe_root(PyrrhicPosition *pos, int *score, unsigned *results)
return 0;
}
}

2 changes: 1 addition & 1 deletion src/uci.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "types.h"

#define VERSION_ID "13.96"
#define VERSION_ID "13.97"

#ifndef LICENSE_OWNER
#define LICENSE_OWNER "Unlicensed"
Expand Down

0 comments on commit 15b5d72

Please sign in to comment.