Remove unnecessary check disabling in history updates. Fix typos and update gitignore (bench 6468026)
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -182,4 +182,5 @@ pretty.json
|
||||
*.bin
|
||||
fcq
|
||||
*.bullet
|
||||
nim.cfg
|
||||
nim.cfg
|
||||
data/
|
||||
@@ -573,10 +573,6 @@ proc updateHistories(self: SearchManager, sideToMove: PieceColor, move: Move, pi
|
||||
assert move.isCapture() or move.isQuiet()
|
||||
let startAttacked = self.board.position.threats.contains(move.startSquare)
|
||||
let targetAttacked = self.board.position.threats.contains(move.targetSquare)
|
||||
when not defined(danger):
|
||||
# FIXME: Some mysterious bugs are occurring in this code that causes the values to go beyond
|
||||
# the -32768..32767 range. Need to investigate
|
||||
{.push checks:off.}
|
||||
if move.isQuiet():
|
||||
let bonus = (if good: self.parameters.moveBonuses.quiet.good else: -self.parameters.moveBonuses.quiet.bad) * depth
|
||||
if ply > 0 and not self.board.positions[^2].fromNull:
|
||||
@@ -597,8 +593,6 @@ proc updateHistories(self: SearchManager, sideToMove: PieceColor, move: Move, pi
|
||||
# We use this formula to evenly spread the improvement the more we increase it (or decrease it)
|
||||
# while keeping it constrained to a maximum (or minimum) value so it doesn't (over|under)flow.
|
||||
self.histories.captureHistory[sideToMove][move.startSquare][move.targetSquare][victim][startAttacked][targetAttacked] += int16(bonus - abs(bonus) * self.getMainHistScore(sideToMove, move) div HISTORY_SCORE_CAP)
|
||||
when not defined(danger):
|
||||
{.pop.}
|
||||
|
||||
|
||||
proc getEstimatedMoveScore(self: SearchManager, hashMove: Move, move: Move, ply: int): ScoredMove {.inline.} =
|
||||
|
||||
@@ -162,7 +162,7 @@ def main(args: Namespace) -> int:
|
||||
if __name__ == "__main__":
|
||||
parser = ArgumentParser(description="Automatically compare perft results between Heimdall and Stockfish")
|
||||
parser.add_argument("--fen", "-f", type=str, default="", help="The FEN string of the position to start from (empty string means the initial one). Defaults to ''")
|
||||
parser.add_argument("--ply", "-d", type=int, required=True, help="The depth to stop at, expressed in plys (half-moves)")
|
||||
parser.add_argument("--ply", "-d", type=int, required=True, help="The depth to stop at, expressed in plies (half-moves)")
|
||||
parser.add_argument("--bulk", action="store_true", help="Enable bulk-counting for Heimdall (much faster)", default=False)
|
||||
parser.add_argument("--stockfish", type=Path, help="Path to the stockfish executable. Defaults to '' (detected automatically)", default=None)
|
||||
parser.add_argument("--heimdall", type=Path, help="Path to the heimdall executable. Defaults to '' (detected automatically)", default=None)
|
||||
|
||||
@@ -70,7 +70,7 @@ def main(args: Namespace) -> int:
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = ArgumentParser(description="Run a set of tests using compare_positions.py")
|
||||
parser.add_argument("--ply", "-d", type=int, required=True, help="The depth to stop at, expressed in plys (half-moves)")
|
||||
parser.add_argument("--ply", "-d", type=int, required=True, help="The depth to stop at, expressed in plies (half-moves)")
|
||||
parser.add_argument("-b", "--bulk", action="store_true", help="Enable bulk-counting for Heimdall (much faster)", default=False)
|
||||
parser.add_argument("--stockfish", type=Path, help="Path to the stockfish executable. Defaults to '' (detected automatically)", default=None)
|
||||
parser.add_argument("--heimdall", type=Path, help="Path to the heimdall executable. Defaults to '' (detected automatically)", default=None)
|
||||
|
||||
Reference in New Issue
Block a user