]> git.sesse.net Git - stockfish/log
stockfish
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

9 years agoRemove undefended minors
Arjun Temurnikar [Tue, 13 May 2014 19:35:10 +0000 (21:35 +0200)]
Remove undefended minors

Tested in "no regression" mode.

Passed both STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 68026 W: 12277 L: 12236 D: 43513

And LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 85682 W: 12861 L: 12836 D: 59985

bench: 7311935

9 years agoSave stalemates in TT
Marco Costalba [Sun, 11 May 2014 08:56:25 +0000 (10:56 +0200)]
Save stalemates in TT

When there aren't legal moves after
a search, instead of returning imediately,
save bestValue in TT as in the usual case.

There is really no reason to special case
this one.

With this patch is fully fixed (again) follwing
position:

    7k/6p1/6B1/5K1P/8/8/8/8 w - - 0 1

Also in SMP case.

bench: 8802105

9 years agoRetire "Idle Threads Sleep" UCI option
Marco Costalba [Sun, 11 May 2014 08:13:56 +0000 (10:13 +0200)]
Retire "Idle Threads Sleep" UCI option

After last Joona's patch there is no measurable
difference between the option set or unset.

Tested by Andreas Strangmüller with 16 threads
on his Dual Opteron 6376.

After 5000 games at 15+0.05 the result is:

1 Stockfish_14050822_T16_on   : 3003  5000 (+849,=3396,-755), 50.9 %
2 Stockfish_14050822_T16_off  : 2997  5000 (+755,=3396,-849), 49.1 %

bench: 880215

9 years agoMake imbalance table more clear
Arjun Temurnikar [Sat, 10 May 2014 06:18:09 +0000 (23:18 -0700)]
Make imbalance table more clear

No functional change.

9 years agoPass Position as const ref in update_stats()
Reuven Peleg [Thu, 8 May 2014 20:18:19 +0000 (23:18 +0300)]
Pass Position as const ref in update_stats()

No functional change.

9 years agoClarify some comments in SMP code
Marco Costalba [Thu, 8 May 2014 07:09:35 +0000 (09:09 +0200)]
Clarify some comments in SMP code

Spotted by Joona.

No functional change.

9 years agoReformat and simplify previous patch
Marco Costalba [Wed, 7 May 2014 06:47:18 +0000 (08:47 +0200)]
Reformat and simplify previous patch

No functional change.

9 years agoAllow a slave to 'late join' another splitpoint
Joona Kiiski [Sat, 3 May 2014 17:29:31 +0000 (18:29 +0100)]
Allow a slave to 'late join' another splitpoint

Instead of waiting to be allocated, actively search
for another split point to join when finishes its
search. Also modify split conditions.

This patch has been tested with 7 threads SMP and
passed both STC:

LLR: 2.97 (-2.94,2.94) [-1.50,4.50]
Total: 2885 W: 519 L: 410 D: 1956

And a reduced-LTC at  25+0.05
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 4401 W: 684 L: 566 D: 3151

Was then retested against regression in 3 thread case
at standard LTC of  60+0.05:

LLR: 2.96 (-2.94,2.94) [-4.00,0.00]
Total: 40809 W: 5446 L: 5406 D: 29957

bench: 8802105

9 years agoRewrite Score extractors
Ron Britvich [Mon, 5 May 2014 06:52:14 +0000 (08:52 +0200)]
Rewrite Score extractors

Less tricky and even a bit faster. With this
version Visual Studio Ultimate 2013 Update 2 RC
runs fine even in O2 optimization.

No functional change.

9 years agoChange search() signature
Marco Costalba [Sun, 4 May 2014 11:11:32 +0000 (13:11 +0200)]
Change search() signature

Pass SpNode as template parameter.

No functional change.

9 years agoRevert dynamic contempt
Marco Costalba [Sun, 4 May 2014 07:58:49 +0000 (09:58 +0200)]
Revert dynamic contempt

On a final fixed game number test it failed
to prove better than standard version.

STC 15+0.05

ELO: -0.86 +-1.7 (95%) LOS: 15.8%
Total: 57578 W: 10070 L: 10213 D: 37295

bench: 8802105

9 years agoRevert stalemate detection in evaluation
Marco Costalba [Sun, 4 May 2014 07:42:05 +0000 (09:42 +0200)]
Revert stalemate detection in evaluation

Unfortunatly we have a slow down that causes
a regression in STC with no-regression mode:

LLR: -2.96 (-2.94,2.94) [-3.00,1.00]
Total: 22454 W: 3836 L: 4029 D: 14589

bench: 8678654

9 years agoRevert back KBPsK to latest Gary's version
Marco Costalba [Sun, 4 May 2014 07:31:25 +0000 (09:31 +0200)]
Revert back KBPsK to latest Gary's version

The bug was found to be elsewhere. This version
is correct and also is able to detect as draw
positions like:

8/8/5b2/8/8/4k1p1/6P1/5K2 b - - 6 133

bench: 8678654

9 years agoFix KXK endgame
Ronald de Man [Sat, 3 May 2014 19:37:24 +0000 (21:37 +0200)]
Fix KXK endgame

Position is win also if strong side has a bishop
and a knight (plus other material, otherwise
KBNK would be triggered instead of KXK).

This fixes a subtle bug where a search on position

k7/8/8/8/8/P7/PB6/K7 b - - 6 1

Instead of returning a draw score, suddendly returns
a big score. This happens because at one point in
search we reach this position:

8/Pk6/8/8/8/4B3/P7/K7 w - - 3 8

Where white can promote. In case of rook promotion (and also in case of
queen promotion) the resutling position gets a huge static eval that is
above VALUE_KNOWN_WIN (from the point of view of white). So for rook
promotion it is

          &&  futilityBase > -VALUE_KNOWN_WIN

that prevents futility pruning in qsearch. (Removing this condition indeed
lets the problem occur). Raising the static eval for K+B+N+X v K to a value
higher than VALUE_KNOWN_WIN fixes this particular problem without having to
introduce an extra futility pruning condition in qsearch.

I just checked and it seems K+R v K, K+2B v K and even K+B+N v K already get
a huge static eval. Why not K+B+N+P v K?

I think this fix corrects an oversight. There is special code for KBNK, but
KBNXK is handled by KXK, so the test for sufficient material should also test
for B+N.

bench: 8678654

9 years agoFully correct stealmate detection
Marco Costalba [Sat, 3 May 2014 10:09:56 +0000 (12:09 +0200)]
Fully correct stealmate detection

In the (rare) cases when the two conditions
are true, then fully check again with a slow
but correct MoveList<LEGAL>(pos).size().

This is able to detect false positives like
this one:

8/8/8/Q7/5k1p/5P2/4KP2/8 b - - 0 17

When we have a possible simple pawn push that
is not stored in attacks[] array. Because the
third condition triggers very rarely, even if
it is slow, it does not alters in a measurable
way the average speed of the engine.

bench: 8678654

9 years agoAdd stealmate detection to evaluation
Marco Costalba [Sat, 3 May 2014 09:45:58 +0000 (11:45 +0200)]
Add stealmate detection to evaluation

Currently a stealmate position is misevaluated
in a negative/positive score, this leads qsearch(),
that does not detects stealmates too, to return the
wrong score and this yields to some kind of endgames
to be completely misevaluated.

With this patch is fully fixed follwing position

7k/6p1/6B1/5K1P/8/8/8/8 w - - 0 1

Also in SMP case.

Correct root cause analysys by Ronald de Man.

bench: 8678654

9 years agoRevert to Galurung's KBPsK endgame
Marco Costalba [Fri, 2 May 2014 08:27:13 +0000 (10:27 +0200)]
Revert to Galurung's KBPsK endgame

After reverting to the original Tord's
endgame, a search on position

7k/6p1/6B1/5K1P/8/8/8/8 w - - 0 1

Reports, correctly, a draw score instead of
an advantage for white.

Issue reported by Uri Blass.

bench: 8678654

9 years agoUse only standard conforming eg_value()
Marco Costalba [Thu, 1 May 2014 21:08:07 +0000 (23:08 +0200)]
Use only standard conforming eg_value()

Remove the optimization for Intel, is not
standard and can break at any time, moreover
our release build is not done with Intel C++
anymore so we don't need to sqeeze the extra
speed out from this compiler.

No functional change.

9 years agoDon't save stale value in TT after split
Marco Costalba [Thu, 1 May 2014 14:25:17 +0000 (16:25 +0200)]
Don't save stale value in TT after split

If we return from split with a stale value
due to a stop or a cutoff upstream occurred,
then we exit moves loop and save a stale value
in TT before returning search().

This patch, from Joona, fixes this.

bench: 8678654

9 years agoBetter document search stop condition
Marco Costalba [Thu, 1 May 2014 06:28:49 +0000 (08:28 +0200)]
Better document search stop condition

