lantonov / asmFish

A continuation of the nice project asmFish by Mohammed Li. Latest version: 07.08.2019
https://lantonov.github.io/asmFish/
Other
118 stars 49 forks source link

Crashes in Chess960 #10

Closed lantonov closed 7 years ago

lantonov commented 7 years ago

asmFish is very stable in normal chess but crashes randomly in FRC (Chess960). In the file /guts/Castling.asm there are functions that check legality for short and long castling for white and black. As Chess960 has different castling rules than normal chess, maybe the problem is there.

It is also possible that asmFish is just not meant to play Chess960.

lantonov commented 7 years ago

Google led me to some of my old postings (Jun 21) on Fishcooking which I had forgotten and Moha's replies:

me (Lyudmil Antonov change)

Jun 21

I just had a very strange FRC game on FICS. asmFish resigned for no reason. The GUI (Winboard) is set not to resign for any reason.

[Event "ICS rated wild/fr match"] [Site "freechess.org"] [Date "2016.06.21"] [Round "-"] [White "zerowin"] [Black "FishTest"] [Result "1-0"] [WhiteElo "2481"] [BlackElo "2734"] [TimeControl "60+1"] [Variant "fischerandom"] [FEN "nrkbbrqn/pppppppp/8/8/8/8/PPPPPPPP/NRKBBRQN w FBfb - 0 1"] [SetUp "1"]

{-------------- n r k b b r q n p p p p p p p p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P P P P P P P P N R K B B R Q N white to play --------------}

  1. Nb3 f5 {-0.05/21 7} 2. f4 Ng6 {-0.15/21 1.0} 3. e3 e6 {-0.15/22 4} 4. Be2 Be7 {-0.06/21 0.8} 5. O-O-O Nb6 {-0.12/23} 6. Kb1 {FishTest resigns} 1-0

mohammed li

Jun 21

This is not a very strange resignation. The program erroneously thinks that O-O is legal and tries to play it. I have since redone the castling encoding and fixed this.

me (Lyudmil Antonov change)

Jul 3

asmFish (02 July version) resigned suddenly on FRC again:

[Event "ICS rated wild/fr match"] [Site "freechess.org"] [Date "2016.07.03"] [Round "-"] [White "zerowin"] [Black "FishTest"] [Result "1-0"] [WhiteElo "2479"] [BlackElo "2737"] [TimeControl "60+1"] [Variant "fischerandom"] [FEN "qnbrknrb/pppppppp/8/8/8/8/PPPPPPPP/QNBRKNRB w GDgd - 0 1"] [SetUp "1"]

{-------------- q n b r k n r b p p p p p p p p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P P P P P P P P Q N B R K N R B white to play --------------}

  1. d4 d5 {-0.16/17 1.9} 2. g3 Ne6 {+0.26/16 1.0} 3. Ne3 c5 {+0.17/18 1.5} 4 dxc5 d4 {+0.21/19 1.1} 5. Nd5 Rxd5 {+3.47/16 0.8} 6. Bxd5 Nc6 {-2.85/18 2.7} 7. c3 dxc3 {-2.71/18 0.8} 8. Nxc3 Nb4 {-2.71/18 1.6} 9. O-O {FishTest resigns} 1-0
lantonov commented 7 years ago

I suppose that Moha has fixed it by just making O-O and O-O-O in FRC illegal which causes crashing. I will try to replay these games to see if they will crash this time.

lantonov commented 7 years ago

Pay attention to the castling rights in these FENs (FBfb and GDgd). They are not like the usual castling rights (KQkq). Probably this causes additional confusion in the engine. asmFish has some code for handling Chess960 positions (Think.asm) and a UCI option for Chess960 (Uci.asm). However, code for handling castling and Shredder-FENs (those above) is missing.

lantonov commented 7 years ago

Here is the info from a debug version of asmFish (VERBOSE equ 3):

   position fen nrkbbrqn/pppppppp/8/8/8/8/PPPPPPPP/NRKBBRQN w FBfb - 0 1
   moves
   n r k b b r q n
   p p p p p p p p
   . . . . . . . .
   . . . . . . . .
   . . . . . . . .
   . . . . . . . .
   P P P P P P P P
   N R K B B R Q N
   white:     a1 b1 c1 d1 e1 f1 g1 h1 a2 b2 c2 d2 e2 f2 g2 h2
   black:     a7 b7 c7 d7 e7 f7 g7 h7 a8 b8 c8 d8 e8 f8 g8 h8
   pawn:      a2 b2 c2 d2 e2 f2 g2 h2 a7 b7 c7 d7 e7 f7 g7 h7
   knight:    a1 h1 a8 h8
   bishop:    d1 e1 d8 e8
   rook:      b1 f1 b8 f8
   queen:     g1 g8
   king:      c1 c8
   checkers:
   pinned:
   fen:            nrkbbrqn/pppppppp/8/8/8/8/PPPPPPPP/NRKBBRQN w KQkq - 0 1
   isok:           yes
   sideToMove:     w
   castlingRights: KQkq
   epSquare:       -
   rule50:         0
   pliesFromNull:  0
   capturedPiece:  .
   key:            45611295e033f952
   pawnKey:        3209d0458a9d5083
   materialKey:    1e868803d55f83ef
   psq:            mg: 0  eg: 0
   npMaterial:     w: 8241  b: 8241
   Gen_Legal:      a2a3 b2b3 c2c3 d2d3 e2e3 f2f3 g2g3 h2h3 a2a4 b2b4 c2c4 d2d4
                           e2e4 f2f4 g2g4 h2h4 a1b3 h1g3

FBfb is transformed in KQkq as for normal chess. (P.S. Because I have forgotten to set the option UCI_Chess960).

The board before O-O-O is

       n r k . b r q .
       p p p p b . p p
        . . . . p . n .
        . . . . . p . .
        . . . . . P . .
        . N . . P . . .
        P P P P B . P P
        . R K . B R Q N

Now the a-side castling is moves c1c1 and in the diagram the castling structure is as should be

         n r k . b r q .
         p p p p b . p p
         . . . . p . n .
         . . . . . p . .
         . . . . . P . .
         . N . . P . . .
         P P P P B . P P
         . . K R B R Q N

The last move moves c1b1

          . r k . b r q .
          p p p p b . p p
          . n . . p . n .
          . . . . . p . .
          . . . . . P . .
          . N . . P . . .
          P P P P B . P P
         . K . R B R Q N

and it appears normal. The next game also makes the castling right. Things just became more complicated.

lantonov commented 7 years ago

