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

4064 commits

Author SHA1 Message Date
VoyagerOne
30c583204f Singular extension and check extension tweak
If singular extension fails to trigger extension then don't consider check extension.

STC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 69428 W: 12663 L: 12271 D: 44494

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 44023 W: 5875 L: 5612 D: 32536

Bench: 6170444

Closes #1043
2017-03-25 10:13:25 -07:00
VoyagerOne
352bd6f5aa Skip quiet moves based on moveCount pruning threshold and history stats
If we can moveCountPrune and next quiet move has negative stats,
then go directly to the next move stage (Bad_Captures).

Reduction formula is tweaked to compensate for the decrease in move count that is used in LMR.

STC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 6847 W: 1276 L: 1123 D: 4448

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 48687 W: 6503 L: 6226 D: 35958

Bench: 5919519

Closes #1036
2017-03-18 15:44:49 -07:00
Joost VandeVondele
c80d52c845 History stat bonus: Move condition to bonus calculation
about 0.5% speedup.

No functional change

Closes #1034
2017-03-17 14:46:47 -07:00
joergoster
c076216a32 Pawns count imbalance table
Instead of having a continuous increasing bonus for our number of pawns when calculating imbalance, use a separate lookup array with tuned values.
Idea by GuardianRM.

STC
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 16155 W: 2980 L: 2787 D: 10388

LTC
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 100478 W: 13055 L: 12615 D: 74808

Bench: 6128779

Closes #1030
2017-03-17 14:41:08 -07:00
Marco Costalba
a6d6a2c2fa Assorted code style fixes
No functional change

Closes #1029
2017-03-14 21:02:21 -07:00
mstembera
d01b66ae8f Fix pawn entry prefetch
No functional change

Closes #1026
2017-03-14 20:56:26 -07:00
snicolet
c3d2e6aba9 Helper functions to count material for both sides
Syntactic sugar: helper functions to count material or pieces for both sides.

No functional change

Closes #1025
2017-03-08 18:45:38 -08:00
Joost VandeVondele
d490bb9973 Always have counterMoves associated
Simplifies away all associated checks, leading to a ~0.5% speedup.
The code now explicitly checks if moves are OK, rather than using nullptr checks.

Verified for no regression:

LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 32218 W: 5762 L: 5660 D: 20796

No functional change

Closes #1021
2017-03-08 18:35:23 -08:00
pb00068
cc76524c2e Further simplify skipping of plies with threads
No functional change

Closes #1020
2017-03-08 18:03:01 -08:00
VoyagerOne
3627348e2b Allow pruning advance pawn pushes if not near endgame
STC:
LLR: -2.95 (-2.94,2.94) [0.00,5.00]
Total: 101088 W: 18016 L: 17717 D: 65355

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 61194 W: 8108 L: 7791 D: 45295

Bench: 5803228

Closes #1023
2017-03-05 18:58:06 -08:00
snicolet
728ce2195c Speed-up some arrays reading
This patch removes the empty rows at the beginning and at the end of
MobilityBonus[] and Protector[] arrays:

• reducing the size of MobilityBonus from 768 bytes to 512 bytes
• reducing the size of Protector from 1024 to 512 bytes

Also adds some comments and cleaner code for the arrays in pawns.cpp

No speed penalty (measured speed-up of 0.4%).

No functional change.

Closes #1018
2017-03-05 18:20:27 -08:00
Joost VandeVondele
1810c4d758 Simplify skipping of plies with helper threads
Replaces the HalfDensity array with an equivalent, compact implementation.
Includes suggestions by mcostalba & snicolet.

No functional change

Closes #1004
2017-02-26 16:41:58 -08:00
snicolet
8f7e032b8c Change definition of "weak" in threats calculation
By defining "strongly protected" as "protected by a pawn, or protected
by two pieces and not attacked by two enemy pieces".

