Marco Costalba
c729e4e1ab
Forgot two conversion to new POPCNT interface
...
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-05-21 16:50:19 +02:00
Marco Costalba
e7d3a006cd
Enable POPCNT at runtime
...
Runtime detect POPCNT instruction support and
use it.
Also if POPCNT is not supported we don't add _any_ overhead so
that we don't lose any speed in standard case.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-05-21 16:41:31 +02:00
Marco Costalba
3376c68f4b
Introduce bitcount.h
...
It will be used for POPCNT intrinsics.
For now no bianry and functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-05-21 16:19:20 +02:00
Marco Costalba
4f7ec4128f
Retire count_1s_8bit()
...
Use the plain array lookup in the only place where it
is used. This remove an unecessary indirection and better
clarifies what code does.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-05-19 15:49:54 +01:00
Marco Costalba
1e4472b651
Small code style triviality in evaluation
...
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-05-19 15:41:45 +01:00
Marco Costalba
da579e46b7
Remove hardcode default values of UCI variables from evaluation
...
This is the same change we have already done in search.cpp,
this time for evaluation.cpp
If a variable will be populated reading an UCI option
then do not hard code its default values.
This avoids misleadings when reading the sources.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-05-19 15:35:12 +01:00
Marco Costalba
f83b899f39
Cache king shelter info in pawns structure
...
It does not change often and is not so fast
to calculate.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-05-17 10:23:24 +01:00
Marco Costalba
980124c609
Fix some Intel compilers warnings
...
Also a compile fix due to Makefile missing new
application.cpp file.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-05-09 12:09:25 +02:00
Marco Costalba
5c81602d14
Update copyright year
...
We are well in 2009 already.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-05-07 14:54:40 +02:00
Marco Costalba
a88e762b4e
Rewrite the way application exits
...
Centralize in a single object all the global resources
management and avoid a bunch of sparse exit() calls.
This is more reliable and clean and more stick to C++ coding
practices.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-05-07 12:59:19 +02:00
Marco Costalba
ef8acdc73b
Fix a small bug in king safety
...
Merged from iPhone Glaurung.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-03-22 13:11:24 +01:00
Marco Costalba
feb5342b39
Safe guard some wild and ugly casts
...
These casts are needed but plain ugly, at least be
sure they don't hide any subtle conversion bug.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-03-16 13:59:41 +01:00
Marco Costalba
b870f5a091
Silence a good bunch of Intel warnings
...
Note that some pawns and material info has been switched
to int from int8_t.
This is a waste of space but it is not clear if we have a
faster or slower code (or nothing changed), some test should be
needed.
Few warnings still are alive.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-03-15 18:19:08 +01:00
Marco Costalba
8de91be61e
Fix a silly warning on Intel compiler
...
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-03-15 18:18:42 +01:00
Marco Costalba
ca4e78db8d
Revert NULL move beta corrections
...
After testing result is bad -25 ELO
2009-03-15 16:44:12 +01:00
Marco Costalba
c8773c720a
Merge Joona Kiiski NULL search beta correction
...
Prune more moves after a null search because of
a lower beta limit then in main search.
In test positions reduces the searched nodes of 30% !!!!
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-03-14 13:00:22 +01:00
Marco Costalba
3ed603cd64
Merge Joona Kiiski evaluation tweaks
...
Merge tewaks to many evaluation parameters
by Joona Kiiski.
After test they seem good!
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-03-14 12:55:14 +01:00
Marco Costalba
72b88e09e1
Micro optimize previous patch
...
Also remove some Intel warnings, not all :-(
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-03-06 20:47:19 +01:00
Marco Costalba
3e663d8c50
Introduce evaluate_pieces<>() to remove redundancy
...
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-03-06 19:19:45 +01:00
Marco Costalba
7f4f18f959
Revert mobility of pinned pieces for now
...
We will redo after rewriting the handling of
pinned bitboard and its friends.
2009-02-19 15:49:54 +01:00
Marco Costalba
c45818e9f8
Remove xxx_of_color() for real
...
Remove also from assert expressions. Was hidden
in release mode.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-17 17:26:15 +01:00
Marco Costalba
9f5b709db7
Mobility is zero for a pinned piece
...
A little bit more overhead, but better mobility evaluation.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-17 11:29:14 +01:00
Marco Costalba
2c955f25de
Remove xxx_of_color() helpers
...
They hide the underlying uniform function call with
no benefit.
A little bit more verbose but now is clear what happens.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-17 10:54:47 +01:00
Marco Costalba
4b53bb02f6
Fix a very old bug in queen mobility
...
For queen mobility could be bigger then 15, so
we need count_1s() not count_1s_max_15().
This bug was introduced by patch:
"Group common evaluate code" of 24/9/2008
So it's almost 4 months and two release old!
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-01-10 16:11:33 +01:00
Marco Costalba
bdbbc4e06b
Rewrite evaluate_common() as a template
...
Seems to speed up this very hot path and code is
cleaner too.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-01-07 15:48:22 +01:00
Marco Costalba
5cacefe7c6
Another micro-optmization in valuate_passed_pawns()
...
very small gain, but still a gain at the cost of
an extra indentation level.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-01-07 15:47:31 +01:00
Marco Costalba
9b87d151bc
Fix a small bug in rook pawn evaluation
...
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-01-06 16:10:22 +01:00
Marco Costalba
cbfbf25d1b
evaluate_passed_pawns() micro-optmization
...
No functional change, only a bit faster.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-01-06 16:06:08 +01:00
Marco Costalba
90585a8a36
Final space inflate of evaluatio.cpp
...
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-01-06 15:59:08 +01:00
Marco Costalba
e236a0c652
Space inflate evaluate_passed_pawns()
...
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-01-06 15:49:33 +01:00
Marco Costalba
d0804341c5
Piece mobility: filter out squares protected by pawns
...
Do not consider squares protected by enemy pawns
in mobility evaluation.
This reduces the mobility value by about 15%
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-01-05 15:14:16 +01:00
Marco Costalba
e3b03f13b3
Passed pawns: consider enemy rooks or queens from behind
...
Merged from Glaurung 2.2
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-12-22 12:10:15 +01:00
Marco Costalba
54b7da120f
King safety: retire rook contact check
...
Merged from Glaurung 2.2
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-12-22 12:07:00 +01:00
Marco Costalba
61c6a3d5a0
Merge cosmetics from Glaurung 2.2
...
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-12-21 17:02:34 +01:00
Marco Costalba
31d4f0b734
Merge space weigth evaluation fromGlaurung 2.2
...
Is a new evaluation rule that gives bonus in midgame
to the side that has more space behind pawns for its
minor pieces.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-12-21 16:26:36 +01:00
Marco Costalba
9d5d69e435
Revert sigmoid interpolator
...
After deep test (1000 games) it seems do not improve anything,
actually seems slightly weaker.
So remove it for now.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-30 21:16:47 +01:00
Marco Costalba
af59cb1d63
Refactor Position::pinned_pieces() to use templates
...
Also better document this interesting function.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-24 21:10:04 +02:00
Marco Costalba
5dc2312121
Update copyright info
...
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-20 21:47:20 +02:00
Marco Costalba
760f77872f
Remove Positions::xxx_count() functions
...
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-20 21:47:18 +02:00
Marco Costalba
d4f14a8e83
Remove Position::xxx_list() functions
...
No useful, only obfuscating.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-20 21:47:17 +02:00
Marco Costalba
d9e54ceaa1
Prefer template to name decoration
...
This also allows faster code although bigger.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-20 21:47:16 +02:00
Marco Costalba
b00abed181
Space inflate evaluate_king()
...
This is the most complex piece of software
so far.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-26 05:54:49 +02:00
Marco Costalba
2e3faae067
Clarify difference between king zone and adjacent zone
...
There are subtle differences in the king evaluation
that should be clear to avoid misunderstandings.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-26 05:54:49 +02:00
Marco Costalba
453e815d4b
Tidy up quick_evaluate()
...
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-26 05:54:49 +02:00
Marco Costalba
3e0dc9ee84
Tidy up middle game specific evaluation
...
Also add starting position to benchmarks.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-26 05:54:49 +02:00
Marco Costalba
597ef38c39
Code style massage evaluate()
...
No functional changes.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-26 05:54:49 +02:00
Marco Costalba
3ee3cdc09b
Evaluate: weight_option() is static
...
Declare function under local namespace. This removes a
warning from the picky Intel compiler.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-24 21:17:28 +02:00
Marco Costalba
ca891e9760
Cleanup read_weights() in evaluate.cpp
...
Exception to 80 colums rule here, but result
seems better.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-24 21:02:16 +02:00
Marco Costalba
dfcfed6432
Evaluate: rename king attack variables
...
A better naming IMHO
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-24 21:02:15 +02:00
Marco Costalba
34ca22486a
Further cleanup evaluate()
...
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-24 21:02:15 +02:00