Because Moha always asked for system info about any crash, here is the info from Event Viewer on the last crash:

Faulting application name: asmFishW_2016-12-17_bmi2.exe, version: 0.0.0.0, time stamp: 0x58550b81 Faulting module name: asmFishW_2016-12-17_bmi2.exe, version: 0.0.0.0, time stamp: 0x58550b81 Exception code: 0xc0000005 Fault offset: 0x0000000000142f6d Faulting process ID: 0x1f2c Faulting application start time: 0x01d2591f819a266a Faulting application path: c:\winboard\polyglot\asmFishW_2016-12-17_bmi2.exe Faulting module path: c:\winboard\polyglot\asmFishW_2016-12-17_bmi2.exe Report ID: cf140685-2bfc-457e-ba44-a9a48669b4a5 Faulting package full name: Faulting package-relative application ID:

Fault bucket 116300666535, type 5 Event Name: BEX64 Response: Not available Cab Id: 0

Problem signature: P1: asmFishW_2016-12-17_bmi2.exe P2: 0.0.0.0 P3: 58550b81 P4: StackHash_b4ee P5: 0.0.0.0 P6: 00000000 P7: PCH_84 P8: c0000005 P9: 0000000000000008 P10:

muxel commented 7 years ago

Can you provide a pgn where this happens? Could be some invalid position like no King on board.

lantonov commented 7 years ago

I looked for these games in the game log file but unfortunately the GUI (winboard) writes the games only after they are finished. So the crashed games are missing.

muxel commented 7 years ago

Your crash seems to happen in Evaluate.asm line 1189, which is related to square of King (ksq). I can't test FRC with Arena because it does things like 2 white moves in a row or capture white king with white rook, AND Arena continues playing without saying illegal move...

lantonov commented 7 years ago

Yesterday, theo in TCEC chat tried FRC in cutechess-cli and it crashed about 10 times in 140 games. I will try it now to see what it will show. Hopefully, it writes the games before finished.

lantonov commented 7 years ago

I got very early crash in cutechess-cli. The event viewer is

Faulting application name: asmFishW_2016-12-17_bmi2.exe, version: 0.0.0.0, time stamp: 0x58550b81 Faulting module name: asmFishW_2016-12-17_bmi2.exe, version: 0.0.0.0, time stamp: 0x58550b81 Exception code: 0xc0000005 Fault offset: 0x0000000000142f6d Faulting process ID: 0x144 Faulting application start time: 0x01d25b0f59b1a9b1 Faulting application path: C:\Winboard\Polyglot\asmFishW_2016-12-17_bmi2.exe Faulting module path: C:\Winboard\Polyglot\asmFishW_2016-12-17_bmi2.exe Report ID: 54134dd4-64de-4d38-969f-84b2c897a73d Faulting package full name: Faulting package-relative application ID:

I have pgn this time:

[Event "?"] [Site "?"] [Date "2016.12.20"] [Round "14"] [White "asmFish"] [Black "Stockfish"] [Result "0-1"] [FEN "nnqbrkbr/pppppppp/8/8/8/8/PPPPPPPP/NNQBRKBR w KQkq - 0 1"] [PlyCount "28"] [SetUp "1"] [Termination "abandoned"] [TimeControl "inf"] [Variant "fischerandom"]

  1. e4 {+0.56/10 0.055s} e5 {-0.31/10 0.055s} 2. d3 {+0.27/10 0.042s} d6 {-0.14/10 0.023s} 3. h4 {+0.22/10 0.013s} Nc6 {-0.09/10 0.020s}
  2. f4 {+0.24/10 0.033s} Bf6 {-0.08/10 0.042s} 5. f5 {+0.37/10 0.079s} Nb6 {-0.14/10 0.047s} 6. g4 {+0.67/10 0.025s} h6 {-0.57/10 0.059s}
  3. Nb3 {+0.77/10 0.023s} a5 {-0.60/10 0.040s} 8. Nc3 {+1.02/10 0.014s} a4 {-0.49/10 0.032s} 9. Nd2 {+0.84/10 0.022s} Nd4 {-0.72/10 0.027s}
  4. Bf2 {+1.00/10 0.040s} g6 {-0.57/10 0.041s} 11. Nd5 {+1.72/10 0.042s} Nxd5 {-1.52/10 0.022s} 12. exd5 {+1.11/10 0.014s} h5 {-1.48/10 0.026s}
  5. g5 {+1.73/10 0.032s} Bd8 {-1.25/10 0.038s} 14. fxg6 {+1.42/10 0.020s} fxg6 {-1.07/10 0.029s, White disconnects} 0-1
lantonov commented 7 years ago

One more crash:

[Event "?"] [Site "?"] [Date "2016.12.20"] [Round "158"] [White "asmFish"] [Black "Stockfish"] [Result "0-1"] [FEN "bbnnrkrq/pppppppp/8/8/8/8/PPPPPPPP/BBNNRKRQ w KQkq - 0 1"] [PlyCount "4"] [SetUp "1"] [Termination "abandoned"] [TimeControl "inf"] [Variant "fischerandom"]

  1. g3 {+0.41/10 0.10s} g6 {-0.34/10 0.12s} 2. Nd3 {+0.19/10 0.033s} Nc6 {-0.20/10 0.032s, White disconnects} 0-1

The next is interesting (White makes illegal move g1h1). This did not crash

[Event "?"] [Site "?"] [Date "2016.12.20"] [Round "70"] [White "asmFish"] [Black "Stockfish"] [Result "0-1"] [FEN "nnbrqbkr/pppppppp/8/8/8/8/PPPPPPPP/NNBRQBKR w KQkq - 0 1"] [PlyCount "22"] [SetUp "1"] [TimeControl "inf"] [Variant "fischerandom"]

  1. d4 {+0.66/10 0.032s} e5 {-0.34/10 0.073s} 2. dxe5 {+0.48/10 0.051s} Nb6 {-0.48/10 0.032s} 3. e4 {+0.49/10 0.012s} Qxe5 {-0.49/10 0.038s}
  2. c4 {+0.45/10 0.028s} Re8 {-0.37/10 0.046s} 5. Nc2 {+0.23/10 0.032s} Nc6 {-0.06/10 0.029s} 6. b4 {+0.54/10 0.012s} Qh5 {+0.33/10 0.058s}
  3. c5 {+0.37/10 0.022s} Rxe4 {+0.18/10 0.015s} 8. Ne3 {+0.71/10 0.018s} Rxb4 {+0.03/10 0.036s} 9. cxb6 {+0.29/10 0.008s} Rxb1 {-0.32/10 0.020s}
  4. bxc7 {+0.27/10 0.019s} Qc5 {-0.44/10 0.075s} 11. Bd3 {+0.39/10 0.041s} Ra1 {-0.22/10 0.030s, White makes an illegal move: g1h1} 0-1