Handling a stop or a cutoff in the search is
a tricky business, so better document this
difficult part of the code.

No functional change.

9 years agoRemove dead code in search
Marco Costalba [Thu, 1 May 2014 05:44:32 +0000 (07:44 +0200)]
Remove dead code in search

We can never have bestValue == -VALUE_INFINITE at
the end of move loop because if no legal move exists
we detect it with previous condition on !moveCount,
if a legal move exists we never prune it due to
futility pruning condition:

bestValue > VALUE_MATED_IN_MAX_PLY

So this code never executes, as I have also verified
directly.

Issue reported by Joona.

No functional change.

9 years agoFix a compile error with Intel C++
Marco Costalba [Wed, 30 Apr 2014 06:55:45 +0000 (08:55 +0200)]
Fix a compile error with Intel C++

Intel compiler is very picky:
"error: this operation on an enumerated type requires an
applicable user-defined operator function"

Reported by Tony Gaor.

No functional change.

9 years agoPenalize hanging pieces
snicolet [Sat, 26 Apr 2014 23:35:46 +0000 (01:35 +0200)]
Penalize hanging pieces

Passed both STC
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 8519 W: 1565 L: 1440 D: 5514

And LTC
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 60618 W: 9141 L: 8777 D: 42700

bench: 8678654

9 years agoRearrange interpolation formula
Marco Costalba [Mon, 28 Apr 2014 15:15:16 +0000 (17:15 +0200)]
Rearrange interpolation formula

Put the division at the end to reduce
rounding errors. This alters the bench
due to different rounding errors, but
should not alter ELO in any way.

bench: 7615217

9 years agoMinor stuff scattered around
mstembera [Mon, 28 Apr 2014 08:30:06 +0000 (01:30 -0700)]
Minor stuff scattered around

Just random minor stuff I found while browsing the code.

No functional change.

9 years agoRemove other useless floor()
Marco Costalba [Sun, 27 Apr 2014 17:17:40 +0000 (19:17 +0200)]
Remove other useless floor()

No functional change.

9 years agoDon't need floor() in timeman.cpp
Marco Costalba [Sun, 27 Apr 2014 17:10:00 +0000 (19:10 +0200)]
Don't need floor() in timeman.cpp

For positive numbers result is equivalent:
http://stackoverflow.com/questions/3300290/cast-to-int-vs-floor

Spotted by Joseph Ellis.

No functional change.

9 years agoFix Intel compiler warnings
Marco Costalba [Sun, 27 Apr 2014 10:02:36 +0000 (12:02 +0200)]
Fix Intel compiler warnings

Fallout from previous patch: Intel compiler
is very noisy.

No functional change.

9 years agoRemove some useless casts
Marco Costalba [Sun, 27 Apr 2014 09:40:44 +0000 (11:40 +0200)]
Remove some useless casts

No functional change.

9 years agoWe can add an integer to a Value
Marco Costalba [Sun, 27 Apr 2014 08:13:59 +0000 (10:13 +0200)]
We can add an integer to a Value

We have defined corresponding operators,
so rely on them to streamline the code
and increase readibility.

No functional change.

9 years agoRemove rook passers eval completely
Arjun Temurnikar [Sun, 20 Apr 2014 23:44:18 +0000 (16:44 -0700)]
Remove rook passers eval completely

Tested in no-regression mode.

Passed STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 17727 W: 3248 L: 3122 D: 11357

And (a very long!) LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 106327 W: 16258 L: 16265 D: 73804

bench: 7396783

9 years agoReformatting in material.h
Marco Costalba [Sun, 27 Apr 2014 07:31:22 +0000 (09:31 +0200)]
Reformatting in material.h

No functional change.

9 years agoMove game phase constants to enum Value
Marco Costalba [Sun, 27 Apr 2014 07:23:45 +0000 (09:23 +0200)]
Move game phase constants to enum Value

No functional change.

9 years agoSpeed up by almost 3%
Marco Costalba [Sat, 26 Apr 2014 22:25:18 +0000 (00:25 +0200)]
Speed up by almost 3%

This apparentely silly tweak allows
to speed up the bench by almost 3%.

Not clear why, repeating with perft,
the speed up vanishes.

Suggested by Jonathan Calovski.

No functional change.

9 years agoFix issues detected by Coverity Scan
Marco Costalba [Sat, 26 Apr 2014 07:20:37 +0000 (09:20 +0200)]
Fix issues detected by Coverity Scan

