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

2849 commits

Author SHA1 Message Date
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
6fbe027da0 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 09:06:03 +02:00
Marco Costalba
ddcb572c41 Disable flto when debugging
Link-time optimization does not work well with
generation of debugging information:

http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html

Reported by Louis Zulli

No functional change.
2013-07-03 08:21:21 +02:00
Marco Costalba
12c0dfc113 Revert "Remove confusing optimization"
This reverts commit e05c80a088.

we gain a speed up of 1.5% under gcc !

No functional change.
2013-07-02 20:12:57 +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
17d41b3861 Fix some stale comments
No functional change.
2013-06-23 13:19:03 +02:00
Marco Costalba
8cff4862a6 Move SquareDistance[] to bitboard.cpp
No functional change.
2013-06-23 13:13:13 +02:00
Marco Costalba
908d98820b Don't explicitize enum values when not needed
Compiler will chose the correct values in sequential
order for you.

Also move file and rank bitboards definitions to
bitboard.h

No functional change.
2013-06-23 11:30:40 +02:00
Marco Costalba
a4c11b71ac Retire in_front_bb(Color c, Square s) overload
Explciitly call rank_of() in the few places where
it is used.

No functional change.
2013-06-23 10:16:43 +02:00
Marco Costalba
b2fadf32aa Retire ThisAndAdjacentFilesBB[]
It is unused. Also renamed attack_span_mask to
pawn_attack_span

No functional change.
2013-06-23 10:09:24 +02:00
Marco Costalba
378bcfe760 Simplify hidden_checkers()
De-templetize and pass color as function argument.
No speed change.

No functional change.
2013-06-23 09:03:40 +02:00
Marco Costalba
fe2ed42661 Name functions along corresponding UCI commands
No functional change.
2013-06-22 12:46:03 +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
Ryan Schmitt
e95e69515a Include file attacks in 'major on pawn'
Passed both short TC:
LLR: 2.97 (-2.94,2.94)
Total: 57846 W: 12248 L: 11974 D: 33624

And long one:
LLR: 2.95 (-2.94,2.94)
Total: 9181 W: 1732 L: 1581 D: 5868

bench: 4609948
2013-06-19 07:22:10 +02:00
Reuven Peleg
e05c80a088 Remove confusing optimization
Here we skip the call to pos.attacks_from<ROOK>(s) in the 98%
of cases, testing the first 2 members first. Unfortunatly
code is a bit triky and not clear. So we give up to the
speed optimization in exchange of more code clarity.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2013-06-17 18:12:15 +02:00
Reuven Peleg
7b31e81d77 Merge some if statements in pos_is_ok()
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2013-06-17 18:02:59 +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
cd782c11ec Rename piece_count and piece_list
No functional change.
2013-06-16 13:21:10 +02:00
Marco Costalba
5ea984ac35 Don't calculate pawnsOnSquares twice
And reformat some code while there.

No functional change.
2013-06-16 11:32:10 +02:00
Marco Costalba
1fd020a8ba Use move_pawns() in Pawns::probe
And rename some stuff.

No functional change.
2013-06-16 10:40:36 +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
2c7ab488a8 Fix description of TT entry
It was way outdated and wrong !

No functional change.
2013-06-14 08:21:02 +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
de1dc4f2de Don't need to expose namespace Zobrist
It can be local to position.cpp

No functional change.
2013-06-09 23:27:07 +02:00