Split Index Super Set Yielding (SISSY) Bitboards

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

mar
Posts: 2554
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Split Index Super Set Yielding (SISSY) Bitboards

Post by mar »

Mike Sherwin wrote: Wed Apr 14, 2021 4:59 am YES,,,YES YES YES I dyxjubf did it!!!
congratulations, Michael. did you measure a performance gain for the bishop SISSY?
how big are the tables now?
Martin Sedlak
Mike Sherwin
Posts: 860
Joined: Fri Aug 21, 2020 1:25 am
Location: Planet Earth, Sol system
Full name: Michael J Sherwin

Re: Split Index Super Set Yielding (SISSY) Bitboards

Post by Mike Sherwin »

mar wrote: Thu Apr 15, 2021 8:13 pm
Mike Sherwin wrote: Wed Apr 14, 2021 4:59 am YES,,,YES YES YES I dyxjubf did it!!!
congratulations, Michael. did you measure a performance gain for the bishop SISSY?
how big are the tables now?
There is a small performance gain. The problem is I had to revert to an earlier source that does not have timing for search or perft. That of course is a minor addition. Anyway right now I'm trying to track down the "last" bug in the search. I think I have finally found the bug and am trying to kill it. Although, for the union version vs the shift version (just SISSY bishop) measuring the time by hand saved ~5 seconds (122 seconds vs 127 seconds) on perft 7.

I'm thinking to do the initialization using a c++ "new" block and then combining the ranks into an array followed by deleting the new block. Then the bishop table would be half the size of the original. The rook can be reduced to only two ranks and its table would be reduced to one fourth the size. The queen would then be a combination of the bishop and rook for a total of 5 lookups. Also, if I can get the bishop efficiently down to only two lookups then the queen would only require 4 lookups! It of course is still a work in progress and better minds than mine could make magnitudes faster progress than I can so I'd really appreciate some more assistance! :!:
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Split Index Super Set Yielding (SISSY) Bitboards

Post by mvanthoor »

Congrats :) If you had done this somewhere in the 90's, you'd probably have gotten a Ph.D. out of this... I haven't read all the code, but I feel this stuff is way over my head. It was hard enough to actually understand fancy magic bitboards and then implement them myself without looking at other code... let alone try to come up with my very own bitboard implementation.
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL
Mike Sherwin
Posts: 860
Joined: Fri Aug 21, 2020 1:25 am
Location: Planet Earth, Sol system
Full name: Michael J Sherwin

Re: Split Index Super Set Yielding (SISSY) Bitboards

Post by Mike Sherwin »

mvanthoor wrote: Fri Apr 16, 2021 2:37 am Congrats :) If you had done this somewhere in the 90's, you'd probably have gotten a Ph.D. out of this... I haven't read all the code, but I feel this stuff is way over my head. It was hard enough to actually understand fancy magic bitboards and then implement them myself without looking at other code... let alone try to come up with my very own bitboard implementation.
Thank you very much for the kind words!
It took me all of the 90's and some of the early 2000's to learn enough C to even attempt writing a chess engine. Then I still needed a C primer book in one hand. I still do today but not as much. My learning disability is really a brick wall that I constantly have to knock down. I attempted to start writing a chess engine on an Atari 800 in 1983. I finally was able to release RomiChess in mid 2005. That's 21 years. :( :evil:

So, these little accomplishments are a monumental victory for me. :D The date this thread was started was Feb 13, 2020 and I know I started SISSY with a previous post. And before that all the way back in 2009 as I just rediscovered. I think a university would not have had that much tolerance and would have expelled me long before I earned a PH.D.

But, nonetheless I am feeling very good right now! 8-)

Thanks

Edit: And the strangest paradox to me is that someone with a severe learning disability was able to write one of the most successful learning chess engines of the time. Now how strange is that? :shock: :D
Mike Sherwin
Posts: 860
Joined: Fri Aug 21, 2020 1:25 am
Location: Planet Earth, Sol system
Full name: Michael J Sherwin

Re: Split Index Super Set Yielding (SISSY) Bitboards

Post by Mike Sherwin »

mvanthoor wrote: Fri Apr 16, 2021 2:37 am I haven't read all the code, but I feel this stuff is way over my head.
SISSY bitboards basic idea is to and supersets together to get the final bitboard. In the initialization for each square and for each 7 bit index shift the index up to each rank in turn and then & it with the bishop's possible move bits on an empty board to get the blockers that are possible for the rank. Generate the bitboard as if those are the only blockers. Now for each rank there is a superset saved in bss[square][index][rank]. Then because the bishop moves in one half of the bitboard can with one shift 24 be all brought into the other half of the bitboard without collisions it is possible to combine ranks bss[sq][index][rank] 2 & 5, 3 & 6, 4 & 7. For every ii and for every jj shift them up to the appropriate rank to & them with the possible bishop moves to get the blockers. Shift them back down oring the resulting i and j to combine the indexes and store the combined supersets.

Then in the bishop mg get the blockers and reduce them down to three ranks for only three lookups instead of six.

Very simple, really. 8-)