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

2864 commits

Author SHA1 Message Date
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
Marco Costalba
a6e0f62a4f Zobrist::init() should be Position::init()
No functional change.
2013-06-09 13:54:38 +02:00
Marco Costalba
81e242a96d Convert pieceSquareTable to 3 dimensions
No functional change.
2013-06-09 13:10:21 +02:00
Marco Costalba
dd1855eb2f More consistent 'piece' variable naming
No functional change.
2013-06-09 12:56:05 +02:00
Marco Costalba
db4cd89cb8 Introduce operator~(Piece c)
Small syntactic sugar to reverse piece color.

No functional change.
2013-06-09 12:44:04 +02:00
Marco Costalba
7e95495b35 Retire psq_delta()
No functional change.
2013-06-09 12:32:16 +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
Marco Costalba
05c6f7a40b Fix search log when using skills
In case of we pick a sub-optimal move be
sure to print this, and not the best one
on seach log file.

Bug spotted by Guenther Demetz.

No functional change.
2013-06-08 10:56:20 +02:00
Marco Costalba
2a98042c21 Fix a crash when 'go' multiple times
Search is started after setting a position and
issuing UCI 'go' command. Then if we stop the search
and call 'go' again without setting a new position it
is assumed that the previous setup is preserved, but
this is not the case because what happens is that
SetupStates is reset to NULL, leading to a crash as
soon as RootPos.is_draw() is called because st->previous
is now stale.

UCI protocol is not very clear about requiring that a
position is setup always before launching a search,
so here we easy the life of GUI developers assuming
that the current state is preserved after returning
from a 'stop' command.

Bug reported by Gregor Cramer.

No functional change.
2013-06-01 16:19:42 +02:00
Marco Costalba
46409a7852 Assorted renaming in evaluation
And some reshuffle too.

No functional change.
2013-06-01 13:17:39 +02:00
jundery
d8b266af8b Passed pawn tuning
A small number of tests with simulated
annealing at 15s indicated these values
may be better

And this is verified at long 60+0.05 TC
LLR: 2.95 (-2.94,2.94)
Total: 40658 W: 7821 L: 7501 D: 25336

bench: 4931544
2013-05-31 09:17:48 +02:00
Marco Costalba
abb40777bf Shrink engine UCI name
Some GUI have problems with long names.

Reported by George Speight.

No functional change.
2013-05-27 17:43:38 +02:00
Marco Costalba
90abcac1c7 Add Pawn Structure also to polyglot.ini
No functional change.
2013-05-25 13:14:41 +02:00
Marco Costalba
7222f47350 Re-add "Pawn Structure" UCI option
And reshuffle the code to not special case
this parameter.

No functional change.
2013-05-25 12:38:14 +02:00
Marco Costalba
eafb66e1aa More uniform tracing code
No functional change.
2013-05-25 12:01:50 +02:00
Uri Blass
d4a02b135d Bunch of 3 small patches
This patch is the sum of:

- Grainsize of 4 instead of 8

- Removing "depth < DEPTH_ZERO"

- Change DEPTH_QS_RECAPTURES = -5 to -7

All the patches individually failed to pass SPRT but scored
around 50%.

Together they pass easily short TC:
LLR: 2.96 (-2.94,2.94)
Total: 4429 W: 964 L: 844 D: 2621

And with some difficult long TC of 60+0.05:
LLR: 2.95 (-2.94,2.94)
Total: 64133 W: 11968 L: 11532 D: 40633

bench: 4821467
2013-05-23 17:59:39 +02:00
Marco Costalba
d3608c4e79 Microptimize MoveList loop
Add MOVE_NONE at the tail, this allows to loop
across MoveList checking for *it != MOVE_NONE,
and because *it is used imediately after compiler
is able to reuse it.

With this small patch perft speed increased of 3%

And it is also a semplification !

No functional change.
2013-05-19 22:00:49 +02:00
Marco Costalba
38cfbeeb50 Delay killers[] initialization
Most of the time we cut-off earlier, at captures, so this
results in useless work.

There is a small functionality change becuase 'ss' can change
from MovePicker c'tor to when killers are tried due, for
instance, to singular search.

bench: 4603795
2013-05-19 21:41:56 +02:00
Marco Costalba
77547a4ef1 Reduce countermoves less in LMR
Passed SPRT for both short TC 15+0.05:
LLR: 2.95 (-2.94,2.94)
Total: 17724 W: 3756 L: 3598 D: 10370

