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

3322 commits

Author SHA1 Message Date
lucasart
e60cdca9b0 Convert TT depth to int8_t
Now that half plies have been removed from the engine, we can encode
TT depth into an int8_t.

Range is -128 to +127, so it goes still further than the previous
limit of 121 plies (with ONE_PLY == 2 where depth - DEPTH_NONE was
encoded as an uint8_t).

No functional change.

Resolved #60
2014-10-01 20:51:32 +01: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
Marco Costalba
222f59b9c1 Move ONE_PLY to be 1 instead of 2: search()
Now that half-plies are no more used we can simplify
the code assuming that ONE_PLY is 1 and no more 2.

Verified with a SMP test:
LLR: 2.95 (-2.94,2.94) [-4.50,0.00]
Total: 8926 W: 1712 L: 1607 D: 5607

No functional change.
2014-09-29 15:17:12 +02:00
lucasart
27a1877299 Clean up VALUE_KNOWN_WIN conditions
A patch (+ some extra changes) passed with:

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 14575 W: 3101 L: 2967 D: 8507

LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 42579 W: 7580 L: 7496 D: 27503

Bench: 6545733

Resolves #52
2014-09-28 17:45:49 +01:00
Uri Blass
ea9c424bba Remove use of half-ply reductions from LMR, Null-move, IID and
Singular extensions.

STC:
ELO: 3.80 +-3.1 (95%) LOS: 99.2%
Total: 19727 W: 4190 L: 3974 D: 11563

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 7647 W: 1356 L: 1214 D: 5077

Bench: 6545733

Resolves #55
2014-09-28 04:33:28 +08:00
Joona Kiiski
7ed15af371 Cap evaluation based null move extra reduction to three plies
It's a zero elo patch, and a reasonable safeguard against uncontrolled extreme reductions.

STC:
ELO: -0.08 +-2.0 (95%) LOS: 46.9%
Total: 40000 W: 6728 L: 6737 D: 26535

LTC:
ELO: -0.14 +-1.8 (95%) LOS: 44.0%
Total: 40000 W: 5557 L: 5573 D: 28870

Bench: 7201830
2014-09-25 20:42:25 +01:00
Uri Blass
d6613b7589 Change history reduction in LMR to be a full ply.
STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 9829 W: 2142 L: 1998 D: 5689

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 27162 W: 4802 L: 4692 D: 17668

Bench: 7284120

Resolves #53
2014-09-26 02:22:39 +08: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
Marco Costalba
4d0a6c5a6f Rename time variable to reflect UCI parameters
On top of previous patch, rename time variables to
reflect the simplification of UCI parameters.

It is more correct to use as varibales directly the
corresponding UCI option, without intorducing redundant
intermediate variables.

This allows also to simplify the code.

No functional change.
2014-09-21 08:23:12 +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
Marco Costalba
aa10d0aaa6 Rename "Contempt Factor" to "Contempt"
Suggested by Ronald and Lucas on talkchess.

No functional change.

Conflicts:
	src/ucioption.cpp
2014-09-16 21:14:00 +01:00
Marco Costalba
ff480bdb83 Retire struct Log
No more used now that we have removed
"Write Search Log" UCI option.

No functional change.
2014-09-16 21:13:50 +01:00
lucasart
b66552fc27 Simplify Time Management UCI options
No functional change
2014-09-15 20:24:51 +01:00
Marco Costalba
cd065dd584 Small tweak to idle_loop()
In case of a succesful late join we set again
'searching' flag, so we can restart search
immediately without an useless lock/unlock
cycle.

No functional change.
2014-09-04 20:19:03 +01:00
Joona Kiiski
95b24083fb Simplify idle_loop()
No functional change
2014-08-30 21:03:41 +01:00
lucasart
877313a413 Retire Search Log
No functional change

Bench: 7461881
2014-08-24 16:28:51 +01:00
Marco Costalba
8b8885ab07 Fix perft 1
Compute correct number of moves for this corner case.

A smal bug crept in after recent perft rework.

No functional change.
2014-08-10 07:36:22 +08:00
lucasart
a903ed07e0 Retire move_to_san()
Now "Write Search Log" will pring moves in UCI format, consistent with all the rest. This functionality is
not aimed at end-users anyway. It's hardly useful at all, in fact. Also, pretty-printing SAN moves is
something that better belongs in the GUI than in the engine.

