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

1424 commits

Author SHA1 Message Date
Marco Costalba
8189ae9e1c Fix a silly bug that disabled second killer
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Signed-off-by: unknown <Marco@.(none)>
2008-11-19 22:15:26 +01:00
Marco Costalba
1d525bb45f qsearch: restore pruning of pv nodes with negative SEE
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Signed-off-by: unknown <Marco@.(none)>
2008-11-19 22:15:14 +01:00
Marco Costalba
da7d872eda Fix Intel warnings and init_search_stack argument
Should be a reference not a copy!

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-16 12:46:12 +01:00
Marco Costalba
49d52b8266 Set killer slots number to 2
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-16 12:37:48 +01:00
Marco Costalba
75d001addd MovePicker: fix a nasty bug in EvalInfo optimization
EvalInfo has missing attack info when a specialized
endgame function is used.

We missed this case and were using an empty attack bitboard
instead so that no captures were generated for endgames.

After testing the EvalInfo optimization gave worst results,
so after a (long) debug session this nasty bug was found.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-16 12:37:48 +01:00
Marco Costalba
7daaf03b39 Add and use update_killers()
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-16 12:37:48 +01:00
Marco Costalba
2e778445d5 Add and use move_is_killer() helper
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-16 12:37:48 +01:00
Marco Costalba
93bc05cf69 Convert killers to a vector
Add infrastructure to threat killer moves as a vector,
this will allow us to easily parametrize the number of
killer moves, instead of hardcode this value to two as is now.

This patch just add the infrastructure, no functional
change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-16 12:37:47 +01:00
Marco Costalba
a7227ac26f qsearch: do not prune pv nodes with negative SEE
Also small micro-optimization, take a line out of
the moves loop.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-16 12:37:47 +01:00
Marco Costalba
bb0da595a7 Disable per-square MVV/LVA for now
Needs more testing.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-16 12:37:47 +01:00
Marco Costalba
20d7197a9b MovePicker: use EvalInfo to skip generating captures
When we know already no captures are possible in a given
position.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-16 12:37:46 +01:00
Marco Costalba
f4758ced90 Position::to_fen(): fix a bug in side to move representation
Was introduced almost two months ago in patch:
"Space inflate Position::to_fen()"

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-16 12:37:46 +01:00
Marco Costalba
3c05bd70eb Print the move in addition to position
Teach Position::print() to optionally print a
given move in san notation in addition to
the ASCII representation of the board.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-16 12:37:46 +01:00
Marco Costalba
7000e100bd Enable per-square MVV/LVA
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-16 12:37:46 +01:00
Marco Costalba
2ed22e4fc8 MovePicker:find bad captures during scoring
Instead of pospone until picking. No functional
change and probably no performance change but it is
needed for following patch.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-16 12:37:46 +01:00
Marco Costalba
940c53c366 MovePicker: introduce per square MVV/LVA ordering
Just added the infrastructure, no functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-16 12:37:45 +01:00
Marco Costalba
4df8651c82 Fix hashfull info
Do not count has a replacement when a TT entry is
written in an empty slot.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-16 12:37:45 +01:00
Marco Costalba
2d4e2bc62a Fix in ok_to_history(): castle move is not a capture
It is erroneusly considered a capture because king
moves on the same square of the rook.

Use the correct function Position::move_is_capture()
instead of the open coded (and buggy) one.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-10 19:19:40 +01:00
Marco Costalba
d89a03cc35 Small tidyup of TranspositionTable::store()
Hopefully without bugs this time!

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-10 19:19:40 +01:00
Marco Costalba
34b1d0538b Fix a logic bug in TranspositionTable::store()
Make the logic work as advertised in the function
description.

Still a fallback from TT cleanup.

This should be less serious then the one in retrieve(),
but it's still a bug.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-10 19:19:40 +01:00
Marco Costalba
cdf1f23bc5 Micro optimization of update_history()
Remove an useless comparison.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-10 19:19:40 +01:00
Marco Costalba
e86468cc63 Use cut-off checks in qsearch as killer moves
Killers should not be captures, but checks are not
and are produced also in qsearch.

Use this information, will be useful for move ordering.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-10 19:19:40 +01:00
Marco Costalba
e7bad2687a Smaller null move reduction when depth is high
Lower probability to miss something important.

It seems to increase strenght. Idea form Cyclone.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-10 19:19:39 +01:00
Marco Costalba
3f610e2b13 Introduce LastIterations variable
Is set during the last iteration.

