KYLChiu / sporkfish

Chess engine in Python
MIT License
5 stars 0 forks source link

[SPORK-82] Delta Pruning #95

Closed KYLChiu closed 7 months ago

KYLChiu commented 7 months ago

Currently only has effect where the evaluator is called MANY times, e.g. at depth 7 for [r1b2rk1/ppq2ppp/3bpn2/3pP3/8/2PB2B1/PP1N1PPP/R2QK2R b KQ - 0 11]:

Otherwise it keeps the runtime about the same, though evaluator is called less (this means the extra time to calculate the piece type of captured pieces becomes the bottleneck, I think): [r1b2rk1/ppqn1pbp/6p1/3pp3/7B/2PB1N2/PP3PPP/R2QR1K1 w - - 0 16], depth 4:

test_perf_base        51991010 function calls (51883437 primitive calls) in 16.572 seconds

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
   102263    2.904    0.000    7.676    0.000 evaluator.py:208(evaluate)
test_perf_delta_pruning  45108764 function calls (45028818 primitive calls) in 15.887 seconds

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
    74636    2.374    0.000    6.210    0.000 evaluator.py:208(evaluate)