]> git.sesse.net Git - stockfish/log
stockfish
9 years agoEvaluate king safety when no queen is present.
uriblass [Sun, 21 Sep 2014 17:32:47 +0000 (01:32 +0800)]
Evaluate king safety when no queen is present.

LLR: 2.97 (-2.94,2.94) [-1.50,4.50]
Total: 16657 W: 3547 L: 3391 D: 9719

LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 31258 W: 5664 L: 5403 D: 20191

Bench: 8331165

Resolves #51

9 years agoFix spacing.
Gary Linscott [Sun, 21 Sep 2014 17:27:34 +0000 (01:27 +0800)]
Fix spacing.

No functional change.

9 years agoRearrange evaluation constants definitions
Marco Costalba [Sat, 20 Sep 2014 08:19:21 +0000 (10:19 +0200)]
Rearrange evaluation constants definitions

Make them more uniform and consistent.

No functional change.

Conflicts:
src/evaluate.cpp

9 years agoRename time variable to reflect UCI parameters
Marco Costalba [Thu, 18 Sep 2014 13:44:38 +0000 (15:44 +0200)]
Rename time variable to reflect UCI parameters

On top of previous patch, rename time variables to
reflect the simplification of UCI parameters.

It is more correct to use as varibales directly the
corresponding UCI option, without intorducing redundant
intermediate variables.

This allows also to simplify the code.

No functional change.

9 years agoKing-pawn threat bonus for endgames.
mbootsector [Fri, 19 Sep 2014 14:33:42 +0000 (22:33 +0800)]
King-pawn threat bonus for endgames.

STC:
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 10224 W: 1765 L: 1638 D: 6821

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,6.00]
Total: 6923 W: 1027 L: 899 D: 4997

bench 7818100

Resolves #49

9 years agoRename "Contempt Factor" to "Contempt"
Marco Costalba [Mon, 8 Sep 2014 13:44:25 +0000 (15:44 +0200)]
Rename "Contempt Factor" to "Contempt"

Suggested by Ronald and Lucas on talkchess.

No functional change.

Conflicts:
src/ucioption.cpp

9 years agoRetire struct Log
Marco Costalba [Sun, 14 Sep 2014 08:06:36 +0000 (10:06 +0200)]
Retire struct Log

No more used now that we have removed
"Write Search Log" UCI option.

No functional change.

9 years agoSimplify Time Management UCI options
lucasart [Mon, 15 Sep 2014 19:24:51 +0000 (20:24 +0100)]
Simplify Time Management UCI options

No functional change

9 years agoSmall tweak to idle_loop()
Marco Costalba [Fri, 29 Aug 2014 12:59:32 +0000 (14:59 +0200)]
Small tweak to idle_loop()

In case of a succesful late join we set again
'searching' flag, so we can restart search
immediately without an useless lock/unlock
cycle.

No functional change.

9 years agoSimplify idle_loop()
Joona Kiiski [Sat, 30 Aug 2014 20:03:41 +0000 (21:03 +0100)]
Simplify idle_loop()

No functional change

9 years agoRetire Search Log
lucasart [Sun, 24 Aug 2014 15:28:51 +0000 (16:28 +0100)]
Retire Search Log

No functional change

Bench: 7461881

9 years agoFix perft 1
Marco Costalba [Sat, 9 Aug 2014 09:33:02 +0000 (11:33 +0200)]
Fix perft 1

Compute correct number of moves for this corner case.

A smal bug crept in after recent perft rework.

No functional change.

9 years agoRetire move_to_san()
lucasart [Sat, 9 Aug 2014 23:22:55 +0000 (07:22 +0800)]
Retire move_to_san()

Now "Write Search Log" will pring moves in UCI format, consistent with all the rest. This functionality is
not aimed at end-users anyway. It's hardly useful at all, in fact. Also, pretty-printing SAN moves is
something that better belongs in the GUI than in the engine.

No functional change.

9 years agoMove to_char() and to_string() to notation
lucasart [Sat, 9 Aug 2014 05:11:36 +0000 (13:11 +0800)]
Move to_char() and to_string() to notation
Where they better belong.

Also, this removes '#include <string>' from types.h, which reduces the amount of code to compile (every
translation unit includes types.h).

No functional change.

9 years agoRework perft implementation
Marco Costalba [Fri, 8 Aug 2014 08:59:28 +0000 (10:59 +0200)]
Rework perft implementation

Unify various perft functions and move all the code
to search.cpp.

Avoid perft implementation to be splitted between
benchmark.cpp (where it has no reason to be) and
search.cpp

No functional and no speed change (tested).