One more crasher

[Event "?"] [Site "?"] [Date "2016.12.20"] [Round "42"] [White "asmFish"] [Black "Stockfish"] [Result "0-1"] [FEN "nqbbrkrn/pppppppp/8/8/8/8/PPPPPPPP/NQBBRKRN w KQkq - 0 1"] [PlyCount "20"] [SetUp "1"] [Termination "abandoned"] [TimeControl "inf"] [Variant "fischerandom"]

  1. Ng3 {+0.20/10 0.050s} e5 {-0.22/10 0.062s} 2. c3 {+0.08/10 0.028s} Nb6 {-0.05/10 0.025s} 3. e4 {+0.08/10 0.016s} Ng6 {0.00/10 0.013s}
  2. d4 {+0.20/10 0.025s} exd4 {-0.18/10 0.032s} 5. cxd4 {+0.26/10 0.006s} d5 {-0.24/10 0.028s} 6. e5 {+0.25/10 0.013s} Be7 {-0.34/10 0.042s}
  3. f4 {+0.88/10 0.022s} Bb4 {-0.31/10 0.039s} 8. Re2 {+0.76/10 0.017s} Bg4 {-0.14/10 0.024s} 9. Nc2 {-3.23/10 0.026s} Bxe2+ {-0.26/10 0.018s}
  4. Nxe2 {-4.48/10 0.023s} Be7 {+0.14/10 0.006s, White disconnects} 0-1
muxel commented 7 years ago

Thank you. Nice position for testing, crashes quickly. I'll try to track this down.

lantonov commented 7 years ago

You are the person to thank to. I don't have access to 64 bit CPU now but with 32 bit Stockfish I analysed the positions and found that the implementation of castling is different between SF and asmFish. In SF castling is a rook move, and in asmFish castling is a king move. Castling in FRC is coded in the following in SF:

namespace {

