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

2862 commits

Author SHA1 Message Date
Marco Costalba
9fc77bc414 Fix trapped rook condition
A rook is trapped if on rank 1 as is the king.
Currently the condition aloows for the rook
to be also in front of the pawns as long
as king is on first rank.

Verified with short TC test:
LLR: -1.71 (-2.94,2.94)
Total: 23234 W: 4317 L: 4317 D: 14600

Here what it counts is that after 23K games
result is equal.

bench: 4696542
2013-05-05 12:27:11 +02:00
Marco Costalba
3b92159908 Further simplify previous patch
No functional change.
2013-05-04 12:15:31 +02:00
homoSapiensSapiens
e00bb13e85 Merge some conditions
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2013-05-04 11:13:22 +02:00
Marco Costalba
3b41e62666 Drop some redundant defined(_WIN64)
When it is already defined(_WIN32).

According to Microsoft documentation:
http://msdn.microsoft.com/en-us/library/b0084kay.aspx

_WIN32 Defined for applications for Win32 and Win64. Always defined.

_WIN64 Defined for applications for Win64.

Patch suggested by Joona.

No functional change.
2013-05-03 15:24:54 +02:00
Marco Costalba
37c91aa94c Print time and node count before search ends
This info is normally printed together with
PV info in uci_pv() but when search is stopped,
for instance when max search time is reached,
uci_pv is not called and we miss this bits.

Suggested by gravy_train

No functional change.
2013-05-03 10:26:03 +02:00
Marco Costalba
43f67eab5f Merge mobility area tweak
A nice improvment.

Was good at 15+0.05
LLR: 2.96 (-2.94,2.94)
Total: 10731 W: 2176 L: 2040 D: 6515

And at 60"+0.05
LLR: 2.96 (-2.94,2.94)
Total: 10601 W: 1968 L: 1810 D: 6823

bench: 4676606
2013-05-03 10:12:31 +02:00
Gary Linscott
11d30b6298 Fix rounding issue 2013-05-02 14:37:55 -04:00
Gary Linscott
3edb15d183 More aggressive move count pruning 2013-05-02 09:47:34 -04:00
Marco Costalba
d44ac0a485 Another take at TT alignment
This time revert to original version but using
uintptr_t instead of size_t

Suggested by Lucas.

No functional change.
2013-05-02 09:38:23 +02:00
Marco Costalba
481eda4ca0 Re-add "Cache line aligned TT"
But this time do not play with pointers, in
particular do not assume that size_t is an
unsigned type of the same width as pointers.

This code should be fully portable.

No functional change.
2013-05-01 23:42:16 +02:00
jhellis3
7323231786 Tweak Mobility Area
Only consider pawns and the king as restricting.
2013-05-01 02:37:50 -05:00
Marco Costalba
e381951a24 Restore development version
No functional change.
2013-04-30 20:01:07 +02:00
Marco Costalba
aa2368a687 Stockfish 3
Stockfish bench signature is: 4176431
2013-04-30 19:42:43 +02:00
Marco Costalba
293c44bc09 Revert "Cache line aligned TT"
This reverts commit 083fe58124

It seems to break Android build

No functional change.
2013-04-30 19:42:21 +02:00
Marco Costalba
06b9140e5c Temporary revert "Expose EvalInfo struct to search"
It is not needed for the release and introduces
a slowdown, although very small.

Probably it will be readded after the release.

No functional change.
2013-04-29 00:55:32 +02:00
Marco Costalba
156635749b Fix a 'value > VALUE_INFINITE' assert
This fixes an assert while testing with debug on.

Assert was due to static null pruning returning value

eval - futility_margin(depth, (ss-1)->futilityMoveCount)

That was sometimes higher than VALUE_INFINITE triggering
an assert at the caller site.

Because eval con be equal to ttValue and anyhow is read from
TT that can be corrupted in SMP case, we need to sanity
check it before to use.

bench: 4176431
2013-04-27 13:08:11 +02:00
Marco Costalba
083fe58124 Cache line aligned TT
Let TT clusters (16*4=64 bytes) to hold on a singe cache line.
This avoids the need for the double prefetch.

