Skip to content

Commit

Permalink
My net
Browse files Browse the repository at this point in the history
  • Loading branch information
rafid-dev committed Apr 7, 2023
1 parent b9cb459 commit 5036a2f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 22 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Rice is not a complete chess program and requires a <a href="https://www.chesspr

I would specially like to thank <a href="https://github.com/Disservin">Disservin</a>, author of <a href="https://github.com/Disservin/Smallbrain">Smallbrain</a> for his <a href="https://github.com/Disservin/chess-library">chess library in c++</a> which is used in Rice.

I would also like to specially thank <a href="https://github.com/TheBlackPlague">Shaheryar Sohail</a>, author of <a href="https://github.com/TheBlackPlague/StockNemo">StockNemo<a>, for enormous help in implementing NNUE.

Below are some really nice people who has helped me during the development of Rice.
* <a href="https://github.com/pgg106">Zuppa</a>, author of <a href="https://github.com/PGG106/Alexandria/">Alexandria</a>.
* <a href="https://github.com/raklaptudirm">Rak</a>, author of <a href="https://github.com/raklaptudirm/mess">Mess</a>.
Expand Down
Binary file added src/Rice
Binary file not shown.
2 changes: 1 addition & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ int LMRDivision = 236;
void init_all()
{
InitSearch();
nnue.Init("so.json");
nnue.Init("a.json");
}
Binary file added src/nn1.nnue
Binary file not shown.
2 changes: 1 addition & 1 deletion src/nnue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#define INCBIN_STYLE INCBIN_STYLE_CAMEL
#include "incbin/incbin.h"

INCBIN(EVAL, "nn.nnue");
INCBIN(EVAL, "nn1.nnue");

bool DEBUG = false;

Expand Down
38 changes: 19 additions & 19 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,11 @@ int AlphaBeta(int alpha, int beta, int depth, Board &board, SearchInfo &info,
}
}

if (depth <= 3 &&
eval - 63 + 182 * depth <= alpha)
{
return Quiescence(alpha, beta, board, info, ss, table);
}
// if (depth <= 3 &&
// eval - 63 + 182 * depth <= alpha)
// {
// return Quiescence(alpha, beta, board, info, ss, table);
// }
}

movesloop:
Expand Down Expand Up @@ -393,20 +393,20 @@ int AlphaBeta(int alpha, int beta, int depth, Board &board, SearchInfo &info,
/* Extensions
* Search extra ply if move comes from tt
*/
if (!isRoot && depth >= 7 && (move == tte.move) && (tte.flag & HFBETA) && abs(tte.score) < ISMATE && tte.depth >= depth - 3){
int singularBeta = tte.score - 3 * depth;
int singularDepth = (depth - 1)/2;

ss->excluded = tte.move;
int singularScore = AlphaBeta(singularBeta - 1, singularBeta, singularDepth, board, info, ss, table);
ss->excluded = NO_MOVE;

if (singularScore < singularBeta){
extension = 1;
}else if (singularBeta >= beta){
return (singularBeta);
}
}
// if (!isRoot && depth >= 7 && (move == tte.move) && (tte.flag & HFBETA) && abs(tte.score) < ISMATE && tte.depth >= depth - 3){
// int singularBeta = tte.score - 3 * depth;
// int singularDepth = (depth - 1)/2;

// ss->excluded = tte.move;
// int singularScore = AlphaBeta(singularBeta - 1, singularBeta, singularDepth, board, info, ss, table);
// ss->excluded = NO_MOVE;

// if (singularScore < singularBeta){
// extension = 1;
// }else if (singularBeta >= beta){
// return (singularBeta);
// }
// }

/* Initialize new depth based on extension*/
int newDepth = depth + extension;
Expand Down
2 changes: 1 addition & 1 deletion src/sprt.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cutechess-cli -engine cmd="rice.exe" name="dev" proto="uci" -engine cmd="./binaries/rice.exe" name="master" proto="uci" -each tc=inf/6+0.06 -openings file=./pgns/8moves_v3.pgn order=random -games 2 -rounds 2500 -repeat 2 -maxmoves 200 -sprt elo0=0 elo1=5 alpha=0.05 beta=0.05 -concurrency 6 -ratinginterval 10 -pgnout "./pgns/postnnue.pgn"
cutechess-cli -engine cmd="./Rice.exe" name="dev" proto="uci" -engine cmd="./binaries/Rice.exe" name="master" proto="uci" -each tc=inf/6+0.06 -openings file=./pgns/8moves_v3.pgn order=random -games 2 -rounds 2500 -repeat 2 -maxmoves 200 -sprt elo0=0 elo1=5 alpha=0.05 beta=0.05 -concurrency 6 -ratinginterval 10 -pgnout "./pgns/postnnue.pgn"

0 comments on commit 5036a2f

Please sign in to comment.