  template<CastlingRight Cr, bool Checks, bool Chess960>
  ExtMove* generate_castling(const Position& pos, ExtMove* moveList, Color us) {

    static const bool KingSide = (Cr == WHITE_OO || Cr == BLACK_OO);

    if (pos.castling_impeded(Cr) || !pos.can_castle(Cr))
        return moveList;

    // After castling, the rook and king final positions are the same in Chess960
    // as they would be in standard chess.
    Square kfrom = pos.square<KING>(us);
    Square rfrom = pos.castling_rook_square(Cr);
    Square kto = relative_square(us, KingSide ? SQ_G1 : SQ_C1);
    Bitboard enemies = pos.pieces(~us);

    assert(!pos.checkers());

    const Square K = Chess960 ? kto > kfrom ? WEST : EAST
                              : KingSide    ? WEST : EAST;

    for (Square s = kto; s != kfrom; s += K)
        if (pos.attackers_to(s) & enemies)
            return moveList;

    // Because we generate only legal castling moves we need to verify that
    // when moving the castling rook we do not discover some hidden checker.
    // For instance an enemy queen in SQ_A1 when castling rook is in SQ_B1.
    if (Chess960 && (attacks_bb<ROOK>(kto, pos.pieces() ^ rfrom) & pos.pieces(~us, ROOK, QUEEN)))
        return moveList;

    Move m = make<CASTLING>(kfrom, rfrom);

    if (Checks && !pos.gives_check(m))
        return moveList;

    *moveList++ = m;
    return moveList;
  }

It still is not perfect because in the end position of the second game (that with the illegal move) white can make an FRC h-side castling while SF doesn't allow it.

muxel commented 7 years ago

Yes, asmFish uses the "King captures Rook" representation for castling moves. But that is not the problem.

lantonov commented 7 years ago

Testing the first game with the debug version made some strange castling rights but otherwise didn't crash

setoption name UCI_Chess960 value true
position fen bbnnrkrq/pppppppp/8/8/8/8/PPPPPPPP/BBNNRKRQ w KQkq - 0 1
moves g2g3 g7g6
b b n n r k r q
p p p p p p . p
. . . . . . p .
. . . . . . . .
. . . . . . . .
. . . . . . P .
P P P P P P . P
B B N N R K R Q
white:     a1 b1 c1 d1 e1 f1 g1 h1 a2 b2 c2 d2 e2 f2 h2 g3
black:     g6 a7 b7 c7 d7 e7 f7 h7 a8 b8 c8 d8 e8 f8 g8 h8
pawn:      a2 b2 c2 d2 e2 f2 h2 g3 g6 a7 b7 c7 d7 e7 f7 h7
knight:    c1 d1 c8 d8
bishop:    a1 b1 a8 b8
rook:      e1 g1 e8 g8
queen:     h1 h8
king:      f1 f8
checkers:
pinned:
fen:            bbnnrkrq/pppppp1p/6p1/8/8/6P1/PPPPPP1P/BBNNRKRQ w GEį - 0 1
isok:           yes
sideToMove:     w
castlingRights: GEge
epSquare:       -
rule50:         0
pliesFromNull:  2
capturedPiece:  .
key:            59788d3c46e91347
pawnKey:        18894d728b511c8a
materialKey:    1e868803d55f83ef
psq:            mg: 0  eg: 0
npMaterial:     w: 8241  b: 8241
Gen_Legal:      a2a3 b2b3 c2c3 d2d3 e2e3 f2f3 h2h3 g3g4
                a2a4 b2b4 c2c4 d2d4 e2e4 f2f4 h2h4 c1b3
                c1d3 d1c3 d1e3 g1g2 h1g2 h1f3 h1e4 h1d5
                h1c6 h1b7 f1g2 f1g1
moves c1d3 d8c6
b b n . r k r q
p p p p p p . p
. . n . . . p .
. . . . . . . .
. . . . . . . .
. . . N . . P .
P P P P P P . P
B B . N R K R Q
white:     a1 b1 d1 e1 f1 g1 h1 a2 b2 c2 d2 e2 f2 h2 d3 g3
black:     c6 g6 a7 b7 c7 d7 e7 f7 h7 a8 b8 c8 e8 f8 g8 h8
pawn:      a2 b2 c2 d2 e2 f2 h2 g3 g6 a7 b7 c7 d7 e7 f7 h7
knight:    d1 d3 c6 c8
bishop:    a1 b1 a8 b8
rook:      e1 g1 e8 g8
queen:     h1 h8
king:      f1 f8
checkers:
pinned:
fen:            bbn1rkrq/pppppp1p/2n3p1/8/8/3N2P1/PPPPPP1P/BB1NRKRQ w GEį - 2 1
isok:           yes
sideToMove:     w
castlingRights: GEge
epSquare:       -
rule50:         2
pliesFromNull:  4
capturedPiece:  .
key:            8bfed12bfebfb2e1
pawnKey:        18894d728b511c8a
materialKey:    1e868803d55f83ef
psq:            mg: 16  eg: 68
npMaterial:     w: 8241  b: 8241
Gen_Legal:      a2a3 b2b3 c2c3 e2e3 f2f3 h2h3 g3g4 a2a4
                b2b4 c2c4 e2e4 f2f4 h2h4 d1c3 d1e3 d3c1
                d3b4 d3f4 d3c5 d3e5 g1g2 h1g2 h1f3 h1e4
                h1d5 h1c6 f1g2 f1g1
moves f1g1
b b n . r k r q
p p p p p p . p
. . n . . . p .
. . . . . . . .
. . . . . . . .
. . . N . . P .
P P P P P P . P
B B . N R R K Q
white:     a1 b1 d1 e1 f1 g1 h1 a2 b2 c2 d2 e2 f2 h2 d3 g3
black:     c6 g6 a7 b7 c7 d7 e7 f7 h7 a8 b8 c8 e8 f8 g8 h8
pawn:      a2 b2 c2 d2 e2 f2 h2 g3 g6 a7 b7 c7 d7 e7 f7 h7
knight:    d1 d3 c6 c8
bishop:    a1 b1 a8 b8
rook:      e1 f1 e8 g8
queen:     h1 h8
king:      g1 f8
checkers:
pinned:
fen:            bbn1rkrq/pppppp1p/2n3p1/8/8/3N2P1/PPPPPP1P/BB1NRRKQ b į - 3 1
isok:           yes
sideToMove:     b
castlingRights: ge
epSquare:       -
rule50:         3
pliesFromNull:  5
capturedPiece:  .
key:            b4f54d33a0dedd73
pawnKey:        18894d728b511c8a
materialKey:    1e868803d55f83ef
psq:            mg: 66  eg: 41
npMaterial:     w: 8241  b: 8241
Gen_Legal:      g6g5 a7a6 b7b6 d7d6 e7e6 f7f6 h7h6 a7a5
                b7b5 d7d5 e7e5 f7f5 h7h5 c6b4 c6d4 c6a5
                c6e5 c6d8 c8b6 c8d6 e8d8 g8g7 h8b2 h8c3
                h8d4 h8e5 h8f6 h8g7 f8g7 f8g8

GEį should be GEge in order to comply to Shredder FEN convention

lantonov commented 7 years ago

The third game - the same strange castling rules

position fen nqbbrkrn/pppppppp/8/8/8/8/PPPPPPPP/NQBBRKRN w KQkq - 0 1
moves
n q b b r k r n
p p p p p p p p
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
P P P P P P P P
N Q B B R K R N
white:     a1 b1 c1 d1 e1 f1 g1 h1 a2 b2 c2 d2 e2 f2 g2 h2
black:     a7 b7 c7 d7 e7 f7 g7 h7 a8 b8 c8 d8 e8 f8 g8 h8
pawn:      a2 b2 c2 d2 e2 f2 g2 h2 a7 b7 c7 d7 e7 f7 g7 h7
knight:    a1 h1 a8 h8
bishop:    c1 d1 c8 d8
rook:      e1 g1 e8 g8
queen:     b1 b8
king:      f1 f8
checkers:
pinned:
fen:            nqbbrkrn/pppppppp/8/8/8/8/PPPPPPPP/NQBBRKRN w GEį - 0 1
isok:           yes
sideToMove:     w
castlingRights: GEge
epSquare:       -
rule50:         0
pliesFromNull:  0
capturedPiece:  .
key:            26e674a19a4ee713
pawnKey:        3209d0458a9d5083
materialKey:    1e868803d55f83ef
psq:            mg: 0  eg: 0
npMaterial:     w: 8241  b: 8241
Gen_Legal:      a2a3 b2b3 c2c3 d2d3 e2e3 f2f3 g2g3 h2h3
                a2a4 b2b4 c2c4 d2d4 e2e4 f2f4 g2g4 h2h4
                a1b3 h1g3 f1g1
moves h1g3 e7e5 c2c3 a8b6 e2e4 h8g6 d2d4 e5d4 c3d4 d7d5 e4e5 d8e7
. q b . r k r .
p p p . b p p p
. n . . . . n .
. . . p P . . .
. . . P . . . .
. . . . . . N .
P P . . . P P P
N Q B B R K R .
white:     a1 b1 c1 d1 e1 f1 g1 a2 b2 f2 g2 h2 g3 d4 e5
black:     d5 b6 g6 a7 b7 c7 e7 f7 g7 h7 b8 c8 e8 f8 g8
pawn:      a2 b2 f2 g2 h2 d4 d5 e5 a7 b7 c7 f7 g7 h7
knight:    a1 g3 b6 g6
bishop:    c1 d1 e7 c8
rook:      e1 g1 e8 g8
queen:     b1 b8
king:      f1 f8
checkers:
pinned:
fen:            1qb1rkr1/ppp1bppp/1n4n1/3pP3/3P4/6N1/PP3PPP/NQBBRKR1 w GEį - 1 1
isok:           yes
sideToMove:     w
castlingRights: GEge
epSquare:       -
rule50:         1
pliesFromNull:  12
capturedPiece:  .
key:            1d142f534e9a1a3b
pawnKey:        73da1372ebea3bab
materialKey:    d3c20ccfe6b13bbe
psq:            mg: -142  eg: -95
npMaterial:     w: 8241  b: 8241
Gen_Legal:      a2a3 b2b3 f2f3 h2h3 e5e6 a2a4 b2b4 f2f4
                h2h4 a1c2 a1b3 g3h1 g3e2 g3e4 g3f5 g3h5
                c1d2 c1e3 c1f4 c1g5 c1h6 d1c2 d1e2 d1b3
                d1f3 d1a4 d1g4 d1h5 e1e2 e1e3 e1e4 g1h1
                b1c2 b1d3 b1e4 b1f5 b1g6 f1e2 f1g1
moves f2f4 e7b4 e1e2
. q b . r k r .
p p p . . p p p
. n . . . . n .
. . . p P . . .
. b . P . P . .
. . . . . . N .
P P . . R . P P
N Q B B . K R .
white:     a1 b1 c1 d1 f1 g1 a2 b2 e2 g2 h2 g3 d4 f4 e5
black:     b4 d5 b6 g6 a7 b7 c7 f7 g7 h7 b8 c8 e8 f8 g8
pawn:      a2 b2 g2 h2 d4 f4 d5 e5 a7 b7 c7 f7 g7 h7
knight:    a1 g3 b6 g6
bishop:    c1 d1 b4 c8
rook:      g1 e2 e8 g8
queen:     b1 b8
king:      f1 f8
checkers:
pinned:
fen:            1qb1rkr1/ppp2ppp/1n4n1/3pP3/1b1P1P2/6N1/PP2R1PP/NQBB1KR1 b Gį - 2 1
isok:           yes
sideToMove:     b
castlingRights: Gge
epSquare:       -
rule50:         2
pliesFromNull:  15
capturedPiece:  .
key:            8339ec0f7ec75853
pawnKey:        be500e26e32433c5
materialKey:    d3c20ccfe6b13bbe
psq:            mg: -143  eg: -102
npMaterial:     w: 8241  b: 8241
Gen_Legal:      a7a6 c7c6 f7f6 h7h6 a7a5 c7c5 f7f5 h7h5
                b6a4 b6c4 b6d7 b6a8 g6f4 g6h4 g6e5 g6e7
                g6h8 b4e1 b4d2 b4a3 b4c3 b4a5 b4c5 b4d6
                b4e7 c8h3 c8g4 c8f5 c8e6 c8d7 e8e5 e8e6
                e8e7 e8d8 g8h8 b8a8 f8e7 f8g8
moves c8g4 a1c2 g4e2 g3e2 b4e7
. q . . r k r .
p p p . b p p p
. n . . . . n .
. . . p P . . .
. . . P . P . .
. . . . . . . .
P P N . N . P P
. Q B B . K R .
white:     b1 c1 d1 f1 g1 a2 b2 c2 e2 g2 h2 d4 f4 e5
black:     d5 b6 g6 a7 b7 c7 e7 f7 g7 h7 b8 e8 f8 g8
pawn:      a2 b2 g2 h2 d4 f4 d5 e5 a7 b7 c7 f7 g7 h7
knight:    c2 e2 b6 g6
bishop:    c1 d1 e7
rook:      g1 e8 g8
queen:     b1 b8
king:      f1 f8
checkers:
pinned:
fen:            1q2rkr1/ppp1bppp/1n4n1/3pP3/3P1P2/8/PPN1N1PP/1QBB1KR1 w Gį - 1 1
isok:           yes
sideToMove:     w
castlingRights: Gge
epSquare:       -
rule50:         1
pliesFromNull:  20
capturedPiece:  .
key:            2349efe1345f0d71
pawnKey:        be500e26e32433c5
materialKey:    3389286b9d326636
psq:            mg: -480  eg: -503
npMaterial:     w: 6956  b: 7415
Gen_Legal:      a2a3 b2b3 g2g3 h2h3 f4f5 e5e6 a2a4 b2b4
                g2g4 h2h4 c2a1 c2e1 c2a3 c2e3 c2b4 e2c3
                e2g3 c1d2 c1e3 g1h1 b1a1 f1e1 f1f2 f1g1
lantonov commented 7 years ago

The second game

position fen nnbrqbkr/pppppppp/8/8/8/8/PPPPPPPP/NNBRQBKR w KQkq - 0 1
moves d2d4 e7e5 d4e5 a8b6 e2e4 e8e5 c2c4 d8e8
. n b . r b k r
p p p p . p p p
. n . . . . . .
. . . . q . . .
. . P . P . . .
. . . . . . . .
P P . . . P P P
N N B R Q B K R
white:     a1 b1 c1 d1 e1 f1 g1 h1 a2 b2 f2 g2 h2 c4 e4
black:     e5 b6 a7 b7 c7 d7 f7 g7 h7 b8 c8 e8 f8 g8 h8
pawn:      a2 b2 f2 g2 h2 c4 e4 a7 b7 c7 d7 f7 g7 h7
knight:    a1 b1 b6 b8
bishop:    c1 f1 c8 f8
rook:      d1 h1 e8 h8
queen:     e1 e5
king:      g1 g8
checkers:
pinned:
fen:            1nb1rbkr/pppp1ppp/1n6/4q3/2P1P3/8/PP3PPP/NNBRQBKR w HDá - 1 1
isok:           yes
sideToMove:     w
castlingRights: HDh
epSquare:       -
rule50:         1
pliesFromNull:  8
capturedPiece:  .
key:            3302b997272bdd61
pawnKey:        d0f3800c949b6e72
materialKey:    d3c20ccfe6b13bbe
psq:            mg: -84  eg: -121
npMaterial:     w: 8241  b: 8241
Gen_Legal:      a2a3 b2b3 f2f3 g2g3 h2h3 c4c5 a2a4 b2b4
                f2f4 g2g4 h2h4 a1c2 a1b3 b1d2 b1a3 b1c3
                c1d2 c1e3 c1f4 c1g5 c1h6 f1e2 f1d3 d1d2
                d1d3 d1d4 d1d5 d1d6 d1d7 e1d2 e1e2 e1c3
                e1e3 e1b4 e1a5
moves a1c2 b8c6 b2b4 e5h5 c4c5 e8e4 c2e3 e4b4 c5b6 b4b1 b6c7 h5c5
. . b . . b k r
p p P p . p p p
. . n . . . . .
. . q . . . . .
. . . . . . . .
. . . . N . . .
P . . . . P P P
. r B R Q B K R
white:     c1 d1 e1 f1 g1 h1 a2 f2 g2 h2 e3 c7
black:     b1 c5 c6 a7 b7 d7 f7 g7 h7 c8 f8 g8 h8
pawn:      a2 f2 g2 h2 a7 b7 c7 d7 f7 g7 h7
knight:    e3 c6
bishop:    c1 f1 c8 f8
rook:      b1 d1 h1 h8
queen:     e1 c5
king:      g1 g8
checkers:
pinned:
fen:            2b2bkr/ppPp1ppp/2n5/2q5/8/4N3/P4PPP/1rBRQBKR w HDá - 1 1
isok:           yes
sideToMove:     w
castlingRights: HDh
epSquare:       -
rule50:         1
pliesFromNull:  20
capturedPiece:  .
key:            d0c3e9a5d1c84f79
pawnKey:        6f0e3d740db14c55
materialKey:    ef21ea712b5da931
psq:            mg: -201  eg: -243
npMaterial:     w: 7488  b: 7488
Gen_Legal:      a2a3 f2f3 g2g3 h2h3 a2a4 f2f4 g2g4 h2h4
                e3c2 e3c4 e3g4 e3d5 e3f5 c1b2 c1d2 c1a3
                f1e2 f1d3 f1c4 f1b5 f1a6 d1d2 d1d3 d1d4
                d1d5 d1d6 d1d7 e1d2 e1e2 e1c3 e1b4 e1a5

moves f1d3 b1a1
. . b . . b k r
p p P p . p p p
. . n . . . . .
. . q . . . . .
. . . . . . . .
. . . B N . . .
P . . . . P P P
r . B R Q . K R
white:     c1 d1 e1 g1 h1 a2 f2 g2 h2 d3 e3 c7
black:     a1 c5 c6 a7 b7 d7 f7 g7 h7 c8 f8 g8 h8
pawn:      a2 f2 g2 h2 a7 b7 c7 d7 f7 g7 h7
knight:    e3 c6
bishop:    c1 d3 c8 f8
rook:      a1 d1 h1 h8
queen:     e1 c5
king:      g1 g8
checkers:
pinned:
fen:            2b2bkr/ppPp1ppp/2n5/2q5/8/3BN3/P4PPP/r1BRQ1KR w HDá - 3 1
isok:           yes
sideToMove:     w
castlingRights: HDh
epSquare:       -
rule50:         3
pliesFromNull:  22
capturedPiece:  .
key:            f3bf82efaf3cdaa5
pawnKey:        6f0e3d740db14c55
materialKey:    ef21ea712b5da931
psq:            mg: -157  eg: -189
npMaterial:     w: 7488  b: 7488
Gen_Legal:      a2a3 f2f3 g2g3 h2h3 a2a4 f2f4 g2g4 h2h4
                e3f1 e3c2 e3c4 e3g4 e3d5 e3f5 c1b2 c1d2
                c1a3 d3b1 d3f1 d3c2 d3e2 d3c4 d3e4 d3b5
                d3f5 d3a6 d3g6 d3h7 d1d2 e1f1 e1d2 e1e2
                e1c3 e1b4 e1a5 g1f1 g1h1

and the h-side castling g1h1 is illegal move. Again strange castling rights in fen (HDá instead of HDh)

lantonov commented 7 years ago

We have such strange fen's also in normal, non-crashing games. For example


[Event "?"]
[Site "?"]
[Date "2016.12.20"]
[Round "4"]
[White "asmFish"]
[Black "Stockfish"]
[Result "1-0"]
[FEN "nbnqbrkr/pppppppp/8/8/8/8/PPPPPPPP/NBNQBRKR w KQkq - 0 1"]
[PlyCount "48"]
[SetUp "1"]
[Termination "adjudication"]
[TimeControl "inf"]
[Variant "fischerandom"]

1. c4 {+0.61/10 0.034s} d5 {-0.53/10 0.037s} 2. c5 {+0.46/10 0.036s}
e6 {-0.53/10 0.022s} 3. Qb3 {+0.44/10 0.015s} b6 {-0.44/10 0.030s}
4. d4 {+0.48/10 0.026s} Ne7 {-0.55/10 0.040s} 5. Nd3 {+0.38/10 0.037s}
h5 {-0.44/10 0.049s} 6. h4 {+0.77/10 0.035s} Nf5 {-0.43/10 0.046s}
7. Nc2 {+0.39/10 0.033s} Nxh4 {-0.34/10 0.045s} 8. Ne3 {+0.20/10 0.057s}
Ng6 {-0.37/10 0.056s} 9. Bb4 {+0.36/10 0.027s} a5 {-0.49/10 0.028s}
10. Bc3 {+0.30/10 0.085s} Bc6 {-0.41/10 0.085s} 11. Bc2 {+0.38/10 0.056s}
Ba7 {-0.05/10 0.13s} 12. Qa3 {+0.37/10 0.074s} e5 {-0.45/10 0.060s}
13. Nxe5 {+0.31/10 0.046s} Nxe5 {-0.71/10 0.044s} 14. dxe5 {+0.11/10 0.020s}
bxc5 {-0.93/10 0.097s} 15. Nf5 {+1.02/10 0.058s} h4 {-0.65/10 0.035s}
16. e6 {+1.54/10 0.010s} fxe6 {-0.10/10 0.048s} 17. Bxg7 {+0.41/10 0.018s}
exf5 {-0.41/10 0.011s} 18. Bxh8 {+2.18/10 0.025s} Kxh8 {-1.04/10 0.010s}
19. Qg3 {+7.68/10 0.044s} Rf7 {-6.20/10 0.019s} 20. Rxh4+ {+8.66/10 0.038s}
Qxh4 {-8.10/10 0.026s} 21. Qxh4+ {+9.07/10 0.013s} Kg8 {-8.35/10 0.011s}
22. Bxf5 {+9.27/10 0.003s} Rxf5 {-8.76/10 0.031s} 23. Qg4+ {+10.63/10 0.013s}
Kf7 {-10.44/10 0.023s} 24. Qxf5+ {+11.23/10 0.016s}
Ke7 {-10.86/10 0.024s, White wins by adjudication} 1-0

setoption name UCI_Chess960 value true
position fen nbnqbrkr/pppppppp/8/8/8/8/PPPPPPPP/NBNQBRKR w KQkq - 0 1
moves
n b n q b r k r
p p p p p p p p
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
P P P P P P P P
N B N Q B R K R
white:     a1 b1 c1 d1 e1 f1 g1 h1 a2 b2 c2 d2 e2 f2 g2 h2
black:     a7 b7 c7 d7 e7 f7 g7 h7 a8 b8 c8 d8 e8 f8 g8 h8
pawn:      a2 b2 c2 d2 e2 f2 g2 h2 a7 b7 c7 d7 e7 f7 g7 h7
knight:    a1 c1 a8 c8
bishop:    b1 e1 b8 e8
rook:      f1 h1 f8 h8
queen:     d1 d8
king:      g1 g8
checkers:
pinned:
fen:            nbnqbrkr/pppppppp/8/8/8/8/PPPPPPPP/NBNQBRKR w HFá× - 0 1
isok:           yes
sideToMove:     w
castlingRights: HFhf
epSquare:       -
rule50:         0
pliesFromNull:  0
capturedPiece:  .
key:            ca689a988474e4ed
pawnKey:        3209d0458a9d5083
materialKey:    1e868803d55f83ef
psq:            mg: 0  eg: 0
npMaterial:     w: 8241  b: 8241
Gen_Legal:      a2a3 b2b3 c2c3 d2d3 e2e3 f2f3 g2g3 h2h3
                a2a4 b2b4 c2c4 d2d4 e2e4 f2f4 g2g4 h2h4
                a1b3 c1b3 c1d3
muxel commented 7 years ago

We have such strange fen's also in normal, non-crashing games.

This is a small bug in Position_Print which does its own FEN printing. and edx, 0x07070707 is missing which converts squares (0..63) to files (0..7) before adding 'AAaa'. The ASCII codes are simply off by +56.

lantonov commented 7 years ago

and edx, 0x07070707 is here in the present code in one place (guts/Position.asm, line 652) but in the other place (guts/Position.asm, after line 1223) is missing.

tthsqe12 commented 7 years ago

Hello there! These crashes are caused by a buggy "GivesCheck" function. There was one place I forgot while updating it to chess960. I have no idea how to use github. I will download this repo and see how you all have been doing with this project and try to update to the latest version with lazy eval. corrected Move_GivesCheck.asm:

          align   64
Move_GivesCheck:
    ; in:  rbp  address of Pos
    ;      rbx  address of State - check info must be filled in
    ;      ecx  move assumed to be psuedo legal
    ; out: eax =  0 if does not give check
    ;      eax = -1 if does give check

ProfileInc Move_GivesCheck

        mov   r8d, ecx
        shr   r8d, 6
        and   r8d, 63   ; r8d = from
        mov   r9d, ecx
        and   r9d, 63   ; r9d = to
        mov   r11, qword[rbx+State.dcCandidates]
          movzx   r10d, byte[rbp+Pos.board+r8]     ; r10 = FROM PIECE
        and   r10d, 7

         or   eax, -1

        mov   rdx, qword[rbx+State.checkSq+8*r10]
         bt   rdx, r9
         jc   .Ret

         bt   r11, r8
         jc   .DiscoveredCheck

        xor   eax, eax
        cmp   ecx, MOVE_TYPE_PROM shl 12
        jae   .Special
.Ret:
        ret

          align   8
.Special:
           push   rsi rdi
.Special.AfterPrologue:
        shr   ecx, 12   ; ecx = move type
        mov   esi, dword[rbp+Pos.sideToMove]
          movzx   edi, byte[rbx+State.ksq]
        mov   rdx, qword[rbp+Pos.typeBB+8*White]
         or   rdx, qword[rbp+Pos.typeBB+8*Black]
        btr   rdx, r8
        bts   rdx, r9

