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

888 commits

Author SHA1 Message Date
Marco Costalba
5815718177 Do not special case reductions for MultiPV case
Note that this introduces an asymmetry in which best move
is searched deeper then others also in MultiPV, but this is
not an error per se.

No functional change when MultiPV = 1

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-02-17 09:08:27 +01:00
Marco Costalba
4ead60e2a7 Write the LogFile only at the end of an iteration
Skip writing fail high/low sequences. Note that we don't need
fail high/low markers anymore in pretty_pv().

No functional change but some do/undo move sequences.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-02-13 11:45:49 +01:00
Marco Costalba
2786aed195 Spell checking fixes in search.cpp
Reported by Eelco on open-chess.org

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-02-12 19:06:07 +01:00
Marco Costalba
876ceb1feb Rename iteration in depth in id_loop()
And retire the redundant one.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-02-12 18:53:02 +01:00
Marco Costalba
29076043e0 Start to count iterations from 1
First search should be done at iteration = 1, not 2. So offset
the variable by one.

As a nice side effect now search correctly stops at PLY_MAX
included, not after searching (PLY_MAX - 1) as before.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-02-12 18:17:37 +01:00
Marco Costalba
aa84731fb9 Fix wrong reported depth
Interestingly this patch will make people complain search depth
is reduced against 2.0.1 ;-) but actually it is only an artifact.

Spotted by Joona.

No functional change apart from a different do / undo move
sequence due to teh fact that we don't call pv_info_to_uci()
anymore before entering id loop.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-02-12 17:58:25 +01:00
Marco Costalba
c006435bb4 Move sending of PV line to id_loop()
No functional change apart form move reordering because
pv_info_to_uci() performs a do / undo_move sequence.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-02-11 06:28:55 +01:00
Marco Costalba
141410f177 Maximum aspiration delta of 24
After 9080 games
1430 - 1342 - 6308  ELO +3 (+- 2.9)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-02-10 21:09:20 +01:00
Joona Kiiski
3abff79df3 Maximum aspiration delta of 64
After 9242 games
Mod vs Orig: 1483 - 1373 - 6386  ELO +4 (+- 2.9)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-02-09 23:52:24 +01:00
Marco Costalba
62c707e1d5 Simplify latest patches
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-02-06 12:41:47 +01:00
Joona Kiiski
26e7673c18 Retire some conditions from ok_to_use_TT_pv
After 4844 games 768 - 747 - 3329  ELO +2

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-02-05 11:06:08 +01:00
Marco Costalba
b366c7dc38 Use TT for pruning also in PV nodes
Biggest advantage is be able to analize positions
without "loss of memory" when goind back/forth in
a position.

Patch has proven to fix analysys problems and is even
worths some elo points.

After 5811 games Mod- Orig:
1037 - 902 - 3872 +8 ELO  (+- 3.6) LOS 97%

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-31 13:07:26 +01:00
Marco Costalba
9ba7f701ea Retire singleEvasion
This let us get rid of number_of_evasions()

After 5487 games
Mod- Orig: 851 - 852 - 3784 +0 ELO  (+- 3.7)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-27 07:55:04 +01:00
Marco Costalba
f352008958 Introduce and use qsearch_scoring()
Move qsearch scoring functionality out of RootMoveList
initialization. Will be needed by future patches.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-23 10:54:16 +01:00
Marco Costalba
6849f0800e Retire InitialDepth
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-23 10:52:51 +01:00
Marco Costalba
5194b2bb06 Pass TT move instead of Rml[0].pv[0] to MovePicker
This is used for secondary scoring so it does not
changes the fact that Rml[0].pv[0] is always tried
as first anyhow.

It happens this is even a no functional change patch
becuase we reinsert PV in TT after a search so that
TT move is actually Rml[0].pv[0].

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-23 09:11:31 +01:00
Joona Kiiski
a8f457d425 Different searchedMoves system
After 8751 games on russian cluster
Mod- Orig: 1426 - 1323 - 6002  ELO +4 (+- 2.9) LOS 86%

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-23 08:36:47 +01:00
Marco Costalba
79b1a7417f Remove special Root cases
So to better spot where the differences really
count. Also add some more additional cleanup.

