1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-02 09:39:36 +00:00
Commit graph

872 commits

Author SHA1 Message Date
Marco Costalba
be2925b3c5 Restore user weights to 100
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-06-24 10:31:03 +01:00
Marco Costalba
d494725400 Spell fix in evaluate.cpp
Spotted by Eelco.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-07 10:08:53 +01:00
Marco Costalba
f7fee4c616 Fix a warning in debug mode
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-03 19:29:21 +01:00
Marco Costalba
b1929960f9 Fix bug in evaluate_passed_pawns()
If blockSq is already on rank 8, blockSq + pawn_push(Us) is on rank 9,
outside of board. It does not make sense to measure king distance to
a field outside the board.

Bug spotted by Fruity:
http://open-chess.org/viewtopic.php?f=5&t=1156&start=10

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-03 12:10:53 +01:00
Marco Costalba
8447248705 Retire "Pawn Structure" UCI option
Almost useless for the user and now is in sync with
the material value that is already weighted.

A small speedup of 0,4% because we avoid an apply_weight()
call in a fast path.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-02 17:50:46 +01:00
Marco Costalba
a10487b074 Rename stuff in evaluate.cpp
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-02 17:50:37 +01:00
Marco Costalba
db31efb8a6 Additional tweaks in evaluate_unstoppable_pawns()
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-01 12:15:40 +01:00
Marco Costalba
75acd52415 Remove redundancy in evaluate_unstoppable_pawns()
Spotted by Fruity
http://open-chess.org/viewtopic.php?f=5&t=1156&start=20

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-01 10:31:27 +01:00
Marco Costalba
18c9b5ee86 Small reformat in evaluate_unstoppable_pawns()
Also simplify tracing because evaluate_unstoppable_pawns()
return always zero if both colors have non pawn material.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-01 09:58:45 +01:00
Marco Costalba
4dc7ba1619 Rename check related functions
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-29 18:56:48 +01:00
Marco Costalba
05cfb00f26 Large API rename in ThreadsManager
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-25 10:30:39 +01:00
Marco Costalba
fecefbb99c Move pawn and material tables under Thread class
This change allows to remove some quite a bit of code
and seems the natural thing to do.

Introduced file thread.cpp to move away from search.cpp a lot
of threads related stuff.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-24 17:07:22 +01:00
Marco Costalba
633c83f648 Document why we use per-thread pawn and material tables
Arisen from a discussion on talkchess.

No fnctional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-24 08:18:39 +01:00
Marco Costalba
068561f86a Small simplification in scale_by_game_phase()
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-17 10:31:26 +01:00
Marco Costalba
6738b65be9 Prefetch also material tables
Prefetch both pawn and material tables in do_move() and
prefetch always, not only after a pawn move or a capture.

Speed up of 0,7%

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-11 12:24:02 +01:00
Marco Costalba
bd33766da0 Add evaluation tracing code
This patch is based on Justin Blanchard's original
work and allows to breakdown evaluation in its sub terms and
show to the user.

Tracing code has zero speed impact when not used.

Note that tracing code is not thread-safe, but this
should not be a problem given the typical usage scenario.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-02-26 14:26:27 +01:00
Marco Costalba
dd718d92a7 Correctly round evaluation to grain size
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-02-23 23:52:51 +01:00
Marco Costalba
2ff2b59727 Rename piece_of_color_and_type() to make_piece()
To be aligned with make_square()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-02-23 18:42:35 +01:00
Marco Costalba
deb212cb05 Retire enum SquareDelta
Use Square instead. At the end is the same because we were
anyway foreseen operators on mixed terms (Square, SquareDelta).

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-02-23 18:41:35 +01:00
Marco Costalba
45acec1865 Retire some unused functions in bitboard.h
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-19 13:33:26 +01:00
Marco Costalba
f200f3ccd2 Another attempt at fixing Chess960
Keep the isChess960 flag inside Position so that is
copied with the Position, but esplicitly highlight the
fact that a FEN string has not enough information to detect
Chess960 in general case. To do this add a boolean argument
isChess960 to from_fen() function so to self document this
shortcoming of FEN notation.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-03 22:50:38 +01:00
Tord Romstad
d5f2e32b5c Reintroduce the old "trapped bishop in the corner" evaluation term
for Chess960 games.

After 1918 games at 30"
Mod - Orig: 1052-866 (+532,-346,=1040), Elo +33.8
2011-01-03 22:32:57 +01:00
Marco Costalba
4d6258bb32 Implement "seldepth" UCI info
This is the "selective search depth in plies" and we set
equal to PV line length.

Tested that works under FritzGUI.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-12-31 14:27:24 +01:00
Joona Kiiski
8a858aea34 New try for unstoppable pawn evaluation
This time we try very hard to avoid false positives.
The obvious downside is that we also miss many true
winning positions.