9 years agoWrite perft(N-1) into cout
lucasart [Thu, 7 Aug 2014 13:07:57 +0000 (21:07 +0800)]
Write perft(N-1) into cout
So that one can redirect cout to /dev/null and only print print cerr in the terminal (for more accurate speed
tests).

Suggested by Marco.

No functional change.

9 years agoFix Hash in bench
lucasart [Thu, 7 Aug 2014 10:51:07 +0000 (18:51 +0800)]
Fix Hash in bench
The compiler tries to cast Options["Hash"] into a string, using:

Option::operator std::string() const {
  assert(type == "string");
  return currentValue;
}

And, as expected, the assert() fails.

std::to_string() would be the right solution, but it's C++11. And using a stringstream is too much code to
achieve so little. Let's keep it the way it was: hardcoded (ie. default hash defined in two places).

No functional change.

9 years agoRemove insufficient material rule
joergoster [Wed, 6 Aug 2014 10:36:04 +0000 (18:36 +0800)]
Remove insufficient material rule
The eval already returns zero in KK, KBK, KNK (see material.cpp). The difference is:
- we lose the "TB pruning" benefit of the draw rule (ie. search goes on even if eval is zero)
- we gain some speed by removing a useless test from the hot path

STC:
LLR: 0.05 (-2.94,2.94) [-3.00,1.00]
Total: 128000 W: 21357 L: 21560 D: 85083

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 33023 W: 4613 L: 4509 D: 23901

bench 7461881

9 years agoRemove useless code in Position::pretty()
lucasart [Tue, 5 Aug 2014 23:04:27 +0000 (07:04 +0800)]
Remove useless code in Position::pretty()
First, remove some dead code (function never called with a Move argument).

Then, remove printing of legal moves, which does not belong here. Let's keep commands orthogonal and minimal:
- the "d" command should display the board, nothing more, or less.
- "perft 1" will display the list of legal moves.

No functional change.

9 years agoReduce minimum memory requirement by 16MB
lucasart [Tue, 5 Aug 2014 03:42:48 +0000 (11:42 +0800)]
Reduce minimum memory requirement by 16MB
Stockfish allocates the default hash (32MB) in main(), before entering UCI::loop(). If there is not enough
memory, the program will crash even before UCI::loop() is entered and the GUI is given a change to specify a
lower Hash value.

This defective design could be resolved by doing a lazy allocation upon "isready" command, as the UCI protocol
guarantees that "isready" will be sent at least once before any search. But it's a bit cumbersome when using
Stockfish "manually" to have to remember to type "isready" everytime.

So leave the current design, but reduce the default hash to 16MB instread of 32MB. In order to perform such
quick searches (depth=13), there is no reason to use so much Hash anyway. Another benefit is to introduce a
bit of hash pressure in bench, which increases chances to detect rare bugs related to TT replacement, for
example.

This is not a functional change, although it obviously changes the bench.

bench 7461879

9 years agoDefault Hash defined in a single place
lucasart [Tue, 5 Aug 2014 03:39:50 +0000 (11:39 +0800)]
Default Hash defined in a single place
Instead of defining it both in ucioption.cpp and benchmark.cpp. Obviously changing the default Hash will
change the bench as a result.

No functional change.

9 years agoRetire divide command
lucasart [Mon, 4 Aug 2014 05:54:09 +0000 (13:54 +0800)]
Retire divide command
The main purpose of perft is to help debugging. But without the breakdown in sum of perft(N-1), it is a
completely useless debugging tool.

So perft now displays the breakdown, and divide is therefore removed.

No functional change.

9 years agoEnsure printing UCI info in multi-pv case
Marco Costalba [Sat, 2 Aug 2014 09:02:13 +0000 (11:02 +0200)]
Ensure printing UCI info in multi-pv case

After commit 94b1bbb68be6b0bc3aaf1cb804841a022bcc7007, in case available root moves are less than multiPV, we
could never reach condition:

PVIdx + 1 == multiPV

and as a consequence UCI output is not printed.

Fixed suggested by Joerg Oster.

No functional change.

9 years agoCorrect bench timing
Oskar Werkelin Ahlin [Fri, 1 Aug 2014 11:32:53 +0000 (19:32 +0800)]
Correct bench timing

No functional change.

9 years agoDocument Threat[] indices
lucasart [Mon, 28 Jul 2014 23:05:12 +0000 (07:05 +0800)]
Document Threat[] indices
From Marco's repo.

No functional change.

9 years agoFix a warning with MSVC 2010
Marco Costalba [Sat, 26 Jul 2014 14:01:09 +0000 (16:01 +0200)]
Fix a warning with MSVC 2010

Warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data

No functional change.

9 years agoSmall code style reformatting
David Zar [Sun, 27 Jul 2014 14:27:53 +0000 (17:27 +0300)]
Small code style reformatting

No functional change.

9 years agoAspiration: widen slower
lucasart [Sun, 27 Jul 2014 01:05:28 +0000 (09:05 +0800)]
Aspiration: widen slower
STC:
LLR: -2.95 (-2.94,2.94) [0.00,4.00]
Total: 182323 W: 30664 L: 30234 D: 121425

LTC:
LLR: 3.51 (-2.94,2.94) [0.00,4.00]
Total: 59841 W: 8345 L: 8006 D: 43490

bench 7962536

9 years agoOutpost tuning
David Zar [Tue, 22 Jul 2014 23:05:10 +0000 (07:05 +0800)]
Outpost tuning
double mg bonus and half eg bonus.

STC:
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 18142 W: 3094 L: 2948 D: 12100

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 83561 W: 11706 L: 11329 D: 60526

bench 7831429

9 years agoRevert Contempt = 20
lucasart [Sun, 20 Jul 2014 00:50:54 +0000 (08:50 +0800)]
Revert Contempt = 20

Despite being neutral at STC, it turned out to be regressive at LTC:

40k games at LTC with Hash=8
ELO: -2.06 +-1.9 (95%) LOS: 1.4%
Total: 39720 W: 5740 L: 5976 D: 28004

40k games at LTC with Hash=128
ELO: -2.69 +-1.9 (95%) LOS: 0.2%
Total: 39149 W: 5702 L: 6005 D: 27442

bench 7477963

9 years agoSimplify evaluate_passed_pawns
Marco Costalba [Mon, 14 Jul 2014 13:15:07 +0000 (15:15 +0200)]
Simplify evaluate_passed_pawns

From a suggestion by David Zar.

No functional change.

9 years agoContempt = 20
lucasart [Mon, 14 Jul 2014 23:03:37 +0000 (07:03 +0800)]
Contempt = 20
Also raise the admissible bounds to (-100,100), as there is no reason to prevent users from using high
values if they want to.

Does not regress in self play:
ELO: 0.10 +-2.0 (95%) LOS: 53.7%
Total: 40000 W: 7084 L: 7073 D: 25843

master vs SF 3
ELO: 182.86 +-2.7 (95%) LOS: 100.0%
Total: 40000 W: 21843 L: 2541 D: 15616

Contempt = 20 vs SF 3
ELO: 189.25 +-2.8 (95%) LOS: 100.0%
Total: 40000 W: 22721 L: 2859 D: 14420

Diff is therefore 6.4 +/- 3.9 elo against a 180-190 elo weaker engine, which is significantly positive,
as expected. This elo difference is likely understated, because of FishTest aggressive draw adjudication
though.

We could push Contempt further, but after 20cp, it would get in the way of FishTest draw adjudication
rule, and is likely to reduce the testing throughput as a result.

bench 8198667

9 years agoBonus passed pawn blocked by our pieces
David Zar [Mon, 14 Jul 2014 10:26:25 +0000 (18:26 +0800)]
Bonus passed pawn blocked by our pieces

passed STC:
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 63965 W: 10950 L: 10692 D: 42323

and LTC:
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 19237 W: 2740 L: 2562 D: 13935

bench: 7477963

9 years agoSmall reformat to Skill class
Marco Costalba [Thu, 10 Jul 2014 14:40:10 +0000 (16:40 +0200)]
Small reformat to Skill class

Steamline a bit the implementation of
skill levels. As a side effect we can
retire MultiPV global and use a local
variable instead.

No functional change.

9 years agoRemove useless condition
lucasart [Thu, 10 Jul 2014 10:25:20 +0000 (18:25 +0800)]
Remove useless condition

Small simplification, suggested by Uri Blass.

passed STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 25839 W: 4464 L: 4351 D: 17024

and LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 220039 W: 29981 L: 30131 D: 159927

No functional change.

9 years agoRetire FakeSplit
Joona Kiiski [Mon, 7 Jul 2014 19:37:06 +0000 (20:37 +0100)]
Retire FakeSplit

    - Currently broken
    - Never been really useful
    - Does not work well with new splitting model

Verified for no regression at STC with 3 threads:
LLR: 2.96 (-2.94,2.94) [-6.00,0.00]
Total: 81905 W: 12122 L: 12381 D: 57402

No functional change

9 years agoAvoid 'double assigments' tricks
Marco Costalba [Sat, 5 Jul 2014 06:15:57 +0000 (08:15 +0200)]
Avoid 'double assigments' tricks