        mov   eax, dword[.JmpTable+4*(rcx-MOVE_TYPE_PROM)]
        jmp   rax

          align   8
.JmpTable:   dd .PromKnight,.PromBishop,.PromRook,.PromQueen
         dd .EpCapture,0,0,0
         dd .Castling,0,0,0

          align   8
.Castling:
; *********** start of correction *************
; esi starts as
;  esi=0 if we are white
;  esi=1 if we are black
; we are supposed to get into esi the following number
;  esi=0 if white and O-O
;  esi=1 if white and O-O-O
;  esi=2 if black and O-O
;  esi=3 if black and O-O-O
; r9d contains to square   (square of rook)
; r8d contains from square (square of king)
;
; this code is incorrect as it assumes
;  O-O   if r9 is on files E,F,G,H
;  O-O-O if r9 is on files A,B,C,D
;                mov   eax, r9d
;                and   eax, 7
;                cmp   eax, 4
;                adc   esi, esi
;
; since we assume that only one of the four possible castling moves have been passed in,
;  this can be corrected by comparing the rook square to the king square
        cmp   r9d, r8d
        adc   esi, esi
; *********** end of correction *************

          movzx   eax, byte[rbp-Thread.rootPos+Thread.castling_rfrom+rsi]
          movzx   r11d, byte[rbp-Thread.rootPos+Thread.castling_rto+rsi]
        btr   rdx, rax
        bts   rdx, r11
        bts   rdx, r9  ; set king again if nec
    RookAttacks   rax, r11, rdx, r10
         bt   rax, rdi
        sbb   eax, eax
        pop   rdi rsi
        ret

