Skip to content

Commit

Permalink
Consolidated mlb and mpb into one movelist_buf.
Browse files Browse the repository at this point in the history
  • Loading branch information
dpldgr committed Nov 20, 2024
1 parent 544773b commit 1f770f1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
3 changes: 1 addition & 2 deletions src/movegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@

namespace Stockfish {

movelist_buf mlb(MAX_MOVES,8);
movelist_buf mpb(MAX_MOVES,64);
movelist_buf mlb(MAX_MOVES,64);

namespace {

Expand Down
1 change: 0 additions & 1 deletion src/movegen.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ ExtMove* generate(const Position& pos, ExtMove* moveList);
};

extern movelist_buf mlb;
extern movelist_buf mpb;

/// The MoveList struct is a simple wrapper around generate(). It sometimes comes
/// in handy to use this class instead of the low level generate() function.
Expand Down
8 changes: 4 additions & 4 deletions src/movepick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const ButterflyHist
ttMove(ttm), refutations{{killers[0], 0}, {killers[1], 0}, {cm, 0}}, depth(d), ply(pl) {

assert(d > 0);
this->moves = mpb.acquire();
this->moves = mlb.acquire();

stage = (pos.checkers() ? EVASION_TT : MAIN_TT) +
!(ttm && pos.pseudo_legal(ttm));
Expand All @@ -81,7 +81,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const ButterflyHist
: pos(p), mainHistory(mh), gateHistory(dh), captureHistory(cph), continuationHistory(ch), ttMove(ttm), recaptureSquare(rs), depth(d) {

assert(d <= 0);
this->moves = mpb.acquire();
this->moves = mlb.acquire();

stage = (pos.checkers() ? EVASION_TT : QSEARCH_TT) +
!( ttm
Expand All @@ -95,7 +95,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Value th, const GateHistory*
: pos(p), gateHistory(dh), captureHistory(cph), ttMove(ttm), threshold(th) {

assert(!pos.checkers());
this->moves = mpb.acquire();
this->moves = mlb.acquire();

stage = PROBCUT_TT + !(ttm && pos.capture(ttm)
&& pos.pseudo_legal(ttm)
Expand All @@ -104,7 +104,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Value th, const GateHistory*

MovePicker::~MovePicker() {

mpb.release(this->moves);
mlb.release(this->moves);
}


Expand Down
8 changes: 0 additions & 8 deletions src/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,6 @@ namespace {
return v;
}

#ifdef ALLVARS
// Duck chess
// https://duckchess.com/
Variant* duck_variant() {
Expand All @@ -537,7 +536,6 @@ namespace {
v->endgameEval = EG_EVAL_DUCK;
return v;
}
#endif

Variant* isolation_variant() { //https://boardgamegeek.com/boardgame/1875/isolation
Variant* v = chess_variant_base()->init();
Expand Down Expand Up @@ -1681,7 +1679,6 @@ namespace {
v->enclosingDropStart = make_bitboard(SQ_E5, SQ_F5, SQ_E6, SQ_F6);
return v;
}
#ifdef ALLVARS
// Game of the Amazons
// https://en.wikipedia.org/wiki/Game_of_the_Amazons
Variant* amazons_variant() {
Expand All @@ -1696,7 +1693,6 @@ namespace {
v->wallingRule = ARROW;
return v;
}
#endif
// Xiangqi (Chinese chess)
// https://en.wikipedia.org/wiki/Xiangqi
// Xiangqi base variant for inheriting rules without chasing rules
Expand Down Expand Up @@ -1855,9 +1851,7 @@ void VariantMap::init() {
add("isolation7x7", isolation7x7_variant());
add("snailtrail", snailtrail_variant());
add("fox-and-hounds", fox_and_hounds_variant());
#ifdef ALLVARS
add("duck", duck_variant());
#endif
add("joust", joust_variant());
add("3check", threecheck_variant());
add("5check", fivecheck_variant());
Expand Down Expand Up @@ -1924,9 +1918,7 @@ void VariantMap::init() {
add("shako", shako_variant());
add("clobber10", clobber10_variant());
add("flipello10", flipello10_variant());
#ifdef ALLVARS
add("amazons", amazons_variant());
#endif
add("xiangqi", xiangqi_variant());
add("manchu", manchu_variant());
add("supply", supply_variant());
Expand Down

0 comments on commit 1f770f1

Please sign in to comment.