Search found 9 matches

by kalyan4code
Thu Oct 10, 2019 1:30 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Understanding first rank attack state generation
Replies: 15
Views: 2798

Re: Understanding first rank attack state generation

Because of the inner six bit mask with 01111110b, which would usually require an additional shift right 1 for a 0..63 range, is already implicitly multiplied by two (0,2,4,....126). With a two-dimensional array it takes one additional instruction ;-) BYTE arrFirstRankAttacks64x8[64][8]; // 512 Byte...
by kalyan4code
Thu Oct 10, 2019 6:04 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Understanding first rank attack state generation
Replies: 15
Views: 2798

Re: Understanding first rank attack state generation

Sorry for the confusion. I will comment the routine a little bit more ...
Thanks Gerd. That was clear to me already. But still my question remains unanswered:
While looking up the rankattacks array the computation if index uses occupancy multipled by 4 instead of 8, why?

Code: Select all

4*occ + file
by kalyan4code
Thu Oct 10, 2019 3:21 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Understanding first rank attack state generation
Replies: 15
Views: 2798

Re: Understanding first rank attack state generation

May be correct (" May be! "). But the following argument makes me think otherwise: When you generate rank attacks (generate_rank_attacks() - see my post earler for the code) it is invoked as: generate_rank_attacks(2 * sq, file); Ideally every square is multiplied by 2 (the multiplication by 2 is nee...
by kalyan4code
Wed Oct 09, 2019 6:30 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Understanding first rank attack state generation
Replies: 15
Views: 2798

Re: Understanding first rank attack state generation

From the CPW documentation on " Attacks on All Ranks " I didn't quite understand the following statement: // Copied from CPW Wiki Page --start The array is defined one-dimensional, and has to indexed by 8*occ + file. The reason was playing the optimization game and to safe the right shift one, but t...
by kalyan4code
Thu Jul 18, 2019 12:37 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Understanding first rank attack state generation
Replies: 15
Views: 2798

Re: Understanding first rank attack state generation

I I understood most part of the code except this lines (appearing twice in generate_rank_attack): if ((o & b) == b) break; What is the use of the above if loop conditional? Many Thanks, Kalyan The purpose of this code is to generate an attack mask containing empty squares and the first occupied squ...
by kalyan4code
Thu Jul 18, 2019 11:20 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Understanding first rank attack state generation
Replies: 15
Views: 2798

Re: Understanding first rank attack state generation

(by the way the results of hqperft are actually pretty good performance-wise) Appreciation goes out to Richard for hqperft & who ever invented Hyperbola Quintessence! That's one of the reason why I'm looking at hyperbola quintessence. My guess is this is indeed occupancy (all combinations), but sim...
by kalyan4code
Thu Jul 18, 2019 11:00 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Understanding first rank attack state generation
Replies: 15
Views: 2798

Re: Understanding first rank attack state generation

I assume o is occupancy and f is file, so you or the attack mask first, then if occupancy bit was set, you break out of the loop. One loop goes to the left, other loop goes to the right. No rocket science. Thanks Martin. I now understand the if loop conditional check. One more clarification request...
by kalyan4code
Thu Jul 18, 2019 9:55 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Understanding first rank attack state generation
Replies: 15
Views: 2798

Re: Understanding first rank attack state generation

mar wrote:
Thu Jul 18, 2019 9:32 am
since b=1<<x, I guess it's simply a test whether bit #x is set in o
The question is why to check this condition and when it evaluates to true why break out of the for loop?
by kalyan4code
Thu Jul 18, 2019 8:47 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Understanding first rank attack state generation
Replies: 15
Views: 2798

Understanding first rank attack state generation

I am trying to understand how hyperbola quintessence works. While I got to understand how it works for files, diagonals & anti-diagonals and it doesn't work for rooks/queens moving along the ranks. I ended up with Richard Delorme's hqperft project in which he uses following code to generate first ra...