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

503 commits

Author SHA1 Message Date
Joona Kiiski
61a6e46664 Fix indentations for hanging pawns code
No functional change
2015-03-29 08:54:25 +01:00
Ajith
63500274db Give a reduced bonus for threats by hanging pawns
Passed STC:
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 105539 W: 20389 L: 20001 D: 65149

and LTC:
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 9629 W: 1577 L: 1432 D: 6620

Bench: 7658627

Resolves #317
2015-03-29 07:28:47 +08:00
joergoster
966bc477af Tuned mobility with another SPSA run
Further improved mobility values after another SPSA session, 50k
iterations.

Elo measure at very fast 9+0.05":
ELO: 3.40 +-2.2 (95%) LOS: 99.9%
Total: 40000 W: 8434 L: 8042 D: 23524

and LTC SPRT[0, 4]:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 11052 W: 1874 L: 1687 D: 7491

Bench: 8226843

Resolves #301
2015-03-20 08:08:21 +08:00
joergoster
a4b98a052e New values for Mobility and Outposts.
Both are the result of a SPSA tuning session with a custom book, 50k iterations each.

After an additional tuning session of the mobility values, tuning the delta values, with following result.

40k games at 9+0.05:
ELO: 4.13 +-2.2 (95%) LOS: 100.0%
Total: 40000 W: 8581 L: 8106 D: 23313

and LTC
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 36518 W: 6049 L: 5782 D: 24687

Bench: 8567402

Resolves #284
2015-03-14 21:35:52 +00:00
Marco Costalba
0da7295795 Sync with master
bench: 8285241
2015-02-28 20:22:28 +01:00
Stéphane Nicolet
9369f4963d Raise penalty for knight attacked by pawn
Raise a bit the penalty for knight attacked by pawn.

STC:
LLR: 2.97 (-2.94,2.94) [-1.50,4.50]
Total: 27744 W: 5563 L: 5380 D: 16801

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 87571 W: 14747 L: 14314 D: 58510

Bench: 8285241

Resolves #270
2015-03-01 00:58:32 +08:00
Marco Costalba
a459709fcc Retire apply_weight()
Use the more natural operator*() instead.

No functional change.
2015-02-27 10:38:12 +01:00
Marco Costalba
8d16111ffd Sync with master
bench: 8253813
2015-02-22 14:20:23 +01:00
Stéphane Nicolet
41ccc885ec Fix comment for kingAdjacentZoneAttacksCount
The comment for kingAdjacentZoneAttacksCount[] was bogus, using
reversed semantics for color.

No functional change

Resolves #262
2015-02-20 19:59:26 +00:00
snicolet
2f46592736 Mobile phalanxes
Try to create mobile phalanxes

STC:
LLR: 2.97 (-2.94,2.94) [-1.50,4.50]
Total: 52393 W: 10912 L: 10656 D: 30825

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,6.00]
Total: 30398 W: 5315 L: 5063 D: 20020

Bench: 8253813

Resolves #261
2015-02-20 19:56:57 +00:00
Marco Costalba
40548c9153 Sync with master
bench: 7911944
2015-02-20 10:37:29 +01:00
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