diff --git a/Scripts/game.pgn b/Scripts/game.pgn index f3dd06c..7e3d92e 100644 --- a/Scripts/game.pgn +++ b/Scripts/game.pgn @@ -1,33 +1,74 @@ [Event "?"] [Site "?"] -[Date "2026.02.19"] +[Date "2026.03.26"] [Round "1"] [White "Eleanor-dev"] [Black "Eleanor-base"] [Result "0-1"] -[FEN "rnbqkbnr/1pp2pp1/p2pp3/7p/2P5/5NP1/PP1PPPBP/RNBQ1RK1 b kq - 0 1"] -[GameDuration "00:00:09"] -[GameEndTime "2026-02-19T14:23:45.385 UTC"] -[GameStartTime "2026-02-19T14:23:36.234 UTC"] -[PlyCount "33"] +[FEN "rn1qk1nr/pbp1ppbp/1p1p2p1/3P4/5P2/2N1P3/PPPB2PP/R2QKBNR b KQkq - 0 1"] +[GameDuration "00:00:14"] +[GameEndTime "2026-03-26T20:42:15.476 CET"] +[GameStartTime "2026-03-26T20:42:00.864 CET"] +[PlyCount "115"] [SetUp "1"] [Termination "abandoned"] -[TimeControl "7.42+0.07"] +[TimeControl "5.17+0.05"] -1... Be7 {-2.14 13/26 298 257201} 2. h3 {+2.42 13/23 411 242566} -c5 {-1.86 14/28 322 258868} 3. d4 {+1.91 13/28 393 140944} -cxd4 {-2.02 14/28 292 226207} 4. Nxd4 {+1.78 14/26 369 310818} -Nf6 {-1.87 14/27 259 202951} 5. Nc3 {+1.74 14/28 262 199377} -Qc7 {-1.87 14/24 376 53755} 6. Bg5 {+1.96 14/27 260 198748} -Nc6 {-2.24 14/26 303 221514} 7. Rc1 {+1.96 13/26 346 111270} -Bd7 {-2.03 14/27 339 133181} 8. e3 {+2.23 13/27 329 122851} -Rc8 {-2.30 12/21 339 87727} 9. b3 {+1.79 14/24 279 223142} -Qa5 {-1.93 14/28 311 195408} 10. Bxf6 {+1.97 14/26 230 176615} -Bxf6 {-1.71 13/30 163 111085} 11. Ne4 {+1.38 14/28 274 214328} -Be7 {-1.52 14/27 255 187927} 12. Nxd6+ {+1.73 14/37 263 224669} -Bxd6 {-1.44 15/28 140 104101} 13. Nxc6 {+1.73 16/37 182 164873} -Bxc6 {-1.74 16/34 174 125622} 14. Qxd6 {+1.69 17/36 271 98496} -Bxg2 {-1.66 16/39 277 79460} 15. Kxg2 {+1.53 15/27 159 151849} -Rd8 {-1.44 16/31 175 147340} 16. b4 {+1.57 16/28 260 125736} -Rxd6 {-1.28 15/24 275 93890} 17. bxa5 {+1.46 14/31 249 87997} -Ke7 {-1.50 16/30 254 168346, White disconnects} 0-1 +1... Nf6 {+0.25 16/24 256 274740} 2. Bb5+ {-0.31 14/28 286 222469} +c6 {+0.30 14/30 154 175813} 3. dxc6 {-0.31 15/29 214 240246} +Nxc6 {+0.29 15/25 271 56301} 4. Nf3 {-0.25 16/25 174 198800} +O-O {+0.25 14/29 260 157287} 5. O-O {-0.28 15/26 245 287541} +a6 {+0.24 17/35 224 246704} 6. Bd3 {-0.22 14/27 136 153559} +b5 {+0.24 17/31 241 178951} 7. Qe1 {-0.24 14/28 245 274939} +Qb6 {+0.25 16/25 230 190364} 8. a3 {-0.25 14/25 207 226160} +e5 {+0.26 14/27 221 86623} 9. fxe5 {-0.10 14/27 158 172124} +Nxe5 {+0.28 13/27 214 129429} 10. Nxe5 {-0.39 13/24 170 177476} +dxe5 {+0.26 15/27 100 113069} 11. Kh1 {-0.18 13/23 121 136389} +e4 {+0.32 13/18 202 26644} 12. Be2 {-0.19 15/28 182 213316} +Rfc8 {+0.19 13/23 194 212538} 13. a4 {-0.12 13/24 207 126167} +b4 {+0.22 13/25 187 192683} 14. a5 {-0.18 14/26 101 112261} +Qd8 {+0.15 14/31 111 123537} 15. Na4 {-0.19 14/34 196 210792} +Nd5 {+0.23 15/29 157 177113} 16. Qf2 {-0.22 14/25 188 135679} +f5 {+0.22 15/28 130 130850} 17. c4 {-0.23 13/25 182 139155} +bxc3 {+0.24 15/25 98 105292} 18. bxc3 {-0.24 13/25 175 94316} +Bc6 {+0.23 14/17 166 18894} 19. Bc4 {-0.20 14/29 97 108937} +Bxa4 {+0.20 13/24 81 86007} 20. Rxa4 {-0.21 16/30 85 101741} +h5 {+0.25 13/20 159 95557} 21. Qe2 {-0.25 12/30 165 163762} +Kh7 {+0.36 12/21 98 103093} 22. Rxf5 {-0.39 12/27 159 75820} +gxf5 {+0.34 12/26 101 110999} 23. Qxh5+ {-0.45 13/38 107 119594} +Kg8 {+0.33 13/23 149 16142} 24. Qxf5 {-0.39 14/26 74 84084} +Rc5 {+0.40 13/23 144 140578} 25. Qe6+ {-0.37 12/36 150 138869} +Kf8 {+0.53 14/27 138 120201} 26. Bc1 {-0.45 14/30 144 132855} +Rb8 {+0.59 14/33 74 90173} 27. Ra1 {-0.55 14/36 130 123759} +Qf6 {+0.63 14/35 82 98374} 28. Qxf6+ {-0.21 14/39 132 146058} +Bxf6 {+0.61 15/35 100 125452} 29. Ba3 {-0.59 14/29 86 103103} +Nb4 {+0.57 16/29 129 51381} 30. Bxb4 {-0.57 15/25 64 80650} +Rxb4 {+0.53 14/29 91 125806} 31. cxb4 {-0.49 15/23 129 48919} +Rxc4 {+0.47 15/27 122 47840} 32. Rb1 {-0.45 15/30 67 91596} +Be7 {+0.46 14/24 92 126553} 33. g4 {-0.44 15/26 124 72397} +Rxb4 {+0.49 14/25 73 87941} 34. Rf1+ {-0.49 14/28 121 72810} +Ke8 {+0.45 15/36 89 113698} 35. Rf5 {-0.45 13/22 117 70248} +Kd7 {+0.45 14/30 115 74784} 36. Re5 {-0.45 13/22 82 101380} +Bd6 {+0.50 14/33 87 110879} 37. Rh5 {-0.45 12/34 113 72228} +Rb1+ {+0.50 15/32 56 64801} 38. Kg2 {-0.46 14/29 74 94136} +Rb2+ {+0.50 14/17 108 4246} 39. Kh1 {-0.48 15/25 108 48523} +Re2 {+0.53 14/27 78 96242} 40. Rh7+ {-0.56 13/28 105 70703} +Ke6 {+0.59 13/25 67 86840} 41. Rh6+ {-0.61 14/29 87 110057} +Kd5 {+0.59 15/27 91 103932} 42. Rh5+ {-0.65 14/28 100 108417} +Be5 {+0.70 14/33 94 110182} 43. Rh3 {-0.67 14/30 86 100550} +Kc4 {+0.83 13/27 100 123700} 44. Rh5 {-0.75 12/24 96 56083} +Bc3 {+0.88 12/26 47 63602} 45. Rh6 {-0.73 12/23 95 70966} +Rxe3 {+0.92 12/31 96 115497} 46. h4 {-0.83 10/24 91 46076} +Re1+ {+0.98 12/25 94 124212} 47. Kg2 {-0.92 13/29 45 57555} +Bd4 {+0.94 14/28 86 116606} 48. Rxa6 {-0.93 13/26 90 42707} +e3 {+0.95 13/23 90 44547} 49. Re6 {-0.92 12/40 88 86679} +e2 {+0.99 13/23 88 36470} 50. a6 {-0.96 13/40 86 89628} +Kd5 {+0.97 12/27 86 80236} 51. a7 {-0.97 12/30 84 17470} +Bxa7 {+1.08 13/30 84 33077} 52. Re7 {-1.12 12/28 82 71784} +Rg1+ {+1.17 13/28 53 70853} 53. Kf3 {-1.21 13/30 81 51340} +e1=Q {+1.21 13/30 83 51082} 54. Rxe1 {-1.51 14/31 59 80154} +Rxe1 {+1.25 13/29 41 59171} 55. h5 {-1.31 14/29 40 55864} +Bd4 {+1.29 12/29 81 48179} 56. g5 {-1.23 11/26 80 30276} +Rf1+ {+1.33 12/20 80 18531} 57. Kg2 {-3.99 12/39 78 76309} +Rf5 {+1.56 12/26 79 58979} 58. g6 {-M18 12/38 76 76733} +Ke4 {+M19 13/35 46 55731, White disconnects} 0-1 diff --git a/source/search.cpp b/source/search.cpp index 4bb4c1f..a23d676 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -98,56 +98,54 @@ static int GetReductions(Board &board, Move &move, int depth, int moveSeen, int int reduction = 0; // Late Move Reduction - if (depth >= 2 && moveSeen >= 2 + (2 * isPV)) { - reduction = lmrTable[move.IsQuiet()][depth][moveSeen] * 1024; + reduction = lmrTable[move.IsQuiet()][depth][moveSeen] * 1024; - if (cutnode) - reduction += lmrCutnode; + if (cutnode) + reduction += lmrCutnode; - if constexpr (isPV) - reduction -= lmrIsPV; - - if (!improving) - reduction += lmrImproving; + if constexpr (isPV) + reduction -= lmrIsPV; - if (corrplexity) - reduction -= lmrCorrplexity; + if (!improving) + reduction += lmrImproving; - if (ttpv) - reduction -= lmrTTPV; + if (corrplexity) + reduction -= lmrCorrplexity; - if (ttpvFailLow) - reduction += lmrTTPVFailLow; + if (ttpv) + reduction -= lmrTTPV; - // History LMR - int historyReduction = 0; + if (ttpvFailLow) + reduction += lmrTTPVFailLow; - if (move.IsQuiet()) { - bool sourceThreatened = board.IsSquareThreatened(board.sideToMove, move.MoveFrom()); - bool targetThreatened = board.IsSquareThreatened(board.sideToMove, move.MoveTo()); + // History LMR + int historyReduction = 0; - historyReduction = ctx->history[board.sideToMove][move.MoveFrom()][move.MoveTo()][sourceThreatened][targetThreatened]; - if (ply > 0) { - historyReduction += ctx->conthist.GetNPly(board, move, ctx, ply, 1); + if (move.IsQuiet()) { + bool sourceThreatened = board.IsSquareThreatened(board.sideToMove, move.MoveFrom()); + bool targetThreatened = board.IsSquareThreatened(board.sideToMove, move.MoveTo()); - if (ply > 1) - historyReduction += ctx->conthist.GetNPly(board, move, ctx, ply, 2); - } - } else if (move.IsCapture()) { - int attackerType = board.GetPieceType(move.MoveFrom()); - int targetType = board.GetPieceType(move.MoveTo()); + historyReduction = ctx->history[board.sideToMove][move.MoveFrom()][move.MoveTo()][sourceThreatened][targetThreatened]; + if (ply > 0) { + historyReduction += ctx->conthist.GetNPly(board, move, ctx, ply, 1); - if (move.GetFlags() == epCapture) { - targetType = Pawn; - } - - historyReduction = ctx->capthist[board.sideToMove][attackerType][targetType][move.MoveTo()]; + if (ply > 1) + historyReduction += ctx->conthist.GetNPly(board, move, ctx, ply, 2); + } + } else if (move.IsCapture()) { + int attackerType = board.GetPieceType(move.MoveFrom()); + int targetType = board.GetPieceType(move.MoveTo()); + + if (move.GetFlags() == epCapture) { + targetType = Pawn; } - historyReduction = historyReduction / lmrHistoryDivisor; - reduction -= historyReduction * 1024; + historyReduction = ctx->capthist[board.sideToMove][attackerType][targetType][move.MoveTo()]; } + historyReduction = historyReduction / lmrHistoryDivisor; + reduction -= historyReduction * 1024; + reduction /= 1024; return std::clamp(reduction, -1, depth - 1); @@ -659,38 +657,33 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC cutnode |= extension < 0; - const bool ttpvFailLow = ttpv && ttHit && entry.score <= alpha; - - int reductions = GetReductions(board, currMove, depth, moveSeen, ply, cutnode, improving, corrplexity, ttpv, ttpvFailLow, ctx); int newDepth = depth + (copy.InCheck() && !ctx->excluded) - 1 + extension; U64 nodesBeforeSearch = ctx->nodes; - // First move (suspected PV node) - if (!moveSeen) { - // Full search - if constexpr (isPV) { - score = -PVS(copy, newDepth, -beta, -alpha, ply + 1, ctx, false).score; - } else { - score = -PVS(copy, newDepth, -beta, -alpha, ply + 1, ctx, !cutnode).score; - } - } else if (reductions) { - // Null-window search with reductions - score = -PVS(copy, newDepth - reductions, -alpha-1, -alpha, ply + 1, ctx, true).score; + if (depth >= 2 && moveSeen >= 2 + (2 * isPV)) { + const bool ttpvFailLow = ttpv && ttHit && entry.score <= alpha; - if (score > alpha) { - // Null-window search now without the reduction - score = -PVS(copy, newDepth, -alpha-1, -alpha, ply + 1, ctx, !cutnode).score; + int reductions = GetReductions(board, currMove, depth, moveSeen, ply, cutnode, improving, corrplexity, ttpv, ttpvFailLow, ctx); + int reduced = newDepth - reductions; + + score = -PVS(copy, reduced, -alpha - 1, -alpha, ply + 1, ctx, true).score; + + if (score > alpha && reduced < newDepth) { + const bool goDeeper = score > results.score + lmrDeeperBase + lmrDeeperScalar * newDepth; + const bool goShallower = score < results.score + newDepth; + + newDepth += goDeeper - goShallower; + + score = -PVS(copy, newDepth, -alpha - 1, -alpha, ply + 1, ctx, !cutnode).score; } - } else { - // Null-window search - score = -PVS(copy, newDepth, -alpha-1, -alpha, ply + 1, ctx, !cutnode).score; + } else if (!isPV || moveSeen > 0) { + score = -PVS(copy, newDepth, -alpha - 1, -alpha, ply + 1, ctx, !cutnode).score; } - // Check if we need to do full window re-search - if (moveSeen && score > alpha && score < beta) { - score = -PVS(copy, newDepth, -beta, -alpha, ply + 1, ctx, false).score; + if (isPV && (moveSeen == 0 || score > alpha)) { + score = -PVS(copy, newDepth, -beta, -alpha, ply + 1, ctx, false).score; } moveSeen++; diff --git a/source/tunables.h b/source/tunables.h index 8abb700..ac0a1c0 100644 --- a/source/tunables.h +++ b/source/tunables.h @@ -17,6 +17,8 @@ X_INT(lmrImproving, 1024, 6000, 10000) \ X_INT(lmrCorrplexity, 1024, 6000, 10000) \ X_INT(lmrTTPVFailLow, 1024, 6000, 10000) \ + X_INT(lmrDeeperBase, 30, 6000, 10000) \ + X_INT(lmrDeeperScalar, 4, 6000, 10000) \ X_INT(rfpBase, 25, 50, 200) \ X_INT(rfpMargin, 100, 50, 200) \ X_INT(fpMargin, 100, 50, 200) \