Passed STC:
LLR: 2.97 (-2.94,2.94) [0.00,5.00]
Total: 17050 W: 3128 L: 2931 D: 10991

Passed LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 120995 W: 15852 L: 15343 D: 89800

Bench : 6269229

Closes #1016
2017-02-25 17:43:54 -08:00
mstembera
f1e3dfea74 Reorder members of Material::Entry
This eliminates alignment padding and reduces size from 48 to 40 bytes.
This makes the material HashTable smaller and more cache friendly.

No functional change

Closes #1013
2017-02-23 21:33:03 -08:00
GuardianRM
9f48e1ec15 Pieces protecting king
Initial protective idea by Snicolet for knight, for other pieces too
Patch add penalties and bonuses for pieces, depending on the distance from the own king

STC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 21192 W: 3919 L: 3704 D: 13569

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 26177 W: 3642 L: 3435 D: 19100

Bench : 6687377

Closes #1012
2017-02-23 21:26:59 -08:00
snicolet
eefbe967c2 Keep pawns on both flanks
Positions with pawns on only one flank tend to be more drawish. We add
a term to the initiative bonus to help the attacking player keep pawns
on both flanks.

STC: yellowish run stopped after 257137 games
LLR: -0.92 (-2.94,2.94) [0.00,5.00]
Total: 257137 W: 46560 L: 45511 D: 165066

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 15602 W: 2125 L: 1956 D: 11521

Bench : 6976310

Closes #1009
2017-02-19 14:27:03 -08:00
FauziAkram
c243cd5f4a Variable tuning
A tuning patch which cover the following changes:

increase the importance of queen and rook mobility in endgame and
decrease it in mg, since if we use the heavy pieces too early in the game
we will just make opponent develop their pieces by threatening ours.

King Psqt:
1)King will be encouraged more to stay in the first ranks in the MG
2)and will be encouraged more to go to the middle of the board/last ranks in the EG

Bishop scale better in EG
Logical changes on various psqt tables
1/6 of the changes of the last tuning session on mobility tables

STC: LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 227879 W: 41240 L: 40313 D: 146326
LTC : LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 167047 W: 21871 L: 21291 D: 123885

Bench: 5695960

Closes #1008
2017-02-19 14:00:44 -08:00
VoyagerOne
05cf45f2d1 Razor Simplification
Remove code that restrict using tt-moves for razoring.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 67442 W: 12039 L: 11997 D: 43406

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 38541 W: 5044 L: 4947 D: 28550

Bench: 5667216

Closes #1002
2017-02-18 22:50:37 -08:00
torfranz
faedcf08a8 Retire loose enemies bonus
STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 44727 W: 7943 L: 7862 D: 28922

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 148343 W: 19044 L: 19088 D: 110211

Bench: 5669076

Closes #1005
2017-02-14 21:26:08 -08:00
VoyagerOne
83fb4547f6 search(): Move nullValue variable into local scope
No functional change

Closes #1003
2017-02-14 21:22:58 -08:00
Joost VandeVondele
1e814e0ca0 Fix makefile: 32 bit builds without optimization.
Fixes failing build for

make ARCH=x86-32 clean && make ARCH=x86-32 optimize=no build

by passing -m32 also to the link step.

Extend travis testing accordingly.

No functional change.

Closes #999
2017-02-14 21:11:44 -08:00
torfranz
e0d91f4c44 Retire small bonus in passed pawn evaluation
STC: http://tests.stockfishchess.org/tests/view/5899824d0ebc59099759f3ee
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 33370 W: 6061 L: 5961 D: 21348

LTC: http://tests.stockfishchess.org/tests/view/5899e3820ebc59099759f415
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 36206 W: 4664 L: 4563 D: 26979

Bench: 6072262

Closes #998
2017-02-10 16:52:34 -08:00
Joona Kiiski
a753e20bd4 A small tweak in doEasyMove()
Time.elapsed() > Time.optimum() * 5 / 44
instaed of:
Time.elapsed() > Time.optimum() * 5 / 42

