Marco Costalba [Sat, 13 Oct 2012 08:40:38 +0000]
Scale contempt factor to zero at endgame
Contempt Factor is more effective at opening/middle game
and seems harmful at endgame phase. See:
http://chessprogramming.wikispaces.com/Contempt+Factor
http://web.archive.org/web/
20070707023203/www.brucemo.com/compchess/programming/contempt.htm
Therefore we scale down the contempt factor while going
on with the game so to reach zero at endgame phase.
No functional change.
Marco Costalba [Thu, 11 Oct 2012 19:11:11 +0000]
Fix a minor bug in search
As Joona says: "The problem is that when doing full
window search (-VALUE_INFINITE, VALUE_INFINITE), and
pruning all the moves will return fail low which is
mate score, because only clause touching alpha is
"mate distance pruning". So we are returning mate score
although we are just pruning all the moves. In reality
there probably is no mate in sight.
Bug spotted and fixed by Joona.
Jean-Francois Romang [Thu, 11 Oct 2012 14:55:25 +0000]
ARM lsb/msb assembly
Implement lsb/msb using armv7 assembly instructions.
msb is the easiest one, using a gcc intrinsic that generates
code using the ARM's clz instruction. lsb is also using this
clz instruction, but with the help of ARM's 'rbit' (bit
reversing) instruction. This leads to a >2% speed gain.
I also renamed 'arm-32' to the more meaningfull 'armv7' in the Makefile
No functional change.
Jean-Francois Romang [Wed, 10 Oct 2012 11:34:06 +0000]
Introduce arm-32 ARCH in Makefile
No functional change.
Marco Costalba [Wed, 10 Oct 2012 06:09:52 +0000]
Retire is_dangerous() and inline its content
No functional change.
Marco Costalba [Mon, 8 Oct 2012 09:19:50 +0000]
Rearrange prefetch code
No functional change.
Marco Costalba [Sun, 7 Oct 2012 22:36:08 +0000]
Merge pull request #29 from RyanTaker/patch-3
Add Contempt Factor to Polyglot.ini
RyanTaker [Sun, 7 Oct 2012 16:49:55 +0000]
Add Contempt Factor in Polyglot
The contempt factor was previously not included in polyglot.ini
Marco Costalba [Sun, 7 Oct 2012 07:34:04 +0000]
Sync qsearch with search
Port to qsearch() the same changes we recently
added to search().
Overall this search refactoring series shows
almost 2% speed up on gcc compile.
No functional change.
Daylen Yang [Sun, 7 Oct 2012 00:56:12 +0000]
Improve compatibility with older versions of Mac OS X
Use the -mmacosx-version-min flag to support older versions of Mac OS X
(like version 10.6 and 10.7) when compiled on a machine running version
10.8.
Marco Costalba [Sat, 6 Oct 2012 10:53:41 +0000]
Fix POPCNT support on mingw 64
When using asm 'popcnt' instruction the given
operand registers must be of the same type.
No functional change.
Marco Costalba [Sat, 6 Oct 2012 10:25:13 +0000]
Fix mingw compile with ARCH=x86-64
When using the Makefile (as for the mingw case),
IS_64BIT and USE_BSFQ are already set with
ARCH=x86-64 and do not need to be redefined.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 6 Oct 2012 08:12:34 +0000]
Fix Contempt Factor implementation
First disable Contempt Factor during analysis, then
calculate the modified draw score from the point of
view of the player, so from the point of view of
RootPosition color.
Thanks to Ryan Taker for suggesting the fixes.
No functional change.
Marco Costalba [Sat, 6 Oct 2012 07:09:27 +0000]
Fix fallouts from previous patch
These kind of arch specific code is really nasty
to make it right becuase you need to verify on
all the platforms.
Now should compile properly also on ARM
Reported by Jean-Francois.
No functional change.
Jean-Francois Romang [Fri, 5 Oct 2012 20:30:22 +0000]
Allow prefetching on non-x86 platforms with gcc
In particular on ARM processors. Original patch by
Jean-Francois, sligtly modified by me to preserve
the meaning of NO_PREFETCH flag.
Verified with gcc, clang and icc that prefetch instruction
is correctly created.
No functional change.
Marco Costalba [Fri, 5 Oct 2012 13:00:35 +0000]
Retire futility_move_count()
And remove (bestValue < beta) condition from
moves loop.
No functional change.
Marco Costalba [Wed, 3 Oct 2012 12:11:20 +0000]
Rewrite search best value update
A simplification and also a small speed-up of
about 1% mainly due to reducing calls to
thisThread->cutoff_occurred().
Worst case split point recovering time after a
cut-off occurred is limited to 3 msec on my slow
PC, and usually is below 1 msec, so it seems safe
to remove the cutoff_occurred() check.
No functional change.
Marco Costalba [Fri, 5 Oct 2012 06:23:56 +0000]
Add experimental contempt factor
This is very crude and very basic: simply in case
of a draw for repetition or 50 moves rule return
a negative score instead of zero according to the
contempt factor (in centipawns). If contempt is
positive engine will try to avoid draws (to use
with weaker opponents), if negative engine will
try to draw. If zero (default) there are no changes.
No functional change.
Marco Costalba [Wed, 3 Oct 2012 08:34:42 +0000]
Retire EasyMoveMargin
Use a value related to PawnValue instead.
This is a different patch from previous one because
could affect game play and skill levels, although
in a mostly unmeasurable way. Indeed thresold has
been raised so easy move is a bit harder to trigger
and skill level is a bit more prone to blunders.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 3 Oct 2012 08:08:10 +0000]
Don't hide thresolds values
Show the real value in the code, not hide it
behind a variable name, especially when there
is only once occurence.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Tue, 2 Oct 2012 04:18:21 +0000]
Further push singular extension
Extend for an extra half-ply in case the node is (probably)
going to fail high. In this case the added overhead is limited.
A novelity is the way this patch has been tested: Always in
self-play but with a much longer TC to allow the singular
extension to fully kick in and also (my impression) to have
less noisy results.
Ater 1015 games on my QUAD at 60"+0.05
Mod vs Orig 173 - 150 - 692 ELO +8
Marco Costalba [Mon, 1 Oct 2012 07:33:13 +0000]
Further rearrange search()
No functional change.
Marco Costalba [Sun, 30 Sep 2012 09:32:42 +0000]
Don't push on the stack 200KB in one go
This could be a limit on some platforms (as it seems
to be in Native Client). Patch from a SF fork on github:
https://github.com/ccherng/Stockfish/commit/
47374afd6fdfabd9de183a7a67d645daad45fb21
No functional change.
Marco Costalba [Sun, 30 Sep 2012 04:49:56 +0000]
Add support for node limited search
Handle also the SMP case. This has been quite tricky, not
trivial to enforce the node limit in SMP case becuase
with "helpful master" concept we can have recursive split
points and we cannot lock them all at once so there is the
risk of counting the same nodes more than once.
Anyhow this patch should be race free and counted nodes are
correct.
No functional change.
Marco Costalba [Sat, 29 Sep 2012 16:26:17 +0000]
Skip some useless initializations in search()
And rearrange a bit the initialization code. Still
some polishing to do, but it is a first step.
No functional change.
Marco Costalba [Sat, 29 Sep 2012 15:41:53 +0000]
Don't need to early check PV moves for legality
As long as isPvMove (renamed to pvMove) is set after
legality check, we can postpone legality even in PV case.
Patch aligns the PV case with the common non-pv one.
No functional change.
Marco Costalba [Sat, 22 Sep 2012 09:08:10 +0000]
Drop a magic in book.cpp
Mask out move's spacial flags without relying
on internal Move representation.
No functional change.
Marco Costalba [Sat, 22 Sep 2012 07:26:25 +0000]
Tweaks to bitcount functions
Seems even a bit faster now (almost 1% in 32bit case).
No functional change.
Marco Costalba [Fri, 21 Sep 2012 22:37:18 +0000]
Restore development version
Marco Costalba [Fri, 21 Sep 2012 22:18:00 +0000]
Stockfish 2.3.1
Stockfish bench signature is: 5423738
Gary Linscott [Sun, 16 Sep 2012 13:59:30 +0000]
Bonus for rook/queen attacking pawns on same rank
Patch and tuning by Gary Linscott from an idea of Ryan Taker.
Double tested by Gary:
Wins: 3390 Losses: 2972 Draws: 11323
LOS: 99.999992%
ELO: 8.213465 +- 99%: 6.746506 95%: 5.124415
Win%: 51.181792 +- 99%: 0.969791 95%: 0.736740
And by me:
After 5612 games 1255 1085 3271 +11 ELO
Marco Costalba [Thu, 20 Sep 2012 17:25:27 +0000]
Fix compile on 64 bits
Reported by Quocvuong82.
No functional change.
Marco Costalba [Tue, 18 Sep 2012 08:02:20 +0000]
Simplify BSFTable initialization
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sun, 16 Sep 2012 12:06:13 +0000]
Fix crash under Chess 960
We have a crash with this position:
rkqbnnbr/pppppppp/8/8/8/8/PPPPPPPP/RKQBNNBR w HAha -
What happens is that even if we are castling QUEEN_SIDE,
in this case we have kfrom (B8) < kto (C8) so the loop
that checks for attackers runs forever leading to a crash.
The fix is to check for (kto > kfrom) instead of
Side == KING_SIDE, but this is slower in the normal case of
ortodhox chess, so rewrite generate_castle() to handle the
chess960 case as a template parameter and allow the compiler
to optimize out the comparison in case of normal chess.
Reported by Ray Banks.
Marco Costalba [Sun, 16 Sep 2012 08:30:32 +0000]
Rename class Book to PolyglotBook
And move struct BookEntry out of the header where it is
not needed.
No functional change.
Marco Costalba [Sun, 16 Sep 2012 06:52:38 +0000]
Fix KpsK endgame
Broken by commit
a44c5cf4f77b05a03 of 3 /12 / 2011 that
was labeled "No functional change" because our 'bench'
test didn't triggered that particular endgame. Indeed
we need to run a specific bench on a set of endgames
position when touching endgame.cpp because normal bench
does not cover endgames properly.
Found by MSVC 2012 code analyzer.
Marco Costalba [Sat, 15 Sep 2012 07:34:31 +0000]
Restore development version
No functional change.
Marco Costalba [Sat, 30 Jun 2012 07:00:48 +0000]
Stockfish 2.3
Stockfish bench signature is: 5416292
Marco Costalba [Sat, 15 Sep 2012 08:50:23 +0000]
Fix compile with Intel 13.0
It seems Intel is unable to properly workout templates with 'static'
storage specifier.
Workaround using an anonymous namespace instead.
No functional change.
Marco Costalba [Mon, 10 Sep 2012 16:24:53 +0000]
Don't exit earlier from aspiration window loop
Currently we exit the loop when
abs(bestValue) >= VALUE_KNOWN_WIN
but there is no logical reason for this. It seems more
natural to re-search again with full open window.
This has practically no impact in most cases, we have a
'no functional change' running 'bench' command.
Marco Costalba [Fri, 14 Sep 2012 07:42:59 +0000]
Fix MSVC 2012 64bits warnings
Reported by Rein.
No functional change.
Marco Costalba [Tue, 11 Sep 2012 18:00:58 +0000]
Speed-up generate<LEGAL>
The trick here is to check for legality only in the
(rare) cases we have pinned pieces or a king move
or an en-passant.
This trick is able to increase the speed of perft
of more then 20%!
No functional change.
Marco Costalba [Sun, 9 Sep 2012 12:30:22 +0000]
Remove redundancy in move generation
Introduce generate_all_moves() and remove a good
bunch of redundant code.
No functional change.
Marco Costalba [Sun, 9 Sep 2012 08:49:25 +0000]
Simplify generate_castle()
Skipping the calls to std::min(), std::man() we get
even a nice speed-up on perft.
No functional change.
Marco Costalba [Sun, 9 Sep 2012 08:17:31 +0000]
Rename *last to *end
It is a more correct name because it points past the
last move of the list.
No functional change.
Marco Costalba [Sun, 9 Sep 2012 08:02:11 +0000]
Enable link time optimization only when optimizing
Because it is quite slow, skip it when 'optimize' flag is 'no'
No functional change.
Marco Costalba [Fri, 7 Sep 2012 13:21:50 +0000]
Revert "Simplify Option c'tor"
std::to_string() is C++11 material, not c++03.
So revert the patch.
Marco Costalba [Thu, 6 Sep 2012 16:16:37 +0000]
Simplify Option c'tor
No functional change.
Marco Costalba [Tue, 4 Sep 2012 07:38:51 +0000]
Get rid of struct Time
We just need the milliseconds of current system
time for our needs. This allows to simplify the
API.
No functional change.
Marco Costalba [Sun, 2 Sep 2012 14:39:01 +0000]
Rename current_time() to now()
Follow C++11 naming conventions.
No functional change.
Marco Costalba [Sat, 1 Sep 2012 22:15:27 +0000]
Greatly speed up SEE
Simply reshuffling the code inverting the condition in next_attacker()
yields a miraculous speed up of more than 3% under gcc!
On my laptop a bench run goes from 320Knps to 330Knps
No functional change.
Marco Costalba [Sat, 1 Sep 2012 09:45:14 +0000]
Unroll least valuable attacker loop in SEE
This allows to reduce the scanning for new X-ray attacks
according to the capturing piece type.
It seems to be just a very small speed increase in MSVC 64
bit and gcc 32 bit, I guess cache issues value more than some
instruction less to execute (as usual).
No functional change.
Marco Costalba [Sat, 1 Sep 2012 09:45:14 +0000]
Slightly simplify SEE
Some renaming and small code reshuffle.
No fuctional change.
Marco Costalba [Fri, 31 Aug 2012 13:19:35 +0000]
Retire Time::restart()
Simplify API.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Fri, 31 Aug 2012 12:21:16 +0000]
Don't need to memset HashTable
Default c'tor Entry() already initializes
to zero all its POD members.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 29 Aug 2012 14:43:01 +0000]
Terminate threads before to exit main()
It is very difficult and risky to assure
that a running thread doesn't access a global
variable. This is currently true, but could
change in the future and we don't want to rely
on code that works 'by accident'. The threads
are still running when ThreadPool destructor is
called (after main() returns) and this could
lead to crashes if a thread accesses a global
that has been already freed. The solution is to
use an exit() function and call it while we are
still in main(), ensuring global variables are
still alive at threads termination time.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 29 Aug 2012 11:28:59 +0000]
Convert to sync_cout and sync_endl
Serialize access to std::cout all over the code.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 29 Aug 2012 09:25:11 +0000]
Introduce serialization of accesses to std::cout
When many threds concurrently print you need to serialize
the access to std::cout to avoid output lines are intermixed
with the contents of each thread.
This is not strictly needed at the moment because
only main thread prints out, although some ad-hoc
test could trigger UCI::loop() printing while searching.
Anyhow we want to lift this pretty avoidable constrain
also as a prerequisite for future work.
This patch just introduces the support, next one will enable
the serialization.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Mon, 27 Aug 2012 12:39:59 +0000]
Correctly handle handover of setup states
Before the search we setup the starting position doing all the
moves (sent by GUI) from start position to the position just
before to start searching.
To do this we use a set of StateInfo records used by each
do_move() call. These records shall be kept valid during all
the search because repetition draw detection uses them to back
track all the earlier positions keys. The problem is that, while
searching, the GUI could send another 'position' command, this
calls set_position() that clears the states! Of course a crash
follows shortly.
Before searching all the relevant parameters are copied in
start_searching() just for this reason: to fully detach data
accessed during the search from the UCI protocol handling.
So the natural solution would be to copy also the setup states.
Unfortunatly this approach does not work because StateInfo
contains a pointer to the previous record, so naively copying and
then freeing the original memory leads to a crash.
That's why we use two std::auto_ptr (one belonging to UCI and another
to Search) to safely transfer ownership of the StateInfo records to
the search, after we have setup the root position.
As a nice side-effect all the possible memory leaks are magically
sorted out for us by std::auto_ptr semantic.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sun, 26 Aug 2012 16:07:54 +0000]
Use std::deque to store setup states
Marco Costalba [Sat, 25 Aug 2012 17:48:08 +0000]
Document PolyGlotRandoms[] offsets
Should be more clear from where the 'magic' numbers
come from.
Also bit of reformat while there.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Fri, 24 Aug 2012 11:40:58 +0000]
Explicitly use threads.size()
Instead of just size(). Although code is longer,
should be more immediate to understand when reading.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Fri, 24 Aug 2012 09:59:41 +0000]
Introduce struct Mutex and ConditionVariable
To mimics C++11 std::mutex and std::condition_variable,
also rename locks and condition variables to be more
uniform across the classes.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Fri, 24 Aug 2012 08:30:50 +0000]
Slightly microptimize SEE
Reduce of one instruction. It seems a tad faster on
the profiler now. Very slightly but anyhow it is a
code semplification.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 22 Aug 2012 10:44:43 +0000]
Use size_t as operator[] argument type
This better mimics std::vector::operator[] and
fixes a warning with MSVC 64bit.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 22 Aug 2012 09:13:09 +0000]
Merge generate_direct_checks() in generate_moves()
Further reduce redundancy in move generation.
Veirifed no speed regression on MSVC, Clang and gcc.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 22 Aug 2012 07:29:49 +0000]
Streamline generate_moves()
Greatly simplify these very performace critical functions.
Amazingly we don't have any speed regression actually under
MSVC we have the same assembly for generate_moves() !
In generate_direct_checks() 'target' is calculated only
once being a loop invariant.
On Clang there is even a slight speed up.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Mon, 20 Aug 2012 17:41:28 +0000]
Reformat piece values arrays
And rename stuff while there.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Mon, 20 Aug 2012 17:09:57 +0000]
Move zobrist keys out of Position
Are used by Position but do not belong to that class,
there is only one instance of them (that's why were
defined as static), so move to a proper namespace instead.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Mon, 20 Aug 2012 13:44:30 +0000]
Retire copy c'tor from class Position
Not needed.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Mon, 20 Aug 2012 06:54:38 +0000]
Prefer a reference to a pointer
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sun, 19 Aug 2012 23:04:42 +0000]
Use enums instead of constants for piece values
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sun, 19 Aug 2012 13:12:39 +0000]
Document De Bruijn sequences
Insted of raw magic numbers.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sun, 19 Aug 2012 12:06:26 +0000]
Avoid wake up master thread when useless
Check we are the last slave of the split point
before to wake up the master. This should avoid
spurious wakes up.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sun, 19 Aug 2012 10:20:33 +0000]
Simplify idle_loop() signature
We can detect the split point master also from within idle_loop,
so we can call the function without parameters and remove an
overloaded member hack in Thread class.
Note that we don't need to take a lock around curSplitPoint
when entering idle_loop() because if we are the master then
curSplitPoint cannot change under our feet (because is_searching
is set and so we cannot be reallocated), if we are a slave
we enter idle_loop() only upon Thread creation and in that case
is always splitPointsCnt == 0. This is true even in the very rare
case that curSplitPoint != NULL, if we have been already allocated
even before entering idle_loop().
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sun, 19 Aug 2012 09:20:15 +0000]
Prefer size_t over int for array sizes
Align to standard library conventions.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 18 Aug 2012 12:04:43 +0000]
Introduce namespace Bitbases
Let's continue this namespace galore...
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 18 Aug 2012 10:50:43 +0000]
Introduce namespace UCI
Ater previous patch it comes naturally to take this
extra step.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 18 Aug 2012 10:23:18 +0000]
Retire struct OptionsMap
Directly use the underlying std::map instead and avoid
a useless inheritance.
As a nice side-effect Options global object has now a
default c'tor avoiding possible issues with globals
initializations.
Suggested by Rein Halbersma.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 18 Aug 2012 10:00:56 +0000]
Explicitly qualify STL functions
Suggested by Rein Halbersma.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 18 Aug 2012 09:43:13 +0000]
Retire MovePickerExt struct
Templetize MovePicker::next_move() member function instead. It
is easier and we also avoid the forwarding of MovePicker() c'tor
arguments in the common case.
Suggested by Rein Halbersma.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Mon, 30 Jul 2012 07:44:54 +0000]
Guard against 'divide by zero' in bench
Also remove an useless cast.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Joseph R. Prostko [Mon, 30 Jul 2012 00:13:27 +0000]
Added Haiku-specific changes to Makefile
First change: If Haiku is host platform, change
installation prefix to /boot/common/bin
Second change: Only link in pthreads if Haiku isn't
host platform.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Thu, 26 Jul 2012 17:16:24 +0000]
Fix UCI promotion move notation
Regression introduced by revision
f0db6a6c0b82a586
Spotted by Joona.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Linus Arver [Thu, 19 Jul 2012 19:09:37 +0000]
Readme.txt: more grammar/style fixes
Linus Arver [Wed, 18 Jul 2012 23:46:51 +0000]
Readme.txt: grammar/stylistic fixes
Marco Costalba [Sun, 15 Jul 2012 08:03:38 +0000]
Fix regression in move_to_san()
Broken since commit
628808a11382a3ac
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sun, 15 Jul 2012 07:14:25 +0000]
Introduce notation.h
And group there all the formatting functions but
uci_pv() that requires access to search.cpp variables.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 14 Jul 2012 12:19:16 +0000]
Rewrite pv_info_xxx() signatures
Use the helpers to format the PV info but without
writing to output stream (file or cout). Message
formatting and sending are two logically different
task.
Incidentaly reintroduce the pretty_pv() name,
from Glaurung memories :-)
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 14 Jul 2012 11:29:11 +0000]
Include castle moves in 'dangerous' flag
Simplifies the code and seems more natural.
We have a very small fucntional change becuase now
at PV nodes castles are extended one ply anyhow.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 14 Jul 2012 11:18:14 +0000]
Merge exclusion search conditions
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Fri, 13 Jul 2012 08:54:24 +0000]
Remove redundant condition in is_dangerous()
A pawn on 7th is always passed so retire
this redundant condition.
No funtional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sun, 8 Jul 2012 09:22:42 +0000]
Silence a MSVC warning in class Tie
With warning level 4 MSVC complains that a default
assignment operator could not be generated due to
member 'file' is a reference (warning C4512).
Use a pointer instead of a reference and move
struct Tie outisde class Logger while there.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sun, 8 Jul 2012 07:30:37 +0000]
Rename first_1 / last_1 in lsb / msb
It seems more accurate: lsb is clear while 'first
bit' depends from where you look at the bitboard.
And fix compile in case of 64 bits platforms that
do not use BSFQ intrinsics.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 7 Jul 2012 18:30:27 +0000]
Use last_1() to compute new TT size
Transposition table consists of a power of 2
number of TTCluster entries.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 7 Jul 2012 18:00:05 +0000]
Revert to -O3 with Clang
Instead of -O4 option that does not work with both mingw and
Linux gcc (tested with Clang 3.1).
As reported by Reed Kotler:
Turns out that -O4 is not a valid option for clang unless you have
the proper gold linker and plugins built. That's because -O4 enables
LTO, which writes out bitcode files during the compile, and then loads
those and optimizes them during the link phase.
It requires a linker that supports LLVM's LTO. There is a plugin for
Gold available as part of LLVM.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 7 Jul 2012 15:28:39 +0000]
Fix signedness warning in time_to_msec()
We have a signed integer here so let the return type
take in account that.
Found by Clang with -Weverything option.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Thu, 5 Jul 2012 10:52:11 +0000]
More idiomatic signature for operator=()
Return a reference instead of void so to enable
chained assignments like
"p = q = Position(...);"
Suggested by Rein Halbersma.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Thu, 5 Jul 2012 10:48:17 +0000]
Streamline null search reduction formula
Although a (little) functional change, we have no ELO change
but formula it is now more clear.
After 13019 games at 30"+0.05
Mod vs Orig 2075 - 2088 - 8856 ELO 0 (+- 3.4)
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 30 Jun 2012 07:00:48 +0000]
Clear transposition table on "ucinewgame"
It seems the standard behaviour as implemented
in most engines although UCI protocol does not
specify what to do upon "ucinewgame" command.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>