1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00:00
Commit graph

3386 commits

Author SHA1 Message Date
Marco Costalba
69ac45d903 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.
2014-06-05 23:55:18 +02:00
Marco Costalba
323a006666 Fix a warning with MSVC Premium 2013
Reported by Ron Britvich.

No functional change.
2014-06-05 23:46:58 +02:00
pellanda
16e170d105 Update Readme.md
Retire line about polyglot.ini and
book as they are not used anymore.

No functional change.
2014-06-04 22:31:59 +02:00
Lucas Braesch
adeded29fb 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
2014-06-03 20:01:36 +02:00
Marco Costalba
187a9fe5e7 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.
2014-06-03 12:38:58 +02:00
kinderchocolate
6f48367094 Add some const qualifier
No functional change.
2014-06-03 11:43:52 +02:00
Reuven Peleg
83a574ff27 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
2014-06-03 11:33:19 +02:00
Marco Costalba
f4dcec0b94 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.
2014-06-01 15:29:34 +02:00
Marco Costalba
e4fc9d84d7 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.
2014-06-01 13:37:21 +02:00
Marco Costalba
07a525cdfd 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.
2014-05-31 23:48:23 +02:00
Marco Costalba
f5622cd5ec Restore development version
bench: 8732553
2014-05-31 23:34:36 +02:00
Marco Costalba
54f8a9cb13 Stockfish 5
Stockfish bench signature is: 8732553
2014-05-31 09:16:54 +02:00
Marco Costalba
ad937d0b2d 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
2014-05-26 21:39:48 +02:00
Marco Costalba
495a0fa699 Fix a warning with Intel compiler
warning #2259: non-pointer conversion from
"int" to "int16_t={short}" may lose significant
bits.

No functional change.
2014-05-25 00:21:46 +02:00
Marco Costalba
585655b16e Tidy up tt.h
Backport some non-functional changes
found working on 'dense TT' patch.

No functional change.
2014-05-25 00:02:09 +02:00
Marco Costalba
e49eb67119 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.
2014-05-24 09:56:32 +02:00
Marco Costalba
88b5100e29 Update polyglot.ini after last patch
No functional change.
2014-05-19 21:19:47 +02:00
Lucas Braesch
40f5abba10 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
2014-05-19 14:24:39 +02:00
Marco Costalba
5e03734eac 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
2014-05-17 22:59:07 +02:00
Marco Costalba
e46a72dd1d 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
2014-05-17 12:49:52 +02:00
Michel Van den Bergh
5ec63eb6b6 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
2014-05-13 22:37:28 +02:00
Arjun Temurnikar
a3c8c4b70d 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
2014-05-13 21:37:42 +02:00
Marco Costalba
696d6cedb9 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
2014-05-11 10:56:25 +02:00
Marco Costalba
9f843adf89 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
2014-05-11 10:29:56 +02:00
Arjun Temurnikar
bfd8704a7d Make imbalance table more clear
No functional change.
2014-05-10 08:54:31 +02:00
Reuven Peleg
f89a8f0769 Pass Position as const ref in update_stats()
No functional change.
2014-05-08 22:36:30 +02:00
Marco Costalba
6ba1d3ead6 Clarify some comments in SMP code
Spotted by Joona.

No functional change.
2014-05-08 09:09:35 +02:00
Marco Costalba
7e3dba4f4c Reformat and simplify previous patch
No functional change.
2014-05-07 08:56:16 +02:00
Joona Kiiski
f6e98a924a 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
2014-05-07 08:38:56 +02:00
Ron Britvich
8f6a494ad7 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.
2014-05-05 09:05:29 +02:00
Marco Costalba
b8e6f83cfb Change search() signature
Pass SpNode as template parameter.

No functional change.
2014-05-04 13:35:30 +02:00
Marco Costalba
5413fda739 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
2014-05-04 09:58:49 +02:00
Marco Costalba
145d293142 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
2014-05-04 09:42:32 +02:00
Marco Costalba
f1240483fb 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
2014-05-04 09:34:22 +02:00
Ronald de Man
c0d3010438 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
2014-05-03 21:40:09 +02:00
Marco Costalba
a9e93fa6a5 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
2014-05-03 12:12:22 +02:00
Marco Costalba
9e8bf82350 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
2014-05-03 11:47:49 +02:00
Marco Costalba
dc87ec7258 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
2014-05-02 11:04:18 +02:00
Marco Costalba
43973f43c6 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.
2014-05-01 23:08:07 +02:00
Marco Costalba
bee4f1cf09 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
2014-05-01 16:26:18 +02:00
Marco Costalba
da91a34c09 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.
2014-05-01 08:48:59 +02:00
Marco Costalba
626dc8a03b 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.
2014-05-01 07:46:44 +02:00
Marco Costalba
cf50e265fa 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.
2014-04-30 08:55:45 +02:00
snicolet
d3ffd0ffca 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
2014-04-30 08:36:44 +02:00
Marco Costalba
db229504e2 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
2014-04-28 17:27:49 +02:00
mstembera
918c29f83a Minor stuff scattered around
Just random minor stuff I found while browsing the code.

No functional change.
2014-04-28 17:07:43 +02:00
Marco Costalba
a1f39c1ef9 Remove other useless floor()
No functional change.
2014-04-27 19:17:40 +02:00
Marco Costalba
9f2a64abd2 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.
2014-04-27 19:10:00 +02:00
Marco Costalba
93e3b06fe2 Fix Intel compiler warnings
Fallout from previous patch: Intel compiler
is very noisy.

No functional change.
2014-04-27 12:02:36 +02:00
Marco Costalba
86c20416c8 Remove some useless casts
No functional change.
2014-04-27 11:44:16 +02:00