This was yellow on STC:
LLR: -2.96 (-2.94,2.94) [0.00,4.00]
Total: 156856 W: 28317 L: 27942 D: 100597

Passed on LTC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 36909 W: 4926 L: 4682 D: 27301

Note: Patch was originally submitted by user GuardianRM.
However his repo was deleted before merge.

No functional change

Closes #995
2017-02-10 16:44:13 -08:00
Stefano80
5205d44f87 Simplify scale factor computation
Minor non-functional simplifications in computing the scale factor.

In my opinion, the code is now slightly more readable:

- remove one condition which can never be satisfied.
- immediately return instead of assigning the sf variable.

Tested for non-regression:

LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 62162 W: 11166 L: 11115 D: 39881

No functional change

Closes #992
2017-02-05 16:06:37 -08:00
VoyagerOne
0553b46829 Simplify Queen Mobility
STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 85997 W: 15550 L: 15540 D: 54907

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 25333 W: 3370 L: 3256 D: 18707

Bench: 6459194

Closes #991
2017-02-05 15:40:30 -08:00
Stéphane Nicolet
ddecdc97d7 Simplify away QueenContactChecks
Changing the definition of safe checks to include
squares protected only by the king, but twice
attacked by the opponent.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 8691 W: 1683 L: 1541 D: 5467
http://tests.stockfishchess.org/tests/view/588f53b50ebc5915193f7dc7

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 31266 W: 4150 L: 4043 D: 23073
http://tests.stockfishchess.org/tests/view/588f68ab0ebc5915193f7dda

