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

1784 commits

Author SHA1 Message Date
Marco Costalba
2e6839c9a0 Increase risk of blunders at low skill levels
According to Heinz's tests current setup is in fact too
strong for weak players. This seems the best according
to his tests.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-20 12:04:43 +01:00
Marco Costalba
67b0d0b1cc Use only history to score non captures
It seems gain is practically unuseful, so remove.

After 13554 games:
Mod vs Orig 2252 - 2319 - 8983 ELO -1 (+- 3.4)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-17 22:32:12 +01:00
Marco Costalba
068561f86a Small simplification in scale_by_game_phase()
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-17 10:31:26 +01:00
Marco Costalba
076b62310e Move ply to SearchStack
Shrink search() signature for better readibility.

We get also a nice 1.3% speed increase.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-17 08:59:54 +01:00
Marco Costalba
5ba85ef441 Remove one indentation level in get_next_move()
Small renaming and fix some comments.

No functional and no speed change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-16 12:57:06 +01:00
Marco Costalba
c13b53a514 Code style in tt.cpp
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-16 10:49:35 +01:00
Marco Costalba
a860576493 Better self-document LMR reduction() formula
Suggested by Onno

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-16 10:49:27 +01:00
Marco Costalba
786564068b Promote OptionsMap to a class
And add a bit of documentation too.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-16 10:49:20 +01:00
Marco Costalba
6056a43419 Fix a stale comment
Spotted by Onno

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-16 10:21:31 +01:00
Marco Costalba
f8e767388b Remove src/COPYING file
It is enough the one in the base directory

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-14 07:06:56 +01:00
Marco Costalba
b41b590457 Remove "divide by zero" workaround
It is now useless because of the condition at the beginning.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-14 07:04:32 +01:00
Marco Costalba
7f367e6019 Cleanup debug counters
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-13 18:51:56 +01:00
Marco Costalba
54f1c383d3 Move move_is_legal() under Position class
It is a more logical place than in move generation file.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-13 13:18:19 +01:00
Marco Costalba
fe8f5b3497 Some more cleanup in endgame.cpp
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-13 13:17:21 +01:00
Marco Costalba
6608a16a6a Fix some warnings and a compile error with icc
Unfortunatly icc does not understand that weakerSide and
strongerSide belongs to the base class :-(

So we have define them in the derived class.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-12 08:05:41 +01:00
Marco Costalba
b5d5646c84 Move EndgameFunctions to endgame.cpp
And cleanup code while there.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-11 21:25:24 +01:00
Marco Costalba
08c464c690 Increase MaterialTableSize 8 times
Now that we prefetch in material hash table we
can increase its size and gain something.

Hit rate is now of 98% from 92%

Speedup of 0.8%

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-11 18:15:40 +01:00
Marco Costalba
f28ddbb852 Introduce and use NoPawnsSF[] in material.cpp
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-11 18:11:16 +01:00
Marco Costalba
c88eebc989 Tempeltize material imbalance
Speedup of almost 1%

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-11 12:35:54 +01:00
Marco Costalba
7a84b8ca34 Sync material.h with pawns.h
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-11 12:24:10 +01:00
Marco Costalba
6738b65be9 Prefetch also material tables
Prefetch both pawn and material tables in do_move() and
prefetch always, not only after a pawn move or a capture.

Speed up of 0,7%

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-11 12:24:02 +01:00
Marco Costalba
2f1935078d Assorted code style and comments in pawns.cpp and pawns.h
The only interesting thing is that a backward or isolated
pawn cannot be a candidate passer, so code this condition.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-10 12:16:36 +01:00
Marco Costalba
8e71ee7ec6 Retire mate threat extension
It seems we have a lot of totally useless code !

After 8577 games 1504 - 1451 - 5622 ELO +2 (+- 4.4)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-08 07:48:05 +01:00
Marco Costalba
9bee5f51d8 Fix a compile error in debug mode
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-07 08:09:41 +01:00
Marco Costalba
927f1b0bd3 Assorted code style and comments in search.cpp
Nothing really serious....

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-05 19:00:40 +01:00
Marco Costalba
04108d4541 Added -Wshadow option and fixed resulting warnings
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-04 12:11:01 +01:00
Marco Costalba
f7ef48b478 Teach SF to blunder
Add blunder cabability to skill level feature.

The idea is that instead of choosing the best move at the end
of the ID loop, we now do this at a randomly chosen sampling depth
dependent on SkillLevel, so that at low skill levels we sample when
ID loop has reached only a small depth and so we have an higher
probability to pick up a blunder.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-02 10:04:34 +01:00
Joona Kiiski
2e8998eac9 Use prob cut search to prune bad captures
The idea is to try a shallow search with reduced beta
on bad captures so to quickly prune them out in case
are really bad.

After 5529 games 966 - 868 - 3695  ELO +6 (+- 5.4) LOS 91%

Tested also version without upper limitation to 8 plies:

After 8780 games 1537 - 1398 - 5850  ELO +5 (+- 4.3) LOS 93%

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-02 08:39:54 +01:00
Marco Costalba
8402b40341 Retire recapture extension also for PvNode
Seems that extension is useless.

After 10105 games
Mod vs Orig 1738 - 1702 - 6665  ELO +1 (+- 4)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-01 22:02:18 +01:00
Marco Costalba
408fdcc93f Use a constant instead of value_mate_in(PLY_MAX)
And also apply the same to value_mated_in(PLY_MAX)

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-01 21:46:45 +01:00
Marco Costalba
b27e237b04 Retire value_is_mate()
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-01 21:46:34 +01:00
Marco Costalba
f5b8db7a1e Simplify wait_for_stop_or_ponderhit()
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-01 21:46:27 +01:00
Marco Costalba
8d4caebabe Retire update_killers()
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-01 21:46:12 +01:00
Marco Costalba
d173285da5 Fine tune skill level
Rescaled Skill level from 0 to 20. At level 19 is still
comparable with Crafty 20.14, while at low levels strength
increase is now less steep.

Thanks to Joona and Heinz for testing and valuable
comments.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-28 13:09:13 +01:00
Marco Costalba
41fe70d703 Add "Skill level functionality
It is now possible to adjust skill level of Stockfish
from 10 (full strength) to 0.

Skill adjustment is done in such a way that is CPU speed and
time control largely independent, at least at low skills. It
means that given a skill we have same play level on a mobile
phone and on a super OCTAL CPU, at 1' per game or at 180'.

At skill 9 strength is that of an average engine, I have used
Crafty 20.14 to tune and we are more or less there. At skill 0
engine is pretty weak but still shows a realistic play.

When skill is not used we don't have any impact on the regular
code.

Idea to use MultiPV is from Heinz van Saanen, implementation and
formulas by me.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-27 11:50:22 +01:00
Marco Costalba
d372f2e39a Fix a compile error with icc
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-26 09:25:26 +01:00
Marco Costalba
4270aec558 Send PV line to GUI only after resolving a fail high
This is how Shredder, Rybka and others do and
avoids user is confused by a fail high (sent to GUI)
followed by a fail low (not sent).

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-24 13:21:54 +01:00
Marco Costalba
f427acbd27 Triviality in position.cpp
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-24 13:21:47 +01:00
Marco Costalba
87ca13a79a Retire move_ambiguity() altogether
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-23 13:09:04 +01:00
Marco Costalba
d52d91064f Simplify move_ambiguity()
And additional small touches in move.cpp

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-22 13:23:41 +01:00
Marco Costalba
920b1abede Do not send ponder move if we don't have it
Has been reported by Justin Blanchard that
this creates problems on some buggy GUI.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-19 16:08:19 +01:00
Marco Costalba
5ea08e79c4 Use intrinsic in pop_1st_bit() under MSVC 64 bits
Around 1% speedup when compiled with MSVC 64

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-17 14:29:09 +01:00
Marco Costalba
635be39acf Additional cleanup in bitbase.cpp
Also better document what code does.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-12 18:22:22 +01:00
Marco Costalba
c1c0984452 Move KPKBitbase[] where it belongs
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-12 12:12:41 +01:00
Marco Costalba
d653aeca05 Fix a couple of issues in bitbase.cpp
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-12 11:22:02 +01:00
Marco Costalba
09d217bff7 Reintroduce initialization of some bitboards
With off-by-one bug in InFrontBB[] loop fixed.

Also use int instead of File to workaround a bug
in mingw 4.4.0 in first loop that cycles forever.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-10 19:23:39 +01:00
Marco Costalba
d9113d127b Rename NonSlidingAttacksBB[] in StepAttacksBB[]
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-10 08:10:26 +01:00
Marco Costalba
c2511243b4 Update copyright notes in rkiss.h
New info after a thread on talkchess:

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

and some emails exchange with Heinz.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-10 08:08:34 +01:00
Marco Costalba
d85cf6d9c3 Revert previous patch due to miscompile under gcc
I need to understand what's going on, in the
meantime revert.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-10 08:08:04 +01:00
Marco Costalba
a617b03875 Change initialization of some bitboards
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-08 19:44:19 +01:00