Most of Coverity Scan reports are false
positives, but in rare cases we have
confirmed (very small) issues.

No functional change.

9 years agoSpeed up picking of killers
Marco Costalba [Fri, 25 Apr 2014 10:53:51 +0000 (12:53 +0200)]
Speed up picking of killers

Changing the order of the conditions gives
about 1% speed up!

No functional change.

9 years agoRemove RookOn7th and merge values into psqt
Arjun Temurnikar [Sun, 20 Apr 2014 10:50:03 +0000 (03:50 -0700)]
Remove RookOn7th and merge values into psqt

Tested in no-regression mode:

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 55678 W: 9954 L: 9892 D: 35832

LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 9238 W: 1448 L: 1311 D: 6479

bench: 7905850

9 years agoRemove penalty for knight when few enemy pawns
Arjun Temurnikar [Sat, 19 Apr 2014 01:54:23 +0000 (18:54 -0700)]
Remove penalty for knight when few enemy pawns

Tested in standard mode at STC and no-regression
mode at LTC:

STC
LLR: 2.97 (-2.94,2.94) [-1.50,4.50]
Total: 19503 W: 3502 L: 3349 D: 12652

LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 67474 W: 9974 L: 9921 D: 47579

bench: 8331217

9 years agoShuffle movepicker score
Jonathan Calovski [Wed, 23 Apr 2014 03:14:46 +0000 (13:14 +1000)]
Shuffle movepicker score

Believed to be a speed optimization as benched
on Windows with bench realtime affinity 0x1 deleting
highest and lowest runs:

Base Test
1549259 1608202
1538115 1583934
1543168 1556938
1536365 1554179
1533026 1582010

Signature remains unchanged and gives anywhere from 1-2% nps
boost in analysis depending on number of cores used.

No functional change.

9 years agoCorrectly apply previous patch
Marco Costalba [Thu, 24 Apr 2014 06:35:13 +0000 (08:35 +0200)]
Correctly apply previous patch

Apply the correct values from previous patch.

bench: 8082049

9 years agoMove queen vs. 3 minors rule to imbalance tables
joergoster [Sat, 19 Apr 2014 14:41:56 +0000 (16:41 +0200)]
Move queen vs. 3 minors rule to imbalance tables

Tuned with CLOP after 57k games.

Simplification: tested in no-regression mode.

Passed both STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 17254 W: 3159 L: 3032 D: 11063

And LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 32413 W: 4967 L: 4864 D: 22582

bench: 8082049

9 years agoRevert "Generalize shift_bb() to handle double pushes"
Marco Costalba [Mon, 21 Apr 2014 18:54:55 +0000 (20:54 +0200)]
Revert "Generalize shift_bb() to handle double pushes"

Seems to intorduce some compiler warning as
reported by Gary. Warning seems bogus, but
revert anyhow.

No functional change.

9 years agoReset DrawValue[] before new search
Marco Costalba [Mon, 21 Apr 2014 12:30:27 +0000 (14:30 +0200)]
Reset DrawValue[] before new search

Spotted by Ronald de Man

bench: 7384368

9 years agoRise contempt when in advantage
Leonid Pechenik [Thu, 17 Apr 2014 16:49:57 +0000 (12:49 -0400)]
Rise contempt when in advantage

This is a very discussed patch with many
argumentations pro and against. The fact is
it passed both STC:

LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 16305 W: 3001 L: 2855 D: 10449

And LTC
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 34273 W: 5180 L: 4931 D: 24162

Although it is true that a correct test should
include foreign engines, we commit it anyhow so
people can test it out in the wild, under broader
conditions.

bench: 7384368

9 years agoStreamline implementation of Position::pretty()
Marco Costalba [Mon, 21 Apr 2014 09:42:08 +0000 (11:42 +0200)]
Streamline implementation of Position::pretty()

Simpler and more in line with Bitboards::pretty()

No functional change.

9 years agoRaise penalty blocked enemy pawn on 6th rank
Stefan Geschwentner [Sat, 5 Apr 2014 10:27:57 +0000 (12:27 +0200)]
Raise penalty blocked enemy pawn on 6th rank

Idea from Lyudmil Tsvetkov.

The value seems to be raised a bit abruptly, but as
Gary said, a blocked pawn on the sixth rank has been
instrumental in limiting king mobility in multiple
losses that I've seen from SF. A blocked pawn on fifth
rank is much less serious on the king safety impact.

Passed both STC
LLR: 2.97 (-2.94,2.94) [-1.50,4.50]
Total: 14551 W: 2750 L: 2607 D: 9194