After 10544 games on RC
Mod- Orig:  1744  - 1646 - 7154 ELO +3 (+- 2.7) LOS 83%

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-12-04 09:07:45 +01:00
Marco Costalba
bacb645939 Rewrite options handling in an object oriented fashion
Big rewrite and about 100 lines removed.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-11-05 06:10:05 +01:00
Marco Costalba
ff95bbd41f Use margins[] array in evaluate
It will be used by future patches.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-10-30 14:24:19 +01:00
Marco Costalba
85a7456bd7 Fixed some warnings when using -Weffc++ gcc option
Plus some other icc warnings popped up with new and strictier
compile options.

No functional and speed change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-10-16 15:00:20 +01:00
Marco Costalba
2feeb206ff Use VALUE_DRAW instead of VALUE_ZERO where better
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-10-10 09:05:46 +01:00
Marco Costalba
f00c976bb2 Retire updateKingTables[]
Suggested by Marek Kwiatkowski.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-10-06 19:28:27 +01:00
Marco Costalba
1bbbc13b46 Skip ei.kingZone[] initialization together with king safety
Another microptimization by Marek Kwiatkowski.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-10-05 22:32:53 +01:00
Marco Costalba
1ee1d852fe Skip an useless compare in space evaluation
Spotted by Marek Kwiatkowski.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-10-05 22:16:09 +01:00
Marco Costalba
d4876dc963 Rewrite bit counting functions
Get rid of macros and use templates instead,
this is safer and allows us fix the warning:

ISO C++ forbids braced-groups within expressions

That broke compilation with -pedantic flag under
gcc and POPCNT enabled.

No functional and no performance change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-10-04 18:40:44 +01:00
Marco Costalba
7305b56957 Shrink OutpostBonus[] definition
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-09-25 11:12:55 +01:00
Marco Costalba
045beac156 Simplify scale factors implementation
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-09-24 12:56:45 +01:00
Marco Costalba
0e3535ea23 Rename no_mob_area in mobilityArea
It is the correct name.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-09-24 12:56:38 +01:00
Marco Costalba
debc815352 We need just one eval margin in search
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-09-14 18:06:10 +01:00
Marco Costalba
dd8a076128 Reintroduce rook contact checks
Were removed when merged from Glaurung 2.2, but without
any test.

Note that weight has been increased from original 2 to 4 and
has been also fixed a bug where in the original version were
considered also diagonal sqaures for the rook, that are
contact squares but not checks.

After 4449 games at 30"+0.1
Mod - Orig:  717 - 649 - 3083  ELO +5 (+- 4.1)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-09-14 13:48:26 +01:00
Marco Costalba
4143d00011 Increase QueenContactCheckBonus
And also other check bonuses.

After 4272 games on russian cluster at 30"+0.1
Mod - Orig:  711 - 612 - 2949  ELO +8 (+- 4.2)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-09-13 00:10:48 +01:00
Marco Costalba
1a2768705a Do not update king tables when we skip king safety
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-09-12 14:28:07 +01:00
Joona Kiiski
fa2478a81f Retire pawn storm evaluation
More then 100 lines of almost useless evaluations. Prefer
code semplification to a very small and dubious advantage.

After 7457 games on russian cluster:
Mod - Orig: 1285 - 1334 - 4838  ELO -2 (+- 3.2)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-09-11 09:46:00 +01:00
Marco Costalba
2a2353aac6 Speed up updateShelter()
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-08-26 18:52:53 +02:00
Marco Costalba
1b4084b4a5 Assorted code style in evaluation.cpp
Renaming, cleanu up, etc.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-08-26 13:47:38 +01:00
Marco Costalba
c7dd9b8d0c Finally remove value from EvalInfo
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-08-26 13:47:29 +01:00
Marco Costalba
9ee42d83b6 Remove dependency from ei.value in evaluate functions
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-08-26 13:41:28 +01:00
Marco Costalba
3107e68c03 Remove margin[] from EvalInfo
Directly pass arguments to king evaluation.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-08-26 13:41:28 +01:00
Marco Costalba
d4250c52f0 Remove MaterialInfo* from EvalInfo
Use a local variable instead.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-08-26 13:41:27 +01:00
Marco Costalba
15d265cc66 Change evaluate() signature
Hide EvalInfo and return just the score and the margin.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-08-26 13:41:26 +01:00
Marco Costalba
fff59319b0 Retire attackedBy[] access functions
Currently are used by evaluation itself and the
whole EvalInfo will be removed from global visibility
by next patch, so no reason to use them.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-08-26 13:41:26 +01:00
Marco Costalba
c7a932bc74 Rename ei.kingDanger in ei.margin
It will be more clear when we will go to add stuff
apart from king danger itself.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-08-24 19:16:03 +01:00
Marco Costalba
00469d1798 Call apply_weight() only once in passed pawns evaluation
First accumulate the bonus for each pawn, then call the
not very fast apply_weight().

Should be no functional change apart from rounding issues.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-08-24 19:13:13 +01:00