No functional change.
2014-08-10 07:28:00 +08:00
lucasart
880e3cd7c8 Move to_char() and to_string() to notation
Where they better belong.

Also, this removes '#include <string>' from types.h, which reduces the amount of code to compile (every
translation unit includes types.h).

No functional change.
2014-08-09 13:25:05 +08:00
Marco Costalba
a67c22611a Rework perft implementation
Unify various perft functions and move all the code
to search.cpp.

Avoid perft implementation to be splitted between
benchmark.cpp (where it has no reason to be) and
search.cpp

No functional and no speed change (tested).
2014-08-09 13:00:59 +08:00
lucasart
2efeded6e3 Write perft(N-1) into cout
So that one can redirect cout to /dev/null and only print print cerr in the terminal (for more accurate speed
tests).

Suggested by Marco.

No functional change.
2014-08-07 21:15:05 +08:00
lucasart
6044f25d71 Fix Hash in bench
The compiler tries to cast Options["Hash"] into a string, using:

Option::operator std::string() const {
  assert(type == "string");
  return currentValue;
}

And, as expected, the assert() fails.

std::to_string() would be the right solution, but it's C++11. And using a stringstream is too much code to
achieve so little. Let's keep it the way it was: hardcoded (ie. default hash defined in two places).

No functional change.
2014-08-07 18:51:07 +08:00
joergoster
9da015517c Remove insufficient material rule
The eval already returns zero in KK, KBK, KNK (see material.cpp). The difference is:
- we lose the "TB pruning" benefit of the draw rule (ie. search goes on even if eval is zero)
- we gain some speed by removing a useless test from the hot path

STC:
LLR: 0.05 (-2.94,2.94) [-3.00,1.00]
Total: 128000 W: 21357 L: 21560 D: 85083

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 33023 W: 4613 L: 4509 D: 23901

bench 7461881
2014-08-06 18:42:10 +08:00
lucasart
888a1d3445 Remove useless code in Position::pretty()
First, remove some dead code (function never called with a Move argument).

Then, remove printing of legal moves, which does not belong here. Let's keep commands orthogonal and minimal:
- the "d" command should display the board, nothing more, or less.
- "perft 1" will display the list of legal moves.

No functional change.
2014-08-06 07:04:27 +08:00
lucasart
8b88ca9017 Reduce minimum memory requirement by 16MB
Stockfish allocates the default hash (32MB) in main(), before entering UCI::loop(). If there is not enough
memory, the program will crash even before UCI::loop() is entered and the GUI is given a change to specify a
lower Hash value.

This defective design could be resolved by doing a lazy allocation upon "isready" command, as the UCI protocol
guarantees that "isready" will be sent at least once before any search. But it's a bit cumbersome when using
Stockfish "manually" to have to remember to type "isready" everytime.

So leave the current design, but reduce the default hash to 16MB instread of 32MB. In order to perform such
quick searches (depth=13), there is no reason to use so much Hash anyway. Another benefit is to introduce a
bit of hash pressure in bench, which increases chances to detect rare bugs related to TT replacement, for
example.

This is not a functional change, although it obviously changes the bench.

bench 7461879
2014-08-05 11:42:48 +08:00
lucasart
94fe366779 Default Hash defined in a single place
Instead of defining it both in ucioption.cpp and benchmark.cpp. Obviously changing the default Hash will
change the bench as a result.

No functional change.
2014-08-05 11:40:25 +08:00
lucasart
535f70088e Retire divide command
The main purpose of perft is to help debugging. But without the breakdown in sum of perft(N-1), it is a
completely useless debugging tool.

So perft now displays the breakdown, and divide is therefore removed.

No functional change.
2014-08-04 13:54:09 +08:00
Marco Costalba
1b69910865 Ensure printing UCI info in multi-pv case
After commit 94b1bbb68b, in case available root moves are less than multiPV, we
could never reach condition:

PVIdx + 1 == multiPV

and as a consequence UCI output is not printed.

Fixed suggested by Joerg Oster.

No functional change.
2014-08-02 22:16:45 +08:00
Oskar Werkelin Ahlin
29451de874 Correct bench timing
No functional change.
2014-08-01 19:32:53 +08:00
lucasart
5adc678628 Document Threat[] indices
From Marco's repo.

No functional change.
2014-07-30 07:06:48 +08:00
Marco Costalba
f2053ba19f Fix a warning with MSVC 2010
Warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data

