Marco Costalba
6656ed8904
Simplify attackUnits formula
...
Use '/ 8' instead of '* 31 / 256'
Passed STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 55077 W: 10999 L: 10940 D: 33138
And LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 14751 W: 2530 L: 2400 D: 9821
bench: 7911944
2015-02-17 08:23:35 +01:00
Marco Costalba
20a5c07472
Further simplify KingDanger init
...
And remove a tale whitespace while there.
No functional change.
2015-02-14 15:56:54 +01:00
Marco Costalba
e38eb2302d
Further simplify KingDanger init
...
And remove a tale whitespace while there.
No functional change.
2015-02-14 15:55:11 +01:00
Marco Costalba
0af24a1445
Sync with master
...
Bench: 7369224
2015-02-14 15:30:16 +01:00
snicolet
a8f9c7a790
Small bonus for all safe pawn pushes
...
Pawn flexibility: add a small bonus for all safe pawn pushes
STC:
LLR: 2.70 (-2.94,2.94) [-1.50,4.50]
Total: 18233 W: 3705 L: 3557 D: 10971
LTC:
LLR: 2.97 (-2.94,2.94) [0.00,6.00]
Total: 17684 W: 3042 L: 2854 D: 11788
Bench: 7369224
Resolves #253
2015-02-13 21:33:00 +00:00
Marco Costalba
c0a80afe89
Reformat tracing functions
...
No functional change.
2015-02-13 11:54:46 +01:00
hxim
44a571c1c7
Fix KingDanger[] array initialization
...
Use integer arithmetic instead of floating point arithmetic.
Floating point arithmetic was causing different results for some 32-bit compiles
No functional change
Resolves #249
Resolves #250
2015-02-09 22:02:35 +00:00
Marco Costalba
170bdf40cd
Rename dbg_hit_on_c() to dbg_hit_on()
...
Use an overload instead of a new named function.
I have found this handier and easier when adding
some quick debug code.
No functional change.
2015-02-07 11:18:06 +01:00
Marco Costalba
8b0fee9998
Rename dbg_hit_on_c() to dbg_hit_on()
...
Use an overload instead of a new named function.
I have found this handier and easier when adding
some quick debug code.
No functional change.
2015-02-07 11:15:38 +01:00
Stefan Geschwentner
18b0809639
Add bonus for pawn attack threats
...
Latent pawn attacks: Add a bonus to safe pawn pushes which attacks an
enemy piece. Based on an idea of Lyudmil Tsvetkov.
STC:
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 7925 W: 1666 L: 1537 D: 4722
LTC:
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 40109 W: 6841 L: 6546 D: 26722
Bench: 7696257
Resolves #240
2015-02-03 11:19:33 +08:00
NicklasPersson
ddccb5355c
Improved King Safety values
...
From an SPSA-session on king safety.
STC:
ELO: 3.21 +-2.1 (95%) LOS: 99.8%
Total: 40000 W: 8181 L: 7812 D: 24007
LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 47765 W: 8091 L: 7785 D: 31889
Bench: 8589262
Resolves #241
2015-02-03 04:00:52 +08:00
NicklasPersson
7837fb2aca
King safety tuning with values obtained by SPSA.
...
Part I:
LTC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 11529 W: 2075 L: 1882 D: 7572
Part II:
LTC:
ELO: 2.07 +-2.1 (95%) LOS: 97.3%
Total: 34859 W: 5967 L: 5759 D: 23133
Bench: 7374604
Resolves #228
2015-01-28 21:05:21 +00:00
Marco Costalba
42b48b08e8
Update copyright year
...
No functional change.
2015-01-10 11:46:28 +01:00
lucasart
a6e292034a
Remove a useless optimization
...
This optimization is aimed at old hardware only (withouth popcount), and even on
non popcount compile (ARCH=x86-64), it provides no mesurable speedup:
stat test master diff
mean 2,341,779 2,354,699 -12,920
stdev 12,910 14,770 18,150
speedup -0.55%
P(speedup>0) 23.8%
No functional change.
Resolves #187
2015-01-03 20:40:57 +00:00
Joona Kiiski
c7332d5610
Smoother king safety
...
STC:
LLR: 4.03 (-2.94,2.94) [-1.50,4.50]
Total: 35707 W: 7352 L: 7106 D: 21249
LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 24563 W: 4330 L: 4095 D: 16138
Bench: 8411409
Resolves #190
2015-01-03 20:34:20 +00:00
Marco Costalba
91cc82aa25
Let material probing to access per-thread table
...
It is up to material (and pawn) table look up
code to know where the per-thread tables are,
so change API to reflect this.
Also some comment fixing while there
No functional change.
2015-01-02 21:31:02 +01:00
Stefan Geschwentner
25b492ab58
Big King Safety tuning
...
All king safety related terms (shelterweakness, stormdanger,
attackunits, ..) was tuned together. Additionally for attack units a
finer granularity (factor 4) is used.
STC
ELO: 9.22 +-3.1 (95%) LOS: 100.0%
Total: 19514 W: 4340 L: 3822 D: 11352
LTC
LLR: 2.96 (-2.94,2.94) [0.00,6.00]
Total: 6399 W: 1192 L: 1056 D: 4151
Bench: 8224782
Resolves #184
2015-01-03 03:33:02 +08:00
Marco Costalba
4c9b423161
Retire Material::space_weight()
...
Move all in evaluation.
Simplify the code and concentrate in a single place
all the logic behind space evaluation, making it much
more clear.
Verified also at STC it does not regress due to a possible
slow down:
LLR: 3.91 (-2.94,2.94) [-3.00,1.00]
Total: 65744 W: 13285 L: 13194 D: 39265
No functional change.
2015-01-02 10:02:28 +01:00
Marco Costalba
6933f05f4b
Use score and value consistently
...
And other assorted small fixing, code style
tweaks and reshuffles in evaluate.cpp
No functional change.
2014-12-28 19:06:56 +01:00
Marco Costalba
9cae6e66ce
Don't account for Tempo in specialized endgames
...
The evaluation is already done by the specialized
function, don't need to add something elese later.
With this patch following positions are evaluated
correctly as draws:
8/6p1/1Pkp1p1p/2nNn2P/2P1K1P1/8/8/3B4 w - - 7
8/1k4p1/1P1p1p1p/3NnK1P/2P3P1/1n6/4B3/8 w - -
Verified it not regress with an STC test:
LLR: 3.15 (-2.94,2.94) [-3.00,1.00]
Total: 49812 W: 10095 L: 10016 D: 29701
Reported by Arjun Temurnikar.
bench: 8289983
2014-12-19 11:06:40 +01:00
Jonathan Calovski
48127fe5d3
Amend defended
...
Amend defended to remove now redundant condition.
No functional change.
Resolves #125
2014-11-22 05:46:59 +08:00
hxim
0a1f54975f
Fix some comments
...
No functional change.
Resolves #123
2014-11-19 06:39:17 +08:00
Marco Costalba
57fdfdedcf
Assorted code-style triviality
...
No functional change.
2014-11-09 20:17:29 +01:00
Marco Costalba
6fb0a1bc40
Introduce distance() and unify some API
...
Original work by Lucas.
No functional change.
2014-11-09 10:27:04 +01:00
lucasart
8e98bd616e
Apply King Safety later in the endgame
...
Idea is to apply king safety later in the endgame. Previously, we didn't
apply KS in a RR vs. Q ending for example, which causes poor play.
Now we calculate king attacks when the attacking side has a queen or more.
STC with 8moves_v3
LLR: 3.06 (-2.94,2.94) [0.00,4.00]
Total: 38481 W: 6228 L: 5952 D: 26301
LTC with 2moves_v1
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 51053 W: 8670 L: 8353 D: 34030
Bench: 7514010
Resolves #98
2014-11-06 13:01:47 -05:00
Ajith
0608d6aaec
Add bonuses for each threat instead of max threat value.
...
Use SPSA tuned values for all threat bonuses
STC
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 6074 W: 1284 L: 1160 D: 3630
LTC
LLR: 2.97 (-2.94,2.94) [0.00,6.00]
Total: 13563 W: 2402 L: 2232 D: 8929
Bench: 6981908
Resolves #94
2014-11-04 23:50:54 +08:00
Marco Costalba
42a20920e5
Retire ScalePawnSpan[]
...
Obscure, undocmented and misnamed array. Replace with
the direct formula: it is much more clear what the
code does.
No functional change.
Resolves #90
2014-11-01 22:10:25 +00:00
lucasart
2ee1250294
Remove dead code
...
No functional change.
Closes #87
2014-11-01 20:16:29 +00:00
Marco Costalba
460892382a
Code style clean-up
...
This piece of code needs some love.
No functional change.
2014-10-30 12:32:43 +01:00
mstembera
5605cc7684
max_piece_type cleanup, and slight speed increase.
...
No functional change.
Resolves #81
2014-10-28 22:23:01 +08:00
Joona Kiiski
7d42752158
A small clean up of previous patch suggested by Marco
...
No functional change
2014-10-27 20:26:12 +00:00
Joona Kiiski
fefb27bab4
Speed up max_piece_type()
...
Write code in the way that allows compiler to perform loop unrolling.
My measurement (32 cycles each):
Orig:
Time (Mean: 2466.59375, Trimmed mean: 2464.25, Std: 12.6869487803348)
Nodes (Mean: 4294458, Trimmed mean: 4294458, Std: 0)
Speed (Mean: 1741.09247987678, Trimmed mean: 1742.72879715475, Std: 8.93612608292678)
Time (Mean: 2470.15625, Trimmed mean: 2468.75, Std: 12.7484581610433)
Nodes (Mean: 4294458, Trimmed mean: 4294458, Std: 0)
Speed (Mean: 1738.58176151341, Trimmed mean: 1739.54618465403, Std: 8.95585822316946)
Mod:
Time (Mean: 2449.90625, Trimmed mean: 2445.9375, Std: 12.1000116635508)
Nodes (Mean: 4294458, Trimmed mean: 4294458, Std: 0)
Speed (Mean: 1752.94829372932, Trimmed mean: 1755.75934908231, Std: 8.61478453124504)
Time (Mean: 2442.78125, Trimmed mean: 2441.1875, Std: 8.17839157228837)
Nodes (Mean: 4294458, Trimmed mean: 4294458, Std: 0)
Speed (Mean: 1758.03872783803, Trimmed mean: 1759.16825356261, Std: 5.81131316346191)
No functional change
2014-10-27 20:25:57 +00:00
Marco Costalba
5cbcff55cc
Rename ucioption.h to uci.h
...
We are going to add all UCI related
functions here, so first rename it
to a more proper name.
No functional change.
2014-10-26 19:39:46 +00:00
Marco Costalba
4f6b1bf3be
Reformat max_threat()
...
Helper function should just know how to find the
biggest piece type in a bitboard. All the threat
logic and data shoud be in evaluate_threats().
This nicely separates the scope of the two functions
in a more consistent way and simplifies the code.
No functional change.
2014-10-26 09:12:56 +00:00
snicolet
8d62ece945
Calculate maximum threat for hanging pieces
...
Use the max_threat() helper function to estimate more precisely the
best hanging piece threat. Also retunes the Threat array using SPSA.
STC
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 7598 W: 1596 L: 1468 D: 4534
LTC
LLR: 2.97 (-2.94,2.94) [0.00,6.00]
Total: 7896 W: 1495 L: 1350 D: 5051
Bench: 6816504
Resolves #73
2014-10-24 01:10:11 +08:00
Marco Costalba
89d9db2979
Rename Tracing methods
...
Easier to understand and more in line with
standard Trace classes naming like:
http://msdn.microsoft.com/en-us/library/system.diagnostics.trace.aspx
No functional change.
2014-10-12 20:35:19 +01:00
Marco Costalba
907f912463
Account for Tempo in do_evaluate()
...
This is more correct because we let evaluate()
to be a pure dispatcher and also now evaluate
and tracing outputs are consistent.
No functional change.
2014-10-12 20:35:07 +01:00
lucasart
069073ea68
Merge Connected and Candidate
...
These two notions are very correlated. Since connected has the most
generality, it makes sense to generalize it to encompass what is
covered by candidate.
STC:
LLR: 4.03 (-2.94,2.94) [-3.00,1.00]
Total: 11970 W: 2577 L: 2379 D: 7014
LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 13194 W: 2389 L: 2255 D: 8550
bench 7328585
2014-10-07 07:42:17 +01:00
Ajith
4b926f227d
Extend King Threats to all pieces (other than pawns).
...
STC
LLR: 2.99 (-2.94,2.94) [-1.50,4.50]
Total: 20559 W: 4261 L: 4095 D: 12203
LTC
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 75232 W: 13097 L: 12696 D: 49439
Bench: 7543790
Resolves #63
2014-10-04 03:54:12 +08:00
Marco Costalba
a1b62d68ec
Trivial code style fixes
...
Mainly to sync mine and official repo.
No functional change.
2014-09-30 09:05:20 +02:00
uriblass
fed3e752ae
Evaluate king safety when no queen is present.
...
LLR: 2.97 (-2.94,2.94) [-1.50,4.50]
Total: 16657 W: 3547 L: 3391 D: 9719
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 31258 W: 5664 L: 5403 D: 20191
Bench: 8331165
Resolves #51
2014-09-22 01:32:47 +08:00
Gary Linscott
766fb9c67d
Fix spacing.
...
No functional change.
2014-09-22 01:27:34 +08:00
Marco Costalba
b652720903
Rearrange evaluation constants definitions
...
Make them more uniform and consistent.
No functional change.
Conflicts:
src/evaluate.cpp
2014-09-21 08:26:25 +08:00
mbootsector
2eec710318
King-pawn threat bonus for endgames.
...
STC:
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 10224 W: 1765 L: 1638 D: 6821
LTC:
LLR: 2.96 (-2.94,2.94) [0.00,6.00]
Total: 6923 W: 1027 L: 899 D: 4997
bench 7818100
Resolves #49
2014-09-19 22:36:05 +08:00
lucasart
5adc678628
Document Threat[] indices
...
From Marco's repo.
No functional change.
2014-07-30 07:06:48 +08:00
David Zar
4758fd31b1
Outpost tuning
...
double mg bonus and half eg bonus.
STC:
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 18142 W: 3094 L: 2948 D: 12100
LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 83561 W: 11706 L: 11329 D: 60526
bench 7831429
2014-07-23 07:05:10 +08:00
Marco Costalba
896bd917f8
Simplify evaluate_passed_pawns
...
From a suggestion by David Zar.
No functional change.
2014-07-15 20:59:32 +08:00
David Zar
a9b8e8b931
Bonus passed pawn blocked by our pieces
...
passed STC:
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 63965 W: 10950 L: 10692 D: 42323
and LTC:
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 19237 W: 2740 L: 2562 D: 13935
bench: 7477963
2014-07-14 21:19:07 +08:00
joergoster
ac7780bd35
Tune trapped rook penalty
...
Passed STC
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 15687 W: 3352 L: 3199 D: 9136
and LTC (parameter tweaks)
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 27983 W: 5046 L: 4797 D: 18140
bench: 8330705
2014-07-03 19:38:54 +08:00
Ajith
6b354305e1
Add bonuses for Minors attacking enemy pieces(except pawns) even when they are protected by enemy pawns.
...
Patch passed STC
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 8206 W: 1426 L: 1304 D: 5476
and LTC
LLR: 2.97 (-2.94,2.94) [0.00,6.00]
Total: 19534 W: 2821 L: 2640 D: 14073
Bench: 9942172
2014-06-30 10:55:10 -04:00