]> git.sesse.net Git - stockfish/log
stockfish
6 years agoCount all weak squares in the king ring with a single popcount
Stéphane Nicolet [Fri, 25 Aug 2017 21:50:11 +0000 (23:50 +0200)]
Count all weak squares in the king ring with a single popcount

Passed STC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 26966 W: 4993 L: 4745 D: 17228
http://tests.stockfishchess.org/tests/view/599e798a0ebc5916ff64aa8c

and LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 39570 W: 5104 L: 4857 D: 29609
http://tests.stockfishchess.org/tests/view/599ee5230ebc5916ff64aabe

Bench: 5965302

6 years agoUse moveCount history for reduction
Joost VandeVondele [Wed, 23 Aug 2017 19:00:28 +0000 (21:00 +0200)]
Use moveCount history for reduction

Use less reduction for moves with larger moveCount if your
opponent did an unexpected (== high moveCount) move in the
previous ply... unexpected moves might need unexpected answers.

passed STC:
http://tests.stockfishchess.org/tests/view/599f08cc0ebc5916ff64aace
LLR: 2.97 (-2.94,2.94) [0.00,5.00]
Total: 9638 W: 1889 L: 1720 D: 6029

passed LTC:
http://tests.stockfishchess.org/tests/view/599f1e5c0ebc5916ff64aadc
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 28308 W: 3742 L: 3533 D: 21033

Bench: 5747429

6 years agoAvoid constructing an empty tuple in qsearch
Stéphane Nicolet [Mon, 21 Aug 2017 16:59:24 +0000 (18:59 +0200)]
Avoid constructing an empty tuple in qsearch

Avoid constructing, passing as a parameter and binding a useless empty tuple of pointers in the qsearch move picker constructor.

Also reformat the scoring function in movepicker.cpp and do some cleaning in evaluate.cpp while there.

No functional change.

6 years agoImprove appeyor build
Marco Costalba [Sun, 20 Aug 2017 13:29:11 +0000 (15:29 +0200)]
Improve appeyor build

Check bench number and do not
hard-code *.cpp file names.

No functional change.

6 years agoRestore safety margin of 60ms
lucasart [Sun, 20 Aug 2017 11:59:46 +0000 (19:59 +0800)]
Restore safety margin of 60ms

What this patch does is:
* increase safety margin from 40ms to 60ms. It's worth noting that the previous
  code not only used 60ms incompressible safety margin, but also an additional
  buffer of 30ms for each "move to go".
* remove a whart, integrating the extra 10ms in Move Overhead value instead.
  Additionally, this ensures that optimumtime doesn't become bigger than maximum
  time after maximum time has been artificially discounted by 10ms. So it keeps
  the code more logical.

Tested at 3 different time controls:

Standard 10+0.1
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 58008 W: 10674 L: 10617 D: 36717

Sudden death 16+0
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 59664 W: 10945 L: 10891 D: 37828

Tournament 40/10
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 16371 W: 3092 L: 2963 D: 10316

bench: 5479946

6 years agoFix some Clang warnings
Marco Costalba [Sat, 19 Aug 2017 12:32:31 +0000 (14:32 +0200)]
Fix some Clang warnings

Found by Clang in extra verbose mode :-)

No functional change.

6 years agoWide bench coverage
Marco Costalba [Tue, 15 Aug 2017 09:51:14 +0000 (02:51 -0700)]
Wide bench coverage

Add tests for:

- Positions with move list
- Chess960 positions

Now bench covers almost all cases, only few endgames
are still out of reach (verified with lcov)

It is a non functionality patch, but bench
changed because we added new test positions.

bench: 5479946

6 years agoRestore perft
Marco Costalba [Tue, 15 Aug 2017 08:05:22 +0000 (01:05 -0700)]
Restore perft

Rewrite perft to be placed naturally inside new
bench code. In particular we don't have special
custom code to run perft anymore but perft is
just a new parameter of 'go' command.

So user API is now changed, old style command:

$perft 5

becomes

$go perft 4

No functional change.

6 years agoRewrite benchmark
Marco Costalba [Mon, 14 Aug 2017 17:41:04 +0000 (10:41 -0700)]
Rewrite benchmark

First step in improving bench to handle
arbitrary UCI commands so to test many
more code paths.

This first patch just set the new code
structure.

No functional change.

6 years agoReformat time manager code
Marco Costalba [Fri, 18 Aug 2017 15:44:37 +0000 (08:44 -0700)]
Reformat time manager code

In particular clarify that 'sd'
parameter is used only in !movesToGo
case.

Verified with Ivan's check tool it is
equivalent to original code.

No functional change.

6 years agoCollect more corrections to optimum/maximum
Joost VandeVondele [Fri, 18 Aug 2017 07:38:27 +0000 (09:38 +0200)]
Collect more corrections to optimum/maximum

The only call site of Time.maximum() corrected by 10.
Do this directly in remaining().

Ponder increased Time.optimum by 25% in init(). Idem.
Delete unused includes.

No functional change.

6 years agoSpeed up Trevis CI
Marco Costalba [Wed, 16 Aug 2017 09:28:54 +0000 (02:28 -0700)]
Speed up Trevis CI

Avoid a couple of redundant rebuilds and compile
with 2 threads since travis gives 2vCPUs.

Also enable -O1 optimization for valgrind and
sanitizers, it should be safe withouth false
positives and it gives a very sensible speed
up, especially with valgrind.

The spee dup allow us to increase testing to
depth 10, useful for thread sanitizer.

No functional change.

6 years agoClarify stats range
Marco Costalba [Fri, 18 Aug 2017 09:02:35 +0000 (02:02 -0700)]
Clarify stats range

Current update formula ensures that the
possible value range is [-32 * D, 32 * D].

So we never overflow if abs(32 * D) < INT16_MAX

Thanks to Joost and mstembera to clarify this.

No functional change.

6 years agoTime management simplification
IIvec [Fri, 7 Oct 2016 16:12:19 +0000 (18:12 +0200)]
Time management simplification

