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

1440 commits

Author SHA1 Message Date
Joona Kiiski
f39cf1b008 Use null move when depth >= 2 plies
Passed both short TC:
LLR: 2.96 (-2.94,2.94)
Total: 23725 W: 5031 L: 4855 D: 13839

And long TC:
LLR: 2.96 (-2.94,2.94)
Total: 15730 W: 2939 L: 2754 D: 10037

bench: 4729333
2013-08-22 09:06:48 +02:00
Tom Vijlbrief
f45eee318b Fix crash when reaching max ply
Bug introduced in 1b7223a53c that
updated the ss base stack without increasing
the dimension.

No functional change.
2013-08-19 16:53:46 +02:00
Leonid Pechenik
91c2c44fb1 Further tweak movecount pruning
Passed both short TC
LLR: 2.95 (-2.94,2.94)
Total: 15140 W: 3125 L: 2976 D: 9039

And long TC
LLR: 2.95 (-2.94,2.94)
Total: 17118 W: 3165 L: 2974 D: 10979

bench: 4132374
2013-08-18 09:13:57 +02:00
Marco Costalba
4f55ed14d3 Revert using exceptions
Due to crashes. It will be reapplied once
we understand what's happening.

No functional change.
2013-08-15 09:36:26 +02:00
Marco Costalba
11b1a76f35 Use exceptions to stop the search
Instead of classical flags, throw an
exception when we want to immediately halt
the search. Currently only one type
is used for both UCI stop and threads
cut off.

No functional change.
2013-08-14 08:29:57 +02:00
Marco Costalba
5769509d72 Fix 'improving' condition
Because VALUE_NONE is 30002, it happens that
after a check the next move is never an improving
one.

After this patch bench signature is independent from
VALUE_NONE actual value.

bench: 4303194
2013-08-09 08:21:55 +02:00
Marco Costalba
fff6b9f061 Increase LMR when not improving
Apply to LMR the same Eelco's idea
applied to move count pruning.

This is the result of a series of
attempts started by Thomas Kolarik.

Passed both short TC
LLR: 2.95 (-2.94, 2.94)
Total: 5675 W: 1241 L: 1117 D: 3317


And long TC:
LLR: 2.95 (-2.94, 2.94)
Total: 8748 W: 1689 L: 1539 D: 5520

bench: 4356801
2013-08-08 10:28:48 +02:00
Marco Costalba
55948623e7 Rework Thread hierarchy
Introduce ThreadBase struct that is search
agnostic and just handles low level stuff,
and derive all the other specialized classes
form here.

In particular TimerThread does not hinerits
anymore all the search related stuff from Thread.

Also some renaming while there.

Suggested by Steven Edwards

No functional change.
2013-07-31 18:35:52 +02:00
Eelco de Groot
5ee16a180a Increase pruning if evaluation is not improving
Add an additional set of margins to movecount pruning
to be used when static evaluation is getting worse
than previous move.

Here are the margins table with changing
depth (fm0 not improving, fm1 improving):

    d: 0, fm0: 3, fm1: 3
    d: 1, fm0: 4, fm1: 4
    d: 2, fm0: 6, fm1: 6
    d: 3, fm0: 7, fm1: 10
    d: 4, fm0: 11, fm1: 15
    d: 5, fm0: 15, fm1: 21
    d: 6, fm0: 21, fm1: 29
    d: 7, fm0: 27, fm1: 37
    d: 8, fm0: 35, fm1: 47
    d: 9, fm0: 42, fm1: 57
    d: 10, fm0: 51, fm1: 68
    d: 11, fm0: 60, fm1: 81
    d: 12, fm0: 70, fm1: 94
    d: 13, fm0: 81, fm1: 108
    d: 14, fm0: 92, fm1: 123
    d: 15, fm0: 104, fm1: 139

Good at both short TC

LLR: 2.97 (-2.94,2.94)
Total: 11502 W: 2503 L: 2361 D: 6638

