Skip to content

Commit

Permalink
tune piece value and update see_ge (~97000 iter)
Browse files Browse the repository at this point in the history
  • Loading branch information
skystarspython committed Oct 6, 2022
1 parent 621b7cb commit e00522e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,22 +688,22 @@ bool Position::see_ge(Move m, Value threshold) const {
occupied ^= least_significant_square_bb(bb);
}

else if ((bb = stmAttackers & pieces(KNIGHT)))
else if ((bb = stmAttackers & pieces(CANNON)))
{
if ((swap = KnightValueMg - swap) < res)
if ((swap = CannonValueMg - swap) < res)
break;

occupied ^= least_significant_square_bb(bb);
cannons = attacks_bb<CANNON>(to, occupied) & pieces(CANNON);
attackers = nonCannons | cannons;
}

else if ((bb = stmAttackers & pieces(CANNON)))
else if ((bb = stmAttackers & pieces(KNIGHT)))
{
if ((swap = CannonValueMg - swap) < res)
if ((swap = KnightValueMg - swap) < res)
break;

occupied ^= least_significant_square_bb(bb);
cannons = attacks_bb<CANNON>(to, occupied) & pieces(CANNON);
attackers = nonCannons | cannons;
}

else if ((bb = stmAttackers & pieces(ROOK)))
Expand Down
12 changes: 6 additions & 6 deletions src/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,12 @@ enum Value : int {
VALUE_MATE_IN_MAX_PLY = VALUE_MATE - MAX_PLY,
VALUE_MATED_IN_MAX_PLY = -VALUE_MATE_IN_MAX_PLY,

RookValueMg = 1463, RookValueEg = 1455,
AdvisorValueMg = 293 , AdvisorValueEg = 172 ,
CannonValueMg = 861 , CannonValueEg = 586 ,
PawnValueMg = 90 , PawnValueEg = 151 ,
KnightValueMg = 534 , KnightValueEg = 679 ,
BishopValueMg = 311 , BishopValueEg = 220 ,
RookValueMg = 1462, RookValueEg = 1268,
AdvisorValueMg = 189 , AdvisorValueEg = 156 ,
CannonValueMg = 515 , CannonValueEg = 674 ,
PawnValueMg = 72 , PawnValueEg = 135 ,
KnightValueMg = 554 , KnightValueEg = 744 ,
BishopValueMg = 202 , BishopValueEg = 173 ,
};

enum PieceType {
Expand Down

0 comments on commit e00522e

Please sign in to comment.