and LTC
LLR: 2.96 (-2.94,2.94) [0.00,6.00]
Total: 43595 W: 6917 L: 6618 D: 30060

And even a retest at 60" fixed games 40K
ELO: 1.79 +-1.9 (95%) LOS: 97.0%
Total: 39889 W: 6018 L: 5813 D: 28058

bench: 7154916

9 years agoGeneralize shift_bb() to handle double pushes
Marco Costalba [Sun, 20 Apr 2014 13:15:43 +0000 (15:15 +0200)]
Generalize shift_bb() to handle double pushes

And use it in evaluate_space.

No functional change.

9 years agoSmall simplification to passed pawns
Arjun Temurnikar [Fri, 18 Apr 2014 04:41:22 +0000 (21:41 -0700)]
Small simplification to passed pawns

Tested in no-regression mode.

Passed both STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 28521 W: 5066 L: 4958 D: 18497

And LTC
LLR: 3.04 (-2.94,2.94) [-3.00,1.00]
Total: 21939 W: 3261 L: 3138 D: 15540

bench: 8165681

10 years agoRemove supporting pawns
Joseph Hellis [Thu, 17 Apr 2014 06:43:40 +0000 (08:43 +0200)]
Remove supporting pawns

Tested in no-regression mode

Passed both STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 44957 W: 7984 L: 7903 D: 29070

and LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 12396 W: 1916 L: 1783 D: 8697

Bench: 7907885

10 years agoEnable BMI1 too when using BMI2 ARCH
Jean-Francois Romang [Mon, 14 Apr 2014 05:10:39 +0000 (07:10 +0200)]
Enable BMI1 too when using BMI2 ARCH

Adding BMI1 allows the compiler to use _blsr_u64
automatically (the advertised 0.3% speed gain).
I verified that the compiler does not use this
instruction with the -mbmi2 flag only. Also, all
processors supporting BMI2 is also supporting BMI1.

No functional change

10 years agoMore readable trapped rook condition
Marco Costalba [Sun, 13 Apr 2014 11:35:58 +0000 (13:35 +0200)]
More readable trapped rook condition

Prefer

file_of(s) < file_of(ksq)

to the inidrect

file_of(ksq) < FILE_E

To evaluate if semiopen side to check is the left side.

Also other small touches while there.

No functional change.

10 years agoSimplify Makefile by removing OS X targets
Daylen Yang [Sat, 12 Apr 2014 23:26:45 +0000 (16:26 -0700)]
Simplify Makefile by removing OS X targets

Right now the Makefile is cluttered with OS X equivalents
of all the x86 targets. We can get rid of all of them and
just check UNAME against "Darwin" for the few OS X-specific
things we need to do.

We also disable Clang LTO when using BMI2 instructions. For
some reason, LLVM cannot find the PEXT instruction when using
LTO. I don't know why, but disabling LTO for BMI2 fixes it.

No functional change.

10 years agoMove args parsing to UCI::loop
Marco Costalba [Sat, 12 Apr 2014 10:52:10 +0000 (12:52 +0200)]
Move args parsing to UCI::loop

This leaves a very clean main.cpp

No functional change.

10 years agoReshuffle in uci.cpp
Marco Costalba [Sat, 12 Apr 2014 10:05:25 +0000 (12:05 +0200)]
Reshuffle in uci.cpp

Move function definitions before call site.

No functional change.

10 years agoReshuffle in timeman.cpp
Marco Costalba [Sat, 12 Apr 2014 10:00:37 +0000 (12:00 +0200)]
Reshuffle in timeman.cpp

Move template definitions before call site.

No functional change.

10 years agoFix a typo in evaluate
Marco Costalba [Sat, 12 Apr 2014 08:17:41 +0000 (10:17 +0200)]
Fix a typo in evaluate

Spotted by Lyudmil Antonov.

No functional change.

10 years agoRetire signature-build
Marco Costalba [Sat, 12 Apr 2014 07:18:55 +0000 (09:18 +0200)]
Retire signature-build

Does not seem used.

No functional change.

10 years agoAdd ARCH x86-64-bmi2 support
Jean-Francois Romang [Thu, 10 Apr 2014 18:07:40 +0000 (20:07 +0200)]
Add ARCH x86-64-bmi2 support

Intel Haswell and newer CPUs can calculate sliders
attacks using special PEXT asm instructions instead
of magic bitboards. This gives a +3% speed up.

