1
0
Fork 0
Commit Graph

3197 Commits (bee4f1cf09132375e1d151c4c0bccb2f9fc38d29)

Author SHA1 Message Date
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 fcf2a34080 Some more work in pretty_pv
No functional change.
2014-04-06 10:15:11 +02:00
Marco Costalba 698b645e10 Small tidy up in move_to_san
No functional change.
2014-04-05 19:05:37 +02:00
mstembera d28ea7b518 Smaller and faster profile-build binaries
I have noticed that increasing the bench depth produces
progressively smaller and slightly faster executables at
the cost of longer compile times.  Also using bench "time"
instead of "depth" seems to produce slightly smaller/faster
executables  given comparable compile times.

I have made a new Makefile that generates smaller and
about 1% to 2% faster profile executables at only a
little extra compile time.  On  my mobile 2GHz i7 a
full profile build time goes from 3'48" to 4'13" and
the exe goes down by 5% from 416,310 bytes to 395,567
bytes.

No functional change.
2014-04-05 12:48:20 +02:00
Lucas Braesch be641e881f Remove QueenOn7th and QueenOnPawn
Small simplification.

Passed SPRT(-3,1) both at STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 17051 W: 3132 L: 3005 D: 10914

and LTC:
LLR: 4.55 (-2.94,2.94) [-3.00,1.00]
Total: 24890 W: 3842 L: 3646 D: 17402

The rationale behind this is that I've never managed to add a
Queen on 7th rank bonus in DiscoCheck, because it never showed
to be positive (evne slightly) in testing. The only thing that
worked is Rook on 7th rank.

In terms of SF code, it seemed natural to group it with QueenOnPawn
as well as those are done together. I know you're against groupping
in general, but when it comes to non regression test, you are being
more conservative by groupping. If the group passes SPRT(-3,1) it's
safer to commit, than test every component in SPRT(-3,1) and end up
with the risk of commiting several -1 elo regression instead of just
one -1 elo regression.

In chess terms, perhaps it's just easier to manouver a Queen (which
can more also diagonaly) than a Rook. Therefore you can let the search
do its job without needing eval ad-hoc terms to guide it. For the Rook
which takes more moves to manouver such eval terms can be (marginally)
useful.

bench: 7473314
2014-04-05 11:26:44 +02:00
mstembera 3b19ea6ae5 Speed up apply_weight
Speed up by about 2% this hot path function pre-calculating
midgame and endgame values of the weight.

No functional change.
2014-04-05 11:12:18 +02:00
Marco Costalba ccf59b0228 Update Readme to 128 max threads
No functional change.
2014-04-03 11:33:42 +02:00
Joerg Oster 299afcd886 Queen vs. 3 pieces imbalance
Passed both STC
LLR: 7.32 (-2.94,2.94) [-1.50,4.50]
Total: 98108 W: 18087 L: 17576 D: 62445

And LTC
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 15082 W: 2417 L: 2248 D: 10417

bench: 7717336
2014-04-03 10:42:06 +02:00
Marco Costalba c15b132f03 Make operator<< to return void
This should help preventing misuse.

No functional change.
2014-04-03 10:34:25 +02:00
Stefan Geschwentner 0ba814b3ca Drop not defended by pawn condition
Passed no-regression test both at STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 96554 W: 17563 L: 17572 D: 61419

and at LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 31891 W: 4905 L: 4801 D: 22185

bench: 7720896
2014-04-01 11:59:25 +02:00
Marco Costalba d2caba1f66 Do not workaround function argument evaluation
Rewrite options initialization to do not trying to
hack upon the undefined evaluation order of function
arguments.

No functional change.
2014-04-01 09:39:41 +02:00
Marco Costalba 1efc19ade0 Fix a compile error with Intel C++
Error: a value of type "int" cannot be assigned
to an entity of type "Value"

No functional change.
2014-03-30 14:20:12 +02:00
Marco Costalba 678425f274 Fix a warning with MSVC 2010
Warning C4804: '<' : unsafe use of type 'bool' in operation

No functional change.
2014-03-30 14:25:57 +02:00
Marco Costalba 422c9c2acd Show evaluation from white POV in trace
We chose this instead of negamax sign convention
(ie. from the point of view of the side to move)
because it is more in line to how the eval
table is presented.