Bitboard init code is already noteasy to follow,
so don't make it even harder using 'smart' code.

Also reindent a while loop in standard way.

No functional change.

9 years agoTune trapped rook penalty
joergoster [Thu, 3 Jul 2014 11:38:54 +0000 (19:38 +0800)]
Tune trapped rook penalty

Passed STC
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 15687 W: 3352 L: 3199 D: 9136

and LTC (parameter tweaks)
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 27983 W: 5046 L: 4797 D: 18140

bench: 8330705

9 years agosize_t cast in TranspositionTable::first_entry()
lucasart [Thu, 3 Jul 2014 10:23:56 +0000 (18:23 +0800)]
size_t cast in TranspositionTable::first_entry()
32-bit truncation would make this function bogus when clusterCount >= 2^33 (ie. Hash >= 256 GB).

No function change.

9 years agoUse compiler intrinsic instead of assembly for popcnt
lucasart [Thu, 3 Jul 2014 10:22:53 +0000 (18:22 +0800)]
Use compiler intrinsic instead of assembly for popcnt
This time, do not break compatibility with some AMD machines that have SSE3 and popcnt, but do
not have SSE4.2.

No functional change.

9 years agoRevert "Use compiler intrinsic instead of assembly for popcnt"
Gary Linscott [Tue, 1 Jul 2014 21:01:54 +0000 (17:01 -0400)]
Revert "Use compiler intrinsic instead of assembly for popcnt"

This reverts commit a69f1d7c2060dc7b320a7b4801105df00b22a96a.

9 years agoUse compiler intrinsic instead of assembly for popcnt
lucasart [Tue, 1 Jul 2014 12:46:16 +0000 (20:46 +0800)]
Use compiler intrinsic instead of assembly for popcnt
No functional change.

9 years agoRaise max Hash to 1TB
lucasart [Tue, 1 Jul 2014 10:13:20 +0000 (18:13 +0800)]
Raise max Hash to 1TB
And use size_t where appropriate, as suggested on FishCooking.

No functional change.

9 years agoAdd bonuses for Minors attacking enemy pieces(except pawns) even when they are protec...
Ajith [Mon, 30 Jun 2014 14:55:10 +0000 (10:55 -0400)]
Add bonuses for Minors attacking enemy pieces(except pawns) even when they are protected by enemy pawns.

Patch passed STC
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 8206 W: 1426 L: 1304 D: 5476

and LTC
LLR: 2.97 (-2.94,2.94) [0.00,6.00]
Total: 19534 W: 2821 L: 2640 D: 14073

Bench: 9942172

9 years agoFix Singular extension condition to handle mate scores
joergoster [Sun, 29 Jun 2014 19:17:40 +0000 (20:17 +0100)]
Fix Singular extension condition to handle mate scores