And long TC 60+0.05:
LLR: 2.95 (-2.94,2.94)
Total: 22672 W: 4232 L: 4011 D: 14429

bench: 4418832
2013-05-19 21:36:23 +02:00
Marco Costalba
8ceef92266 Mimic an iterator for looping across MoveList
Seems more conventional.

No functional change.
2013-05-19 13:28:25 +02:00
Joona Kiiski
f7c013edd0 Use two counter moves instead of one
Very good at long 60"+0.05 TC
LLR: 2.95 (-2.94,2.94)
Total: 5954 W: 1151 L: 1016 D: 3787

[edit: slightly changed form original patch to avoid useless loop
 across killers when killer is MOVE_NONE]

bench: 4327405
2013-05-16 16:20:50 +02:00
Marco Costalba
148490f04c Rename Refutation to Countermove
Use proper naming according to:

http://chessprogramming.wikispaces.com/Countermove+Heuristic

The name of this idea is "Countermove Heuristic" and was
first introduced by Jos Uiterwijk in 1992

No functional change.
2013-05-15 20:59:56 +02:00
Uri Blass
7c6f346c90 Increased mobility array
Performed more or less well at short TC
LLR: 2.95 (-2.94,2.94)
Total: 50517 W: 9815 L: 9574 D: 31128

And a bit better at long TC
LLR: 2.96 (-2.94,2.94)
Total: 15564 W: 2805 L: 2624 D: 10135

bench: 4375253
2013-05-15 00:34:05 +02:00
Marco Costalba
1a34496761 Revert trapped rook bug fix
It seems that do  not limiting checking the
trapped rook only on rank 1 improves the
score.

At long TC
LLR: 2.97 (-2.94,2.94)
Total: 6581 W: 1346 L: 1204 D: 4031

bench: 4985012
2013-05-15 00:06:11 +02:00
Gary Linscott
049e5ca191 Minor bugfixes to refutation table
Don't update refutation table in case of
previous move is MOVE_NULL or MOVE_NONE
and don't try refutation if is already
a killer move.

Pass both short TC
LLR: 2.96 (-2.94,2.94)
Total: 4310 W: 953 L: 869 D: 2488

And long one
LLR: 2.95 (-2.94,2.94)
Total: 6707 W: 1254 L: 1184 D: 4269

bench: 4785954
2013-05-14 23:52:44 +02:00
Marco Costalba
19dd0de4ff Reformat previous patch
No functional change.
2013-05-13 20:42:44 +02:00
Joona Kiiski
8a61b030a6 Enable refuation table
Very good result both at short TC 15+0.05
LLR: 2.95 (-2.94,2.94)
Total: 2803 W: 596 L: 483 D: 1724

And at long TC 60+0.05
LLR: 2.95 (-2.94,2.94)
Total: 2862 W: 548 L: 431 D: 1883

bench: 4329221
2013-05-13 19:48:41 +02:00
Joona Kiiski
c7e31d5aa8 Simple always overwrite Refutation table 2013-05-12 21:21:46 +01:00
Marco Costalba
818a3537a7 Use Them instead of ~Us
Unortunatly we have no guarantee that the call to
operator~(Color c) is resolved at compile time.

Perhaps the solution would be to use C++11 const_expr,
but for now simply use the good old-style ternary operator
that works as expected.

No functional change.
2013-05-11 11:49:44 +02:00
Marco Costalba
bcbc9bfd1f Some code reformat in evaluate_pieces
No functional change.
2013-05-11 11:13:06 +02:00
Marco Costalba
7eda7335fd Simplify previous patch
No functional change.
2013-05-09 19:09:51 +02:00
Marco Costalba
02606a8c83 Merge 'passed_pawns' tweaks
Good at both short and long TC

15+0.05
LLR: 2.96 (-2.94,2.94)
Total: 28220 W: 5531 L: 5349 D: 17340

TC 60+0.05
LLR: 2.95 (-2.94,2.94)
Total: 12612 W: 2221 L: 2057 D: 8334

bench: 4857939
2013-05-08 23:04:11 +02:00
Reuven Peleg
e7505324f6 Avoid explicit bitwise operators
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2013-05-05 22:51:18 +02:00
jundery
653c0527a7 Passed pawn eval
Use a stepped function to evaluate bonuses and add the bonus to the
middle game

bench: 4857939
2013-05-05 11:12:04 -06:00