1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00:00
Commit graph

1280 commits

Author SHA1 Message Date
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
Marco Costalba
aedc6c6f1f Don't silently accept an option name mismatch
With this we could have found earlier the futility
name option bug!

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-12-28 12:37:13 +01:00
Marco Costalba
dae4e7df07 Tweak again futility margings
Lower margins near the leafs, higher at high depth.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-12-25 20:08:45 +01:00
Marco Costalba
96a32eec69 Expose new futility margin interface to UCI
Now futility margin it's actually a scale factor
to apply to the base ones.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-12-25 19:41:24 +01:00
Marco Costalba
e46d3670fd Tweak futility margins
Less prune at the bottom and at the middle, a bit more
at the top.

After 747 games: +215 =345 -187 +13 elo

Also introduced a vector of margins, now that start to be a lot
it is a more flexible solution.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-12-25 12:05:45 +01:00
Marco Costalba
8cd5cb930d Try razoring only for depth > OnePly
Because razoring verification after qsearch() cuts more
then 40% of candidates, do not waste a costly qsearch for
nodes at depth one that will be probably discarded anyway
by futility.

Also tight razoring conditions to keep dangerous false
negatives below 0,05%. Still not clear if it is enough.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-12-24 09:35:57 +01:00
Marco Costalba
2feb9d5100 Futility pruning till ply 6 included
Seems good:

After 796 games: +211 = 393 -192 +8 elo

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-12-24 09:34:09 +01:00
Marco Costalba
d11426c777 Fix a comment
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-12-23 12:02:10 +01:00
Marco Costalba
e96f56adfa Merge futility pruning from Glaurung 2.2
It seems much more powerful then previous one.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-12-23 12:01:48 +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