Search found 2332 matches

by Michael Sherwin
Sat Apr 11, 2020 8:41 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: A Neat Trick
Replies: 13
Views: 1171

Re: A Neat Trick

Just for completeness is this code now at least correct?

Code: Select all

sq = ts - ((epbit[t][ply[t] - 1] & (one << ts)) >> (ts - 3));
          target = board[t][sq];
More simple pseudo code.

Code: Select all

sq = ts - ((epbit & (1ull << ts)) >> (ts - 3));
          target = board[sq];
by Michael Sherwin
Sat Apr 11, 2020 8:04 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: A Neat Trick
Replies: 13
Views: 1171

Re: A Neat Trick

No, statements like that do not require a branch on i386 architecture. There are instructions SETcc which copy a condition code (like the EQ flag) to the AL register. So you just do the compare, which sets the condition codes, and then SETEQ to get a 0 or 1 depending on the result. Thanks for the e...
by Michael Sherwin
Sat Apr 11, 2020 2:19 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: A Neat Trick
Replies: 13
Views: 1171

Re: A Neat Trick

I don't understand your code, because I have no idea what t, ply[] and epbit[][] are. And it looks fishy, because you seem to subtract a bitboard from a square number. But what would be wrong with sq = ts ^ 8*(epbitboard == one<<ts); ? I should have said how the code is structured. The var t is the...
by Michael Sherwin
Sat Apr 11, 2020 4:38 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: A Neat Trick
Replies: 13
Views: 1171

A Neat Trick

If it works. One might guess by my signature that I'm not a fan of "if" statements. While coding a white pawn on the 5th rank I was determined to code a cep capture without using an if statement. I probably spent over two hours on it. It was only after giving up and going to the kitchen to get some ...
by Michael Sherwin
Tue Apr 07, 2020 8:49 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Rewriting RomiChess from scratch for SMP
Replies: 17
Views: 2063

Re: Rewriting RomiChess from scratch for SMP

The MSVC compiler has its inconsistencies. _BitScanForward64() requires an & unsigned long to store the index. When typefdef uint32_t u32; is used it flags it as an error and typedef unsigned long u32 it likes. Also typedef was not working in multi file source. Instead of #defines the compiler wante...
by Michael Sherwin
Tue Apr 07, 2020 8:20 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Rewriting RomiChess from scratch for SMP
Replies: 17
Views: 2063

Re: Rewriting RomiChess from scratch for SMP

That does not seem to be too high of a cost to keep the advantage of a scored list of legal moves for internal move ordering? Just measure and test. :-) However, there are also some other things: #define s08 signed char; The semicolon is wrong. Actually, the whole define is wrong because you never ...
by Michael Sherwin
Tue Apr 07, 2020 7:52 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Rewriting RomiChess from scratch for SMP
Replies: 17
Views: 2063

Re: Rewriting RomiChess from scratch for SMP

I had it in my head that the initialization had been combined into one function. No it is two functions. Added second function. Also redesigned to check for fail high at leaf nodes and return FAILHIGH upon detection. The immediate additional cost is only one compound if statement. That does not seem...
by Michael Sherwin
Tue Apr 07, 2020 6:57 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Rewriting RomiChess from scratch for SMP
Replies: 17
Views: 2063

Re: Rewriting RomiChess from scratch for SMP

This seems efficient as this has to be done on all leaf nodes regardless. This is horribly inefficient because if you get a fail-high on the first move of a leaf node, then you have done the computation for all the other moves in vain. I'd go with a pseudo legal move generator and do the legality c...
by Michael Sherwin
Tue Apr 07, 2020 5:37 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Rewriting RomiChess from scratch for SMP
Replies: 17
Views: 2063

Rewriting RomiChess from scratch for SMP

Something I've wanted to do for 15 years but was unable to do for reasons that there is no need to rehash. Anyway, if I do not do it now I never will. I have at least 3 months of food on hand so I do not have to leave the house. The code will be much cleaner or so that is the goal. The move generati...
by Michael Sherwin
Tue Apr 07, 2020 3:35 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: The devilish fail low
Replies: 34
Views: 2363

Re: The devilish fail low

This is a whatif from the point of view of white. And this might require fail soft. White is searching a move at the root. Black has a best move that leaves white with only one reply to keep the balance, then add depth to that root move in subsequent iterations. Or white has another move just as goo...