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

1513 commits

Author SHA1 Message Date
lucasart
f133f61e3f 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.
2014-07-10 18:25:20 +08:00
Joona Kiiski
eb50793cff 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
2014-07-09 07:19:06 +08:00
joergoster
ffedfa3354 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
2014-06-29 20:17:40 +01:00
Gary Linscott
e6a8d03dd8 Revert "Check for an available slave early on"
This reverts commit ce1c260ea9.
2014-06-26 11:16:36 -04:00
Marco Costalba
e8baf2b772 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
2014-06-21 13:07:29 +02:00
Eelco de Groot
55a3e0af8d 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
2014-06-16 21:50:14 +02:00
Marco Costalba
ce1c260ea9 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.
2014-06-09 04:56:31 +09:00
Marco Costalba
7f56d2949d Avoid to use nullChild
Use instead:

(ss-1)->currentMove == MOVE_NULL

No functional change.
2014-06-06 11:12:05 +02:00
Marco Costalba
d10ae90dea Remove 'update gains' hack
Use (move != MOVE_NONE) condition to
filtering out updating gains at root.

bench: 8454456
2014-06-06 11:10:40 +02:00
Marco Costalba
2f75639485 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
2014-06-06 11:08:35 +02:00
Marco Costalba
ad1167c482 Avoid to use nullChild
Should be a non functional change, but
for some reason bench is changed.

bench: 8454456
2014-06-06 10:07:48 +02:00
Marco Costalba
08753771fc Move Tempo to evaluation
No functional change.
2014-06-06 09:40:01 +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
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
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
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
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
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
a1f39c1ef9 Remove other useless floor()
No functional change.
2014-04-27 19:17:40 +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
Marco Costalba
c9e396b542 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.
2014-04-27 11:25:42 +02:00
Marco Costalba
56273fca1e Reset DrawValue[] before new search
Spotted by Ronald de Man

bench: 7384368
2014-04-21 14:30:27 +02:00
Leonid Pechenik
ef43e6b05d 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
2014-04-21 12:23:03 +02:00
Lucas Braesch
0d8a4c7565 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.
2014-04-06 11:53:28 +02:00
Marco Costalba
64d29a6330 Sync some common names
No functional change.
2014-04-06 11:26:12 +02:00
Marco Costalba
f811a5693e Restore old aspiration window to 16
Tested directly at LTC because previous long
test series on this topic shows it is TC dependant.

Tested with no-regression mode because gets rid of
an ugly and ad-hoc rule.

Test at LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 67918 W: 10590 L: 10541 D: 46787

bench: 7926803
2014-03-29 08:45:40 +01:00
mstembera
ffdf63ff7c Refresh TT entries generation automatically on probe
And other assorted simplifications, tested with SPRT[-3, 1]

Passed both short TC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 18814 W: 3600 L: 3475 D: 11739

And long TC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 20731 W: 3217 L: 3096 D: 14418

No functional change.
2014-03-23 09:46:15 +01:00
Marco Costalba
aab5863dd4 Increase max threads to 128
Thanks to std::bitset we can easily increase
the limit of active threads above 64.

Thanks to Lucas Braesch for pointing at the
correct solution of using std::bitset.

No functional change.
2014-03-18 12:07:26 +01:00
Mysseno
36c381154b Depth dependant aspiration window delta
Split delta value in aspiration window so that when
search depth is less than 24 a smaller delta value
is used. The idea is that the search is likely to
be more accurate at lower depths and so we can exclude
more possibilities, 25% to be exact.

Passed STC
LLR: 2.96 (-2.94, 2.94) [-1.50, 4.50]
Total: 20430 W: 3775 L: 3618 D: 13037

And LTC
LLR: 2.96 (-2.94, 2.94) [0.00, 6.00]
Total: 5032 W: 839 L: 715 D: 3478

Bench: 7451319
2014-03-14 19:47:41 +01:00
mstembera
553ead429d Some minor cleanup stuff
I came across while browsing the code.

No functional change.
2014-03-03 08:57:20 +01:00
Marco Costalba
bbd69c0260 Revert dynamic draw value
When tested with weaker engines did not
performed as expected, actually it was even
a regression from standard version.

bench: 8430785
2014-03-03 08:39:34 +01:00
Marco Costalba
9f0485e343 Retire UCI_AnalyseMode option
It has been obsoleted out already some time ago
and currently there is no point in changing eval
score according to if we are in game or analyzing.

So retire the option.

No functional change.
2014-03-01 12:10:42 +01:00
Joerg Oster
b917cd275e Dynamic draw value
Try to avoid repetition draws at early midgame,
this should give an edge against weaker opponents
and reduce draw rate.

Tested for regressions with SPRT[-3, 1] and
passed both short TC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 68498 W: 12928 L: 12891 D: 42679

And long TC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 40212 W: 6386 L: 6295 D: 27531

bench: 7990513
2014-02-26 19:33:52 +01:00