1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 01:03:09 +00:00
BadFish/src
Marco Costalba 94e41274bb Fix incorrect draw detection
In this position we should have draw for repetition:

position fen rnbqkbnr/2pppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1 moves g1f3 g8f6 f3g1
go infinite

But latest patch broke it.

Actually we had two(!) very subtle bugs, the first is that Position::set()
clears the passed state and in particular 'previous' member, so
that on passing setupStates, 'previous' pointer was reset.

Second bug is even more subtle: SetupStates was based on std::vector
as container, but when vector grows, std::vector copies all its contents
to a new location invalidating all references to its entries. Because
all StateInfo records are linked by 'previous' pointer, this made pointers
go stale upon adding more element to setupStates. So revert to use a
std::deque that ensures references are preserved when pushing back new
elements.

No functional change.
2016-04-18 00:13:16 +02:00
..
syzygy StateInfo is usually allocated on the stack by search() 2016-04-17 08:29:33 +02:00
benchmark.cpp Fix incorrect draw detection 2016-04-18 00:13:16 +02:00
bitbase.cpp Update AUTHORS and copyright notice 2016-01-02 09:43:51 +00:00
bitboard.cpp Hide global visibility when not needed 2016-04-09 10:42:04 +02:00
bitboard.h Hide global visibility when not needed 2016-04-09 10:42:04 +02:00
endgame.cpp StateInfo is usually allocated on the stack by search() 2016-04-17 08:29:33 +02:00
endgame.h Update AUTHORS and copyright notice 2016-01-02 09:43:51 +00:00
evaluate.cpp Hide global visibility when not needed 2016-04-09 10:42:04 +02:00
evaluate.h Update AUTHORS and copyright notice 2016-01-02 09:43:51 +00:00
main.cpp Update AUTHORS and copyright notice 2016-01-02 09:43:51 +00:00
Makefile 32-bit/64-bit Makefile fix 2016-04-08 18:47:31 +01:00
material.cpp Update AUTHORS and copyright notice 2016-01-02 09:43:51 +00:00
material.h Update AUTHORS and copyright notice 2016-01-02 09:43:51 +00:00
misc.cpp Restore development version 2016-01-03 13:52:01 +00:00
misc.h Update AUTHORS and copyright notice 2016-01-02 09:43:51 +00:00
movegen.cpp Update AUTHORS and copyright notice 2016-01-02 09:43:51 +00:00
movegen.h Update AUTHORS and copyright notice 2016-01-02 09:43:51 +00:00
movepick.cpp Add a second level of follow-up moves 2016-04-17 15:19:20 +01:00
movepick.h Add a second level of follow-up moves 2016-04-17 15:19:20 +01:00
pawns.cpp Backward simplication 2016-04-08 19:12:55 +01:00
pawns.h Assorted cleanup of latest commits 2016-03-14 20:42:44 -07:00
position.cpp StateInfo is usually allocated on the stack by search() 2016-04-17 08:29:33 +02:00
position.h Fix incorrect draw detection 2016-04-18 00:13:16 +02:00
psqt.cpp Hide global visibility when not needed 2016-04-09 10:42:04 +02:00
search.cpp Add a second level of follow-up moves 2016-04-17 15:19:20 +01:00
search.h Add a second level of follow-up moves 2016-04-17 15:19:20 +01:00
thread.cpp Fix incorrect draw detection 2016-04-18 00:13:16 +02:00
thread.h StateInfo is usually allocated on the stack by search() 2016-04-17 08:29:33 +02:00
thread_win32.h Assorted English grammar changes 2016-01-16 21:34:29 +00:00
timeman.cpp StateInfo is usually allocated on the stack by search() 2016-04-17 08:29:33 +02:00
timeman.h Time management simplification 2016-01-29 00:47:07 +00:00
tt.cpp Update AUTHORS and copyright notice 2016-01-02 09:43:51 +00:00
tt.h Depth margin parameter-tweak in TT-save 2016-01-18 22:04:38 +00:00
types.h Rewrite bsfq management 2016-03-28 15:46:55 +01:00
uci.cpp Fix incorrect draw detection 2016-04-18 00:13:16 +02:00
uci.h Update AUTHORS and copyright notice 2016-01-02 09:43:51 +00:00
ucioption.cpp Revert "Remove slowMover" 2016-02-28 13:25:05 +00:00