Search found 84 matches
- Sun May 24, 2020 10:27 am
- Forum: Computer Chess Club: Programming and Technical Discussions
- Topic: PGN standard
- Replies: 45
- Views: 17932
Re: PGN standard
Years ago Tord Romstad suggested to create a PGN replacement format in https://www.reddit.com/r/chess/comments/47fexz/towards_a_replacement_for_the_pgn_format/ Does anyone know was it evolved to something concrete? Interesting. That proposal (and most comments) align nicely with what I've been fidd...
- Sat May 23, 2020 6:02 pm
- Forum: Computer Chess Club: Programming and Technical Discussions
- Topic: PGN standard
- Replies: 45
- Views: 17932
Re: PGN standard
I'd suggest replacing PGN with a JSON/YAML-based format. As it happens, I've been recently fiddling with the following position serialisation: { "players": [ { "pieces": [ "Ke1", "Ra1", "Rh1", "Bc1", "Bf1", "Nb1", "Ng1", "Qd1", "Pa2", "Pb2", "Pc2", "Pd2", "Pe2", "Pf2", "Pg2", "Ph2" ], "castlingFiles...
- Mon Apr 27, 2020 4:27 pm
- Forum: Computer Chess Club: Programming and Technical Discussions
- Topic: Dirty hashing trick
- Replies: 15
- Views: 2806
Re: Dirty hashing trick
The idea is to substitute lookup with addition/subtraction. I tried implementing this in double push, but there seems to be a bug somewhere in my logic.
- Mon Apr 27, 2020 1:47 pm
- Forum: Computer Chess Club: Programming and Technical Discussions
- Topic: Dirty hashing trick
- Replies: 15
- Views: 2806
- Mon Apr 27, 2020 1:03 pm
- Forum: Computer Chess Club: Programming and Technical Discussions
- Topic: Dirty hashing trick
- Replies: 15
- Views: 2806
Re: Dirty hashing trick
uint32 pieceKey[NPIECES]; uint32 squareKey[BOARDSIZE]; #define KEY(piece,square) (pieceKey[piece] * (unit64) squareKey[square]) How about the following? uint64_t piece_key[NPIECES]; uint64_t row_key[NPIECES]; uint64_t col_key[NPIECES]; #define KEY(piece, square) (piece_key[piece] + row_key[piece] *...
- Mon Apr 27, 2020 8:49 am
- Forum: Computer Chess Club: Programming and Technical Discussions
- Topic: Dirty hashing trick
- Replies: 15
- Views: 2806
Re: Dirty hashing trick
I use the Polyglot hash values for my TT. It saves some space since I don't need another dedicated array for the hash values and the current position's TT hash value can be used directly when looking up openings from a Polyglot book. I maintain castling rights as 4 bits (low order in a byte), setti...
- Mon Apr 27, 2020 5:04 am
- Forum: Computer Chess Club: Programming and Technical Discussions
- Topic: Dirty hashing trick
- Replies: 15
- Views: 2806
Re: Dirty hashing trick
The following works: static uint64_t get_key_ep_square(register const int8_t ep_square) { return (ep_square >= 0) + (ep_square & 7); } provided that the negative ep_square is divisible by 8. However, that seems to actually slow things down, so I'll stick with the ternary. Using 128 as the negative v...
- Sun Apr 26, 2020 4:01 pm
- Forum: Computer Chess Club: Programming and Technical Discussions
- Topic: Dirty hashing trick
- Replies: 15
- Views: 2806
Re: Dirty hashing trick
OK, I think I got it right this time around: static uint64_t get_key_ep_square(register const int8_t ep_square) { return ep_square < 0 ? 0 : ((ep_square & 7) ^ 8); } static uint64_t rotll(uint64_t n, uint8_t c) { return (n << c) | (n >> (64 - c)); } static uint64_t get_key_castling(register const ui...
- Sun Apr 26, 2020 2:56 pm
- Forum: Computer Chess Club: Programming and Technical Discussions
- Topic: Dirty hashing trick
- Replies: 15
- Views: 2806
Re: Dirty hashing trick
Scratch that. The code is incorrect, no performance gain with corrected code.
- Sun Apr 26, 2020 1:42 pm
- Forum: Computer Chess Club: Programming and Technical Discussions
- Topic: Dirty hashing trick
- Replies: 15
- Views: 2806
Re: Dirty hashing trick
With the same idea applied to e.p. square: static uint64_t get_key_ep_square(register const int8_t ep_square) { return ep_square < 0 ? 0 : ((ep_square & 7) + 8); } static uint64_t get_key_castling(register const uint64_t dirty) { return ((dirty & dirty_masks[SIDE_WHITE]) | ((dirty << 56) & dirty_mas...