Kindergarten Super SISSY Rook Bitboards

Discussion of chess software programming and technical issues.

Moderator: Ras

Mike Sherwin
Posts: 965
Joined: Fri Aug 21, 2020 1:25 am
Location: Planet Earth, Sol system
Full name: Michael J Sherwin

Kindergarten Super SISSY Rook Bitboards

Post by Mike Sherwin »

Code: Select all

u64 KindergartenSuperSISSYRookBitboards(sq, occ) {
  u64 vBlockers = occ & rookViticleBlockers[sq];
  u64 hBlockers = occ & rookHorizontalBlockers[sq];
  u08 vIndex = (vBlockers >> (sq & 7) * DIAGONAL) >> 56;
  u08 hIndex = hBlockers >> (sq >> 3);
  return vSuperset[sq][vIndex] & hSuperset[sq][hIndex];
}
:D
Henk
Posts: 7251
Joined: Mon May 27, 2013 10:31 am

Re: Kindergarten Super SISSY Rook Bitboards

Post by Henk »

What is this for. I use magic bitboards and why would this be better.
Mike Sherwin
Posts: 965
Joined: Fri Aug 21, 2020 1:25 am
Location: Planet Earth, Sol system
Full name: Michael J Sherwin

Re: Kindergarten Super SISSY Rook Bitboards

Post by Mike Sherwin »

Henk wrote: Mon Jan 02, 2023 5:03 pm What is this for. I use magic bitboards and why would this be better.
Well we will have to wait and see! But, the theory behind it is to make something better than either SISSY or Kindergarten bitboards by combining the two. Since Kindergarten bitboards are already close to Magic bitboards in performance there might be a chance to equal or exceed Magic bitboards.

It's just a try. And for me personally it is something (with Gerd's work) that is my own!
Henk
Posts: 7251
Joined: Mon May 27, 2013 10:31 am

Re: Kindergarten Super SISSY Rook Bitboards

Post by Henk »

Magic bitboards is just a lookup in a perfect hash table. But still need to compute the hash key out of occupancy.
dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Re: Kindergarten Super SISSY Rook Bitboards

Post by dangi12012 »

Interesting.

Whats inside these arrays: rookViticleBlockers, rookHorizontalBlockers, vSuperset, hSuperset?
Is this already a working prototype or in the idea stage?
Does it work for bishops too?
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
Mike Sherwin
Posts: 965
Joined: Fri Aug 21, 2020 1:25 am
Location: Planet Earth, Sol system
Full name: Michael J Sherwin

Re: Kindergarten Super SISSY Rook Bitboards

Post by Mike Sherwin »

dangi12012 wrote: Mon Jan 02, 2023 10:29 pm Interesting.

Whats inside these arrays: rookViticleBlockers, rookHorizontalBlockers, vSuperset, hSuperset?
Is this already a working prototype or in the idea stage?
Does it work for bishops too?
I have not done the initialization yet. I was going to that today but for some reason I had to sleep all day. Seemed I had no choice.

Anyway, I created it while I wrote it. It was easy because because it is just the perfect fusion between Gerd's Kindergarten and my SISSY bitboards.

They are defined better in my krazy professor thread. I'll go get that code.

Code: Select all

u64 RookAttacks(sq, occ) {
    u64 vBlockers = (occ & vFileMask[sq]);
    u64 hBlockers = (occ & hRankMask[sq]); 
    u64 vIndex = (vBlockers >> (sq & 7) * MAIN_DIAGONAL) >> 57;
    u64 hIndex = hBlockers >> ((sq >> 3) + 1;
    return vSuperSet[sq][vIndex] & hSuperSet[sq][hIndex];
As Gerd said, "Wasn't that simple? That is why it is called kindergarten bitboards" as it uses a simple multiplication!
And the name SISSY is because of two indexes (Split Index) Yielding two Super Sets!

Code: Select all

u64 BishopAttacks(sq, occ) {
    u64 dBlockers = occ & diagonalMask[sq];
    u64 aBlockers = occ & antidiagMask[sq]; 
    u64 dIndex = (dBlockers * 0x0202020202020202) >> 58;
    u64 aIndex = (aBlockers * 0x0202020202020202) >> 58;
    return dSuperSet[sq][dIndex] & aSuperSet[sq][aIndex];
}
And yes the Bishop is also designed.

Oops, seems I screwed up the code. Let me see if I can unscrew it then I have to go back to bed.

Okay it looks good now. vSuperSet and hSuperSet are just supersets like in SISSY meaning the superset derived from only the vertical blockers or the horizontal blockers. Then they are & together to form the real set.
Does that make sense?
Mike Sherwin
Posts: 965
Joined: Fri Aug 21, 2020 1:25 am
Location: Planet Earth, Sol system
Full name: Michael J Sherwin

Re: Kindergarten Super SISSY Rook Bitboards

Post by Mike Sherwin »

Mike Sherwin wrote: Tue Jan 03, 2023 3:39 am
dangi12012 wrote: Mon Jan 02, 2023 10:29 pm Interesting.

Whats inside these arrays: rookViticleBlockers, rookHorizontalBlockers, vSuperset, hSuperset?
Is this already a working prototype or in the idea stage?
Does it work for bishops too?
I have not done the initialization yet. I was going to that today but for some reason I had to sleep all day. Seemed I had no choice.

Anyway, I created it while I wrote it. It was easy because it is just the perfect fusion between Gerd's Kindergarten and my SISSY bitboards.

They are defined better in my krazy professor thread. I'll go get that code.

Code: Select all

u64 RookAttacks(sq, occ) {
    u64 vBlockers = (occ & vFileMask[sq]);
    u64 hBlockers = (occ & hRankMask[sq]); 
    u64 vIndex = (vBlockers >> (sq & 7) * MAIN_DIAGONAL) >> 57;
    u64 hIndex = hBlockers >> ((sq >> 3) + 1);
    return vSuperSet[sq][vIndex] & hSuperSet[sq][hIndex];
As Gerd said, "Wasn't that simple? That is why it is called kindergarten bitboards" as it uses a simple multiplication!
And the name SISSY is because of two indexes (Split Index) Yielding two Super Sets!

Code: Select all

u64 BishopAttacks(sq, occ) {
    u64 dBlockers = occ & diagonalMask[sq];
    u64 aBlockers = occ & antidiagMask[sq]; 
    u64 dIndex = (dBlockers * 0x0202020202020202) >> 58;
    u64 aIndex = (aBlockers * 0x0202020202020202) >> 58;
    return dSuperSet[sq][dIndex] & aSuperSet[sq][aIndex];
}
And yes the Bishop is also designed.

Oops, seems I screwed up the code. Let me see if I can unscrew it then I have to go back to bed.

Okay it looks good now. vSuperSet and hSuperSet are just supersets like in SISSY meaning the superset derived from only the vertical blockers or the horizontal blockers. Then they are & together to form the real set.
Does that make sense?