Original patches by Lucas and Jean-Francois that has also tested
on his AMD FX:

BIG HASHTABLE

./stockfish bench 1024 1 18 > /dev/null

Before:
1437642 nps
1426519 nps
1438493 nps

After:
1474482 nps
1476375 nps
1475877 nps

SMALL HASHTABLE

./stockfish bench 128 1 18 > /dev/null

Before:
1435207 nps
1435586 nps
1433741 nps

After:
1479143 nps
1471042 nps
1472286 nps

No functional change.
2013-04-26 19:38:11 +02:00
Marco Costalba
e508494a99 Fix a crash introduced few days ago
Crash is due to uninitialized ss->futilityMoveCount that
when happens to be negative, yields to an out of range
access in futility_margin().

Bug is subtle because it shows itself only in SMP case.
Indeed in single thread mode we only use the

Stack ss[MAX_PLY_PLUS_2];

Allocated at the begin of id_loop() and due to pure
(bad) luck, it happens that for all the MAX_PLY_PLUS_2
elements, ss[i].futilityMoveCount >= 0

Note that the patch does not prevent futilityMoveCount
to be overwritten after, for instance singular search
or null verification, but to keep things readable and
because the effect is almost unmeasurable, we here
prefer a slightly incorrect but simpler patch.

bench: 4311634
2013-04-26 12:14:01 +02:00
Marco Costalba
2ef53ee368 Store Eval::Info in Search::Stack
Instead of a pointer. This should fix the issue of
remaining with a stale pointer when for instance calling
IID, but also null search verification, singular search
and razoring where we call search with the same ss
pointer. In this case ss->ei is overwritten in the
search() call and upon returning remains stale.

This patch could have a performance hit because Eval::Info
is big (176 bytes) and during splitting we copy 4 ss entries.

On the good side, this patch is a clean solution.

Proposed by Gary.

No functional change.
2013-04-25 21:52:26 +02:00
Marco Costalba
d810441b35 Expose EvalInfo struct to search
Allow to use EvalInfo struct, populated by
evaluation(), in search.

In particular we allocate Eval::Info on the stack
and pass a pointer to this to evaluate().

Also add to Search::Stack a pointer to Eval::Info,
this allows to reference eval info of previous/next
nodes.

WARNING: Eval::Info is NOT initialized and is populated
by evaluate(), only if the latter is called, and this
does not happen in all the code paths, so care should be
taken when accessing this struct.

No functional change.
2013-04-25 12:57:37 +02:00
Ryan Schmitt
79bcb2ca54 Increase rook/queen on 7th bonus
Shows an increase at 15+0.05
LLR: 3.01 (-2.94,2.94)
Total: 20450 W: 4091 L: 3927 D: 12432

And at 60+0.05
LLR: 2.97 (-2.94,2.94)
Total: 61432 W: 10849 L: 10441 D: 40142

bench: 4493356

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2013-04-25 12:13:17 +02:00
Marco Costalba
289a767ab3 Merge Joona's increased static null pruning
The idea is to fail high more easily in static
null test if in the parent node we are already
very deep in the move list, so the propability
to fail high there is very low.

[edit: I have slightly changed the functionality
moving

ss->futilityMoveCount = moveCount;

At the end of the pruning code, this should not affect
ELO in anyway, but makes code more natural and logic]

Test with SPRT is good at 15+0.05
LLR: 2.96 (-2.94,2.94)
Total: 50653 W: 10024 L: 9780 D: 30849

And at 60+0.05
LLR: 2.97 (-2.94,2.94)
Total: 40799 W: 7227 L: 6921 D: 26651

bench: 4530093
2013-04-25 12:05:00 +02:00
Marco Costalba
4381ea23fe Fix cpu_count() on some platforms
When we use sysconf(_SC_NPROCESSORS_ONLN) to get number of
cores, we have to include sysconf library that is unistd.h

Sometimes it happens to work just becuase unistd.h indirectly
included by some other libraries, but not always.

Reported and fixed by Eyal BD