Also some tweak to formatting while there.

No functional change.
2014-03-30 10:45:46 +02:00
Marco Costalba 9350d0dce5 Raise VALUE_INFINITE
In some legal positions like this one:
R6R/3Q4/1Q4Q1/4Q3/2Q4Q/Q4Q2/Np1Q4/kB1N1KB1  b -- 0 1

We can have a very high score, in this case 30177 and 29267
for midgame and endgame respectively, and because
VALUE_INFINITE = 30001 we have an assert in interpolate()

Midgame and endgame scores are stored in 16 bit signed integers
so we can rise VALUE_INFINITE a little bit. This does not fix
the possibility of overflow in general case, just makes the
condition more difficult to trigger and anyhow better uses all
the score width.

Raising VALUE_INFINITE to 32000 seems to fix the problem for this
particular case.

No functional change.
2014-03-29 11:13:42 +01:00
Jean-Francois Romang 4833887842 Further simplification of TT replace strategy
No functional change
2014-03-29 10:05:02 +01: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
Stefan Geschwentner af0c13ba6a Pinned pieces affect king safety
Here the new idea is to link pinned pieces
with king safety.

Passed both STC
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 10047 W: 1867 L: 1737 D: 6443

And LTC
LLR: 2.97 (-2.94,2.94) [0.00,6.00]
Total: 10419 W: 1692 L: 1543 D: 7184

bench: 8325087
2014-03-29 08:37:55 +01:00
Marco Costalba c7cf45241c Fix a bug in pawns eval tracing
Instead of totals we were showing white and
black values.

Spotted by Sven Schüle

No functional change.
2014-03-26 07:06:29 +01:00
Marco Costalba 865b71309c Simplify TT replace strategy
Tested for no-regression with SPRT[-3, 1] at STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 32046 W: 6020 L: 5918 D: 20108

No functional change.
2014-03-24 08:32:08 +01:00
snicolet e7362dae78 Introduce penalty for weak (=unsupported) pawns.
We add a penalty for each pawn which is not protected by another pawn
of the same color.

Passed both short TC
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 12107 W: 2411 L: 2272 D: 7424

And long TC
LLR: 2.96 (-2.94,2.94) [0.00,6.00]
Total: 9204 W: 1605 L: 1458 D: 6141

bench: 7682173
2014-03-24 08:27:40 +01:00
Marco Costalba 9e72e35942 Fix an incorrect 'friend' declaration
Spotted by Lee David.

No functional change.
2014-03-23 11:17:38 +01:00
Marco Costalba bc183b0c04 Retire last usage of operator|(File f, Rank r)
This for some reason was missed.

No functional change.
2014-03-23 10:42:37 +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 f12449d492 Rename score to value in ExtMove
We use 'score' for the value mid-endgame pair.

No functional change.
2014-03-23 08:54:10 +01:00
Marco Costalba 441a34a1c6 Trivial formatting in ucioption.cpp
No functional change.
2014-03-23 00:06:26 +01:00
Marco Costalba 5f12069cbf Retire operator|(File f, Rank r)
Use make_square() instead. Less fancy but
more clear.

No functional change.
2014-03-22 23:54:18 +01:00
Marco Costalba 4eee603433 Fix a subtle bug in UCI options printing
We want all the UCI options are printed in the order in which are
assigned, so we use an index that, depending on Options.size(),
increases after each option is added to the map. The problem is
that, for instance, in the first assignment:

o["Write Debug Log"] = Option(false, on_logger);

Options.size() can value 0 or 1 according if the l-value (that
increments the size) has been evaluated after or before the
r-value (that uses the size value).

The culprit is that assignment operator in C++ is not a
sequence point:

http://en.wikipedia.org/wiki/Sequence_point

(Note: to be nitpick here we actually use std::map::operator=()
 that being a function can evaluate its arguments in any order)

So there is no guarantee on what term is evaluated first and
behavior is undefined by standard in this case. The net result
is that in case r-value is evaluated after l-value the last
idx is not size() - 1, but size() and in the printing loop
we miss the last option!

Bug was there since ages but only recently has been exposed by
the removal of UCI_Analyze option so that the last one becomes
UCI_Chess960 and when it is missing engine cannot play anymore
Chess960.

The fix is trivial (although a bit hacky): just increase the
last loop index.