To enable it just compile with ARCH=x86-64-bmi2

No functional change.

10 years agoSwitch to hardware PEXT
Marco Costalba [Mon, 7 Apr 2014 19:04:34 +0000 (21:04 +0200)]
Switch to hardware PEXT

Retire software pext and introduce hardware
call when USE_PEXT is defined during compilation.

This is a full complete implementation of sliding
attacks using PEXT.

No functional change.

10 years agoImplement PEXT based attacks
Marco Costalba [Mon, 7 Apr 2014 14:27:14 +0000 (16:27 +0200)]
Implement PEXT based attacks

According to:

https://chessprogramming.wikispaces.com/BMI2#PEXTBitboards

No functional change.

10 years agoAdd PEXT software implementation
Marco Costalba [Mon, 7 Apr 2014 14:02:24 +0000 (16:02 +0200)]
Add PEXT software implementation

For development/debug purposes.

No functional change.

10 years agoBig reshuffle in evaluate.cpp
Marco Costalba [Sat, 12 Apr 2014 06:32:52 +0000 (08:32 +0200)]
Big reshuffle in evaluate.cpp

Reshuffle functions to define them in reverse
calling order (C style).

This allow us to define templates before they are
used. Currently it is not like this, for instance
evaluate_pieces is defined after do_evaluate that
calls it. This happens to work for some strange
reason (two phase lookup?) but we want to avoid
code that works 'by magic'.

As a nice side-effect we can now remove the function
prototypes.

No functional change.

10 years agoMove LowMobPenalty into psq/mobility tables
Gary Linscott [Fri, 11 Apr 2014 16:14:57 +0000 (12:14 -0400)]
Move LowMobPenalty into psq/mobility tables

Tested in no-regression mode.

Passed both STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 36705 W: 6537 L: 6443 D: 23725

and LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 9358 W: 1495 L: 1358 D: 6505

bench: 6921356

10 years agoReduce penalty for doubled pawns further away from each other
Gary Linscott [Fri, 11 Apr 2014 15:04:48 +0000 (11:04 -0400)]
Reduce penalty for doubled pawns further away from each other

Passed both STC
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 38339 W: 6849 L: 6649 D: 24841

and LTC
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 22693 W: 3455 L: 3256 D: 15982

bench: 7508468

10 years agoFurther simplification in evaluate
Marco Costalba [Fri, 11 Apr 2014 06:38:09 +0000 (08:38 +0200)]
Further simplification in evaluate

No functional change

10 years agoGet rid of an evaluate_pieces() overload
Marco Costalba [Thu, 10 Apr 2014 17:45:18 +0000 (19:45 +0200)]
Get rid of an evaluate_pieces() overload

Rewrite and greatly simplify that part of code.

No functional change.

10 years agoAdd a penalty for low mobility pieces
Gary Linscott [Thu, 10 Apr 2014 06:34:14 +0000 (08:34 +0200)]
Add a penalty for low mobility pieces

Passed both STC
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 81857 W: 14652 L: 14342 D: 52863

and LTC
LLR: 2.97 (-2.94,2.94) [0.00,6.00]
Total: 45400 W: 6999 L: 6697 D: 31704

bench: 7716978

10 years agoRestrict queen mobility to safe squares
Gary Linscott [Tue, 8 Apr 2014 19:50:01 +0000 (21:50 +0200)]
Restrict queen mobility to safe squares

Passed both STC
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 16188 W: 3119 L: 2971 D: 10098

and LTC
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 6336 W: 1010 L: 882 D: 4444

bench: 7533692

10 years agoRescale UCI scores to PawnValueEg
Lucas Braesch [Sun, 6 Apr 2014 09:43:30 +0000 (11:43 +0200)]
Rescale UCI scores to PawnValueEg

This is more consistent with what other engines are doing.
Often people thinks that SF's scores are overblown. In the
end, it just boils down to the arbitrary way of rescaling them.

No functional change.

10 years agoSync some common names
Marco Costalba [Sun, 6 Apr 2014 08:50:27 +0000 (10:50 +0200)]
Sync some common names

No functional change.

10 years agoSome more work in pretty_pv
Marco Costalba [Sat, 5 Apr 2014 23:11:30 +0000 (01:11 +0200)]
Some more work in pretty_pv

No functional change.

10 years agoSmall tidy up in move_to_san
Marco Costalba [Sat, 5 Apr 2014 16:54:37 +0000 (18:54 +0200)]
Small tidy up in move_to_san

No functional change.