No functional change.
2013-04-25 10:56:56 +02:00
Joona Kiiski
817ca1820b Fix potential overflow 2013-04-23 07:26:36 +01:00
Joona Kiiski
8df17204f4 More aggressive post-futility pruning 2013-04-21 14:53:27 +01:00
Marco Costalba
f84f04742a Skip a couple of popcount in previous patch
And some little tidy up

No functional change.
2013-04-19 10:31:18 +02:00
Marco Costalba
cc40d1c46a Merge Joona's bishop+pawn tweak
The idea is to penalize a bishop in case of
its pawns are on the same colored squares.

Good at short 15"+0.05 TC
LLR: 2.95 (-2.94,2.94)
Total: 4252 W: 925 L: 806 D: 2521

And at longer 60"+0.05 TC
LLR: 2.95 (-2.94,2.94)
Total: 15006 W: 2743 L: 2564 D: 9699

bench: 5274705
2013-04-19 09:36:00 +02:00
Joona Kiiski
818e0b2d2b Try more aggressive version 2013-04-17 07:58:59 +01:00
Joona Kiiski
3e4dfb49a7 Give a small penalty for bishop for each pawn on the same colored square 2013-04-16 21:20:31 +01:00
Marco Costalba
87436e5544 Skip a redundant check
Spotted by Joona

No functional change.
2013-04-14 23:29:25 +02:00
Marco Costalba
fe72c93141 De-templetize Position::is_draw()
Now that we always check for repetition we don't
need a template anymore.

No functional change.
2013-04-10 22:23:48 +02:00
Joona Kiiski
75221fcf5e Always check repetition
It seems stronger both at fast 15+0.05 TC with fixed game number test:
ELO: 2.74 +-2.7 (95%) LOS: 97.6%
Total: 24000 W: 4698 L: 4509 D: 14793

And also at long 60+0.05 TC with SPRT
LLR: 3.05 (-2.94,2.94)
Total: 38986 W: 6845 L: 6547 D: 25594

bench: 5157061
2013-04-10 22:20:40 +02:00
Marco Costalba
a95cbca568 Simplify and speed up previous patch
Use an optinal argument instead of a template
parameter. Interestingly, not only is simpler,
but also faster, perhaps due to less L1 instruction
cache pressure because we don't duplicate the very
used SEE code path.

No functional change.
2013-04-09 23:32:06 +02:00
Joona Kiiski
d23454854e Document asymmetric SEE pruning trick
Here are the tests:

sprt @ 60+0.05
ELO: 3.53 +-2.8 (95%) LOS: 99.3%
Total: 18794 W: 3098 L: 2907 D: 12789

16000 @ 60+0.05
ELO: 1.39 +-3.1 (95%) LOS: 81.0%
Total: 16000 W: 2689 L: 2625 D: 10686

16000 @ 15+0.05
ELO: 2.82 +-3.3 (95%) LOS: 95.1%
Total: 16000 W: 3148 L: 3018 D: 9834

No functional change

Signature: 4969307
2013-04-09 23:31:57 +02:00
Joona Kiiski
c2902112e5 Don't treat king safety differently in AnalysisMode
Rationale:

- Current settings seem to make engine *significantly* weaker in analysis mode.
- In practice this setting only has effect when king safety scores are high.
- Even in analysis mode its far more important to know if one side is getting mated,
rather than get evaluation correct with 1cp accuracy.

No functional change
2013-04-09 23:29:58 +02:00
Marco Costalba
9498b2af82 Rescale UCI parameters to 100
And correspondingly modify internal ones
to compensate it.

No functional change.
2013-04-09 23:29:58 +02:00
Marco Costalba
2a5ae34bb2 Tweak some UCI parameters
According to Jean-Paul this setup should be stronger
than default.

And SPRT test seems to confirm it:

At fast TC 15"+0.05
ELO: 3.33 +-2.7 (95%) LOS: 99.2%
Total: 25866 W: 5461 L: 5213 D: 15192

