Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ IronPhoenix includes a modern alpha-beta search stack designed specifically for
- History-based move ordering
- Static Exchange Evaluation (SEE)
- Late Move Reductions (LMR)
- Late Move Pruning (LMP)
- Search pruning and reductions
- Iterative deepening
- Principal variation reporting
Expand Down
17 changes: 17 additions & 0 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
namespace ironphoenix {
namespace {

constexpr int LMP_HISTORY_THRESHOLD = 2'000;

IRONPHOENIX_FORCE_INLINE Bitboard teamOccupancy(const Position& pos, Color c) noexcept {
const Color partner = static_cast<Color>(static_cast<unsigned>(c) ^ 2u);
return pos.occupancy(c) | pos.occupancy(partner);
Expand Down Expand Up @@ -441,6 +443,21 @@ namespace ironphoenix {
const int mateWindow = !(alpha > -MATE_THRESHOLD && beta < MATE_THRESHOLD)
&& !terminalKingCapture;

// Late Move Pruning (LMP): at non-PV nodes, stop spending search
// effort on late quiet moves unless history says the move is
// promising. Checks, TT moves, promotions/captures, and mate-window
// searches are never pruned here. This intentionally has no depth cap.
if (!pvNode
&& !inCheckNode
&& legalMoves >= 3 + depth * depth
&& quiet
&& move != ttMove
&& !givesCheckMove
&& !mateWindow
&& lmrHistoryScore < LMP_HISTORY_THRESHOLD) {
continue;
}

if (!pvNode
&& !inCheckNode
&& depth <= tuning.seePruneMaxDepth
Expand Down
Loading