This fix a couple of dubious bugs in MVV/LVA
ordering.
Tests seems to confirm now is slightly better.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This seems to increase strenght (about 15 ELO),
still to test some variations on this theme that
could increase ELO even more.
Idea from Rebel (http://members.home.nl/matador/chess840.htm)
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
When an engine is in deep trouble at few
seconds from time limit then giveup without
fighting anymore.
This is used to reduce "lucky draws" and time pressure
blunders noises that can obfuscate results during tests
blitz games (typical one minute games).
Goal of this technique is to reduce number of matches
needed to reliably prove then an engine A is stronger
then an opponent B.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Razor on ply one if the advantage is more then a pawn,
the only way to gap the advantage is to capture, so
go directly in quiesce.
This seems to have a positive effect.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Without this patch MSVC crashes when compiled
in release mode. It survives and works as
expected in debug mode and with gcc and Intel
compilers.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Always for 32 bit but withot relying on MSVC intrinsics.
It is very similar to previous ones, but this does not
segfaults due to -fno-strict-aliasing compiler option.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Other two debug utilities to compute filter rate.
Usage is:
dbg_before(); // counts passages from this point
if(..) // complex code stuff you want to audit
return/continue
if(...)
.....
dbg_after(); // counts passages from this point
Then somewhere in the code, normally in poll() add
dbg_print_hit_rate() and you will see the filter rate
of your code under auditing.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Like dbg_hit_on(x) but first filter out events and
only when condition 'c' is true the hit counter
is tested with 'x'.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
There are subtle differences in the king evaluation
that should be clear to avoid misunderstandings.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Instead of manually adjust defines in bitboard.h
now proper ones are automatically set.
It is anyhow possible to still set them manually
in case of problems.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
It is more clear, at last for me.
Also cleanup evaluate_rook() and evaluate_queen()
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This removes code redundancy but perhaps
impact performance due to uninlining.
Testing for regression is needed. For now
aim to best code readibility.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
A bunch of Intel C++ warnings removed, other silent out.
Still few remaining but need deeper look.
Also usual whitespace crap removal noise.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Because razoring is reached 10% of times and about 50% of time
first two conditions are met we can save 5% of calls to the fairly
costly evaluate().
On the other side statistics have shown 95% of nodes that pass
the first two razoring conditions pass also the evaluate() test.
So the risk of dropping the third condition seems low enough.
Testing seems to validate this.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This time we use MSVC intrinsics that are
C wrappers for Intel assembler 'bsf' instruction.
The speed up in node count is around 3%, probably
it does not worth the effort. Anyway this patch
can be useful at least for documentation purposes.
This optimization covers 32 bit systems only.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Under Linux we have a segfault after a random time,
about a couple of minutes while running the benchmark.
This happens both with gcc and icc, and both with O2
and O3 optimizations.
Disable for Linux until we understand what's the deal.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Now I/O is fully done with C++ iostreams.
The only exception is in non-windows version
of Bioskey() in misc.cpp
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This final version is a little bit faster then
previous patch and is a bit cleaned up also.
On 32 bit x86 pop_1st_bit is now more then
two times faster then the original one that
is optimized for 64 bit processors.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>