At longer TC 60"+0.05
ELO: 7.27 +-5.0 (95%) LOS: 99.8%
Total: 6544 W: 1212 L: 1075 D: 4257

bench: 5473339

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2013-04-09 23:29:58 +02:00
Marco Costalba
d3fe153fe6 Re-add 'Cowardice' and 'Aggressiveness' UCI options
I have lost my bet with Jean-Paul, so now I re-add
the two options...and I am glad of it :-)

No functional change.
2013-04-09 23:29:58 +02:00
Marco Costalba
889922041b Increase null verification threshold to 12 plies
Increasing depth limit to 10 plies seems stronger
after 16K games at 15"+0.05 (ELO: +3.56) and also
repeating the test at 60"+0.05 TC:

ELO: 2.08 +-3.1 (95%) LOS: 90.9%
Total: 16000 W: 2641 L: 2545 D: 10814

Moreover setting the limit to 12 is proved stronger
then limit set to 10 by direct SPRT test at 15"+0.05:

ELO: 2.56 +-2.0 (95%) LOS: 99.5%
Total: 46568 W: 9240 L: 8897 D: 28431

So we directly set the limit to 12, the strongest setup.

bench: 4361224
2013-04-09 23:29:58 +02:00
Joona Kiiski
7bad50773a Make use of asymmetric SEE 2013-04-05 19:05:32 +01:00
Joona Kiiski
d3c3c4f8e7 Fix a silly bug 2013-04-05 19:05:32 +01:00
Joona Kiiski
2097cd1221 Introduce asymmetric SEE.
No functional change
2013-04-05 19:05:32 +01:00
Marco Costalba
0c1b40c5e2 Lower minimum allowed TT size to 1 MB
Setting a very low TT size could be used
for some specific testing.

No functional change.
2013-04-05 16:56:01 +02:00
Marco Costalba
8c10029df1 Revert "Double Impact of Gain tables"
This reverts commit 36c82b751c

Seems a regression against 2.3.1 tested with 20K games at 60"+0.05

With patch applied
ELO: 15.44 +-2.8 (95%) LOS: 100.0%
Total: 20000 W: 3928 L: 3040 D: 13032

Without patch applied
ELO: 18.76 +-2.8 (95%) LOS: 100.0%
Total: 20000 W: 3903 L: 2824 D: 13273

bench: 4781239
2013-04-05 08:59:38 +02:00
Hiraoka Takuya
6e2371a86b Don't early stop if we have a mated score
No functional change.
2013-04-04 21:39:48 +02:00
Joona Kiiski
36c82b751c Double Impact of Gain tables
Very unorthodox idea.

After 16000 games at 60"+0.05
ELO: 3.14 +-3.4 (95%) LOS: 96.6%
Total: 13407 W: 2278 L: 2157 D: 8972

bench: 4705335
2013-04-03 19:14:59 +02:00
Marco Costalba
7d42d02ec7 Set IID half way between d/2 and d-4
Master IID formula is depth / 2
Previous patch is depth - 4 * ONE_PLY

This one is the middle way:

(dept/2 + depth-4*ONE_PLY)/2  -> depth-2*ONE_PLY-depth/4

After 16000 games at 60+0.05 th 1
ELO: 4.08 +-3.1 (95%) LOS: 99.5%
Total: 16000 W: 2742 L: 2554 D: 10704

bench: 4781239
2013-03-30 22:26:30 +01:00
Marco Costalba
c89274d8fb Merge branch 'master' into increase_iid 2013-03-29 22:50:04 +01:00
Marco Costalba
f2638816bf Raise Min Split Depth
Raise the limit to 12 so to allow people to test
on many cores machines.

Suggested by Gary and Martin.

No functional change.
2013-03-25 20:04:49 +01:00
Marco Costalba
0b4ea54da9 Update bestValue when futility pruning (2)
Same idea of 5af8179647
in qsearch() but applied to search()

After 15500 games at 15+0.05
ELO: 4.48 +-3.4 (95%) LOS: 99.5%
Total: 15500 W: 3061 L: 2861 D: 9578

bench: 4985829
2013-03-24 23:32:21 +01:00