Reported by Eric Mullins that found it on an ARM and MIPS
platforms with gcc 4.7

No functional change.
2014-03-22 11:30:06 +01:00
Marco Costalba c714b90594 Fix a typo
Spotted by Isaac Haïk Dunn.

No functional change.
2014-03-18 18:36:39 +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
Marco Costalba fa3f6dcbea Fix a crash under MSVC
Using memset on a std::vector is undefined behavior,
so manually init all the data memebers of LimitsType.

Bug intorduced in 41641e3b1e

No functional change.
2014-03-16 10:55:58 +01:00
Marco Costalba a091ae4cc8 Split also if no slaves are found
Because we test for available slaves before
entering split(), we almost always allocate a
slave, only in the rare case of a race (less
then 2% of cases) this is not true, but to
special case this occurrence is not worth
the added complexity.

bench: 7451319
2014-03-15 23:43:35 +01:00
Marco Costalba a1a7bc84da Remove "Max Threads per Split Point" UCI option
Experimental patch to verify if drop of nps
in endgames at very long TC is due to this.

Suggested by Ronald de Man.

bench: 7451319
2014-03-15 21:26:04 +01:00
Marco Costalba 6e4b4c42ed Merge default tests in pos_is_ok
No functional change.
2014-03-15 15:34:31 +01:00
Marco Costalba 142874b058 Microptimize castling in undo_move()
We don't need to set 'captured' and 'pt' after we
castle back.

No functional change.
2014-03-15 11:47:30 +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
Marco Costalba d0587f2c7f Use legal positions for endgame initialization
During endgame initialization we get the material
hash key of each endgame forging and ad-hoc position
that in same cases is illegal (leaves teh king under
capture). This is not a problem for the material key,
but rises an assert when SF is run in debug mode with
'testKingCapture' set in pos_is_ok().

So rewrite the code to always produce legal positions.

No functional change.
2014-03-14 09:57:34 +01:00
Marco Costalba 1f4798a173 Further work in pos_is_ok()
No functional change.
2014-03-14 09:43:19 +01:00
Daylen Yang 61e4443342 Re-add link time optimization on OS X
In the new version of clang, -O4 does not imply -flto, so we set the
flag
2014-03-14 08:49:08 +01:00
Marco Costalba 6571acffaa Reformat do_castling()
No functional change.
2014-03-13 12:53:03 +01:00
Marco Costalba 6f3d787692 Further merge StateInfo setup functions
No functional change.
2014-03-12 22:46:17 +01:00
Marco Costalba 1e032ece92 Merge hash key computation functions
No functional change.
2014-03-12 09:14:38 +01:00
Marco Costalba cc3002ff04 Use std::count in pos_is_ok()
No functional change.
2014-03-11 23:19:47 +01:00
Marco Costalba c40d4e0133 Small simplification in gives_check
Use switch statement also for normal case.

No speed regression.

No functional change.
2014-03-11 22:58:08 +01:00
Marco Costalba ca0804dfe4 Print dbg counters after bench
Print last debug counters update just
before to exit benchmark.

Suggested by Stephane Nicolet.

No functional change.
2014-03-11 22:19:14 +01:00
Marco Costalba d2a8ba3299 Simplify pseudo_legal()
Big simplification of pawn move check.

Code has been tested with a brute force approach: for
every position reached during a bench search, the function
has been called for each combinations of Move(from, to)
and verified the result is the same of old code.

Actually this function is very critical becuase is the
one that ensures corrupted TT moves are discarded, so
to properly test it a simple bench is not enough.

Verified also speed is not changed.

No functional chnage.
2014-03-10 08:38:23 +01:00
Marco Costalba 20ff12e1be Simplify generate<EVASIONS>
No speed regression, tested with both perft and
bench.

No functional change.
2014-03-09 12:16:27 +01:00
Marco Costalba 5cf9e0b254 Retire SERIALIZE macros
Explicitly write the 'while' loops. This adds some
code but makes clear what's the code behind the
macro.

No functional change.
2014-03-09 11:10:33 +01:00
Marco Costalba 1d1b7df7c6 Rename castling flag to castling right
This is a more conventional naming as
reported also in:

http://chessprogramming.wikispaces.com/Castling+rights

No functional change.
2014-03-08 15:08:55 +01:00