And long TC

LLR: 2.98 (-2.94,2.94)
Total: 7189 W: 1421 L: 1277 D: 4491

bench: 4364793
2013-07-29 01:21:21 +02:00
Marco Costalba
4064ee5406 Simplify captures ordering
A big simplification and removing of useless code.

Finished at 50% both at short TC (with SPRT) than
at long TC at fixed number of games:
ELO: -0.14 +-3.4 (95%) LOS: 46.8%
Total: 15206 W: 2836 L: 2842 D: 9528

bench: 5059948
2013-07-24 07:53:32 +02:00
Marco Costalba
110644d918 Better document what we skip when in check
No functional change.
2013-07-19 09:37:31 +02:00
Marco Costalba
cbb1a8ed31 Better annotate unlikely conditions
And in case of gcc we win also a small
speed optimization due to better branch
prediction.

No functional change.
2013-07-15 21:01:02 +02:00
Reuven Peleg
a6c5f60caa Simplify a condition in refutes()
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2013-07-15 20:40:49 +02:00
Marco Costalba
4ede49cd85 Fully qualify memset and memcpy
And other trivial touches.

Ispired by Lucas's DiscoCheck

No functional change.
2013-07-13 18:01:13 +02:00
Tom Vijlbrief
6960f41e03 Retire enoughMaterial + lower trapped rook threshold
Here speed up is the name of the game.

Speed up is gained:

- Removing the useless enoughMaterial code

- Limiting trapped rook evaluation to where it counts

Tested at long TC:
LLR: 2.97 (-2.94,2.94)
Total: 10061 W: 1948 L: 1790 D: 6323

bench: 4558173
2013-07-13 18:01:03 +02:00
Marco Costalba
bf90499fc3 A useless assignment found by Clang’s static analyzer
Warning is: "Value stored to 'xxx' is never read" and
it is raised in SpNode case.

No functional change.
2013-07-13 16:57:03 +02:00
Marco Costalba
404c4122ce Fix build with MSVC 2013
Also add an assert hinted by MSVC code analysis tool.

No functional change.
2013-07-13 13:03:09 +02:00
Marco Costalba
2a0bbb9faa Fix printing of PV info: take 2
Now last PV line is printed twice, fix that.

No functional change.
2013-07-13 07:43:50 +02:00
Marco Costalba
128e097d03 Fix printing of PV info
It was erroneusly skipped after the
aspiration window rework.

Reported by Eelco.

No functional change.
2013-07-12 23:42:42 +02:00
Marco Costalba
c1264e46d0 Rename some UCI options
Thanks to Don, Miguel, Louis and the other people
of talkchess forum for the suggestion:

http://www.talkchess.com/forum/viewtopic.php?t=48612

Also sync polyglot.ini with current UCI options

No functional change.
2013-07-11 16:07:10 +02:00
Marco Costalba
366f6b0dab Fix a crash with depth 1 perft
Bug recently introduced in e215a88cdd

No functional change.
2013-07-11 07:23:48 +02:00
Marco Costalba
58aee9a9ea Don't IID when in check also in PvNodes
This tiny functional change allows to
nicely simplify things.

Performed at 50% in short TC:
LLR: -0.43 (-2.94,2.94)
Total: 46406 W: 9681 L: 9565 D: 27160

And succesfully passed long TC reverse test:
LLR: -2.95 (-2.94,2.94)
Total: 4945 W: 858 L: 937 D: 3150

bench: 4507230
2013-07-09 19:03:11 +02:00
Marco Costalba
4b703b1429 Revert previous patch
Unfortunatly a reverse test at long TC failed:

master^ vs master
LLR: 1.37 (-2.94,2.94)
Total: 33682 W: 6294 L: 6071 D: 21317

So becuase short TC score is 50% there is a good
possibility patch is not scalable.

So revert it.

