Search found 1643 matches

by Gerd Isenberg
Tue Mar 10, 2020 8:16 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Removing Large Arrays
Replies: 36
Views: 3341

Re: Removing Large Arrays

Often, I test the speed of different function methods. The results indicate the fixed array PushToEdges[] seems to be faster on average: 10 second test ... PushToEdges 16519006400 push_to_edge 16610155136 In a real chess program with many instances fighting for the caches, things may turn out diffe...
by Gerd Isenberg
Thu Feb 27, 2020 8:57 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Don't understand CarryRippler
Replies: 14
Views: 1161

Re: Don't understand CarryRippler

Unary minus operator of unsigned integers (short, long) in C/C++ is defined as two's complement, which is the increment of the ones' complement. If you add a value and its ones' complement, the sum has all bits set without any intermediate bitwise overflows. If you further add 1, an overflow occurs ...
by Gerd Isenberg
Thu Feb 20, 2020 9:32 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Zobrist key independence
Replies: 38
Views: 3088

Re: Zobrist key independence

Do you remember whether he discussed methods to reduce collisions by improving key independence? Or was it just about measuring the frequency of collisions within real chess trees? Tony Warnock, Burton Wendroff (1988) . Search Tables in Computer Chess . ICCA Journal, Vol. 11, No. 1 Its about BCH Ha...
by Gerd Isenberg
Mon Feb 17, 2020 4:58 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Split Index Super Set Yielding (SISSY) Bitboards
Replies: 45
Views: 4513

Re: Split Index Super Set Yielding (SISSY) Bitboards

You are right, there is no r8h (... r15h), only r8l (Intel style) or r8b (MASM STYLE), so one has to use rax, rbx, rcx, rdx with appropriate l/h byte partial registers for that purpose, and maybe ror reg64 16 instead of shift - or better trust the compiler. https://software.intel.com/en-us/articles/...
by Gerd Isenberg
Mon Feb 17, 2020 10:32 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Split Index Super Set Yielding (SISSY) Bitboards
Replies: 45
Views: 4513

Re: Split Index Super Set Yielding (SISSY) Bitboards

Turns out that a union is of benefit after all. _DATA SEGMENT bbs STRUCT r1 BYTE ? r2 BYTE ? r3 BYTE ? r4 BYTE ? r5 BYTE ? r6 BYTE ? r7 BYTE ? r8 BYTE ? bbs ENDS bbu UNION bbs<> b64 QWORD ? bbu ENDS occ bbu<> _DATA ENDS _TEXT SEGMENT RayAttacks PROC ; rcx = sq ; rdx = address of rss ; r8 = occ shl ...
by Gerd Isenberg
Sat Feb 15, 2020 8:07 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Split Index Super Set Yielding (SISSY) Bitboards
Replies: 45
Views: 4513

Re: Split Index Super Set Yielding (SISSY) Bitboards

Hey Martin and Gerd of course there is the possibility that handwritten assembler would be a benefit. It seems that x86-64 Clang -O3 is hard to beat. The union version prepares many registers with some shift at the beginning to and with 255 aka 16320 = 255 << 6. The explicit shift/and version uses ...
by Gerd Isenberg
Sat Feb 15, 2020 7:46 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Split Index Super Set Yielding (SISSY) Bitboards
Replies: 45
Views: 4513

Re: Split Index Super Set Yielding (SISSY) Bitboards

If I compare the generated assembly of both versions - that seems to be a domain of assembly programmers. That stuff seems much to difficult and long for the compilers - so everything is possible :-) https://godbolt.org/ x86-64 clang (experimental -Clifetime) ...snip... That assembly doesn't look l...
by Gerd Isenberg
Sat Feb 15, 2020 7:13 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Split Index Super Set Yielding (SISSY) Bitboards
Replies: 45
Views: 4513

Re: Split Index Super Set Yielding (SISSY) Bitboards

Thanks Martin! Interesting and really cool stuff. :D I just have three thoughts. One, can we get it down to just one dimension? Two, there is a caveat about the fact that since the full 8 bit index is used that the & 255 can be done away with. I tried my original union idea and it is faster. case W...
by Gerd Isenberg
Fri Feb 14, 2020 5:10 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Split Index Super Set Yielding (SISSY) Bitboards
Replies: 45
Views: 4513

Re: Split Index Super Set Yielding (SISSY) Bitboards

Of course one needs to pass the rank of the occupancy as well! My bad. u64 rnk[64][64]; u64 qss[64][256][6]; // 768K u64 queenAttacks(u08 sq, u64 occ) { u64 bb = rnk[sq][occ >> ((sq & 56) + 1) & 63]; // has all bits set outside the rank return bb & qss[sq][(occ >> 8) & 255][0] & // has all bits set ...
by Gerd Isenberg
Fri Feb 14, 2020 8:23 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Split Index Super Set Yielding (SISSY) Bitboards
Replies: 45
Views: 4513

Re: Split Index Super Set Yielding (SISSY) Bitboards

A have a vague idea now. Small performance killer seems the bb-union. Via 64-bit register each b08 access requires shift/and 63 (which makes the occ.b64 = (occ.b64 >> 1) & 0x003F3F3F3F3F3F00 redundant). Otherwise, writing 64-bit to read partial bytes (movzx reg, byte ptr mem) via memory isn't the wa...