Sometime also during the second last.

During the last iteration is set in the 95% of cases.

During the second last is set in the 40% of cases.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-10 19:19:39 +01:00
Marco Costalba
6cc11272e2 Restore development versioning and LSN filtering
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-10 19:19:39 +01:00
Marco Costalba
a28c17ecb6 Fix a missed initialization in get_option_value()
Spotted and reported by Dann Corbit.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-04 20:59:11 +01:00
Marco Costalba
ec23692433 Stockfish 1.01
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-04 20:56:30 +01:00
Marco Costalba
787d358554 Fix compile under Ubuntu 64bit
Some missing includes.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-04 20:56:30 +01:00
Marco Costalba
ff0d9dad2b Fix a serious bug in TranspositionTable::retrieve()
Reported by Tord Romstad.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-04 20:56:30 +01:00
Marco Costalba
046fd4926f Restore development versioning
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-04 20:56:30 +01:00
Marco Costalba
c595185b3c Restore LSN filtering
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-04 20:56:18 +01:00
Marco Costalba
1a158c0cf0 Revert movepick optimizations before to release
More testing is needed and better do not risk
just before release.

Reverted:

Disable LSN filtering as defualt for release
Use MVV/LVA in score_evasions()

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-02 15:58:10 +01:00
Marco Costalba
8097e99c69 Stockfish 1.0
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-02 15:35:32 +01:00
Marco Costalba
2fa9d25e82 Disable LSN filtering as defualt for release
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-02 15:35:02 +01:00
Marco Costalba
3e275680d5 Use MVV/LVA in score_evasions()
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-02 15:00:28 +01:00
Marco Costalba
d087b0a34a Delay SEE for scoring captures
Do not calculate SEE on all the moves in MovePicker::score_captures()
but delay until pick_move_from_list() when only the best ones are
double checked against their see value.

If a beta cut-off occurs then we avoid calculating SEE on all
the moves, but just the picked ones.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-02 15:00:28 +01:00
Marco Costalba
55b6464d40 search: micro optimization
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-02 15:00:28 +01:00
Marco Costalba
b5232e2da3 Fix a couple of gcc warnings in position.cpp
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-02 15:00:19 +01:00
Marco Costalba
35bd334b30 Update README to Stockfish
Remove Glaurung references.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-02 15:00:09 +01:00
Marco Costalba
6e8bd8bf2d Final touches to material.cpp
No functional changes, altough a bit of code reshuffle.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-01 12:46:54 +01:00
Marco Costalba
899b9455d6 Material: lockless per-thread maps
Adds a good bunch of code but should be faster
and scalable because is lockless.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-01 12:46:54 +01:00
Marco Costalba
8b57416ace Revert "MovePicker::score_captures() order with SEE when pv"
Does not seem to increase the strenght.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-01 12:46:54 +01:00
Marco Costalba
1146fc8d09 Space inflate move.cpp
Also a little cleanup.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-01 12:46:53 +01:00
Marco Costalba
6e5cf2f3c5 Revert "Relax time constraints"
Does not seem to give an improvment, acutually it seems
a totally neutral change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-01 12:46:53 +01:00
Marco Costalba
e5ebd4f5d1 Partially space inflate search.cpp
Space inflate main remaining functions in search.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-01 12:46:53 +01:00
Marco Costalba
cf2bafb661 Relax time constraints
Allow a seacrh to take a bit more time if needed.

This reduces the chanches of wast all the search time
for the last iteration and also allow to start the last
iteration when we have less time remaining.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-01 12:46:53 +01:00
Marco Costalba
79513e3a43 Material: micro optimize map reading
Do only one map walk per read instead of two.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-01 12:46:52 +01:00
Marco Costalba
bd3ec6af15 Material: protect global map access with locks
STL library is not guaranteed to be thread safe, even for
read-access.

So because these global maps are accessed by all the threads
we need to protect them.

This fixes a random crash experienced during testing.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-01 12:46:52 +01:00
Marco Costalba
b2b86cfd27 MovePicker::score_captures() order with SEE when pv
Order PV nodes by SEE instead of MVV/LVA.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-01 12:46:52 +01:00
Marco Costalba
7d717df4e4 Revert "Last minute surprise" for now
It defenitly needs more testing. Just postponed.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-11-01 12:46:52 +01:00