STC (http://tests.stockfishchess.org/tests/view/598188a40ebc5916ff64a21b):
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 25363 W: 4658 L: 4545 D: 16160

LTC (http://tests.stockfishchess.org/tests/view/5981d59a0ebc5916ff64a229):
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 75356 W: 9690 L: 9640 D: 56026

40/10 TC (http://tests.stockfishchess.org/tests/view/5980c5780ebc5916ff64a1ed):
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 19377 W: 3650 L: 3526 D: 12201

15+0 TC (http://tests.stockfishchess.org/tests/view/5982cb730ebc5916ff64a25d):
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 5913 W: 1217 L: 1069 D: 3627

This time management handles base time and movestogo cases separatelly. One can test one case without affecting the other. Also, increment usage can be tested separately without (necessarily) affecting sudden death or x moves in y seconds performance.

On stable machines there are no time losses on 0.1+0.001 time control (tested on i7 + Windows 10 platform).

Bench 5608839

6 years agoFix involuntary conversions of ExtMove to Move
Marco Costalba [Sun, 13 Aug 2017 18:01:26 +0000 (11:01 -0700)]
Fix involuntary conversions of ExtMove to Move

The trick is to create an ambiguity for the
compiler in case an unwanted conversion to
Move is attempted like in:

    ExtMove m1{Move(17),4}, m2{Move(4),17};

    std::cout << (m1 < m2) << std::endl; // 1
    std::cout << (m1 > m2) << std::endl; // 1(!)

This fixes issue #1204

No functional change.

6 years agoUnify stats update()
Marco Costalba [Thu, 17 Aug 2017 08:47:32 +0000 (01:47 -0700)]
Unify stats update()

Now that is a bit bigger makes sense to
unify some duplicated code.

No functional change.

6 years agoUse int16_t in History values
lucasart [Wed, 9 Aug 2017 11:35:05 +0000 (19:35 +0800)]
Use int16_t in History values

Reduces memory footprint by ~1.2MB (per thread).

Strong pressure: small but mesurable gain
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 258430 W: 46977 L: 45943 D: 165510

Low pressure: no regression
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 73542 W: 13058 L: 13026 D: 47458

Strong pressure + LTC: elo gain confirmed
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 31489 W: 4532 L: 4295 D: 22662

Tested for crashing on overflow and after 70K
games at STC we have only 4 time losses,
possible candidate for an overflow.

No functional change.

6 years agoFix incorrect StateInfo
Marco Costalba [Mon, 14 Aug 2017 16:12:16 +0000 (09:12 -0700)]
Fix incorrect StateInfo

We use Position::set() to set root position across
threads. But there are some StateInfo fields (previous,
pliesFromNull, capturedPiece) that cannot be deduced
from a fen string, so set() clears them and to not lose
the info we need to backup and later restore setupStates->back().
Note that setupStates is shared by threads but is accessed
in read-only mode.

This fixes regression introduced by df6cb446eaf21

Tested with 3 threads at STC:
LLR: 2.95 (-2.94,2.94) [-4.00,0.00]
Total: 14436 W: 2304 L: 2196 D: 9936

Bench: 5608839

6 years agoRun clang-tidy 'modernize'
Marco Costalba [Sun, 13 Aug 2017 12:33:25 +0000 (05:33 -0700)]
Run clang-tidy 'modernize'

Some warnings after a run of:

$ clang-tidy-3.8 -checks='modernize-*' *.cpp syzygy/*.cpp -header-filter=.* -- -std=c++11

I have not fixed all suggestions, for instance I still prefer
to declare the type instead of a spread use of 'auto'. I also
perfer good old 'typedef' to the new 'using' form.

I have not fixed some warnings in the last functions of
syzygy code because those are still the original functions
and need to be completely rewritten anyhow.

Thanks to erbsenzaehler for the original idea.

No functional change.

6 years agoThread code reformat
Marco Costalba [Sun, 13 Aug 2017 06:58:31 +0000 (23:58 -0700)]
Thread code reformat

Simplify out low level sync stuff (mutex
and friends) and avoid to use them directly
in many functions.

Also some renaming and better comment while
there.

No functional change.

6 years agoRetire States global variable
Marco Costalba [Sun, 13 Aug 2017 06:38:39 +0000 (23:38 -0700)]
Retire States global variable

And other small touches in uci.cpp

No functional change.

6 years agoFix the handling of opposite bishops in KXK endgame evaluation
tthsqe12 [Sat, 12 Aug 2017 08:50:38 +0000 (10:50 +0200)]
Fix the handling of opposite bishops in KXK endgame evaluation

The case of three or more bishops against a long king must look at all of the
bishops and not just the first two in the piece lists. This patch makes sure
that the position is treated as a win when there are bishops on opposite
colors. This functional change is very small because bench remains the same.

LLR: 2.95 (-2.94,2.94) [-4.00,0.00]
Total: 24249 W: 4349 L: 4275 D: 15625
http://tests.stockfishchess.org/tests/view/598186530ebc5916ff64a218

Bench: 5608839

6 years agoSimplify finished search in ponder/infinite mode.
Joost VandeVondele [Fri, 4 Aug 2017 17:48:07 +0000 (19:48 +0200)]
Simplify finished search in ponder/infinite mode.

In this rare case (e.g. go infinite on a stalemate),
just spin till ponderhit/stop comes.

The Thread::wait() is a renmant of the old YBWC
code, today with lazy SMP, threads don't need to
wait when outside of their idle loop.

No functional change.

6 years agoRe-apply the fix for Limits::ponder race
Marco Costalba [Thu, 10 Aug 2017 19:32:50 +0000 (12:32 -0700)]
Re-apply the fix for Limits::ponder race

But this time correctly set Threads.ponder

We avoid using 'limits' for passing pondering
flag because we don't want to have 2 ponder
variables in search scope: Search::Limits.ponder
and Threads.ponder. This would be confusing also
because limits.ponder is set at the beginning of
the search and never changes, instead Threads.ponder
can change value asynchronously during search.

No functional change.

6 years agoRevert "Fix a race on Limits::ponder"
Marco Costalba [Thu, 10 Aug 2017 17:57:28 +0000 (10:57 -0700)]
Revert "Fix a race on Limits::ponder"

This reverts commit 5410424e3d036b43715c7989aa99e449cdcde18e.

After the commit pondering is broken, so revert for now. I will
resubmit with a proper fix.

The issue is mine, Joost original code is correct.

No functional change.

6 years agoFix a race on Limits::ponder
Joost VandeVondele [Thu, 27 Jul 2017 06:31:25 +0000 (08:31 +0200)]
Fix a race on Limits::ponder

Limits::ponder was used as a signal between uci and search threads,
but is not an atomic variable, leading to the following race as
flagged by a sanitized binary.

Expect input:
```
 spawn  ./stockfish
 send "uci\n"
 expect "uciok"
 send "setoption name Ponder value true\n"
 send "go wtime 4000 btime 4000\n"
 expect "bestmove"
 send "position startpos e2e4 d7d5\n"
 send "go wtime 4000 btime 4000 ponder\n"
 sleep 0.01
 send "ponderhit\n"
 expect "bestmove"
 send "quit\n"
 expect eof
```

Race:
```
WARNING: ThreadSanitizer: data race (pid=7191)
  Read of size 4 at 0x0000005c2260 by thread T1:

  Previous write of size 4 at 0x0000005c2260 by main thread:

  Location is global 'Search::Limits' of size 88 at 0x0000005c2220 (stockfish+0x0000005c2260)
```

The reason of teh race is that ponder is not just set in UCI go()
assignment but also is signaled by an async ponderhit in uci.cpp:

      else if (token == "ponderhit")
          Search::Limits.ponder = 0; // Switch to normal search

The fix is to add an atomic bool to the threads structure to
signal the ponder status, letting Search::Limits to reflect just
what was passed to 'go'.

No functional change.

6 years agoFix some races and clarify the code
Marco Costalba [Sun, 6 Aug 2017 11:43:02 +0000 (04:43 -0700)]
Fix some races and clarify the code

Better split code that should be run at
startup from code run at ucinewgame. Also
fix several races when 'bench', 'perft' and
'ucinewgame' are sent just after 'bestomve'
from the engine threads are still running.

Also use a specific UI thread instead of
main thread when setting up the Position
object used by UI uci loop. This fixes a
race when sending 'eval' command while searching.

We accept a race on 'setoption' to allow the
GUI to change an option while engine is searching
withouth stalling the pipe. Note that changing an
option while searchingg is anyhow not mandated by
UCI protocol.

No functional change.

6 years agoMake variable naming consistent
AndyGrant [Thu, 10 Aug 2017 01:43:30 +0000 (21:43 -0400)]
Make variable naming consistent

moved_piece is the only variable in search not using camel case

6 years agoUnify scoring functions in MovePicker
Joost VandeVondele [Wed, 9 Aug 2017 12:04:59 +0000 (14:04 +0200)]
Unify scoring functions in MovePicker

No functional change.

6 years agoRemove Stack/thread dependence in movepick
Joost VandeVondele [Fri, 30 Jun 2017 15:20:00 +0000 (17:20 +0200)]
Remove Stack/thread dependence in movepick

as a lower level routine, movepicker should not depend on the
search stack or the thread class, removing a circular dependency.
Instead of copying the search stack into the movepicker object,
as well as accessing the thread class for one of the histories,
pass the required fields explicitly to the constructor (removing
the need for thread.h and implicitly search.h in movepick.cpp).
The signature is thus longer, but more explicit:

Also some renaming of histories structures while there.

passed STC [-3,1], suggesting a small elo impact:

LLR: 3.13 (-2.94,2.94) [-3.00,1.00]
Total: 381053 W: 68071 L: 68551 D: 244431
elo =   -0.438 +-    0.660 LOS:    9.7%

No functional change.

6 years agoTweak connected pawns seed[] array values
snicolet [Wed, 2 Aug 2017 01:40:27 +0000 (18:40 -0700)]
Tweak connected pawns seed[] array values

Raise a little bit the values in the connected pawns seed[] array.

STC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 99033 W: 17939 L: 17448 D: 63646
http://tests.stockfishchess.org/tests/view/597355630ebc5916ff649e3e

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 48044 W: 6371 L: 6099 D: 35574
http://tests.stockfishchess.org/tests/view/597596610ebc5916ff649eba

Bench: 5608839

Closes #1182

6 years agoRework the "unsupported" penalty into a "supported" bonus
Rocky640 [Wed, 2 Aug 2017 01:36:33 +0000 (18:36 -0700)]
Rework the "unsupported" penalty into a "supported" bonus

A pawn (according to all the searched positions of a bench run) is not supported 85% of the time,
(in current master it is either isolated, backward or "unsupported").

So it made sense to try moving the S(17, 8) "unsupported" penalty value into the base pawn value hoping for a more representative pawn value, and accordingly
a) adjust backward and isolated so that they stay more or less the same as master
b) increase the mg connected bonus in the supported case by S(17, 0) and let the Connected formula find a suitable eg value according to rank.

Tested as a simplification SPRT(-3, 1)

Passed STC
http://tests.stockfishchess.org/tests/view/5970dbd30ebc5916ff649dd6
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 19613 W: 3663 L: 3540 D: 12410

Passed LTC
http://tests.stockfishchess.org/tests/view/597137780ebc5916ff649de3
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 24721 W: 3306 L: 3191 D: 18224

Bench: 5581946

Closes #1179

6 years agoRemove redundant if-statements
VoyagerOne [Thu, 27 Jul 2017 09:14:18 +0000 (02:14 -0700)]
Remove redundant if-statements

No functional change

Closes #1173

6 years agoTuned PSQT using a custom tuner.
mstembera [Wed, 5 Jul 2017 20:05:29 +0000 (13:05 -0700)]
Tuned PSQT using a custom tuner.

bench: 5878420

Closes #1177

6 years agoSimplify aspiration window
VoyagerOne [Mon, 24 Jul 2017 00:25:23 +0000 (17:25 -0700)]
Simplify aspiration window

Don't modify alpha window on fail-high

Bench: 5875983

Closes #1172

6 years agoFaster travis checks
Joost VandeVondele [Sat, 15 Jul 2017 08:25:35 +0000 (10:25 +0200)]
Faster travis checks

in the last month a couple of timeouts have been seen in travis valgrind testing, leading to undesired false positives. The precise cause of this is unclear: a normal valgrind instrumented run is about 6min, the timeout is 10min. Either there are rare hangs (not reproduced locally), or maybe the actual runtime fluctuates on the travis infrastructure (which uses VMs on AWS as far as I know). This patch leads to roughly a 2x speedup of the instrumented testing by reducing the depth from 10 to 9. If timeouts persist, it needs further analysis.

No functional change.

Closes #1171

6 years agoMove game_phase() to material.cpp
Marco Costalba [Sun, 9 Jul 2017 09:45:31 +0000 (11:45 +0200)]
Move game_phase() to material.cpp

For some reason, although game phase is used
only in material, it is computed in Position.

Move computation to material, where it belongs,
and remove the useless call chain.

No functional change.

6 years agoRevert "Remove questionable gcc flags from profile-build"
Joona Kiiski [Thu, 13 Jul 2017 23:36:27 +0000 (16:36 -0700)]
Revert "Remove questionable gcc flags from profile-build"

This reverts commit 0371a8f8c4a043cb3e7d08b5b8e7d08d49f28324.

6 years agoProvide selective search depth info for each pv move
joergoster [Thu, 13 Jul 2017 23:30:03 +0000 (16:30 -0700)]
Provide selective search depth info for each pv move

No functional change

Closes #1166

6 years agoMove stop signal to Threads
Joost VandeVondele [Thu, 13 Jul 2017 23:07:19 +0000 (16:07 -0700)]
Move stop signal to Threads

Instead of having Signals in the search namespace,
make the stop variables part of the Threads structure.
This moves more of the shared (atomic) variables towards
the thread-related structures, making their role more clear.

No functional change

Closes #1149

6 years agoRemove questionable gcc flags from profile-build
Joona Kiiski [Sat, 8 Jul 2017 21:19:03 +0000 (14:19 -0700)]
Remove questionable gcc flags from profile-build

Optimization options for official stockfish should be
consistent, easy, future proof and simple.

We don't want to optimize for any specific version of gcc

No functional change

Closes #1165

6 years agoQueen vs. Minors imbalance
GuardianRM [Sat, 8 Jul 2017 21:07:25 +0000 (14:07 -0700)]
Queen vs. Minors imbalance

Addition of correction values in case of Imbalance of queens,
depending on the number of light pieces on the side without a queen.

Passed patch:

STC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 29036 W: 5379 L: 5130 D: 18527

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 13680 W: 1836 L: 1674 D: 10170

Bench: 6258930

Closes #1155

6 years agoDon't uselessy share rootDepth
Marco Costalba [Sun, 2 Jul 2017 10:10:50 +0000 (03:10 -0700)]
Don't uselessy share rootDepth

It is not needed becuase the only case is a real special
one (bench on depth with many threads) and can be easily
rewritten to avoid sharing rootDepth.

Verified with ThreadSanitizer.

No functional change.

Closes #1159

6 years agoFix some warnings with clang static analyzer
Marco Costalba [Sun, 2 Jul 2017 11:39:58 +0000 (13:39 +0200)]
Fix some warnings with clang static analyzer

Only one remains (also in tbprobe.cpp), but is bougus.

As a side note, tbprobe.cpp is almost clean, only the last 3
functions probe_wdl(), root_probe() and root_probe_wdl()
are still the original ones and are quite hacky.

Somewhere in the future we will reformat also the last 3
ones. The reason why has not been done before it is because
these functions are really wrong by design and should be
rewritten entirely, not only reformatted.

No functional change.

Closes #1160

6 years agoIndentation fix in index()
Marco Costalba [Sat, 1 Jul 2017 05:58:38 +0000 (07:58 +0200)]
Indentation fix in index()

No functional change.

Closes #1158

6 years agoTidy up
Alain SAVARD [Fri, 23 Jun 2017 04:03:58 +0000 (00:03 -0400)]
Tidy up

No functional change

Closes #1148

6 years agoMagic::index()
mstembera [Thu, 29 Jun 2017 00:11:17 +0000 (17:11 -0700)]
Magic::index()

Make magic_index() a member of Magic since it uses all it's members
and keep us from having to pass the function pointer around to
init_magics().

No functional change

Closes #1146

6 years agoRemove race suppression.
Joost VandeVondele [Fri, 23 Jun 2017 16:23:27 +0000 (18:23 +0200)]
Remove race suppression.

Pull #1134 fixed another race, so that can be removed from the thread sanitizer suppressions.

No functional change.

Closes #1150

6 years agoOnly main thread checks time
Marco Costalba [Sat, 24 Jun 2017 05:15:46 +0000 (07:15 +0200)]
Only main thread checks time

The main change of the patch is that now time check
is done only by main thread. In the past, before lazy
SMP, we needed all the threds to check for available
time because main thread could have been blocked on
a split point, now this is no more the case and main
thread can do the job alone, greatly simplifying the logic.

Verified for regression testing on STC with 7 threads:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 11895 W: 1741 L: 1608 D: 8546

No functional change.

Closes #1152

6 years agoSimplify pos_is_ok()
Marco Costalba [Sat, 24 Jun 2017 10:36:07 +0000 (12:36 +0200)]
Simplify pos_is_ok()

Now we don't need anymore the tricky pointer to
show the failed test. Added some few tests too.

Also small rename in see_ge() while there.

No functional change

Closes #1151

6 years agoIncrease reduction if tt-move is a capture
VoyagerOne [Wed, 21 Jun 2017 21:05:14 +0000 (14:05 -0700)]
Increase reduction if tt-move is a capture

The idea is that chances are the tt-move is best and will be difficult to raise alpha when playing a quiet move.

STC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 7582 W: 1415 L: 1259 D: 4908

LTC:
LLR: 2.97 (-2.94,2.94) [0.00,5.00]
Total: 59553 W: 7885 L: 7573 D: 44095

Bench: 5725676

Closes #1147

6 years agoImprove readability of evaluation functions
snicolet [Wed, 21 Jun 2017 21:01:59 +0000 (14:01 -0700)]
Improve readability of evaluation functions

This patch puts the evaluation helper functions inside EvalInfo struct, which simplifies a bit their signature and (most importantly, IMHO) makes their C++ code much cleaner and simpler to read (by removing the "ei." qualifiers all around in evaluate.cpp).

Also rename the EvalInfo struct into Evaluation class to get a natural invocation v = Evaluation(p).value() to evaluation position p.

The downside is an increase of 20 lines in evaluate.cpp (for the prototypes of the helper functions). The upsides are better readability and a speed-up of 0.6% (by generating all the helpers for the NO_TRACE case together, which helps the instruction cache).

No functional change

Closes #1135

6 years agoUpdate Top CPU - Bench: 6599721
VoyagerOne [Sun, 18 Jun 2017 19:03:18 +0000 (15:03 -0400)]
Update Top CPU - Bench:  6599721

Closes #1145

6 years agoRevert "Prefetch earlier in qsearch()"
Joona Kiiski [Wed, 21 Jun 2017 20:44:05 +0000 (13:44 -0700)]
Revert "Prefetch earlier in qsearch()"

This reverts commit b73016bb41d4c2fad3126b2e0018d71a36e78331.

No functional change

Closes #1144

6 years agoFix four data races.
Joost VandeVondele [Wed, 21 Jun 2017 20:36:53 +0000 (13:36 -0700)]
Fix four data races.

the nodes, tbHits, rootDepth and lastInfoTime variables are read by multiple threads, but not declared atomic, leading to data races as found by -fsanitize=thread. This patch fixes this issue. It is based on top of the CI-threading branch (PR #1129), and should fix the corresponding CI error messages.

The patch passed an STC check for no regression:

http://tests.stockfishchess.org/tests/view/5925d5590ebc59035df34b9f
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 169597 W: 29938 L: 30066 D: 109593

Whereas rootDepth and lastInfoTime are not performance critical, nodes and tbHits are. Indeed, an earlier version using relaxed atomic updates on the latter two variables failed STC testing (http://tests.stockfishchess.org/tests/view/592001700ebc59035df34924), which can be shown to be due to x86-32 (http://tests.stockfishchess.org/tests/view/592330ac0ebc59035df34a89). Indeed, the latter have no instruction to atomically update a 64bit variable. The proposed solution thus uses a variable in Position that is accessed only by one thread, which is copied every few thousand nodes to the shared variable in Thread.

No functional change.

Closes #1130
Closes #1129

6 years agoMisc coding style fixes
Alain SAVARD [Sun, 11 Jun 2017 21:31:15 +0000 (17:31 -0400)]
Misc coding style fixes

a few comment and blank fixes.

No functional change

Closes #1141

6 years agoPrefetch earlier in qsearch()
snicolet [Sat, 17 Jun 2017 02:52:38 +0000 (19:52 -0700)]
Prefetch earlier in qsearch()

Closes #1139

6 years agoBetter naming in endgame code
Marco Costalba [Sun, 4 Jun 2017 09:03:23 +0000 (11:03 +0200)]
Better naming in endgame code

And small clean-up of magic bitboards code.

No functional change.

Closes #1138

6 years agoMove depth calculation in probCut
Brian Sheppard [Sat, 17 Jun 2017 02:27:36 +0000 (19:27 -0700)]
Move depth calculation in probCut

The change passed an STC regression:

LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 59350 W: 10793 L: 10738 D: 37819

I verified that there was no change in performance on my machine, but of course YMMV:

Results for 40 tests for each version:

                Base      Test      Diff
        Mean    2014338   2016121   -1783
        StDev   62655     63441     3860

p-value: 0.678
speedup: 0.001

No functional change.

Closes #1137

6 years agoCall TT.new_search() earlier.
Joost VandeVondele [Tue, 6 Jun 2017 07:48:57 +0000 (09:48 +0200)]
Call TT.new_search() earlier.

TT.new_search() was being called by mainThread in Thread::search(). However, mainThread is the last to start searching, and helper threads could reach a measured rootDepth 10 (on 64 cores) before mainThread increments the TT generation. Fixed by moving the call to MaintThread::search() before helper threads start searching.

No functional change.

Closes #1134

6 years agoReordering magic data
mstembera [Tue, 6 Jun 2017 17:20:43 +0000 (10:20 -0700)]
Reordering magic data

Gather all magic relevant data into a struct.

This changes memory layout putting everything necessary for processing a single square
in the same memory location thus speeding up access.

Original patch by @snicolet

No functional change.

Closes #1127
Closes #1128

6 years agoDon't score as an immediate draw 2-fold repetitions of the root position
atumanian [Tue, 6 Jun 2017 17:13:10 +0000 (10:13 -0700)]
Don't score as an immediate draw 2-fold repetitions of the root position

In the current version a search stops when the current position is the same as
any position earlier in the search stack,
including the root position but excluding positions before the root.
The new version makes an exception for repeating the root position.

This gives correct scores for moves in the MultiPV > 1 mode.

Fixes #948 (see it for the detailed description of the bug).

LTC: http://tests.stockfishchess.org/tests/view/587910bc0ebc5915193f754b
ELO: 0.38 +-1.7 (95%) LOS: 66.8%
Total: 40000 W: 5166 L: 5122 D: 29712

STC: http://tests.stockfishchess.org/tests/view/5922e6230ebc59035df34a50
LLR: 2.94 (-2.94,2.94) [-3.00,1.00]
Total: 94622 W: 17059 L: 17064 D: 60499

 LTC: http://tests.stockfishchess.org/tests/view/59273a000ebc59035df34c03
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 61259 W: 7965 L: 7897 D: 45397

Bench: 6599721

Closes #1126

6 years agouse auto& for histories
Joost VandeVondele [Sun, 28 May 2017 07:58:52 +0000 (09:58 +0200)]
use auto& for histories

No functional change.

Closes #1113

6 years agoHistory code rewrite (#1122)
Marco Costalba [Fri, 26 May 2017 06:42:50 +0000 (08:42 +0200)]
History code rewrite (#1122)

Rearrange and rename all history heuristic code. Naming
is now based on chessprogramming.wikispaces.com conventions
and the relations among the various heuristics are now more
clear and consistent.

No functional change.

6 years agoChanged spelling back to "Bishops" in eval output
Nathan Rugg [Tue, 23 May 2017 06:56:49 +0000 (14:56 +0800)]
Changed spelling back to "Bishops" in eval output

No functional change.

Closes #1124

6 years agoEvasion Pruning Tweak
VoyagerOne [Mon, 22 May 2017 01:25:20 +0000 (18:25 -0700)]
Evasion Pruning Tweak

Use moveCount to decide when to prune for evasion pruning

STC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 24476 W: 4518 L: 4289 D: 15669

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 18362 W: 2476 L: 2298 D: 13588

Bench: 6469989

Closes #1120

6 years agoDo check analysis later in the game
snicolet [Thu, 18 May 2017 01:23:07 +0000 (18:23 -0700)]
Do check analysis later in the game

The previous patch has added a fraction of the king danger score to the
endgame score of the tapered eval, so it seems natural to perform the
king danger computation later in the endgame.

With this patch we extend the limit of such check analysis down to the
material of Rook+Knight, when we have at least two pieces attacking the
opponent king zone.

Passed STC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 7446 W: 1409 L: 1253 D: 4784
http://tests.stockfishchess.org/tests/view/591c097c0ebc59035df3477c

and LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 14234 W: 1946 L: 1781 D: 10507
http://tests.stockfishchess.org/tests/view/591c24f10ebc59035df3478c

Bench: 5975183

Closes #1121

6 years agoUse a fraction of king danger in endgame score
snicolet [Thu, 18 May 2017 01:19:47 +0000 (18:19 -0700)]
Use a fraction of king danger in endgame score

When SF has an attack on the opponent king in one flank, the huge
midgame -> endgame gradient of the tapered eval prevents us to properly
evaluate neutral exchanges on the other flank as the current king
danger score is a pure midgame term. This may affect SF's ability to
switch to defense in some positions. We add a small contribution
of the king danger to the endgame score to limit this
effect.

Again suggested in the following forum thread:
https://groups.google.com/forum/?fromgroups=#!topic/fishcooking/xrUCQ7b0ObE

Passed STC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 12719 W: 2371 L: 2192 D: 8156
http://tests.stockfishchess.org/tests/view/5919761a0ebc59035df3468f

And LTC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 31293 W: 4194 L: 3974 D: 23125
http://tests.stockfishchess.org/tests/view/591980450ebc59035df34695

Bench: 5961548

Closes #1118

6 years agoFix memory access in Search::clear()
Joost VandeVondele [Thu, 18 May 2017 01:15:01 +0000 (18:15 -0700)]
Fix memory access in Search::clear()

Fixes a bug in Search::clear, where the filling of CounterMoveStats&, overwrote (currently presumably unused) memory because sizeof(cm) returns the size in bytes, whereas elements was needed.

No functional change

Closes #1119

6 years agoLimit king ring to eight squares
snicolet [Tue, 16 May 2017 02:26:27 +0000 (19:26 -0700)]
Limit king ring to eight squares

In current master the size of the king ring varies abruptly from eight
squares when the king is in g8, to 12 squares when it is in g7. Because
the king ring is used for estimating attack strength, this may lead to
an overestimation of king danger in some positions. This patch limits
the king ring to eight squares in all cases.

 Inspired by the following forum thread:
https://groups.google.com/forum/?fromgroups=#!topic/fishcooking/xrUCQ7b0ObE

Passed STC:
LLR: 2.97 (-2.94,2.94) [0.00,5.00]
Total: 9244 W: 1777 L: 1611 D: 5856

and LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 87121 W: 11765 L: 11358 D: 63998

Bench: 6121121

Closes #1115

6 years agoExecute an implied ucinewgame at startup
Joost VandeVondele [Sat, 6 May 2017 11:12:39 +0000 (13:12 +0200)]
Execute an implied ucinewgame at startup

execute an implied ucinewgame upon entering the UCI::loop,
to make sure that searches starting with and without an (optional) ucinewgame
command yield the same search.

This is needed now that seach::clear() initializes tables to non-zero default values.

No functional change

Closes #1101
Closes #1104

6 years agoDefault argument for see_ge()
Marco Costalba [Tue, 9 May 2017 11:50:05 +0000 (13:50 +0200)]
Default argument for see_ge()

No functional change.

Closes #1111

6 years agoRemove int to int conversion, unused include.
Joost VandeVondele [Wed, 10 May 2017 01:36:18 +0000 (18:36 -0700)]
Remove int to int conversion, unused include.

No functional change.

Closes #1112

6 years agoLinear Protector bonus by distance
FauziAkram [Mon, 8 May 2017 04:03:59 +0000 (21:03 -0700)]
Linear Protector bonus by distance

Replacing the old Protector table with a simple linear formula which takes into account a different slope for each different piece type.

The idea of this simplification of Protector is originated by Alain (Rocky)

STC: LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 70382 W: 12859 L: 12823 D: 44700

LTC: LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 61554 W: 8098 L: 8031 D: 45425

Bench: 6107863

Closes #1099

6 years agoKing safety and rook mobility parameters tweak
IIvec [Mon, 8 May 2017 03:56:04 +0000 (20:56 -0700)]
King safety and rook mobility parameters tweak

STC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 19280 W: 3595 L: 3373 D: 12312

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 221405 W: 28940 L: 28220 D: 164245

Bench: 6506664

Closes #1105

6 years agoBonus for pawn scrifice which create passed pawn
Stefan Geschwentner [Mon, 8 May 2017 03:38:03 +0000 (20:38 -0700)]
Bonus for pawn scrifice which create passed pawn

STC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 16752 W: 3141 L: 2944 D: 10667

LTC:
LLR: 3.34 (-2.94,2.94) [0.00,5.00]
Total: 33928 W: 4544 L: 4300 D: 25084

Bench: 5639223

Closes #1092

6 years agoMove Pieces[] out of global visibility
Marco Costalba [Sun, 7 May 2017 08:26:09 +0000 (10:26 +0200)]
Move Pieces[] out of global visibility

It is an helper array used only in position.cpp

Also small code tidy up while there.

No functional change.

Closes #1106

6 years agoAvoid *begin always being included in the sorted list regardless of its value.
mstembera [Mon, 8 May 2017 03:14:23 +0000 (20:14 -0700)]
Avoid *begin always being included in the sorted list regardless of its value.

This was a minor criticism by @zamar in the original pull request
https://github.com/official-stockfish/Stockfish/pull/1065
necessitating a comment explanation.

No functional change.

Closes #1091

6 years agoFix multiPV issue #502
joergoster [Thu, 4 May 2017 02:46:40 +0000 (19:46 -0700)]
Fix multiPV issue #502

In general, this patch handles the cases where we don't have a valid score for each PV line in a multiPV search. This can happen if the search has been stopped in an unfortunate moment while still in the aspiration loop. The patch consists of two parts.

Part 1: The new PVIdx was already part of the k-best pv's in the last iteration, and we therefore have a valid pv and score to output from the last iteration. This is taken care of with:

      bool updated = (i <= PVIdx && rootMoves[i].score != -VALUE_INFINITE);

Case 2: The new PVIdx was NOT part of the k-best pv's in the last iteration, and we have no valid pv and score to output. Not from the current nor from the previous iteration. To avoid this, we are now also considering the previous score when sorting, so that the PV lines with no actual but with a valid previous score are pushed up again, and the previous score can be displayed.

  bool operator<(const RootMove& m) const {
    return m.score != score ? m.score < score : m.previousScore < previousScore; } // Descending sort

I also added an assertion in UCI::value() to possibly catch similar issues earlier.

No functional change.

Closes #502
Closes #1074

6 years agogcc 7 port
Joost VandeVondele [Fri, 28 Apr 2017 15:30:14 +0000 (17:30 +0200)]
gcc 7 port

Testing the release candidate revealed only one minor issue, namely a new warning -Wimplicit-fallthrough (part of -Wextra) triggers in the movepicker. This can be silenced by adding a comment, and once we move to c++17 by adding a standard annotation [[fallthrough]];.

No functional change.

Closes #1090

6 years agoDon't do InCheck Pruning at the root of QS
VoyagerOne [Sat, 29 Apr 2017 03:40:01 +0000 (20:40 -0700)]
Don't do InCheck Pruning at the root of QS

STC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 34603 W: 6441 L: 6167 D: 21995

LTC:
LLR: 2.97 (-2.94,2.94) [0.00,5.00]
Total: 24474 W: 3274 L: 3076 D: 18124

Bench: 5934421

Closes #1089

6 years agoRemove cap in kingDanger initialization
Rocky640 [Sat, 29 Apr 2017 03:36:24 +0000 (20:36 -0700)]
Remove cap in kingDanger initialization

Passed STC
http://tests.stockfishchess.org/tests/view/58fd53be0ebc59035df33eb5
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 52048 W: 9397 L: 9329 D: 33322

Passed LTC
http://tests.stockfishchess.org/tests/view/58ff9e0a0ebc59035df33f5c
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 35382 W: 4650 L: 4549 D: 26183

Bench: 5872717

Closes #1087

6 years agoRetire the misdesigned StepAttacks[] array.
Marco Costalba [Sat, 29 Apr 2017 03:33:30 +0000 (20:33 -0700)]
Retire the misdesigned StepAttacks[] array.

StepAttacks[] is misdesigned, the color dependance is specific
to pawns, and trying to generalise to king and knights, proves
neither useful nor convinient in practice.

So this patch reformats the code with the following changes:

- Use PieceType instead of Piece in attacks_() functions

- Use PseudoAttacks for KING and KNIGHT

- Rename StepAttacks[] into PawnAttacks[]

Original patch and idea from Alain Savard.

No functional change.

Closes #1086

6 years agoCopy killers in the movepicker
Joost VandeVondele [Sat, 29 Apr 2017 03:27:39 +0000 (20:27 -0700)]
Copy killers in the movepicker

ss->killers can change while the movepicker is active.
The reason ss->killers changes is related to the singular
extension search in the moves loop that calls search<>
recursively with ss instead of ss+1,
effectively using the same stack entry for caller and callee.
By making a copy of the killers,
the movepicker does the right thing nevertheless.

Tested as a bug fix

STC:
http://tests.stockfishchess.org/tests/view/58ff130f0ebc59035df33f37
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 70845 W: 12752 L: 12716 D: 45377

LTC:
http://tests.stockfishchess.org/tests/view/58ff48000ebc59035df33f3d
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 28368 W: 3730 L: 3619 D: 21019

Bench: 6465887

Closes #1085

6 years agoAvoid misuse of StepAttacksBB for pawns
snicolet [Wed, 26 Apr 2017 00:57:30 +0000 (17:57 -0700)]
Avoid misuse of StepAttacksBB for pawns

Make it explicit that first index of StepAttacksBB is a piece, not a piece type.

No functional change

Closes #1083

6 years agoZero unused constant
Joost VandeVondele [Wed, 26 Apr 2017 00:19:23 +0000 (17:19 -0700)]
Zero unused constant

No functional change

Closes #1081

6 years agoAssorted code style issues
Marco Costalba [Sat, 22 Apr 2017 07:03:17 +0000 (09:03 +0200)]
Assorted code style issues

I have removed the check for

 pieceCount[PAWN] > FILE_NB

because totally useless.

No functional change.

6 years agoSort moves partially: linear depth dependence
Joost VandeVondele [Sun, 23 Apr 2017 15:37:55 +0000 (08:37 -0700)]
Sort moves partially: linear depth dependence

STC: http://tests.stockfishchess.org/tests/view/58f98d260ebc59035df33d5e
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 58958 W: 10862 L: 10485 D: 37611

LTC: http://tests.stockfishchess.org/tests/view/58fa45d40ebc59035df33d86
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 18607 W: 2427 L: 2251 D: 13929

Bench: 6065528

Closes #1079

6 years agoKing safety parameters improved
IIvec [Sun, 23 Apr 2017 15:02:52 +0000 (08:02 -0700)]
King safety parameters improved

STC:
LLR: 2.97 (-2.94,2.94) [0.00,4.00]
Total: 58648 W: 10883 L: 10524 D: 37241

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 52546 W: 7131 L: 6844 D: 38571

Bench 6121479

Closes #1078

6 years agoUse int instead of Value for history related stats.
Joost VandeVondele [Sun, 23 Apr 2017 14:57:48 +0000 (07:57 -0700)]
Use int instead of Value for history related stats.

history related scores are not related to evaluation based scores.
For example, can easily exceed the range -VALUE_INFINITE,VALUE_INFINITE.
As such the current type is confusing, and a plain int is a better match.

tested for no regression:

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 43693 W: 7909 L: 7827 D: 27957

No functional change.

Closes #1070

6 years agosimplify logic for history based pruning
Joost VandeVondele [Thu, 20 Apr 2017 18:22:24 +0000 (11:22 -0700)]
simplify logic for history based pruning

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 34255 W: 6292 L: 6194 D: 21769

LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 89914 W: 11769 L: 11739 D: 66406

Bench: 6581936

Closes #1066

6 years agoPartial insertion sort
Joost VandeVondele [Thu, 20 Apr 2017 18:15:48 +0000 (11:15 -0700)]
Partial insertion sort

the order of elements returned by std::partition is implementation defined (since not stable) and could depend on the version of libstdc++ linked.
As std::stable_partition was tested to be too slow (http://tests.stockfishchess.org/tests/view/585cdfd00ebc5903140c6082).
Instead combine partition with our custom implementation of insert_sort, which fixes this issue.
Implementation based on a patch by mstembera (http://tests.stockfishchess.org/tests/view/58d4d3460ebc59035df3315c), which suggests some benefit by itself.
Higher depth moves are all sorted (INT_MIN version), as in current master.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 33116 W: 6161 L: 6061 D: 20894

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 88703 W: 11572 L: 11540 D: 65591

Bench: 6256522

Closes #1058
Closes #1065

7 years agoUpdate Readme.md
Stefano Cardanobile [Mon, 17 Apr 2017 16:58:02 +0000 (18:58 +0200)]
Update Readme.md

Update number of threads.

Closes #1072

7 years agoPrefer std::find over a hand-coded loop
Joost VandeVondele [Sun, 16 Apr 2017 08:48:17 +0000 (10:48 +0200)]
Prefer std::find over a hand-coded loop

tested for no regression.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 37378 W: 6649 L: 6556 D: 24173

No functional change.

Closes #1071

7 years agoMove-Count Formula Tweak
VoyagerOne [Mon, 17 Apr 2017 16:21:16 +0000 (09:21 -0700)]
Move-Count Formula Tweak

STC:
LLR: 3.18 (-2.94,2.94) [0.00,4.00]
Total: 55004 W: 10289 L: 9930 D: 34785

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 48184 W: 6401 L: 6128 D: 35655

Bench: 5960754

7 years agoRemove cap from space score contribution and increase bonus
Stefano80 [Mon, 17 Apr 2017 16:17:41 +0000 (09:17 -0700)]
Remove cap from space score contribution and increase bonus

STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 58462 W: 10615 L: 10558 D: 37289

LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 65061 W: 8539 L: 8477 D: 48045

It is worth noting that an attempt to only increase the bonus passed STC but failed LTC, and
an attempt to remove the cap without increasing the bonus is still running at STC, but will probably fail after more than 100k.

Bench: 6188591

Closes #1063

7 years agoDoubled and supported pawns
Stéphane Nicolet [Tue, 11 Apr 2017 17:50:24 +0000 (19:50 +0200)]
Doubled and supported pawns

Do not give the doubled pawn penalty when the frontmost pawn is
supported, for instance f2-g2-g3

STC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 55927 W: 10418 L: 10052 D: 35457
http://tests.stockfishchess.org/tests/view/58eb9fc20ebc59035df33858

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 32078 W: 4257 L: 4035 D: 23786
http://tests.stockfishchess.org/tests/view/58ec48420ebc59035df3388b

Bench: 5995472

Closes #1062

7 years agoRemove minimum to contribution from king danger to score.
Stefano80 [Sun, 9 Apr 2017 14:48:20 +0000 (07:48 -0700)]
Remove minimum to contribution from king danger to score.

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 24858 W: 4559 L: 4445 D: 15854

LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 40789 W: 5338 L: 5244 D: 30207

Bench: 7027489

Closes #1059

7 years agoFix zugzwang pruning issues
joergoster [Sat, 8 Apr 2017 00:07:40 +0000 (17:07 -0700)]
Fix zugzwang pruning issues

By adding pos.non_pawn_material(pos.side_to_move()) as a precondition in step 13,
which is already in use in Futility Pruning (child node) and Null Move Pruning for similar reasons.

Pawn endgames, especially those with only 1 or 2 pawns, are simply heavily influenced by zugzwang situations.

Since we are using a bitbase for KPK endgames, I see no reason to accept buggy evals as shown in #760

Patch looks neutral at STC
LLR: 2.32 (-2.94,2.94) [-3.00,1.00]
Total: 79580 W: 10789 L: 10780 D: 58011

and LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 27071 W: 3502 L: 3390 D: 20179

Bench: 6259071

Closes #1051
Closes #760

7 years agoStandardize stat penalty
VoyagerOne [Sat, 8 Apr 2017 00:02:31 +0000 (17:02 -0700)]
Standardize stat penalty

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 90631 W: 16325 L: 16323 D: 57983

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 97679 W: 12779 L: 12759 D: 72141

Bench: 6340591

Closes #1053