Harmless functional change and no regression.

After 5780 games
Mod- Orig: 931 - 955 - 3894 ELO -1 (+- 3.6)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-23 08:36:12 +01:00
Marco Costalba
b67de36671 Retire init_ss_array()
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-20 19:34:25 +01:00
Marco Costalba
d91d6da3c4 Sort root moves moves in MovePickerExt
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-18 18:52:52 +01:00
Marco Costalba
5bad5fc0a7 Fix a (bestValue == -VALUE_INFINITE) assert
In case of a Root node we can leave with bestValue set
to -VALUE_INFINITE if search is stopped by the GUI and
stopReques flag is raised.

This patch fixes the issue.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-18 13:30:13 +01:00
Marco Costalba
6119e4ea37 Additional cleanup in id_loop()
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-18 13:30:13 +01:00
Marco Costalba
5555b60b38 Use a global RootMoveList object instead of a pointer
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-18 13:30:12 +01:00
Marco Costalba
846087e4fb Move globals to id_loop()
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-18 13:30:11 +01:00
Marco Costalba
2e2f1064ba Introduce and use MovePickerExt
A bit of template magic to restore a proper and readable moves
'while' loop that now is again 'similar' to the one that used
to be in search().

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-18 13:30:11 +01:00
Marco Costalba
392c7f2ab6 Unify root_search() step 3
Retire root_search()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-18 13:30:10 +01:00
Marco Costalba
6b8026806c Unify root_search() step 2
Enable the change: now we use search() instead of root_search()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-18 13:29:57 +01:00
Marco Costalba
299bda9ea3 Unify root_search() step 1
Teach search() to behave as a root node if requested.
Just added code, but still no functional change.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-18 13:28:34 +01:00
Marco Costalba
842efefcad Sync root_search() with search()
This will let unification easier.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-16 13:45:34 +01:00
Marco Costalba
c17a127c42 Move fail loops out of root_search() to id_loop()
And sync root_search() with search()

After 9384 games Mod - Orig:
1532 - 1433 - 6419  ELO +3 (+- 2.8)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-16 13:45:23 +01:00
Marco Costalba
7faeab0878 Retire history.cpp
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-15 10:02:45 +01:00
Marco Costalba
62cd133b3a Initialize killers at ss+2 also in root_search()
After 4955 games:
Mod - Orig: 786 - 768 - 3401 +1 ELO

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-14 07:27:06 +01:00
Marco Costalba
611a29f767 Big book.cpp cleanup
Better document PolyGlot formats and greatly
reduce line count.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-10 19:55:02 +01:00
Marco Costalba
15153a1de7 Don't copy Position in pretty_pv()
Also let do_setup_move() don't reuse same StateInfo so that
we can remove the check about different StateInfo objects
before memcpy() in do_move.

Functional change due to harmless additionals
do_move() / undo_move() steps.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-09 12:55:22 +01:00
Marco Costalba
b4acf83704 Ressurect move.cpp
Actually it is san.cpp renamed. Because now has the move
conversions functions and doesn't have any more the bulky
move_from_san(), it is better to call it move.cpp

Remove san.h while there.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-08 17:52:02 +01:00
Marco Costalba
82d5386435 Move uci move parsing under san.cpp
This partially reverts 1e7aaed8bc keeping the conversion
functions from/to move to uci string in the same file.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-08 15:53:49 +01:00
Marco Costalba
0f81f97bb6 Improve I/O responsivness
Added checking of (stdin->_cnt > 0) from Greko.

This seems to greatly improve responsivness when running
under console. Now while running a 'stockfish bench', any key
press immediately is detected by SF while before there was a
delay of some fraction of a second.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-08 14:17:41 +01:00
Marco Costalba
57b3ca916f Unify move generation
Functional change due only to moves reorder. Anyhow after
5242 games at 15"+0.1 TC verified we have no regression.

