The wrong way

Discussion of chess software programming and technical issues.

Moderator: Ras

flok

Re: The wrong way

Post by flok »

Henk wrote:
flok wrote:Today I made the moves-list-generator of my program 3.48% slower.
The code shrunk on the other hand shrunk:
  • 2,28% lines
    7,2% bytes
A good day for a software developer is a day where he removes code.

Strangely bad or ugly code always performs best in Skipper so I have to set it back. Main rule: the more generic your code the slower it gets.
Yesterday I fixed some algorithmic code and got an increase of around 130 elo.
That beats the 3,4% slowdown.
Henk
Posts: 7251
Joined: Mon May 27, 2013 10:31 am

Re: The wrong way

Post by Henk »

flok wrote:
Henk wrote:
flok wrote:Today I made the moves-list-generator of my program 3.48% slower.
The code shrunk on the other hand shrunk:
  • 2,28% lines
    7,2% bytes
A good day for a software developer is a day where he removes code.

Strangely bad or ugly code always performs best in Skipper so I have to set it back. Main rule: the more generic your code the slower it gets.
Yesterday I fixed some algorithmic code and got an increase of around 130 elo.
That beats the 3,4% slowdown.
Can it already beat Fairy-max with two minute time control ? Skipper still can not although its speed is now 2.5-3 times faster than fairy-max. Or it computes too many nodes or it counts too many nodes.

Speed is even greater than Stockfish. So speed does not say much.
Henk
Posts: 7251
Joined: Mon May 27, 2013 10:31 am

Re: The wrong way

Post by Henk »

Skippers code for collecting (white) queen non captures:

Code: Select all

 
               case ChessPiece.Sort.whiteQueen:
                    var nonCaptures = (  StraightMovesArr[((StraightOcc & occupiers) * StraightMagic) >> StraightNShift]
                                       | DiagonalMovesArr[((DiagonalOcc & occupiers) * DiagonalMagic) >> DiagonalNShift]
                                      ) & ~occupiers;
                    while (nonCaptures != 0)
                    {
                        var move = WhiteQueenMovesDict[nonCaptures & (~nonCaptures + 1)];
                        move.Value = (int)(HistoryTable[move]);
                        moves.Add(move);
                        nonCaptures &= nonCaptures - 1;
                    }
                    break;