          align   8
.PromQueen:
      BishopAttacks   r8, r9, rdx, r10
    RookAttacks   rax, r9, rdx, r10
         or   rax, r8
         bt   rax, rdi
        sbb   eax, eax
        pop   rdi rsi
        ret

          align   8
.EpCapture:
        lea   ecx, [2*rsi-1]
        lea   ecx, [r9+8*rcx]
        mov   r8, qword[rbp+Pos.typeBB+8*Bishop]
        mov   r9, qword[rbp+Pos.typeBB+8*Rook]
        btr   rdx, rcx
      BishopAttacks   rax, rdi, rdx, r10
    RookAttacks   r11, rdi, rdx, r10
        mov   r10, qword[rbp+Pos.typeBB+8*Queen]
         or   r8, r10
         or   r9, r10
        and   rax, r8
        and   r11, r9
         or   rax, r11
        and   rax, qword[rbp+Pos.typeBB+8*rsi]
        neg   rax
        sbb   eax, eax
        pop   rdi rsi
        ret

          align   8
.PromBishop:
      BishopAttacks   rax, r9, rdx, r10
         bt   rax, rdi
        sbb   eax, eax
        pop   rdi rsi
        ret

          align   8
.PromRook:
    RookAttacks   rax, r9, rdx, r10
         bt   rax, rdi
        sbb   eax, eax
        pop   rdi rsi
        ret

          align   8
.PromKnight:
        mov   rax, qword[KnightAttacks+8*r9]
         bt   rax, rdi
        sbb   eax, eax
        pop   rdi rsi
        ret