With Eelco's patch "Don't special case for abs(beta) >= VALUE_MATE_IN_MAX_PLY" condition "abs(ttValue) < VALUE_KNOWN_WIN" has been removed from singular extension search, and condition "abs(beta) < VALUE_KNOWN_WIN" was added to the SingularExtensionNode definition.
This might lead to problems, especially in positions, where a mate is due.
For example, this position 5rk1/4K1pp/8/5PPP/8/8/8/1R6 w - - 12 1 triggers an assert.
stockfish: search.cpp:434: Value {anonymous}::search(Position&, Search::Stack*, Value, Value, Depth, bool) [with {anonymous}::NodeType NT = (<unnamed>::NodeType)2u; bool SpNode = false]: Assertion `-VALUE_INFINITE <= alpha && alpha < beta && beta <= VALUE_INFINITE' failed.

So let's re-insert the removed condition.
First spotted by Uri Blass, fix by me.

Bench: 8759675

9 years agoChange the install prefix for Haiku
Joseph R. Prostko [Sun, 29 Jun 2014 14:15:10 +0000 (15:15 +0100)]
Change the install prefix for Haiku

* /boot/common was removed from Haiku
* The equivalent path now that package management has been implemented is /boot/system/non-packaged

No functional change

Bench: 8759681

9 years agoPack 3 TT entries in 32 bytes cluster
Ron Britvich [Sat, 28 Jun 2014 18:05:58 +0000 (14:05 -0400)]
Pack 3 TT entries in 32 bytes cluster

Idea from Ron Britvich

Code reworked by Marco Costalba and Joona Kiiski

Bench: 8095369

Resolves #3
Resolves #10

9 years agoMerge pull request #9 from glinscott/pawnspan
Gary Linscott [Thu, 26 Jun 2014 19:21:06 +0000 (12:21 -0700)]
Merge pull request #9 from glinscott/pawnspan

Scale down endgames with pawns on one or two adjacent files

Passed STC
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 16081 W: 2745 L: 2604 D: 10732

Passed LTC
LLR: 2.95 (-2.94,2.94) [1.00,6.00]
Total: 123832 W: 17292 L: 16584 D: 89956

128k games to measure ELO at 15+0.05:
ELO: 2.07 +-1.1 (95%) LOS: 100.0%
Total: 128000 W: 21632 L: 20869 D: 85499

New bench: 8028792

9 years agoA bit more cleanup
Gary Linscott [Thu, 26 Jun 2014 19:20:30 +0000 (15:20 -0400)]
A bit more cleanup

9 years agoMerge pull request #8 from glinscott/revert_ce1c260
Gary Linscott [Thu, 26 Jun 2014 15:20:45 +0000 (08:20 -0700)]
Merge pull request #8 from glinscott/revert_ce1c260

Revert "Check for an available slave early on"

9 years agoRevert "Check for an available slave early on"
Gary Linscott [Thu, 26 Jun 2014 15:16:36 +0000 (11:16 -0400)]
Revert "Check for an available slave early on"

This reverts commit ce1c260ea97c14eea996d0a2638f4876ccbc412b.

9 years agoOriginal version of shane's patch
Gary Linscott [Wed, 25 Jun 2014 20:45:14 +0000 (16:45 -0400)]
Original version of shane's patch

9 years agoScale down endgames with pawns on one or two adjacent files
shane31 [Wed, 25 Jun 2014 20:01:00 +0000 (16:01 -0400)]
Scale down endgames with pawns on one or two adjacent files

9 years agoMerge pull request #5 from glinscott/authors
Gary Linscott [Mon, 23 Jun 2014 16:14:03 +0000 (09:14 -0700)]
Merge pull request #5 from glinscott/authors

Add AUTHORS

9 years agoSome reformatting in pawns.cpp
Marco Costalba [Sat, 21 Jun 2014 12:32:11 +0000 (14:32 +0200)]
Some reformatting in pawns.cpp

No functional change.

9 years agoEnsure ttValue != VALUE_NONE in singular extension search
Marco Costalba [Sat, 21 Jun 2014 11:07:29 +0000 (13:07 +0200)]
Ensure ttValue != VALUE_NONE in singular extension search

The assert:

  assert(ttValue != VALUE_NONE);

Could fire for multiple reasons (although is very rare),
for instance after an IID we can have ttMove != MOVE_NONE
while ttValue is still set at VALUE_NONE.

But not only this, actually SMP is a source of corrupted
ttValue and anyhow we can detect the condition:

 ttMove != MOVE_NONE && ttValue == VALUE_NONE

even north of IID.

Reported by Ronald de Man.

It is so rare that bench didn't change.

bench: 7710548

9 years agoRemove some duplicates
Gary Linscott [Sat, 21 Jun 2014 04:49:49 +0000 (00:49 -0400)]
Remove some duplicates

9 years agoAdd AUTHORS
Gary Linscott [Sat, 21 Jun 2014 01:35:09 +0000 (21:35 -0400)]
Add AUTHORS

9 years agoBetter value clipping in game_phase()
Marco Costalba [Fri, 20 Jun 2014 22:02:43 +0000 (00:02 +0200)]
Better value clipping in game_phase()

No functional change.

9 years agoMove game_phase() to Position
Marco Costalba [Fri, 20 Jun 2014 21:40:36 +0000 (23:40 +0200)]
Move game_phase() to Position

It seems a more natural to place this
function there.

No functional change.

9 years agoSmall renaming in material weights
Marco Costalba [Fri, 20 Jun 2014 21:15:31 +0000 (23:15 +0200)]
Small renaming in material weights

Also dropped some temporary variable: compiler
is more than able to push on stack temp values
by itself (verified).

No functional change.

9 years agoSimplify a condition in is_KXK()
Marco Costalba [Thu, 19 Jun 2014 13:44:42 +0000 (15:44 +0200)]
Simplify a condition in is_KXK()

No functional change.

9 years agoDon't special case for abs(beta) >= VALUE_MATE_IN_MAX_PLY
Eelco de Groot [Mon, 16 Jun 2014 19:46:42 +0000 (21:46 +0200)]
Don't special case for abs(beta) >= VALUE_MATE_IN_MAX_PLY

Remove from the search this special case and apply
null search and razoring also in mate positions.

Tested in no-regression mode and passed both

STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 65431 W: 10860 L: 10810 D: 43761

and LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 34928 W: 4814 L: 4713 D: 25401

This patch kicks in only in mate positions and in
these cases it seems beneficial in finding mates
faster as Yery Spark measured on the Chest mate suite:

Total number of positions 6425
Fixed nodes 200K per position

master: 1049
new:    1154

And also the 5446 'hard' positions again with 2000K nodes
(those not found by both engines in 200K nodes):

master: 1069
new:    1395

bench: 7710548

9 years agoSimplify unstoppable pawns
Leonid Pechenik [Mon, 16 Jun 2014 10:32:11 +0000 (12:32 +0200)]
Simplify unstoppable pawns

Tested in no-regression mode and passed both

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 17919 W: 3103 L: 2978 D: 11838

and LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 31460 W: 4414 L: 4308 D: 22738

bench: 7709279

9 years agoRemove -ansi flag for Clang
Marco Costalba [Sun, 15 Jun 2014 08:29:53 +0000 (10:29 +0200)]
Remove -ansi flag for Clang

It seems this flag is only for gcc and
yields a warning under OSX Mavericks:

clang: warning: argument unused during compilation: '-ansi'

No functional change.

9 years agoFix a warning with MSVC in 'analyze' mode
Marco Costalba [Sat, 14 Jun 2014 10:46:58 +0000 (12:46 +0200)]
Fix a warning with MSVC in 'analyze' mode

Here MSVC is worried that

StepAttacksBB[PAWN][psq]

could overflow, so change psq initialization
to clarify psq is always less than 64.

No functional change.

9 years agoTriviality in UCI::loop
Marco Costalba [Sat, 14 Jun 2014 10:26:08 +0000 (12:26 +0200)]
Triviality in UCI::loop

Code style paranoid in action here :-)

No functional change.

9 years agoFactor out pawn attacks in 'lever'
Marco Costalba [Sat, 14 Jun 2014 10:16:22 +0000 (12:16 +0200)]
Factor out pawn attacks in 'lever'

Improves readibility and possibly speed.

No functional change.

9 years agoSimplify pawn threats and merge into ThreatenedByPawn[]
Ajith [Wed, 11 Jun 2014 23:31:33 +0000 (08:31 +0900)]
Simplify pawn threats and merge into ThreatenedByPawn[]

Tested in no-regression mode,

passed STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 14477 W: 2493 L: 2362 D: 9622

and LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 51964 W: 7091 L: 7013 D: 37860

bench: 7875814

9 years agoTweak outpost name
Reuven Peleg [Mon, 9 Jun 2014 10:45:56 +0000 (13:45 +0300)]
Tweak outpost name

This name is more accurate, since that function evaluates only one
outpost in every call.
No functional change.

9 years agoAdd bonus for advanced lever
Reuven Peleg [Wed, 11 Jun 2014 14:36:46 +0000 (23:36 +0900)]
Add bonus for advanced lever

Passed both STC
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 15413 W: 2670 L: 2530 D: 10213

And LTC:
LLR: 2.95 (-2.94,2.94) [1.00,6.00]
Total: 66908 W: 9398 L: 8960 D: 48550

Bench : 7859385

9 years agoSmall renaming in Tracing
Marco Costalba [Sun, 8 Jun 2014 20:30:18 +0000 (05:30 +0900)]
Small renaming in Tracing

No functional change.

9 years agoCheck for an available slave early on
Marco Costalba [Sun, 8 Jun 2014 19:56:31 +0000 (04:56 +0900)]
Check for an available slave early on

Don't take the split lock if we don't have
available slaves (about 30-40% of times).

This new condition allows to retire the now
redundant one on number of threads.

No functional change.

9 years agoUse unsigned char as argument of std::isspace
Marco Costalba [Fri, 6 Jun 2014 23:16:31 +0000 (01:16 +0200)]
Use unsigned char as argument of std::isspace

Although signature allows an int:

int isspace( int ch );

The behavior is undefined if the value of ch is
not representable as unsigned char and is not
equal to EOF.

See

http://en.cppreference.com/w/cpp/string/byte/isspace
http://www.greenend.org.uk/rjk/tech/cfu.html

This is really a tricky corner case of C standard!

Spotted and reported by Ron Britvich.

No functional change.

9 years agoAvoid to use nullChild
Marco Costalba [Fri, 6 Jun 2014 09:12:05 +0000 (11:12 +0200)]
Avoid to use nullChild

Use instead:

(ss-1)->currentMove == MOVE_NULL

No functional change.

9 years agoRemove 'update gains' hack
Marco Costalba [Fri, 6 Jun 2014 09:10:40 +0000 (11:10 +0200)]
Remove 'update gains' hack

Use (move != MOVE_NONE) condition to
filtering out updating gains at root.

bench: 8454456

9 years agoTemporary revert previous patch
Marco Costalba [Fri, 6 Jun 2014 09:07:12 +0000 (11:07 +0200)]
Temporary revert previous patch

Split previous patch in 2 steps: first remove
the MOVE_NULL hack, then retire nullChild.

The first step is a prerequisite
for second one and affects bench.

The second step (next patch) just removes nullChild
without affecting bench.

bench: 8205159

9 years agoAvoid to use nullChild
Marco Costalba [Fri, 6 Jun 2014 07:58:00 +0000 (09:58 +0200)]
Avoid to use nullChild

Should be a non functional change, but
for some reason bench is changed.

bench: 8454456

9 years agoMove Tempo to evaluation
Marco Costalba [Fri, 6 Jun 2014 07:35:34 +0000 (09:35 +0200)]
Move Tempo to evaluation

No functional change.

9 years agoRevert "Score extractors"
Marco Costalba [Thu, 5 Jun 2014 21:55:18 +0000 (23:55 +0200)]
Revert "Score extractors"

Are broken for big-endian case and
I have verified with MSVC 2013 Premium
bench is correct and there is no
miscompilation, so the main reason
to change the original code drops.

No functional change.

9 years agoFix a warning with MSVC Premium 2013
Marco Costalba [Thu, 5 Jun 2014 21:46:58 +0000 (23:46 +0200)]
Fix a warning with MSVC Premium 2013

Reported by Ron Britvich.

No functional change.

9 years agoUpdate Readme.md
pellanda [Wed, 4 Jun 2014 13:56:34 +0000 (10:56 -0300)]
Update Readme.md

Retire line about polyglot.ini and
book as they are not used anymore.

No functional change.

9 years agoSymmetric King Safety: take 2
Lucas Braesch [Tue, 3 Jun 2014 12:48:43 +0000 (20:48 +0800)]
Symmetric King Safety: take 2

Another attempt at retiring current asymmetric
king evaluation and use a much simpler symmetric
one. As a good side effect we can avoid recalculating
eval after a null move.

Tested in no-regression mode and passed

STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 21580 W: 3752 L: 3632 D: 14196

LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 18253 W: 2593 L: 2469 D: 13191

And a LTC regression test against SF DD to
verify we don't have regression against
weaker engines due to some kind of 'contempt'
effect:

ELO: 54.69 +-2.1 (95%) LOS: 100.0%
Total: 40000 W: 11072 L: 4827 D: 24101

bench: 8205159

9 years agoUse see() instead of see_sign() in previous patch
Marco Costalba [Tue, 3 Jun 2014 10:38:58 +0000 (12:38 +0200)]
Use see() instead of see_sign() in previous patch

Before it was working by accident in case of
see_sign() and failing with see() due to how
castle moves are coded (king captures the rook).

Better to explicitly filter out castling moves
and use see() without any surprise/trick.

No functional case.

9 years agoAdd some const qualifier
kinderchocolate [Tue, 3 Jun 2014 05:45:10 +0000 (15:45 +1000)]
Add some const qualifier

No functional change.

9 years agoDecrease reduction for moves that escape a capture
Reuven Peleg [Tue, 3 Jun 2014 09:32:45 +0000 (11:32 +0200)]
Decrease reduction for moves that escape a capture

Passed both STC
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 10094 W: 1833 L: 1704 D: 6557

and LTC
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 27738 W: 4147 L: 3928 D: 19663

bench : 8599236

9 years agoRetire Polyglot Book management
Marco Costalba [Sun, 1 Jun 2014 13:29:34 +0000 (15:29 +0200)]
Retire Polyglot Book management

Book handling belongs to GUI, we kept this code
for historical reasons, but nowdays there is
really no need of this old, (mostly) unused
and especially incorrect designed functionality.

It is up to the GUI to choose the book (far easier for
the user) and to select the book parameters. In no
place, including fishtest, TCEC, rating lists, etc.
the "own book" is used, moreover currently SF is
released without any book and even if in the future we
bundle a book in the release package, it will be the GUI
that will take care of it.

This corrects a wrong design decision that Galurung
and later Stockfish inherited from what was common
practice many yeas ago.

No functional change.

9 years agoRetire eval weights UCI options
Marco Costalba [Sun, 1 Jun 2014 11:37:21 +0000 (13:37 +0200)]
Retire eval weights UCI options

There is really little that user can achieve (apart
from a weakened engine) tweaking these parameters
that are already tuned and have no immediate or visible
effect.

So better do not expose them to the user and avoid the
typical "What is the best setup for my machine?" kind of
question (by far the most common, by far the most useless).

No functional change.

9 years agoRetire polyglot.ini
Marco Costalba [Sat, 31 May 2014 21:37:20 +0000 (23:37 +0200)]
Retire polyglot.ini

All actively maintained GUI are able
to understand UCI protocol, so there
is no more need for this obsolete file.

No functional change.

9 years agoRestore development version
Marco Costalba [Sat, 31 May 2014 21:34:36 +0000 (23:34 +0200)]
Restore development version

bench: 8732553

9 years agoStockfish 5
Marco Costalba [Sat, 31 May 2014 07:16:54 +0000 (09:16 +0200)]
Stockfish 5

Stockfish bench signature is: 8732553

9 years agoRevert "Symmetric king safety"
Marco Costalba [Mon, 26 May 2014 19:39:48 +0000 (21:39 +0200)]
Revert "Symmetric king safety"

Regression test of 40K games at 60 secs shows
this commit to be a 2-3 ELO regression.

So revert to original king safety.

bench: 8732553

9 years agoFix a warning with Intel compiler
Marco Costalba [Sat, 24 May 2014 22:21:46 +0000 (00:21 +0200)]
Fix a warning with Intel compiler

warning #2259: non-pointer conversion from
"int" to "int16_t={short}" may lose significant
bits.

No functional change.

9 years agoTidy up tt.h
Marco Costalba [Sat, 24 May 2014 21:53:01 +0000 (23:53 +0200)]
Tidy up tt.h

Backport some non-functional changes
found working on 'dense TT' patch.

No functional change.

9 years agoAdd perft 'divide' command
Marco Costalba [Sat, 24 May 2014 02:31:36 +0000 (04:31 +0200)]
Add perft 'divide' command

To show perft numbers for each move. Just
use 'divide' instead of 'perft', for instance:

position startpos moves e2e4 e7e5
divide 4

Inspired by Ronald de Man.

No functional change.

9 years agoUpdate polyglot.ini after last patch
Marco Costalba [Mon, 19 May 2014 19:19:47 +0000 (21:19 +0200)]
Update polyglot.ini after last patch

No functional change.

9 years agoSymmetric king safety
Lucas Braesch [Mon, 19 May 2014 12:22:15 +0000 (14:22 +0200)]
Symmetric king safety

Retire current asymmetric king evaluation
and use a much simpler symmetric one.

As a side effect retire the infamous
'Aggressiveness' and 'Cowardice' UCI
options.

Tested in no-regression mode,

Passed both STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 33855 W: 5863 L: 5764 D: 22228

And LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 40571 W: 5852 L: 5760 D: 28959

bench: 8321835

9 years agoFix an off-by-one bug in extract_pv_from_tt
Marco Costalba [Sat, 17 May 2014 20:56:35 +0000 (22:56 +0200)]
Fix an off-by-one bug in extract_pv_from_tt

At root we start counting plies from 1,
instead pv[] array starts from 0. So
the variable 'ply' we use in extract_pv_from_tt
to index pv[] is misnamed, indeed it is
not the real ply, but ply-1.

The fix is to leave ply name in extract_pv_from_tt
but assign it the correct start value and
consequentely change all the references to pv[].
Instead in insert_pv_in_tt it's simpler to rename
the misnamed 'ply' in 'idx'.

The off-by-one bug was unhidden when trying to use
'ply' for what it should have been, for instance in
this position:

position fen 8/6R1/8/3k4/8/8/8/2K5 w - - 0 1

at depth 24 mate line is erroneusly truncated due
to value_from_tt() using the wrong ply.

Spotted by Ronald de Man.

bench: 8732553

9 years agoExtract a reliable PV line
Marco Costalba [Sat, 17 May 2014 10:49:52 +0000 (12:49 +0200)]
Extract a reliable PV line

Truncate the extracted PV from the point where
the score stored in hash starts to deviate from
the root score.

Idea from Ronald de Man.

bench: 8732553

9 years agoDrop to qsearch at low depth in razoring
Michel Van den Bergh [Tue, 13 May 2014 20:33:41 +0000 (22:33 +0200)]
Drop to qsearch at low depth in razoring

If razoring conditions are satisfied and
depth is low, then directly drop in qsearch.

Passed both STC
LLR: 2.98 (-2.94,2.94) [-1.50,4.50]
Total: 12914 W: 2345 L: 2208 D: 8361

And LTC
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 50600 W: 7548 L: 7230 D: 35822

bench: 8739659