No functional change.
2014-07-29 06:53:09 +08:00
David Zar
68171ecaca Small code style reformatting
No functional change.
2014-07-29 06:52:32 +08:00
lucasart
6b82a234d0 Aspiration: widen slower
STC:
LLR: -2.95 (-2.94,2.94) [0.00,4.00]
Total: 182323 W: 30664 L: 30234 D: 121425

LTC:
LLR: 3.51 (-2.94,2.94) [0.00,4.00]
Total: 59841 W: 8345 L: 8006 D: 43490

bench 7962536
2014-07-27 09:18:04 +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
lucasart
7f68fc611c Revert Contempt = 20
Despite being neutral at STC, it turned out to be regressive at LTC:

40k games at LTC with Hash=8
ELO: -2.06 +-1.9 (95%) LOS: 1.4%
Total: 39720 W: 5740 L: 5976 D: 28004

40k games at LTC with Hash=128
ELO: -2.69 +-1.9 (95%) LOS: 0.2%
Total: 39149 W: 5702 L: 6005 D: 27442

bench 7477963
2014-07-20 08:50:54 +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
lucasart
67a5e1ecf9 Contempt = 20
Also raise the admissible bounds to (-100,100), as there is no reason to prevent users from using high
values if they want to.

Does not regress in self play:
ELO: 0.10 +-2.0 (95%) LOS: 53.7%
Total: 40000 W: 7084 L: 7073 D: 25843

master vs SF 3
ELO: 182.86 +-2.7 (95%) LOS: 100.0%
Total: 40000 W: 21843 L: 2541 D: 15616

Contempt = 20 vs SF 3
ELO: 189.25 +-2.8 (95%) LOS: 100.0%
Total: 40000 W: 22721 L: 2859 D: 14420

Diff is therefore 6.4 +/- 3.9 elo against a 180-190 elo weaker engine, which is significantly positive,
as expected. This elo difference is likely understated, because of FishTest aggressive draw adjudication
though.

We could push Contempt further, but after 20cp, it would get in the way of FishTest draw adjudication
rule, and is likely to reduce the testing throughput as a result.

bench 8198667
2014-07-15 07:14:58 +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
Marco Costalba
94b1bbb68b Small reformat to Skill class
Steamline a bit the implementation of
skill levels. As a side effect we can
retire MultiPV global and use a local
variable instead.

No functional change.
2014-07-11 18:08:27 +08:00
lucasart
f133f61e3f Remove useless condition
Small simplification, suggested by Uri Blass.

passed STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 25839 W: 4464 L: 4351 D: 17024

and LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 220039 W: 29981 L: 30131 D: 159927

No functional change.
2014-07-10 18:25:20 +08:00
Joona Kiiski
eb50793cff Retire FakeSplit
- Currently broken
    - Never been really useful
    - Does not work well with new splitting model

Verified for no regression at STC with 3 threads:
LLR: 2.96 (-2.94,2.94) [-6.00,0.00]
Total: 81905 W: 12122 L: 12381 D: 57402

No functional change
2014-07-09 07:19:06 +08:00
Marco Costalba
9b30913996 Avoid 'double assigments' tricks
Bitboard init code is already noteasy to follow,
so don't make it even harder using 'smart' code.

Also reindent a while loop in standard way.

No functional change.
2014-07-07 21:53:25 +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
lucasart
c192b692cf size_t cast in TranspositionTable::first_entry()
32-bit truncation would make this function bogus when clusterCount >= 2^33 (ie. Hash >= 256 GB).

No function change.
2014-07-03 18:23:56 +08:00
lucasart
85b08ce3ad Use compiler intrinsic instead of assembly for popcnt
This time, do not break compatibility with some AMD machines that have SSE3 and popcnt, but do
not have SSE4.2.

No functional change.
2014-07-03 18:22:53 +08:00
Gary Linscott
b9a88da4ab Revert "Use compiler intrinsic instead of assembly for popcnt"
This reverts commit a69f1d7c20.
2014-07-01 17:01:54 -04:00
lucasart
a69f1d7c20 Use compiler intrinsic instead of assembly for popcnt
No functional change.
2014-07-01 20:50:33 +08:00
lucasart
24ba204931 Raise max Hash to 1TB
And use size_t where appropriate, as suggested on FishCooking.

No functional change.
2014-07-01 18:37:18 +08:00