bench: 4507288
2013-07-09 08:04:12 +02:00
Marco Costalba
62d38f0196 Simplify "fail high upon reduction" in null search
Do not use threat move to detect the condition. This
let us to retire the big allows() function.

Test at short TC was within 50% score:
LLR: -2.95 (-2.94,2.94)
Total: 38272 W: 7941 L: 7940 D: 22391

To be verified with reverse long TC

bench: 4191565
2013-07-08 07:23:30 +02:00
Marco Costalba
7e575512ae Skip node-level cut-off tests when in check
No functional change.
2013-07-07 13:39:58 +02:00
Marco Costalba
a55fb76dcc Simplify aspiration window code
Here the main difference is that now we center
aspiration window on last returned score. This allows
to simplify handling of mate scores.

We have done a reversed SPRT tests, where we wanted to
verify if master is stronger than this patch.

Long TC: master vs this patch (reverse test)
LLR: -2.95 (-2.94,2.94)
Total: 37992 W: 7012 L: 6920 D: 24060

bench: 4507288
2013-07-03 18:59:23 +02:00
Marco Costalba
838255ef91 Workaround github issue
Temporary revert aspiration window patch
so to be visible to everybody: it will be
re-applied with next patch

No functional change (together with next one)
2013-07-03 18:58:23 +02:00
Marco Costalba
db53883f06 Merge branch 'master' into aspiration
bench: 4507288
2013-07-02 07:27:08 +02:00
Marco Costalba
13ffb08136 Revert "Increase earlier aspiration window size"
This reverts commit b88bc7b766.
2013-07-02 07:25:39 +02:00
Marco Costalba
2d82db1d14 Entering a pawn endgame is no more dangerous
A simplification of the 'dangerous' definition.

Seems neutral at reverse test at long TC

master vs patch
LLR: -2.96 (-2.94,2.94)
Total: 16974 W: 3122 L: 3139 D: 10713

bench: 4689029
2013-07-02 07:24:17 +02:00
Marco Costalba
b88bc7b766 Increase earlier aspiration window size
bench: 4377851
2013-07-01 19:29:38 +02:00
Marco Costalba
e074a19f5c Merge branch 'master' into aspiration 2013-07-01 19:25:23 +02:00
Marco Costalba
b8930d0c26 Fix a stale comment
No functional change.
2013-06-30 13:12:04 +02:00
Marco Costalba
4fc7734547 Simplify search results update
Also some rename while there.

No functional change.
2013-06-30 12:49:39 +02:00
Marco Costalba
92dcbfa658 Reorder conditions according to their frequency
This should minimize useless tests.

No functional change.
2013-06-30 11:35:53 +02:00
Marco Costalba
b50eb6bea8 Center aspiration window on last returned score
bench: 4428212
2013-06-30 11:14:02 +02:00
Marco Costalba
6f079ae720 Simplify aspiration window loop
Don't open the window in case we find a mate score: this
will be takes care with next patch.

No functional change.
2013-06-30 10:54:09 +02:00
Marco Costalba
203fdc9ac1 Use calloc() in TranspositionTable::set_size()
Function calloc() already initializes memory to
zero, so avoid calling clear() afterwards.

Also some renaming while there (inspired by DiscoCheck).

No functional change.
2013-06-29 11:23:07 +02:00
Marco Costalba
e215a88cdd Micro-optimize perft
Avoid to call perft function when we just need to count
moves, at leaf nodes.

Speed up of almost 2%

No functional change.
2013-06-21 09:10:03 +02:00
Marco Costalba
c0964fc70f Remove redundant condition in probcut
When !ss->skipNullMove it is assured that excludedMove == MOVE_NONE

No functional change.
2013-06-17 09:30:59 +02:00
Marco Costalba
02420d4670 Revert "Reduce more CUT nodes only if parent node is reduced"
This reverts commit d54e8a5955.