          align   8
.DiscoveredCheck:
           push   rsi rdi
          movzx   edi, byte[rbx+State.ksq]
        mov   eax, ecx
        and   eax, 64*64-1
        mov   rax, qword[LineBB+8*rax]
         bt   rax, rdi
         jc  .DiscoveredCheckRet
         or   eax, -1
        pop   rdi rsi
        ret
.DiscoveredCheckRet:
        xor   eax, eax
        cmp   ecx, MOVE_TYPE_PROM shl 12
        jae   .Special.AfterPrologue
        pop   rdi rsi
        ret
lantonov commented 7 years ago

Hello Moha ! I and many other people who love asmFish are so glad that you appeared to help! We were growing desperate that we would not be able to keep up with the new SF patches. You made us a great present for the New Year with this code. Unlike with assembly, I am relatively good with the github and know many of its quirks, so for me applying patches, searching for history, and even transformations of big patch stretches present no problem. You can write the updates in any form convenient to you and I will apply those as needed. I had been thinking of many things to tell and questions to ask, but the emotion made me run out of words so I shut up for now.

lantonov commented 7 years ago

Tested the debugged asmFish with 1000 15"+0.05" games against SF. +83 Elo for asmFish at Chess960. No crash. Consider this issue finally solved.

tthsqe12 commented 7 years ago

Hello again! It is great that this project is headed by someone who knows github. I hope you have fun merging my repo with yours. https://github.com/tthsqe12/asm I would like to see the differences either in pieces or all at once.

** additions **** (1) Added the best book move option. If set, engine only plays a move with the highest weight. Also engine displays book move's weight in info string now

(2) Quitting after reading non-empty command line arguments was not the original intention. For this reason, USE_CMDLINEQUIT flag has been introduced. If set, the engine behaves like stockfish Also, the commands 'perft' and 'bench' are the only ones that wait for the search to finish before returning. The command 'wait' can be used after 'go' to ensure that engine doesn't quit before finishing. Behaves like this

C:\Users\pc\Dropbox\asmFish\asmFish>"pedantFishW_bmi2" setoption name threads value 4; setoption name hash value 256; go depth 5; wait pedantFishW_2017-01-16_bmi2 info string hash set to 256 MB no large pages info string node 0 has threads 0 1 2 3 info depth 1 seldepth 1 multipv 1 time 0 nps 47000 score cp 90 nodes 47 tbhits 0 pv e2e4 info depth 2 seldepth 2 multipv 1 time 0 nps 216000 score cp 65 nodes 216 tbhits 0 pv e2e4 d7d6 info depth 3 seldepth 3 multipv 1 time 1 nps 353000 score cp 119 nodes 353 tbhits 0 pv d2d4 d7d6 e2e4 info depth 4 seldepth 4 multipv 1 time 1 nps 1464000 score cp 15 nodes 1464 tbhits 0 pv g1f3 d7d5 d2d4 e7e6 info depth 5 seldepth 5 multipv 1 time 3 nps 1280666 score cp 39 nodes 3842 tbhits 0 pv e2e3 e7e5 d2d4 d7d6 d4e5 bestmove e2e3 ponder e7e5

C:\Users\pc\Dropbox\asmFish\asmFish>

(3) All patches have been applied and 'bench hash 128 threads 1 depth 20' matches 1-13-2017 master.

(4) readme.txt next to main source files contains useful info now. there is also a readme in the guts

(5) various things were cleaned up. For example the USE_SYZYGY=0, USE_BOOK=1 didn't assemble before because of StringLength


One thing about formating: I have all machine opcodes right justified and their operands left justified If you want to change this, it is going to get ugly fast


after noticing that the 3-fold patch was not applied, I went back since sf8 to make sure all of the patches were applied correctly. The ones that were applied were correct!

PATCH: FEN parsing: add a second check for correctly setting e.p. square VERDITC: not applied! CHANGES: now checks as sf does with the additional checks that the ep square and original pawn square is empty, and does not fail if these checks fail; just gives no ep square

PATCH: Non-quiet pruning tweak

PATCH: More accurate 'go nodes' searches at low count VERDICT: thank you for not applying this useless patch! comment has be placed in code for future reference

PATCH: Pawn shelter and pawn storm tuned VERDICT: correct

PATCH: Start searching for a repetition from the 4th ply behind

PATCH: Fix the pawn hash failure when the pawn key is 0 VERDICT: not applied CHANGES: applied

PATCH: Rank based threats VERDITC: correct, but CHANGES: the conditional is now branchless using IsNotPawnMasks

PATCH: TrappedRook simplification VERDICT: correct! and a tricky one!

PATCH: WeakQueen Parameter tweak VERDICT: correct! easy!

PATCH: Remove piece condition in decrease lmr reduction check VERDICT: correct

PATCH: Pawn flank attacks VERDICT: looks correct! also tricky because of GCC!

PATCH: Simplify unstoppable condition

PATCH: Remove SafeCheck VERDICT: correct, but most of the trickery in kingDanger is not necessary now ****should simplify in the near future when performance testing***

PATCH: Don't clear EasyMove in search() VERDICT: correct

PATCH: Tweak best thread selection logic

PATCH: Remove HistoryStats VERDICT: not applied CHANGES: applied

PATCH: Introduce lazy evaluation VERDICT: not applied CHANGES: lazy eval is now computed lazily in Evaluate_Cold.ReturnLazyEval branches to the cold part are done cleverly, but one might want to do the idiv's by hand to return the eval

PATCH: Explicitly use alpha+1 for beta in NonPV search VERDICT: not applied and not needed! might want to apply for readability

PATCH: Simplify threshold handling for probcut VERDICT: correct

PATCH: Clean-up skipEarlyPruning (#921) VERDICT: not applied. but might want to apply for readability

muxel commented 7 years ago

I would like to see the differences either in pieces or all at once.

I made it in pieces to make clear which patches have been applied and which are missing. Now that the gaps are filled I think it should be applied in whole.

I believe that when Marco converted Syzygy to c++ he made some optimizations so perhaps it should be recompiled?

lantonov commented 7 years ago

I finished with applying the changes. Hope I haven't made many errors. Checked the bench again and it is even with the latest SF. Big thank you to both: Muxel and Moha. I am going to close this issue because it went too much off topic and the main issue (Chess960) was solved. Unfortunately, GitHub doesn't offer a convenient chat. I propose to communicate by 2 means which are found in the tabs:

Great work from you, guys !

tthsqe12 commented 7 years ago

Alright, I would also like to learn github on my new box so that i can easily fix something like this: There is a bug that is very rarely going to manifest on https://github.com/lantonov/asmFish/blob/master/asmFish/guts/PosIsDrawMacro.asm#L64#L65 The problem might occur after coldreturnlabel is jumped back to. Muxel, if you like a puzzle, go ahead and try to fix it. I will be trying to learn github in the meantime and cleaning up the syzygy.

lantonov commented 7 years ago

For small changes that involve only one file, you can just open the file, press the Edit button (the pencil), write the changes, and commit with the button below. For changes that involve multiple files, you can submit separate changes which can be squashed before merging.