Mod vs Orig 994 - 958 - 3290 +2 ELO

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-07 16:56:42 +01:00
Marco Costalba
1e7aaed8bc Retire move.cpp
Move its functions where they belong.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-07 13:40:13 +01:00
Marco Costalba
c14dae1fa2 Improve update_killers() signature
Will be used by future patches and is cleaner.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-06 09:09:53 +01:00
Marco Costalba
dadf6a6fe9 Set moveCount base to 1 as in search()
Now first move has moveCount == 1 also in root_search()

Also added small readibility touches.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-05 23:19:12 +01:00
Marco Costalba
6a5dc14251 Use killers also in root_search()
After 4238 games
Mod-Orig 800 - 686 - 2752 +9 ELO

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-05 23:17:28 +01:00
Marco Costalba
55b16593a4 Perft should return an int64_t not an int
Found by Louis Zulli with his super fast
hardware: 65M nodes/sec at perft !

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-05 21:13:21 +01:00
Marco Costalba
97212bafc9 Use 'moveCount' name also in RootSearch
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-04 11:35:54 +01:00
Marco Costalba
2bb555025f Revert Chess960 fix
Will be substituted by a better next patch.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-03 22:48:08 +01:00
Marco Costalba
22ede4442c Fix Chess960 regression
Introduced by me in before 1.9 and found by Tord that says:

The 'isChess960' slot in the 'Position' class is currently
set depending on the initial files of the rooks, and not on the value
of the UCI_Chess960 parameter. This is incorrect, as there are lots of
Chess960 positions where the rooks start on the usual files. As a
consequence (unless I am missing something), Stockfish will occasionally
output castling moves as e1g1/e1c1 rather than the correct e1h1/e1a1 format
in Chess960 games. It is possible that some or even most GUIs are robust
enough to accept both notations, but I wouldn't bet on it. And in any case,
Stockfish's behavior clearly violates the protocol.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-03 00:41:39 +01:00
Marco Costalba
0693ff178e Fix old Glaurung bug related to search logging
When we log best and ponder move to a file before to
return from think we change the position. If position is
then not resended by GUI, as for manual user input we got
an error:

justinb@malibu:~$ stockfish
Stockfish 2.0 JA 64bit by Tord Romstad, Marco Costalba, Joona Kiiski
setoption name Use Search Log value true
go depth 1
info depth 1
info depth 1 seldepth 1 multipv 1 score cp 72 time 59 nodes 20 nps 338 pv g1f3
info depth 2
info depth 2 seldepth 2 multipv 1 score cp 12 time 59 nodes 44 nps 745 pv g1f3 g8f6
info nodes 84 nps 1423 time 59
bestmove g1f3 ponder g8f6
go depth 1
info depth 1 score mate 0
info nodes 87 nps 0 time 0
bestmove (none) ponder (none)

Bug spotted and fixed by UncombedCoconut.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-02 11:22:41 +01:00
Marco Costalba
f902ddaa89 Fix a crash on multi-pv
Bug reported by Tobias Haspel and fixed by Joona.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-01 23:10:37 +01:00
Marco Costalba
3201a43460 Fix an off-by-one bug in sort_multipv()
Second parameter of insertion_sort() is a pointer to the
element _after_ the last of the list, e.g. end() when sorting
all items.

If we want to sort say the first 2 moves we should write:

sort_multipv(2);

So, becuase in root moves loop move counter 'i' starts
from 0, we need to pass:

sort_multipv(i+1);

To sort up to move 'i' included.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-01 16:07:30 +01:00
Marco Costalba
5405efabcb Remove artificial Iteration >= 3 constraint on time manager
It doesn't seem to have any meaning.

Also add a FIXME on the MaxNodes condition that now is broken
in SMP case due to known issue with pos.nodes_searched()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-01 16:07:29 +01:00