Bench : 5885815
2017-01-31 09:54:38 +01:00
VoyagerOne
fa24cc25a4 Simplify TT penalty stat (#980)
STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 20251 W: 3692 L: 3570 D: 12989

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 16432 W: 2155 L: 2029 D: 12248

Bench: 5941174
2017-01-29 08:54:58 +01:00
VoyagerOne
5254a6040c Penalty for a quiet ttMove that fails low
Also the penalty/bonus function is misleading, we
should simply change it to stat_bonus(depth) for
bonus and -stat_bonus(depth+ ONE_PLY) for extra
penalty.

STC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 11656 W: 2183 L: 2008 D: 7465

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 11152 W: 1531 L: 1377 D: 8244

Bench: 6101931
2017-01-28 09:32:07 +01:00
Stefan Geschwentner
471f7a1b5c Candidate passed pawns
Detect safe candidate passers.

STC: http://tests.stockfishchess.org/tests/view/5882395c0ebc5915193f78b3
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 53569 W: 9925 L: 9570 D: 34074

LTC: http://tests.stockfishchess.org/tests/view/5882b4fb0ebc5915193f78e2
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 77576 W: 10387 L: 10014 D: 57175

Bench: 5325829
2017-01-28 09:04:24 +01:00
pb00068
58c181de9a Simplify away pinnedPieces bitboard in EvalInfo (#975)
Results for 20 tests for each version (pgo-builds):

            Base      Test      Diff      
    Mean    2110519   2118116   -7597     
    StDev   8727      4906      10112     

p-value: 0,774
speedup: 0,004

Further verified for no regression:
http://tests.stockfishchess.org/tests/view/5885abd10ebc5915193f79e6
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 21786 W: 3959 L: 3840 D: 13987

No functional change
2017-01-28 08:43:54 +01:00
Alain SAVARD
cf4a38e0cb Simplification of lazy threshold
Passed STC
http://tests.stockfishchess.org/tests/view/587846c10ebc5915193f74ec
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 217236 W: 39041 L: 39254 D: 138941

Passed LTC
http://tests.stockfishchess.org/tests/view/587e157a0ebc5915193f76e7
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 52396 W: 6883 L: 6804 D: 38709

This submitted version (using if (abs(mg + eg) > 1500) )
seems more logical than the following other green simplification (using if (abs(mg)>1500))
since it can happen than mg_value is > eg_value (about 20% of the time)
and the submitted version seems stronger at LTC

STC
http://tests.stockfishchess.org/tests/view/5879702d0ebc5915193f7585
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 39958 W: 7315 L: 7227 D: 25416

LTC
http://tests.stockfishchess.org/tests/view/5879af3e0ebc5915193f7592
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 204322 W: 26529 L: 26648 D: 151145

bench: 6406285
2017-01-21 10:47:54 +01:00
Alain SAVARD
9eed183489 Outpost array simplification
The ReachableOutpost values were almost exactly half the Outpost values.

Passed STC
http://tests.stockfishchess.org/tests/view/588020510ebc5915193f781e
LLR: 3.86 (-2.94,2.94) [-3.00,1.00]
Total: 119238 W: 21462 L: 21460 D: 76316

Passed LTC
http://tests.stockfishchess.org/tests/view/5880ae090ebc5915193f7843
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 23540 W: 3097 L: 2980 D: 17463

Curiously, using a division by 2, with slightly different values, did not passed
http://tests.stockfishchess.org/tests/view/587fece00ebc5915193f780a

bench: 5828283
2017-01-21 10:36:46 +01:00
Alain SAVARD
243a9f5484 Reformat eval_init()
Move more code into eval_init, removing some
clutter in the main routine.

Write eval_init only from "our" point of view
(do not init the attackedBy[Them] bitboards).

Add mobilityArea to the evalinfo

A few edits while being there

tested for non-regression at STC
http://tests.stockfishchess.org/tests/view/587fab230ebc5915193f77d9
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 39585 W: 7183 L: 7094 D: 25308

Non functional change.
2017-01-21 10:13:49 +01:00
Stéphane Nicolet
9f8f093fd6 Update some comments (#973)
Use somewhat more precise comments in a couple of places.

No functional change.
2017-01-17 14:50:03 +01:00
Stefano Cardanobile
de02768af7 Introduce lazy evaluation
After we have taken into account all cheap evaluation
terms, we check whether the score exceeds a given threshold.
If this is the case, we return a scaled down evaluation.

STC:
LLR: 3.35 (-2.94,2.94) [0.00,5.00]
Total: 12575 W: 2316 L: 2122 D: 8137

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 67480 W: 9016 L: 8677 D: 49787

Current version is the one rewritten by ceebo
further edited by me.

Bench: 5367704
2017-01-13 09:17:48 +01:00
loco-loco
99cd513264 Removing CM parameter from the Stats struct. (#970)
After the history simplifications, we are only using Value Stats for CounterMoveHistory table. Therefore the parameter CM is not necessary.

No functional change.
2017-01-12 08:46:46 +01:00
Stéphane Nicolet
d2971f3fca Check for overflow in Score * int multiplication (#969)
Add asserts to check for overflow in Score * int multiplication.

There is no overflow in current master, but it would be easy to
create one as the scale of the current eval does not leave many
spare bits. For instance, adding the following unused variables
in master at the end of evaluate() (line 882 of evaluate.cpp)
overflows:

Score s1 = score * 4;  // no overflow
Score s2 = score * 5;  // overflow

Assertion failed: (eg_value(result) == (i * eg_value(s))),
function operator*, file ./types.h, line 336.

Same md5 checksum as current master for non debug compiles.

No functional change.
2017-01-11 18:11:17 +01:00
Rocky640
d40351243b StormDanger CleanUp (#964)
Order the enum and the array the same way they appear around line 250.
Makes it much easier to follow.

Add comments in the array definition and critical rows.
Use same terminology as elsewhere in pawns.cpp

No functional change.
2017-01-11 08:56:38 +01:00
Joost VandeVondele
d8f683760c Adjust copyright headers to 2017 (#965)
No functional change.
2017-01-11 08:46:29 +01:00
Marco Costalba
332b5013b5 Travis: fix bench fetch in case of PR (#968)
When Travis tests a PR, a commit merge is created
but master branch is not updated, although HEAD is.

No functional change.
2017-01-11 08:44:06 +01:00
lucasart
34e47ca87d Rename FromTo -> History (#963)
Previously, we had duplicated History:

- one with (piece,to) called History
- one with (from,to) called FromTo

Now that we have only one, rename it to History, which is the generally accepted
name in the chess programming litterature for this technique.

Also correct some comments that had not been updated since the introduction of CMH.

No functional change.
2017-01-10 08:47:56 +01:00
lucasart
e0504ab876 Remove HistoryStats
STC:
LLR: 3.44 (-2.94,2.94) [-3.00,1.00]
Total: 120831 W: 21572 L: 21594 D: 77665

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 26565 W: 3519 L: 3406 D: 19640

bench 5920493
2017-01-09 15:50:12 +01:00
Marco Costalba
d9dd520896 Fix previous patch for OS X (#961)
Use posix version of sed that is available on all
platforms.

No functional change.
2017-01-09 15:37:09 +01:00
Marco Costalba
394e9cd892 Trevis CI: use commit bench number as a reference
No functional change.
2017-01-09 12:51:28 +01:00
Joost VandeVondele
ba15781be8 New shell scripts for testing, used for travis CI (#957)
Perform more complex verification and validation.

- signature.sh : extract and optionally compare Bench/Signature/Node count.
- perft.sh : verify perft counts for a number of positions.
- instrumented.sh : run a few commands or uci sequences through valgrind/sanitizer instrumented binaries.
- reprosearch.sh : verify reproducibility of search.

These script can be used from directly from the command line in the src directory.

Update travis script to use these shell scripts.

No functional change.
2017-01-09 10:30:57 +01:00
ElbertoOne
d39ffbeea6 Simplified select best thread (#958)
Only select best thread if score is better and depth equal or larger.

STC (7 threads): http://tests.stockfishchess.org/tests/view/586a4d090ebc5903140c64b2
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 120297 W: 18652 L: 18682 D: 82963

LTC (7 threads): http://tests.stockfishchess.org/tests/view/586e31b30ebc5903140c663d
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 57187 W: 7035 L: 6959 D: 43193

bench: 4940355
2017-01-09 10:26:50 +01:00
Marco Costalba
3ab3e55bb5 Drop Stats c'tors
Now taht we correctly value-initialize Thread objects,
we don't need c'tors anymore because tables will be
zero-initialized by the compier when Thread object
is instanced.

Verified that we have no errors with Valgrind.

No functional change.
2017-01-07 10:14:39 +01:00
Joost VandeVondele
1c316c41bb Correctly zero-initialize MainThread
It can be used uninitialized in time management.
Fixes all valgrind errors on './stockfish go wtime 8000 btime 8000 winc 500 binc 500'

This is one (of the many) quirks of C++. There is a subtle difference between:

new Foo
new Foo()

The first statement calls the default constructor (that in case of a POD leaves data members
uninitialized), the second one performs a value-initialization (that in case of POD is
equivalent to a zero-initialization)

See:
http://stackoverflow.com/questions/620137/do-the-parentheses-after-the-type-name-make-a-difference-with-new
http://stackoverflow.com/questions/5116541/difference-between-creating-object-with-or-without

No functional change.
2017-01-07 10:02:43 +01:00
Joost VandeVondele
90b052462c Zero init fromToStats in constructor. (#953)
Extend commit fe99de to fromToStats, which fixes the last valgrind errors on 
a simple 'go depth 12' at startup.

No functional change.
2017-01-06 10:43:18 +01:00
pb00068
8b2c81d3ea Rejoin lines that belong to HalfDensity map (#952)
No functional change.
2017-01-05 09:00:41 +01:00