It was not proved with SPRT this tweak is stronger. So revert it
for now to follow fishtest guidelines.

bench: 5108393
2013-06-14 08:27:06 +02:00
Marco Costalba
d54e8a5955 Reduce more CUT nodes only if parent node is reduced
So when we are doing a LMR search at the parent ALL node.

This patch didn't prove stronger at 60" TC
LLR: -2.97 (-2.94,2.94)
Total: 22398 W: 4070 L: 4060 D: 14268

But, first, it scores at 50%, second (and most important for me) the opposite,
i.e. normal reduction when parent node is not reduced, seems very bad:
LLR: -2.95 (-2.94,2.94)
Total: 7036 W: 1446 L: 1534 D: 4056

According to Don, this idea of increased reduction of CUT nodes
works because if parent node is reduced, missing a cut-off due to
reduced depth search (meaning position is somehow tricky) forces
a full depth research at parent node, giving due insight in this
set of sensible positions.

IOW if we expect a node to fail-high at depth n, then we assume it
should fail-high also at depth n-1, if this doesn't happen it means
position is tricky enough to deserve a research at depth n+1.

bench: 4687419
2013-06-13 20:05:02 +02:00
Marco Costalba
4bebb15e94 Reduce more CUT nodes
We got a good result from this tweak, in line with
what was already found by Don Dailey.

At short TC:
LLR: 2.95 (-2.94,2.94)
Total: 13097 W: 2742 L: 2598 D: 7757

At long TC:
LLR: 2.97 (-2.94,2.94)
Total: 7281 W: 1408 L: 1265 D: 4608

bench: 5108393
2013-06-13 19:50:32 +02:00
Marco Costalba
3b8f66f8ac Introduce Cut/All node definitions
Follow Don Dailey definition of cut/all node:

"If the previous node was a cut node, we consider this an ALL node.
The only exception is for PV nodes which are a special case of ALL nodes.
In the PVS framework, the first zero width window searched from a PV
node is by our definition a CUT node and if you have to do a re-search
then it is suddenly promoted to a PV nodes (as per PVS search) and only
then can the cut and all nodes swap positions. In other words, these
internal search failures can force the status of every node in the subtree
to swap if it propagates back to the last PV nodes."

http://talkchess.com/forum/viewtopic.php?topic_view=threads&p=519741&t=47577

With this definition we have an hit rate higher than 90% on:

    if (!PvNode && depth > 4 * ONE_PLY)
        dbg_hit_on_c(cutNode, (bestValue >= beta));

And an hit rate of just 28% on:

    if (!PvNode && depth > 4 * ONE_PLY)
        dbg_hit_on_c(!cutNode, (bestValue >= beta));

No functional change.
2013-06-13 19:46:49 +02:00
Marco Costalba
b6e9d901b0 Don't use std::vector::data()
It is a C++11 only function.

Reported by Eelco.

No functional change.
2013-06-13 07:42:43 +02:00
Marco Costalba
1b7223a53c Fix again early stop ss pointer
Fix was wrong becuase search starts from ss+1,
code is a bit tricky here, so rewrite in a way
to be more easy to read and understand.

Spotted by Eelco.

No functional change.
2013-06-09 23:36:46 +02:00
Marco Costalba
dd1855eb2f More consistent 'piece' variable naming
No functional change.
2013-06-09 12:56:05 +02:00
Marco Costalba
55eb7dd1e9 Use alpha instead of beta-1
It is more directly related to a fail-low.

No functional change.
2013-06-09 11:52:39 +02:00
Marco Costalba
902c0566a6 Fix incorrect 'ss' pointer in early stop check
The exclusion search used to verify one move is much
better than other shall be called with 'ss' and not
'ss+1'

No functional change.
2013-06-09 11:01:11 +02:00
Dariusz Orzechowski
bc02cc0c8a Fix a typo
No functional change.
2013-06-08 11:01:28 +02:00