Marco Costalba
214f9dcc27
generate_evasions() avoid an usless check for enpassant case
...
Remove ugly and useless code.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-11 19:01:26 +01:00
Marco Costalba
1dc1cecf01
Optimize generate_piece_blocking_evasions()
...
Rewrite as in generate_piece_moves() using a for
loop instead of the slower serializing of the
bitboard with pop_1st_bit()
This will allow also to merge with generate_piece_moves()
when we will drop legality constrain on generate_evasions()
Generated moves are not changed, but are generated in a
different order, this changes the number of nodes at fixed
depth test.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-11 19:01:06 +01:00
Marco Costalba
67535711e8
generate_evasions() avoid to calculate pinned pieces
...
Pass as function argument.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-11 19:00:52 +01:00
Marco Costalba
56f607fe0f
Drop a double semicolon
...
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-11 19:00:35 +01:00
Marco Costalba
9d044cf4ee
Last touches to movegen.cpp
...
Of course no functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-10 19:01:51 +01:00
Marco Costalba
769f2fdecb
Remove special case of pawn checks generation
...
Also additional renaming.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-10 19:01:49 +01:00
Marco Costalba
9bffe811c4
Remove special case of pawn move generatation
...
Code cleanup. No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-10 19:01:47 +01:00
Marco Costalba
3e20c6c07d
Simplify generate_evasions()
...
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-10 19:01:45 +01:00
Marco Costalba
4f5f97107e
Simplify generate_checks()
...
Also rearrange signatures to be uniform.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-10 19:01:43 +01:00
Marco Costalba
151d47dc85
Micro-optimize do_generate_pawn_checks()
...
Discovery check candidates are normally empty, so
avoid discovery checks generation in that common case.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-10 19:01:41 +01:00
Marco Costalba
33ddeec5e0
Templetize generate_piece_checks_king()
...
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-10 19:01:39 +01:00
Marco Costalba
4573d618e4
Small optimization in generate_evasions()
...
Find squares attacked by slider checkers, we will
remove them from king evasions set so to avoid a couple
of cycles in the slow king evasions legality check loop.
Not a biggie, but now generate_evasions() is faster then
generate_non_captures(), before was slower.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-07 13:26:57 +01:00
Marco Costalba
1156eb865b
Simplify newly introduced castling_is_check()
...
Use bit_is_set() instead of open coding.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-07 13:26:50 +01:00
Marco Costalba
76381cbd69
Small code style tidy up
...
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-07 13:26:42 +01:00
Marco Costalba
fa322b3768
Fix casting warnings under Intel Compiler
...
Int to Char warning fixed changing the function
signature to int.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-07 13:26:29 +01:00
Marco Costalba
2ea7449f2a
Fix Makefile
...
Was broken after we removed color.cpp and square.cpp
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-07 13:26:17 +01:00
Marco Costalba
ee6e8851be
Templetize generate_castle_moves()
...
Cleanup the code and remove lines.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-06 07:14:38 +01:00
Marco Costalba
03211296f1
Add generation of castling checks
...
When we generate checks one case is missing: generation
of castling moves that give check to the opponent king.
This is a very rare case but anyway it is a case
and we can do this without slowing down the common
case of no castling checks.
So this is the patch.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-06 07:14:16 +01:00
Marco Costalba
cc76951483
Remove square.cpp
...
Move the few stuff in square.h
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-04 19:41:56 +01:00
Marco Costalba
f0858cd229
Move constants from piece.cpp to piece.h
...
Leave in piece.cpp only a couple of functions that
need #include <cstring>
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-04 19:41:38 +01:00
Marco Costalba
225d89c51b
PawnInfo::clear() retire memset() and fix Ubuntu compile
...
Go back to original direct assignment, this allows to
add an include in pawns.h to teach about memset()
This fix a compile error under Ubuntu.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-04 19:41:17 +01:00
Marco Costalba
8bef9e59a0
Remove the useless color.cpp
...
Integrate the only (inline) function in color.h
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-04 19:40:43 +01:00
Marco Costalba
82bf08e4f2
Final endgame.cpp space inflate
...
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-04 19:40:31 +01:00
Marco Costalba
c32904f0a0
Revert previous commit.
...
Optimization is correct but slightly slower
so it is a pessimization :-)
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-02-04 19:40:09 +01:00
Marco Costalba
6cfb661ca5
Yet another count_1s() optimization
...
No functional change
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-01-25 19:29:15 +01:00
Marco Costalba
be43219136
Rever count_1s() optimizations
...
They are wrong for all ones case.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-01-25 18:00:57 +01:00
Marco Costalba
d5b77ad45e
MovePicker, remove a variable
...
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-01-25 13:52:35 +01:00
Marco Costalba
c6d62b7da5
MovePicker::find_best_index() never returns -1
...
So avoid checking for it.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-01-25 13:36:59 +01:00
Marco Costalba
3e6e57231e
Rewrite count_1s() to be similar to 64bit counterpart
...
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-01-11 17:15:18 +01:00
Marco Costalba
14c1fd4d27
Micro optimize count_1s_max_15() for 32 bit system
...
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-01-11 17:05:29 +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
ec2927286a
Start to space inflate endgame.cpp
...
Still a lot to do, it's a big file!
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-01-08 15:46:57 +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
539051b1e0
Big trailing whitespace cleanup part 2
...
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-01-07 15:48:11 +01:00
Marco Costalba
c97104e854
Big trailing whitespace cleanup part 1
...
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-01-07 15:47:59 +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
dc4e2d8184
Take in account odd depths in razoring formula
...
This is somewhat taken from Stockfish 1.2 Default,
only the razoring thresold are updated, not the
razoring depth.
At the end razoring is a bit more aggressive. Results
seems slightly positive.
After 999 games +239 =536 -224 Elo +5
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-01-05 12:41:27 +01:00
Marco Costalba
e828753a3a
Fix dbg_mean_of() to enable statistics when called
...
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-12-30 12:54:21 +01:00
Marco Costalba
33bb8305a9
Restore development versioning and LSN filtering
...
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-12-30 12:42:23 +01:00
Marco Costalba
cc3c1dc25a
Stockfish 1.2 optimistic
...
Optimistic razoring settings. It is stronger with
most engines but weaker with someones.
The default is instead more solid and uniform with all
the opponents.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-12-29 12:24:34 +01:00
Marco Costalba
11763d2b7f
Stockfish 1.2
...
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-12-29 12:18:49 +01:00
Marco Costalba
d99a95df29
Micro optimization in extension()
...
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-12-29 12:18:36 +01:00
Marco Costalba
0da1d6a846
Remove a gcc warning on an unused variable
...
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-12-29 12:18:23 +01:00
Marco Costalba
5d94305af3
Properly handle odd depths in razor formula
...
A little bit more aggressive, but should be more
in line with the depths logic.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-12-28 19:38:44 +01:00
Marco Costalba
e4fd9a2df7
Safer razoring formula
...
Add also the possibility to razor at ply one.
It is disable dby default but it seems stronger
against Stockfish itself. It is still not clear if
is stronger against other engines. By now leave
disabled.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-12-28 12:55:33 +01:00