ZirconiumX wrote:Good that the fix is easy - Sigma Chess gives PV as -...
I'm currently recompiling DC.
Hmmm...
Code: Select all
matthew$ gcc -O3 -DPOSIX -DNDEBUG -I/./*.h ./*.c -std=c99 -o doublecheck -Wall -pedantic
In file included from ./search.h:17,
from ./main.c:16:
./tt.h:22: warning: type of bit-field 'depth' is a GCC extension
./tt.h:23: warning: type of bit-field 'key56' is a GCC extension
./main.c: In function 'main':
./main.c:31: warning: ISO C does not support the 'q' printf length modifier
./move.c: In function 'string_to_move':
./move.c:43: warning: 'm.check' is used uninitialized in this function
./move.c:43: warning: 'm.promotion' is used uninitialized in this function
./move.c:43: warning: 'm.ep' is used uninitialized in this function
./movegen.c: In function 'gen_castling':
./movegen.c:145: warning: 'm.check' is used uninitialized in this function
./movegen.c: In function 'gen_quiet_checks':
./movegen.c:37: warning: 'm.check' is used uninitialized in this function
./movegen.c:32: warning: 'm.ep' may be used uninitialized in this function
./movegen.c:32: warning: 'm.promotion' may be used uninitialized in this function
./movegen.c: In function 'gen_piece_moves':
./movegen.c:37: warning: 'm.check' is used uninitialized in this function
./movegen.c:37: warning: 'm.check' is used uninitialized in this function
./movegen.c:37: warning: 'm.check' is used uninitialized in this function
./movegen.c:37: warning: 'm.check' is used uninitialized in this function
./movegen.c:32: warning: 'm.ep' may be used uninitialized in this function
./movegen.c:32: warning: 'm.promotion' may be used uninitialized in this function
./movegen.c:32: warning: 'm.ep' may be used uninitialized in this function
./movegen.c:32: warning: 'm.promotion' may be used uninitialized in this function
./movegen.c:32: warning: 'm.ep' may be used uninitialized in this function
./movegen.c:32: warning: 'm.promotion' may be used uninitialized in this function
./movegen.c:32: warning: 'm.ep' may be used uninitialized in this function
./movegen.c:32: warning: 'm.promotion' may be used uninitialized in this function
./movegen.c: In function 'gen_pawn_moves':
./movegen.c:37: warning: 'm.check' is used uninitialized in this function
./movegen.c:37: warning: 'm.check' is used uninitialized in this function
./movegen.c:37: warning: 'm.check' is used uninitialized in this function
./movegen.c:37: warning: 'm.check' is used uninitialized in this function
./movegen.c:32: warning: 'm.ep' may be used uninitialized in this function
./movegen.c:32: warning: 'm.promotion' may be used uninitialized in this function
./movegen.c:32: warning: 'm.ep' may be used uninitialized in this function
./movegen.c:32: warning: 'm.promotion' may be used uninitialized in this function
./movegen.c:32: warning: 'm.ep' may be used uninitialized in this function
./movegen.c:32: warning: 'm.promotion' may be used uninitialized in this function
./movegen.c:32: warning: 'm.ep' may be used uninitialized in this function
./movegen.c:32: warning: 'm.promotion' may be used uninitialized in this function
./movegen.c: In function 'gen_evasion':
./movegen.c:37: warning: 'm.check' is used uninitialized in this function
./movegen.c:32: warning: 'm.ep' may be used uninitialized in this function
./movegen.c:32: warning: 'm.promotion' may be used uninitialized in this function
./movegen.c: In function 'gen_moves':
./movegen.c:145: warning: 'm.check' is used uninitialized in this function
In file included from ./search.h:17,
from ./search.c:15:
./tt.h:22: warning: type of bit-field 'depth' is a GCC extension
./tt.h:23: warning: type of bit-field 'key56' is a GCC extension
./search.c: In function 'id_loop':
./search.c:82: warning: ISO C does not support the 'q' printf length modifier
./search.c: At top level:
./search.c:49: warning: 'adjust_tt_score' declared inline after being called
./search.c:49: warning: previous declaration of 'adjust_tt_score' was here
./search.c:48: warning: 'can_return_tt' declared inline after being called
./search.c:48: warning: previous declaration of 'can_return_tt' was here
./search.c:47: warning: 'update_killers' declared inline after being called
./search.c:47: warning: previous declaration of 'update_killers' was here
./search.c:392: warning: 'alpha_beta_ok' defined but not used
In file included from ./tt.c:15:
./tt.h:22: warning: type of bit-field 'depth' is a GCC extension
./tt.h:23: warning: type of bit-field 'key56' is a GCC extension
In file included from ./search.h:17,
from ./uci.c:16:
./tt.h:22: warning: type of bit-field 'depth' is a GCC extension
./tt.h:23: warning: type of bit-field 'key56' is a GCC extension
./uci.c: In function 'loop_step':
./uci.c:88: warning: ISO C does not support the 'q' printf length modifier
Better fix those bugs! (No errors though)
You still haven't fixed it:
Naughty DC wrote:
info currmove Qd8xd1+ currmovenumber 54
Matthew:out
That's rather strange. I just compiled it with the "-pedantic" flag and got only the GCC extension warnings. Seems your version of GCC is more "pedantic" than mine
Code: Select all
lucas@megatron:~/Chess/DoubleCheck$ make
gcc -O3 -std=c99 -DPOSIX -DNDEBUG -Wall -pedantic -c -o bitboard.o bitboard.c
gcc -O3 -std=c99 -DPOSIX -DNDEBUG -Wall -pedantic -c -o board.o board.c
gcc -O3 -std=c99 -DPOSIX -DNDEBUG -Wall -pedantic -c -o eval.o eval.c
gcc -O3 -std=c99 -DPOSIX -DNDEBUG -Wall -pedantic -c -o magic.o magic.c
gcc -O3 -std=c99 -DPOSIX -DNDEBUG -Wall -pedantic -c -o main.o main.c
In file included from search.h:17:0,
from main.c:16:
tt.h:22:2: warning: type of bit-field ‘depth’ is a GCC extension [-pedantic]
tt.h:23:2: warning: type of bit-field ‘key54’ is a GCC extension [-pedantic]
gcc -O3 -std=c99 -DPOSIX -DNDEBUG -Wall -pedantic -c -o move.o move.c
gcc -O3 -std=c99 -DPOSIX -DNDEBUG -Wall -pedantic -c -o movegen.o movegen.c
gcc -O3 -std=c99 -DPOSIX -DNDEBUG -Wall -pedantic -c -o movesort.o movesort.c
gcc -O3 -std=c99 -DPOSIX -DNDEBUG -Wall -pedantic -c -o psq.o psq.c
gcc -O3 -std=c99 -DPOSIX -DNDEBUG -Wall -pedantic -c -o search.o search.c
In file included from search.h:17:0,
from search.c:15:
tt.h:22:2: warning: type of bit-field ‘depth’ is a GCC extension [-pedantic]
tt.h:23:2: warning: type of bit-field ‘key54’ is a GCC extension [-pedantic]
gcc -O3 -std=c99 -DPOSIX -DNDEBUG -Wall -pedantic -c -o tt.o tt.c
In file included from tt.c:15:0:
tt.h:22:2: warning: type of bit-field ‘depth’ is a GCC extension [-pedantic]
tt.h:23:2: warning: type of bit-field ‘key54’ is a GCC extension [-pedantic]
gcc -O3 -std=c99 -DPOSIX -DNDEBUG -Wall -pedantic -c -o uci.o uci.c
In file included from search.h:17:0,
from uci.c:16:
tt.h:22:2: warning: type of bit-field ‘depth’ is a GCC extension [-pedantic]
tt.h:23:2: warning: type of bit-field ‘key54’ is a GCC extension [-pedantic]
gcc -O3 -std=c99 -DPOSIX -DNDEBUG -Wall -pedantic -c -o uci_option.o uci_option.c
gcc -O3 -std=c99 -DPOSIX -DNDEBUG -Wall -pedantic -c -o util.o util.c
gcc -O3 -std=c99 -DPOSIX -DNDEBUG -Wall -pedantic -c -o zobrist.o zobrist.c
gcc -flto bitboard.o board.o eval.o magic.o main.o move.o movegen.o movesort.o psq.o search.o tt.o uci.o uci_option.o util.o zobrist.o -o DC
Unfortunately these GCC extensions are extremely important and I don't want to code without.
All the uninitialized stuff is actually OK and intentional. For example the flag move_t.check is not computed by the move generation machinery, but later when moves are "picked" by the move sorting stuff, I test whether they give check and even revealed check and flag the move at this point.
I did a full perft check on lots of positions at different depth to make sure it was 100% bug-free. But I could probably silence these warnings with a few trivial code modifications (with a negligible run time cost).
As for the PV, there is another "true" to set to "false". Good spot (again search.c)
Code: Select all
// root node, display move to search
if (!ply && node_count >= 0x1000) {
char s[16];
move_to_string(B, ms->m, s, false);
printf("info currmove %s currmovenumber %d\n", s, msl.idx);
}